fix flashing during erase() on windows terminal #116
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a fix for windows terminal.
You can see when they implemented this feature here https://github.com/microsoft/terminal/pull/5181/files#diff-e3429f3447a1f078e953e22ed6556dfbffd1c584ec362f1be455d98589c38e79R108
before:
https://emu.bz/before.webm
after:
https://emu.bz/after.webm
for some reason this did not work with WSL in windows terminal, but it never worked in that situation anyway.
I can't detect if it's in windows terminal on WSL because the WT_TERMINAL env variable doesn't exist in that environment, but i could check for /etc/wsl.conf if needed. If it is in windows terminal on WSL, it can't use the cursor position escape sequence in combination with a carriage return in the clear function.
would need to be either
or
in that environment
in a975c3c, simply writing
\033[K
instead of\r\033[K
in the clear function seems to do the trick, but I think I will need some verification that this works as intended in native linux environments.