Skip to content

fix(vitest): ensure restoring terminal cursor on close - #5292

Merged
sheremet-va merged 1 commit into
vitest-dev:mainfrom
hi-ogawa:fix-typecheck-run-restore-terminal-cursor
Mar 14, 2024
Merged

fix(vitest): ensure restoring terminal cursor on close#5292
sheremet-va merged 1 commit into
vitest-dev:mainfrom
hi-ogawa:fix-typecheck-run-restore-terminal-cursor

Conversation

@hi-ogawa

@hi-ogawa hi-ogawa commented Feb 25, 2024

Copy link
Copy Markdown
Collaborator

Description

I couldn't identify the actual cause of cursor not getting back only on typecheck run, so I went with using logUpdate.done to explicitly restore the cursor. There could be some deeper bug specific to typecheck run, but I couldn't see anything suspicious.

additional notes

  • log-update is used only for reporters such as dot and default reporters on TTY, so the bug doesn't occur when using --reporter=tap for example.
  • log-update internally uses cli-cursor, which in turn uses restore-cursor. Since we haven't used logUpdate.done, probably we're relying on restore-cursor's automatic restoration, which somehow doesn't work on typecheck mode.

test

  • run pnpm -C examples/typecheck test:run
  • verify cursor is restored

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terminal cursor is not restored with --typecheck in run mode

3 participants