Skip to content

Conversation

@edmundhung
Copy link
Contributor

Fixes a regression from #21103 where shortcuts stop working after server.restart().

When the dev server restarts, the readline interface is preserved in the new server but it stops responding to input as it has been closed when the old server was closed. This clears the closed readline reference so a fresh instance will be created.

// Restart the server
action.mockClear()
await server.restart()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not expecting the binding state to be preserved across the server restart (i.e. I was thinking that bindCLIShortcuts should be called at this line as well). But it seems that behavior exists since the beginning #13675 and I guess it's fine to keep it as-is.

@sapphi-red sapphi-red added p3-minor-bug An edge case that only affects very specific usage (priority) regression The issue only appears after a new release labels Dec 1, 2025
@sapphi-red sapphi-red merged commit 3765f7b into vitejs:main Dec 1, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p3-minor-bug An edge case that only affects very specific usage (priority) regression The issue only appears after a new release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants