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

COOKED_READ: cmd.exe tab fails to erase trailing characters #16704

Closed
lhecker opened this issue Feb 12, 2024 · 1 comment · Fixed by #16718
Closed

COOKED_READ: cmd.exe tab fails to erase trailing characters #16704

lhecker opened this issue Feb 12, 2024 · 1 comment · Fixed by #16718
Assignees
Labels
Area-CookedRead The cmd.exe COOKED_READ handling In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-3 A description (P3) Product-Conhost For issues in the Console codebase zInbox-Bug Ignore me!

Comments

@lhecker
Copy link
Member

lhecker commented Feb 12, 2024

Windows build number

10.0.26052.0

Steps to reproduce

  • Launch cmd.exe
  • Type foo bar
  • Move the cursor the space after foo
  • Press tab

Expected Behavior

The prompt reads foo.

Actual Behavior

The prompt reads foo bar and trailing bar is inaccessible.

@lhecker lhecker added Product-Conhost For issues in the Console codebase Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-0 Bugs that we consider release-blocking/recall-class (P0) Area-CookedRead The cmd.exe COOKED_READ handling labels Feb 12, 2024
@lhecker lhecker self-assigned this Feb 12, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Feb 12, 2024
@carlos-zamora carlos-zamora removed Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Feb 14, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Tag-Fix Doesn't match tag requirements label Feb 14, 2024
@carlos-zamora carlos-zamora added this to the Terminal v1.21 milestone Feb 14, 2024
@carlos-zamora carlos-zamora added the zInbox-Bug Ignore me! label Feb 14, 2024
@lhecker lhecker added Priority-3 A description (P3) and removed Priority-0 Bugs that we consider release-blocking/recall-class (P0) labels Feb 15, 2024
@lhecker
Copy link
Member Author

lhecker commented Feb 15, 2024

No way... This reproduces all the way back to conhost v1 lol. At this point we've found ReadConsole's dwCtrlWakeupMask API:

  • overwrote the character under the cursor with the control character even though it wasn't ever intended to do that
  • allowed you read beyond the end of the initialized buffer
  • assumed that 1 char = 1 column despite being added after the W APIs got added
  • ✨NEW✨ doesn't even erase the end of the prompt

At this point I finally got to say: Kudos to the people who designed, implemented and reviewed the CONSOLE_READCONSOLE_CONTROL API. Whoever you all are, all of you did a. fantastic. job.

@microsoft-github-policy-service microsoft-github-policy-service bot added the In-PR This issue has a related PR label Feb 15, 2024
DHowett pushed a commit that referenced this issue Feb 21, 2024
Write "<command that doesn't exist> foo" in cmd.exe, move yours cursor
past the <command> and press tab. The "foo" will still be there but
will be inaccessible. This commit fixes the issue. As far as I can
tell, this never worked in any conhost version ever.

Closes #16704
DHowett pushed a commit that referenced this issue Feb 21, 2024
Write "<command that doesn't exist> foo" in cmd.exe, move yours cursor
past the <command> and press tab. The "foo" will still be there but
will be inaccessible. This commit fixes the issue. As far as I can
tell, this never worked in any conhost version ever.

Closes #16704

(cherry picked from commit 5e9f223)
Service-Card-Id: 91851715
Service-Version: 1.20
DHowett pushed a commit that referenced this issue Feb 21, 2024
Write "<command that doesn't exist> foo" in cmd.exe, move yours cursor
past the <command> and press tab. The "foo" will still be there but
will be inaccessible. This commit fixes the issue. As far as I can
tell, this never worked in any conhost version ever.

Closes #16704

(cherry picked from commit 5e9f223)
Service-Card-Id: 91851714
Service-Version: 1.19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-CookedRead The cmd.exe COOKED_READ handling In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-3 A description (P3) Product-Conhost For issues in the Console codebase zInbox-Bug Ignore me!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants