-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
vt: make sure to Flush the entire parsed sequence #4870
vt: make sure to Flush the entire parsed sequence #4870
Conversation
When we had to flush unknown sequences to the terminal, we were only taking the _most recent run_ with us; therefore, if we received `\e[?12` and `34h` in separate packets we would _only_ send out `34h`. This change fixes that issue by ensuring that we cache partial bits of sequences we haven't yet completed, just in case we need to flush them. Fixes #3080. Fixes #3081.
You should test that this correctly flushes/ignores SIXEL data too... |
Chatted offline; since SIXEL data isn't encoded in an escape but rather as a separate "mode" the terminal needs to be put into, this doesn't change how it's handled/passed through/ignored. |
src/terminal/parser/stateMachine.cpp
Outdated
bool succeeded = true; | ||
if (succeeded && _cachedSequence.has_value()) | ||
{ | ||
succeeded = _engine->ActionPassThroughString(*_cachedSequence); | ||
_cachedSequence.reset(); | ||
} | ||
return succeeded && _engine->ActionPassThroughString(_run); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're being tricky here and it's taking more than instantaneous to figure out what you're doing. Can you please add more comments to explain your trickery?
(Also that first succeeded
test is weird given it's always true...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the first succeeded
test is in case anybody ever adds another thing that might fail in this flow ;P but yeah, fair. I'll comment it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve, but please clarify your mild trickery with a comment before merging.
When we had to flush unknown sequences to the terminal, we were only taking the _most recent run_ with us; therefore, if we received `\e[?12` and `34h` in separate packets we would _only_ send out `34h`. This change fixes that issue by ensuring that we cache partial bits of sequences we haven't yet completed, just in case we need to flush them. Fixes microsoft#3080. Fixes microsoft#3081.
When we had to flush unknown sequences to the terminal, we were only
taking the most recent run with us; therefore, if we received
\e[?12
and
34h
in separate packets we would only send out34h
.This change fixes that issue by ensuring that we cache partial bits of
sequences we haven't yet completed, just in case we need to flush them.
Fixes #3080.
Fixes #3081.
PR Checklist
Validation Steps Performed
Ran new tests!