Skip to content

Lines that wrap on space characters at the bottom of the buffer (“new bottom line”) receive an extra line break #5386

Closed

Description

With 0.11.xxx selfhost builds, The following steps reliably result in visual corruption (and also drove me a little crazy!)

  1. Terminal width = 120
  2. Go to the terminal source tree
  3. git blame 862793299a src/types/UiaTextRangeBase.cpp
  4. Search for GetTextRects using /:
    • /GetTextRects<CR>
  5. Go to the next match, using n.
  6. Notice that GetTextRects, which should be on the top line, is gone.
  7. Move right, left (arrow keys), and notice that it reappears.

bad

image

good

image

If you look at the bad image, I highlighted two things that caught my eye. Those are lines that have spaces in column 121, before less hard wraps them (!) I don't have 121 columns ...

Confirmed this in a text editor with the debug tap. I highlighted in blue the same regions that caused a break here.

The vertical strip under the cursor (look for the blue boxes) indicates column 121. Most of the escape sequences for cursor movement start here, but in the boxed areas they're not escapes.

image

Is this the exact wrap issue? Except with conpty sending spaces instead?

Activity

  1. added
    Product-ConptyFor console issues specifically related to conpty
    Area-OutputRelated to output processing (inserting text into buffer, retrieving buffer text, etc.)
    Issue-BugIt either shouldn't be doing this or needs an investigation.
    on Apr 17, 2020
  2. ghost added
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Apr 17, 2020
  3. DHowett-MSFT commented on Apr 17, 2020

    @DHowett-MSFT
    ContributorAuthor
  4. zadjii-msft commented on Apr 17, 2020

    @zadjii-msft
    Member

    I'm not sure, but I can take a look Monday? Unless you think this should interrupt the DX work I'm on now.

    Either this is exact wrap, or more likely, this is an exclusive/inclusive thing. There's one spot in PaintBufferLine that's always been an ExclusiveRight that I've always thought should be an InclusiveRight, and maybe the other conpty changes finally broke that line.

  5. DHowett-MSFT commented on Apr 17, 2020

    @DHowett-MSFT
    ContributorAuthor

    Got this down to a perfect repo.

    1. New bottom line
    2. Print width-1 chars followed by a space
    3. Print something else

    ConPTY will duplicate the single space into two spaces, causing a wrap on the Terminal side.

  6. added a commit that references this issue on Apr 17, 2020
    501871d
  7. ghost added
    In-PRThis issue has a related PR
    on Apr 17, 2020
  8. changed the title [-]_Extremely specific_ repro with git blame causes terminal (pty?) to wrap lines too hard[/-] [+]Lines that wrap on space characters at the bottom of the buffer (“new bottom line”) receive an extra line break[/+] on Apr 19, 2020
  9. ghost closed this as completedin #5398on Apr 20, 2020
  10. ghost removed
    In-PRThis issue has a related PR
    on Apr 20, 2020
  11. ghost added a commit that references this issue on Apr 20, 2020
    152b399
  12. ghost added
    Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.
    on Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area-OutputRelated to output processing (inserting text into buffer, retrieving buffer text, etc.)Issue-BugIt either shouldn't be doing this or needs an investigation.Priority-1A description (P1)Product-ConptyFor console issues specifically related to conptyResolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions