microsoft / microsoft/terminal

Rows should remember their width (MeasureRight())

Open
#17,844 4 comments 0 reactions 0 assignees View on GitHub
Area-Output Issue-Bug Product-Conpty
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

### 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
```python
# `120` here is my console width
for i in range(2):
print('x' * 120 + ' ')
print('yya')
input('--')
```
2. 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](https://github.com/user-attachments/assets/16eeecb3-13f2-4ab3-b50e-414d19449838)
- After resize: (width is 121, line wrap here seems wrong too)
![image](https://github.com/user-attachments/assets/5367ebff-e1b4-427f-b95d-b96e246b0ae1)

Contributor guide

Open the contributing guide

Research direction

Start at the MeasureRight() entry point named in the issue and reproduce the behavior with the provided Python snippet in a 120-column window. Resize the Windows Terminal window and verify that wrapped rows retain their widths, the line wrapping remains correct, and the cursor stays after `--` in `input('--')`.

Written by the indexing model from the issue text.

Assessment

Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.