Wrapped scrollback + CMD leads to the commandline being drawn at the top of the window #22150

Closed
opened 2026-01-31 08:04:49 +00:00 by claunia · 2 comments
Owner

Originally created by @zadjii-msft on GitHub (Aug 23, 2024).

Canary 1.22.2334.0

just jotting notes as I go

  • in cmd
  • ran all the screenbuffer tests, filling the scrollback
  • as it was running, I scrolled up briefly, then back to the bottom
  • after it was done, hit up arrow
  • this is where the commandline got redrawn:

image

basically I suspect that the mapping from buffer- to VT-viewport-coordinates in cooked read is racy
it's definitely not trivial to reproduce by simply printing text and concurrently scrolling / resizing the window

oh dear, I then hit enter to run the command - it predictably printed starting at the cursor, that makes sense. Problem after that was that another up arrow? brought it back to the weird place from before

image

oh wait I just remembered that the last this time has happened to me I also ran TAEF tests
HMMMMM probably a bug in my code, but that's sus

THAT IS SUS

Originally created by @zadjii-msft on GitHub (Aug 23, 2024). Canary 1.22.2334.0 > just jotting notes as I go > * in cmd > * ran all the screenbuffer tests, filling the scrollback > * as it was running, I scrolled up briefly, then back to the bottom > * after it was done, hit up arrow > * this is where the commandline got redrawn: ![image](https://github.com/user-attachments/assets/bffe75c2-6c4c-4d1e-adf7-b4a0f81ed472) > basically I suspect that the mapping from buffer- to VT-viewport-coordinates in cooked read is racy > it's definitely not trivial to reproduce by simply printing text and concurrently scrolling / resizing the window > oh dear, I then hit enter to run the command - it predictably printed starting at the cursor, that makes sense. Problem after that was that another up arrow? brought it back to the weird place from before ![image](https://github.com/user-attachments/assets/004fcfec-e930-4f2b-9ece-242998a8f244) > oh wait I just remembered that the last this time has happened to me I also ran TAEF tests > HMMMMM probably a bug in my code, but that's sus > THAT IS SUS
Author
Owner

@zadjii-msft commented on GitHub (Aug 23, 2024):

Wait I know exactly what happened:

image

The buffer got resized to 12x12 during one of the tests. This is just /dup #17736

@zadjii-msft commented on GitHub (Aug 23, 2024): Wait I know exactly what happened: ![image](https://github.com/user-attachments/assets/b082f414-b366-4ce9-a4ff-6a729eb8aaa4) The buffer got resized to 12x12 during one of the tests. This is just /dup #17736
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Aug 23, 2024):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@microsoft-github-policy-service[bot] commented on GitHub (Aug 23, 2024): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! <!-- Policy app identification https://img.shields.io/static/v1?label=PullRequestIssueManagement. -->
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22150