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 can hang when editing a line with control characters #17893

Open
j4james opened this issue Sep 10, 2024 · 0 comments · May be fixed by #17905
Open

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

j4james opened this issue Sep 10, 2024 · 0 comments · May be fixed by #17905
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-2 A description (P2) Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal.

Comments

@j4james
Copy link
Collaborator

j4james commented 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:

// Layout the _buffer contents into lines.
for (size_t beg = 0; beg < segment.size();)
{
if (res.column >= size.width)
{
lines.emplace_back();
}
auto& line = lines.back();
res = _layoutLine(line.text, segment, beg, line.columns, size.width);
line.columns = res.column;
if (!dirty)
{
line.dirtyBegOffset = line.text.size();
line.dirtyBegColumn = res.column;
}
beg = res.offset;
}

@j4james j4james 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 10, 2024
@lhecker lhecker added Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal. Priority-2 A description (P2) Area-CookedRead The cmd.exe COOKED_READ handling and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Sep 10, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Tag-Fix Doesn't match tag requirements label Sep 10, 2024
@lhecker lhecker linked a pull request Sep 11, 2024 that will close this issue
@microsoft-github-policy-service microsoft-github-policy-service bot added the In-PR This issue has a related PR label Sep 11, 2024
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-2 A description (P2) Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants