microsoft / microsoft/terminal
Random parsing/rendering bugs when input arrives slowly
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 105k
- Forks
- 9.6k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 29
Description
Environment
Windows build number: Win32NT 10.0.18362.0
Windows Terminal version (if applicable): 0.5.2762.0
Steps to reproduce
This bug sounds similar to #3080 and #3081, but this time all the escape sequences are supported by WT, and I don't have a fully reproducible test case, it all seems random.
Resize the terminal to 28 rows (my default due to bug 2061, nevermind).
Execute this a couple of times:
slowcat -t 200000 parsing-delay.txt
whereas slowcat is shipped with VTE and does exactly what you would think, with the parameter being in microseconds, i.e. prints one byte every 0.2 seconds in the above example; and
parsing-delay.txt is the test file stripped down as much as I had patience.
Modify the numeric parameter in the ballpark of 200000 – 350000 (i.e. ~3–5 bytes per second) as you feel like, I have no idea if it influences the behavior, sometimes it feels so but it could just be random. :)
Note that at the end of the command, you're left on the alternate screen. It switches to the normal screen for a short time in the middle and then back to the alternate one.
Expected behavior
The same thing should happen all the time as you repeat this command (except at the first time when you begin on the normal screen), without the spurious random 1 and h described below.
Actual behavior
When switched back to the normal screen for a short time, sometimes a digit 1 appears in the bottom left corner. Even more interestingly, the number of such 1s in that row keeps growing, despite the cursor being explicitly moved to row 28 column 1 every time. (And changing that to column 2 keeps it a digit 1 that appears, so it's not where it comes from.)
When switched back to the alternate screen, sometimes a letter h appears at the top left.
Both artifacts occur to me with a probability of perhaps 25–50-ish %. Play with the timing constant if they don't want to appear to you, it might make a difference, I'm not sure.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the behavior in Windows Terminal with slowcat -t 200000 parsing-delay.txt, varying the delay as described. Compare repeated runs with the related issues #3080 and #3081. Done means switching between the normal and alternate screens is consistent, without spurious 1 or h characters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100