Skip to content
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

Clear scrollback on terminal clear in watch mode #1861

Closed
ColCh opened this issue Oct 4, 2016 · 10 comments
Closed

Clear scrollback on terminal clear in watch mode #1861

ColCh opened this issue Oct 4, 2016 · 10 comments

Comments

@ColCh
Copy link
Contributor

ColCh commented Oct 4, 2016

Output grows really fast in watch mode, and after sometime it gets really hard to navigate through terminal output with scrollbar.

Clearing scrollback before each run will fix that.

OS X : hotkey is CMD+K. but in watch mode you fast get tired of pressing it each time

How to do it programmatically: printf '\e[3J' [1]

[1] VIA: http://apple.stackexchange.com/a/113168

P.S. It's only about watch mode

@cpojer
Copy link
Member

cpojer commented Oct 4, 2016

We clear it every time we re-run tests. It just seems that terminals like iterm allow to scroll back up indefinitely.

I know @gaearon has done a ton of work with this.

@kentcdodds
Copy link
Contributor

Hmmm... Interesting, when I hit CMD+K, it clears the terminal entirely and I can't scroll up (in contrast to the clear command which behaves similar to Jest's watch mode).

@ColCh
Copy link
Contributor Author

ColCh commented Oct 5, 2016

@cpojer I'm using standart terminal app
@kentcdodds yes, that's the point, eliminate scrolling in watch mode

What you think guys?

@cpojer
Copy link
Member

cpojer commented Oct 5, 2016

I'm happy to support this in Jest but I want to get some input from @gaearon first. Also, how does this behave on windows? Do we need to do a platform sniff and print different things or will this work on both?

@ColCh
Copy link
Contributor Author

ColCh commented Oct 5, 2016

Tested on windows 7 cmd - printf '\e[3J' not works, but cls works

UPD echo -e '\e[3J' works on Ubuntu terminal nicely

@cpojer
Copy link
Member

cpojer commented Oct 5, 2016

In this case, would you mind sending a PR with the new behavior for osx (and linux?) and the old one for windows? Can you double check it works well on linux, too?

@ColCh
Copy link
Contributor Author

ColCh commented Oct 5, 2016

yes, but may be wait for @gaearon message? Interesting, what he can say on it

@gaearon
Copy link
Contributor

gaearon commented Oct 5, 2016

Send a PR and I'll be happy to test it with a few edge cases I know have been broken in the past last time I tried to fix this.

@cpojer
Copy link
Member

cpojer commented Dec 7, 2016

let's continue the conversation in the PR.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants