-
-
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 terminal in watch mode #3608
Comments
@gkiely this happens only on MacOS's built-in Terminal application, right? Any other terminal works fine at least based on my testing at #1183 (comment). If I add following to the reproduction script, the terminal is cleared correctly: // 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('\x1B[2J\x1B[3J\x1B[H');
console.log(`\x1Bc${message}`); // Vitest's logger.clearFullScreen
console.log("Testing"); This is something that could probably be added here: vitest/packages/vitest/src/node/logger.ts Line 46 in f427f00
+ this.console.log('\x1B[2J\x1B[3J\x1B[H')
this.console.log(`\x1Bc${message}`) This seems to work at least on my machine but I'm not really familiar with raw ANSI-codes. I picked the sequence from here: sindresorhus/ansi-escapes#25 (comment). |
Yes |
Jest seems to indeed be using different ANSI codes than Vitest. We should try to change Vitest to use the same |
Describe the bug
When using large amounts of text the terminal does not clear on save using macOS.
See #1183 for details.
Reproduction
See instructions from: #1183
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: