-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 console in watch mode #1183
Comments
I've run into this issue before, looking for a solution to prevent the logs of just simply disappearing or when an uncaught error is thrown to be able to read it, this is also replicable on the single run mode |
Open for PR, thanks! |
Console is cleared in watch mode by default. |
@sheremet-va While it clears the console it retains the past results and scrollbar so it does not function like ⌘ + k. This is an issue when debugging something like testing-library that outputs dom html that can take up a lot of vertical screen space. A user would scroll up and then has to scroll back down to re-engage the terminal instead of just updating a test and seeing the new results. I can provide a video of this if you need to see the issue in detail. The ability to truly clear the terminal like Jest does would be great. |
Vitest clears the terminal like Jest does. Check that you don't disable |
Here's what I mean: Jest clears the scrollbar and terminal where vitest does not. I'm running that without a config, just: |
I cannot reproduce it: Screen.Recording.2023-05-31.at.09.40.46.mov |
@sheremet-va Try in the mac terminal. |
I'm able to reproduce this on Mac's terminal. However it works fine using VSCode's internal terminal and Warp. Here's minimal reproduction case which demonstrates the issue. Run script, manually scroll up and wait for 3s. Mac terminal is the only one that does not work. The // repro.mjs
const message = "Hello World";
await new Promise((r) => setTimeout(r, 1000));
Array(200).fill(0).forEach((_, i) => console.log(`Row ${i}`));
console.log("Scroll up now");
await new Promise((r) => setTimeout(r, 3000));
console.log(`\x1Bc${message}`); // Vitest's logger.clearFullScreen
console.log("Testing"); Top left terminal is Warp, top right Mac terminal and bottom one is VSCode: terminals-repro-1.mov |
Clear and concise description of the problem
When iterating over components, while having my test run in the background, the console starts to fill up extremely fast and it becomes hard to get to the beginning of the latest report.
If the console would clear itself, simply scrolling up would suffice.
I also had some other ideas, which might be cool.
Suggested solution
Providing an option to toggle this behaviour in the config maybe like this:
Alternative
Also making some / all functionality part of the interactive CLI.
The "show no stack trace" would fit in quite well there, since hard-coding that in the configuration could be suboptimal, but be just right during one session.
The others maybe not that much.
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: