-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Remove console clearing in logs (or at least allow to scroll) #611
Comments
We don't print any warnings that we clear afterwards. We actually care about only printing relevant information. If some tool we are using prints a stray warning, we should either surface it in a meaningful way, or completely silence it. Can you comment out clearConsole() in node_modules/react-scripts/scripts/start.js and post a screenshot of that warning that was getting cleared?
This is a bit of an advanced use case. I understand your point but the solution is not to completely disable clearing. It's to figure out how to do it well 😉 . Clearing is important because seeing outdated results from previous compilation is confusing to many people. It's hard to focus when your terminal output is full of errors that have already been resolved, but success message happens to be shorter than failure messages, so it is drowned in them. We tried a few different escape sequences with different effects. The current one doesn't work well with scrolling. The previous one did not clear the screen initially on launch on Windows. I think we should change the code to use the current sequence on first call (so that Windows works well), but use the previous sequence for subsequent calls. Seems like that could solve both problems. |
I'm perfectly fine with taking it slow and figuring out the best way to do it :) Regarding the warning, it's actually foreman itself that does it, so there's actually nothing more to do besides figuring out the good way to clear the console.
I understand that it's a bit more advanced than the basic setup, but I think most people will want to have a backend at some point. And it quickly becomes annoying to have to start the app and the backend separately. I think a lot of people will look for a way to start both at the same time and hit this problem. |
I sort of feel that it should be up to Foreman to strip console clear sequences from the output. Since it attempts to merge outputs together, it makes sense that it should strip any escape sequences that cause conflicts between outputs. |
I expect 801c200 to fix it. At least, rather than clear the console completely, it should put a lot of lines between the last and next output. If this still doesn’t quite work for you, I think you’ll need to bring it up with Foreman because it should be technically able to omit certain escape characters from the piped output. |
I’d appreciate if you could check if 0.4.2 works better. |
Thanks for adding this. However, it doesn't work on my system (debian): When using terminator or guake, I see a piece of the escape sequence on the screen. It inserts blank lines (like the "clear" command) but it inserts too many. When using Hyperterm, It behaves exactly like before, almost as if the On this screenshot, the top terminal is terminator and the bottom terminal is hyperterm. I didn't test it on gnome-terminal, but Terminator is based on it so I expect it to behave similarly. |
I’d appreciate if you could try to fiddle with that sequence too. |
Sure, I'll try to make some time and open a PR. I won't be able to test on MacOS though. |
I created a similar issue here: #794 |
Is there no way to disable the clearing of the console altogether? I'm not using any complicated multi-process setup with foreman, though I'd still appreciate if it was under a flag, instead of just checking |
Hello,
I am a bit annoyed by the fact that create-react-app clears the console each time it compiles in 'npm start' logs.
For example, when I run npm start, I sometimes see that there's a warning but it disappears almost immediately and I can't read it. I can't even scroll up to see it!
It's also not very appropriate when I run both the client and server with node-foreman for example, because the app assumes it's the only one to run in the terminal.
Is there a way to disable this or a workaround ?
The text was updated successfully, but these errors were encountered: