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

Rows should remember their width (MeasureRight()) #17844

Open
0x152a opened this issue Sep 1, 2024 · 4 comments
Open

Rows should remember their width (MeasureRight()) #17844

0x152a opened this issue Sep 1, 2024 · 4 comments
Labels
Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Conpty For console issues specifically related to conpty
Milestone

Comments

@0x152a
Copy link

0x152a commented Sep 1, 2024

Windows Terminal version

1.21.2361.0

Windows build number

10.0.22631.0

Other Software

  • System Language: zh_cn
  • Console Font: Hack Nerd Font Mono
  • Font Size: 12

Steps to reproduce

  1. Print more than two lines ending with space and causing line wrap
# `120` here is my console width
for i in range(2):
    print('x' * 120 + ' ')
print('yya')
input('--')
  1. Resize the window to change the console width.

Expected Behavior

Cursor should be after -- of input('--') throughout the process

Actual Behavior

After resize, cursor is before a of print('yya')

  • Before resize: (width is 120)
    image
  • After resize: (width is 121, line wrap here seems wrong too)
    image
@0x152a 0x152a 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 Sep 1, 2024
@ayush1233
Copy link

I want to work on this issue

@carlos-zamora
Copy link
Member

Thanks for filing! We recently rewrote ConPty. Mind checking v1.22 (Preview) to see if it got fixed /?

Also, thanks @ayush1233!

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Sep 25, 2024
@carlos-zamora carlos-zamora added Product-Conpty For console issues specifically related to conpty Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Sep 25, 2024
@0x152a
Copy link
Author

0x152a commented Sep 27, 2024

@carlos-zamora

Mind checking v1.22 (Preview) to see if it got fixed /?

Thank you for the update. I've tested version 1.22.240823002-preview and found that the cursor position issue has been resolved.

However, I've noticed that the line wrapping still seems to be incorrect. That is, the spaces at the end of lines seem to be ignored after adjusting the window width. (Maybe I should open another issue?)

wt-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 Sep 27, 2024
@lhecker
Copy link
Member

lhecker commented Sep 27, 2024

That is, the spaces at the end of lines seem to be ignored after adjusting the window width.

That's a known issue that we're hoping to address at some point. I'm not entirely sure if we have an issue to track it though. We could repurpose this one for it.

The reason that happens is because our text buffer does not keep track of how much text you wrote on any given line. To it, there's no difference between whitespace and no text at all, and so it gets truncated during resize.

@carlos-zamora carlos-zamora removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Attention The core contributors need to come back around and look at this ASAP. labels Oct 2, 2024
@carlos-zamora carlos-zamora added this to the Backlog milestone Oct 2, 2024
@carlos-zamora carlos-zamora changed the title [Bug] Cursor Position Issue on Window Resize with Soft Line Wrapping Rows should remember their width (MeasureRight()) Oct 2, 2024
@carlos-zamora carlos-zamora changed the title Rows should remember their width (MeasureRight()) Rows should remember their width (MeasureRight()) Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Conpty For console issues specifically related to conpty
Projects
None yet
Development

No branches or pull requests

4 participants