Skip to content

Fix: Escape exits Zen Mode when pressed in Normal mode#9991

Open
bouclem wants to merge 1 commit into
VSCodeVim:masterfrom
bouclem:fix/zen-mode-escape
Open

Fix: Escape exits Zen Mode when pressed in Normal mode#9991
bouclem wants to merge 1 commit into
VSCodeVim:masterfrom
bouclem:fix/zen-mode-escape

Conversation

@bouclem
Copy link
Copy Markdown

@bouclem bouclem commented Apr 19, 2026

Fixes #9981

When in Zen Mode with Vim active, pressing Escape while focused on a file tab never reaches VS Code's native Zen Mode exit handler. Vim intercepts the key and the Esc, Esc sequence to exit Zen Mode does nothing.

Cause

CommandEsc in Normal mode already calls a set of VS Code cleanup commands (close reference search, close markers, hide inline suggestions, etc.) via Promise.allSettled. workbench.action.exitZenMode was missing from that list.

Change

  • Added workbench.action.exitZenMode to the existing cleanup commands in CommandEsc.exec() for Normal mode

This means:

  • From Insert mode: first Esc goes to Normal, second Esc exits Zen Mode (matches VS Code's double-Esc behavior)
  • From Normal mode: Esc exits Zen Mode directly (Vim has nothing else to do with it)
  • Outside Zen Mode: the command is a no-op, no side effects

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.

Can't exit zen mode

1 participant