-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix(vitest): ensure restoring terminal cursor on close #5292
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
fix(vitest): ensure restoring terminal cursor on close #5292
Conversation
✅ Deploy Preview for fastidious-cascaron-4ded94 canceled.
|
AriPerkkio
left a comment
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.
we're relying on
restore-cursor's automatic restoration, which somehow doesn't work ontypecheckmode.
As this is such small fix I think it's ok as is. But it would be good to find why exactly restore-custor's exit-patch doesn't trigger in typecheck mode.
If typecheck run is now interrupted with CTRL+c, does the cursor restore correctly?
I just tested now and surprisingly it restores correctly both before and after this fix. I'd like to get to the bottom of it. I'm guessing something wrong with |
Description
--typecheckin run mode #5247I couldn't identify the actual cause of cursor not getting back only on typecheck run, so I went with using
logUpdate.doneto explicitly restore the cursor. There could be some deeper bug specific to typecheck run, but I couldn't see anything suspicious.additional notes
log-updateis used only for reporters such asdotanddefaultreporters on TTY, so the bug doesn't occur when using--reporter=tapfor example.log-updateinternally uses cli-cursor, which in turn uses restore-cursor. Since we haven't usedlogUpdate.done, probably we're relying onrestore-cursor's automatic restoration, which somehow doesn't work ontypecheckmode.test
pnpm -C examples/typecheck test:runPlease don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.