-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
avoid ANSI clearScreen #7523
avoid ANSI clearScreen #7523
Conversation
6b6ed81
to
68bc4d0
Compare
That seems to behave properly as well. But I think we'd have to move it, since we don't usually import from |
|
68bc4d0
to
9208ac6
Compare
Codecov Report
@@ Coverage Diff @@
## master #7523 +/- ##
=======================================
Coverage 67.73% 67.73%
=======================================
Files 247 247
Lines 9513 9513
Branches 5 5
=======================================
Hits 6444 6444
Misses 3067 3067
Partials 2 2 Continue to review full report at Codecov.
|
@jeysal hey, a rebase gone wrong? 🙂 |
Working on it rn, looks like GitHub closed the PR because I force pushed after resetting to origin/master. |
clearScreen is quite aggressive and can e.g. brick the user's shell theme.
Alright, ready for review. Seems like I managed to totally confuse Travis & AppVeyor though :D |
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.
This is great!
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.
LGTM 👍
* avoid ANSI clearScreen clearScreen is quite aggressive and can e.g. brick the user's shell theme. * move specialChars to jest-util
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
clearScreen
is quite aggressive and can e.g. brick the user's shell theme.Better use
eraseScreen
andcursorTo(0, 0)
instead.Summary
Pattern prompts and interactive snapshot mode use
ansiEscapes.clearScreen
, which can sometimes clear more than it should - in this case the shell theme (note the background color changing from dark gray to black when pressingp
in watch mode):I can reproduce this behavior running bash & zsh inside kitty on macOS & Linux with the minimal base16-shell theming setup as described in its readme Installation/Configuration sections.
Test plan
The combination of
eraseScreen
andcursorTo(0, 0)
achieves the same goal asclearScreen
, but does not exhibit its problems:Open question:
How can we guard against regressions that introduce new usages of
clearScreen
? Introduce an abstraction on top of ansi-escapes and avoid direct usage? Seems a bit excessive