Skip to content

feat(shortcuts): show quit shortcut in default CLI output#21572

Open
palewire wants to merge 1 commit intovitejs:mainfrom
palewire:feat/show-quit-shortcut-by-default
Open

feat(shortcuts): show quit shortcut in default CLI output#21572
palewire wants to merge 1 commit intovitejs:mainfrom
palewire:feat/show-quit-shortcut-by-default

Conversation

@palewire
Copy link

@palewire palewire commented Feb 5, 2026

Makes the q + enter quit shortcut visible by default in the dev server startup message, instead of hiding it behind the help menu.

  ➜  press q + enter to quit

This appears right after the existing "press h + enter to show help" line, making both the most essential shortcuts immediately visible.

Why?

When teaching Vite to newcomers (journalism students at CUNY, workshop participants), a common point of frustration is not knowing how to exit the dev server. New developers often:

  • Try Ctrl+C repeatedly (which can leave processes hanging)
  • Close the entire terminal window
  • Don't realize keyboard shortcuts exist at all

The quit shortcut is arguably the most important one for beginners to know, yet it's currently hidden behind h + enter. By the time they discover it, they've already developed workarounds.

@bluwy
Copy link
Member

bluwy commented Feb 6, 2026

  • Try Ctrl+C repeatedly (which can leave processes hanging)
  • Close the entire terminal window

These two should work fine in Vite depending on which you prefer. Ctrl+C also shouldn't be hanging the process. The main benefit of the q+enter shortcut is that it allows Vite to safely teardown before stopping the process, but it should also be fine if its stopped directly from the terminal, node would also tear them down.

Can you show some examples, environments or repros where these methods are causing problems?

@palewire
Copy link
Author

palewire commented Feb 6, 2026

Can you show some examples, environments or repros where these methods are causing problems?

Sure. Here's one.

Even if you don't buy those definitions of the problem, I think this additional line of logging is worth doing strictly for the n00bs.

I have seen dozens of students not understanding they've lost the ability to type more commands when they run npm run dev and encounter a test server for the first time. They often become confused about how to turn off the server.

A little hint like this could go a long way to clearing up that confusion and guiding new users into Vite and web development.

@bluwy
Copy link
Member

bluwy commented Feb 9, 2026

I understand where you're coming from, but additions like these aren't free. Vite is used by various levels of developers. Additional information upfront helps new users, but not others who're already familiar with the terminal, they might consider it as noise and we'd have to reconsider the design again.

Even if we do expose some hint, it's better to show Ctrl+C than q+enter because Ctrl+C is going to work in many other CLIs. If you run npm install, top, or any other servers, Ctrl+C is ubiquitous that it works without explicitly mentioning. What CLIs should document or display instead is custom CLI-specific commands or shortcuts that don't have the same knowledge transfer.

Maybe others feel differently of this, but to balance how Vite is used by various users, I believe we shouldn't add the hint.

@bluwy bluwy added this to Team Board Mar 6, 2026
@github-project-automation github-project-automation bot moved this to Discussing in Team Board Mar 6, 2026
@palewire
Copy link
Author

palewire commented Mar 8, 2026

I totally agree it's a balancing act. In my opinion, this one situation would benefit from a slight lean towards the n00b.

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

Labels

None yet

Projects

Status: Discussing

Development

Successfully merging this pull request may close these issues.

2 participants