Cooked read can hang when editing a line with control characters #22247

Open
opened 2026-01-31 08:07:39 +00:00 by claunia · 0 comments
Owner

Originally created by @j4james on GitHub (Sep 10, 2024).

Windows Terminal version

1.22.2362.0

Windows build number

10.0.19045.4651

Other Software

No response

Steps to reproduce

  1. Open a cmd shell in Windows Terminal.
  2. Type Ctrl+A
  3. Move the cursor left so it's before the ^A.
  4. Type a bunch of characters so the ^A is pushed past the end of the line.

Expected Behavior

The ^A should eventually wrap over onto the next line.

Actual Behavior

Once the ^A reaches the rightmost column, the line editor stops responding to any further keystrokes. In the debugger I can see it's stuck in an infinite loop here:

4aa1624cd2/src/host/readDataCooked.cpp (L922-L941)

Originally created by @j4james on GitHub (Sep 10, 2024). ### Windows Terminal version 1.22.2362.0 ### Windows build number 10.0.19045.4651 ### Other Software _No response_ ### Steps to reproduce 1. Open a cmd shell in Windows Terminal. 2. Type <kbd>Ctrl</kbd>+<kbd>A</kbd> 3. Move the cursor left so it's before the `^A`. 4. Type a bunch of characters so the `^A` is pushed past the end of the line. ### Expected Behavior The `^A` should eventually wrap over onto the next line. ### Actual Behavior Once the `^A` reaches the rightmost column, the line editor stops responding to any further keystrokes. In the debugger I can see it's stuck in an infinite loop here: https://github.com/microsoft/terminal/blob/4aa1624cd2cfd5cdd4106feb26a2aa0f089a0e3d/src/host/readDataCooked.cpp#L922-L941
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22247