Skip to content

Reflow behavior on window resize seems broken if the cursor is hidden #17151

@kunom

Description

@kunom

Windows Terminal version

1.19.10821.0

Windows build number

10.0.19045.4291

Other Software

No response

Steps to reproduce

I have a strange reflow bug that seems to occur only when the cursor is hidden. Steps to reproduce:

  1. Paste the following Python code into a file named status.py:
    import time
    
    HIDE_CURSOR = "\x1b[?25l"
    LF_AND_CLEAR_LINE = "\r\x1b[2K"
    
    print("foo " * 100)
    print()
    print(HIDE_CURSOR)  # --> removing this line fixes the issue
    for i in range(100000):
        print(f"{LF_AND_CLEAR_LINE}working {i}...", end="", flush=True)
        time.sleep(0.05)
  2. Start the script in a new, non-maximized window: start status.py
  3. Take your mouse and rapidly change the width of the window, so that content is repeatedly reflowed. See heavy display distortions:
    image
  4. In the script, remove the "hide cursor" statement and redo the test. Everything works fine now, regardless how heavy you try to distort the display:
    image

Expected Behavior

The reflow mechanism should work regardless of whether the cursor is rendered or not. The behaviour with the visible cursor is the correct one.

Actual Behavior

It looks as if the display reflow logic is broken when the cursor is not rendered, maybe the full line inclusive trailing whitespace is reflowed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-OutputRelated to output processing (inserting text into buffer, retrieving buffer text, etc.)In-PRThis issue has a related PRIssue-BugIt either shouldn't be doing this or needs an investigation.Needs-Tag-FixDoesn't match tag requirementsPriority-3A description (P3)Product-ConptyFor console issues specifically related to conpty

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions