[PR #2924] Patch fix for #1360 until WriteStream (#780) can be implemented. #25154

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

Original Pull Request: https://github.com/microsoft/terminal/pull/2924

State: closed
Merged: Yes


Summary of the Pull Request

Writing can enter an infinite loop with full-width characters being inserted into the last column of the buffer.

References

#780

PR Checklist

Detailed Description of the Pull Request / Additional comments

This is because the "WriteCharsLegacy2ElectricBoogaloo" implementation in the Terminal (Terminal::_WriteBuffer) is a hacky thing that we put together knowing full well that we'd have to do #780 but we had to get this working enough for now. Turns out, it's not super complete and fragile. Surprise.

Validation Steps Performed

  • Manual run of @treit's sample against the Terminal.
  • Attempting to author automated test with @treit's sample
  • I need to run it against conhost and make sure it's not failing too (and fix it there too if it is)
**Original Pull Request:** https://github.com/microsoft/terminal/pull/2924 **State:** closed **Merged:** Yes --- <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Writing can enter an infinite loop with full-width characters being inserted into the last column of the buffer. <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References #780 <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [X] Closes #1360 * [X] I work here * [ ] Draft because I'm going to try to turn the code @treit gave me for repro into a test * [X] Documented by comments at the hack and noted for #780 * [X] I'm a core contributor <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments This is because the "WriteCharsLegacy2ElectricBoogaloo" implementation in the Terminal (`Terminal::_WriteBuffer`) is a hacky thing that we put together knowing full well that we'd have to do #780 but we had to get this working enough for now. Turns out, it's not super complete and fragile. Surprise. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed - Manual run of @treit's sample against the Terminal. - Attempting to author automated test with @treit's sample - I need to run it against conhost and make sure it's not failing too (and fix it there too if it is)
claunia added the pull-request label 2026-01-31 09:07:38 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#25154