Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrupted terminal output after window resized #15042

Closed
RoadToDream opened this issue Mar 24, 2023 · 7 comments
Closed

Corrupted terminal output after window resized #15042

RoadToDream opened this issue Mar 24, 2023 · 7 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Tracking-External This bug isn't resolved, but it's following an external workitem.

Comments

@RoadToDream
Copy link

Windows Terminal version

1.16.10262.0

Windows build number

10.0.22621.0

Other Software

No response

Steps to reproduce

  1. Open Terminal from any folder such that primary prompt is longer than one line.
  2. Enter any command and click enter.
  3. Maximize Terminal window so primary prompt is arranged within one line.
  4. Cursor will be off-position and overwrite my primary prompt.
  5. Video attached below:
Recording.2023-03-24.110725.mp4

Expected Behavior

No response

Actual Behavior

Cursor will be off-position and overwrite my primary prompt.

@RoadToDream RoadToDream added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Mar 24, 2023
@lhecker
Copy link
Member

lhecker commented Mar 24, 2023

Do you have "AtlasEngine" enabled or disabled?

image

If you have it disabled, could you report what happens if you enable it?

@RoadToDream
Copy link
Author

RoadToDream commented Mar 24, 2023

Hi @lhecker, yes I have tried enabling and disabling the new text renderer, also tested toggling Redraw entire screen and their combinations. All of them behaves the same. The issue seems to exist in any program using ConPTY like VS Code.

@RoadToDream
Copy link
Author

Seems like Terminal can't calculate the correct position of cursor but taking col position from last finished command.
For example, if primary prompt breaks into two lines and the cursor is at col 10 after the ls command is executed, after resizing the window such that primary prompt is within one line, cursor will be positioned to col 10 disregarding the updated primary prompt.

@j4james
Copy link
Collaborator

j4james commented Mar 25, 2023

Note that the terminal displays the cursor in the correct position immediately after the resize - it's only once you start typing that it moves to the wrong place. So I suspect this may be PowerShell or PSReadLine issue. Possibly the same underlying problem as PowerShell/PSReadLine#1456.

Also note that you don't get this in the cmd shell, or a bash shell, which is another reason to believe that PowerShell may be the source of the problem.

@RoadToDream
Copy link
Author

Hi @j4james, thank you for pointing this out. I have tested on an environment that does not have PSReadLine installed. But still you may be right, this seems to be a Powershell issue not a Terminal issue, as I have not observed it in a cmd shell. I will leave this issue open for now and reach out to Powershell support and wait for their response.

@zadjii-msft
Copy link
Member

Yea, I'd be sure that this is a PowerShell issue. Does this repro in a conhost.exe window with the same PowerShell setup?

Looks like the downstream issue is being tracked in PowerShell/PowerShell#19405

@zadjii-msft zadjii-msft added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Tracking-External This bug isn't resolved, but it's following an external workitem. labels Mar 27, 2023
@RoadToDream
Copy link
Author

Hi @zadjii-msft, yes for now I believe this is a PowerShell issue and I have submitted in their repo. I may close this ticket now. Thank you and everyone else helping analyze root cause for this issue.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Tracking-External This bug isn't resolved, but it's following an external workitem.
Projects
None yet
Development

No branches or pull requests

4 participants