Make evil-ghostel ESC routing discoverable#543
Open
dakra wants to merge 2 commits into
Open
Conversation
New evil users starting a fullscreen TUI (e.g. Claude Code) felt trapped: with the default auto routing, alt-screen ESC goes to the app, so normal state is unreachable via ESC and nothing pointed at the escape hatch. - Show a one-time echo-area hint the first time auto routing sends ESC to an alt-screen app. - Bind C-c C-r to evil-ghostel-toggle-send-escape and turn it into a two-state toggle: auto flips to whichever mode differs from auto's current effect (evil in alt-screen, terminal otherwise); explicit modes return to auto. Every press now visibly changes the routing. - Show the effective routing in the toggle's message when landing on auto. - Bind C-c <escape> to evil-force-normal-state as a one-shot switch that leaves the routing untouched (function-key event: GUI frames, or ttys with the kitty keyboard protocol via kkp.el). - Document ESC routing in the manual, the main README, a new extension README, and the package commentary. Closes #539
Three different alt-screen checks existed: the native ghostel--alt-screen-p (reads the active screen), line-mode's 1049-or-1047 mode query, and evil-ghostel's 1049-only query. The mode queries miss alt screens entered via other DEC modes (47, 1047) — e.g. evil-ghostel's auto ESC routing kept ESC in evil for a TUI using 1047. Add ghostel-alt-screen-p, a public wrapper around the native check, and use it for line-mode pause/resume and all evil-ghostel alt-screen decisions. Tests stub the native ghostel--alt-screen-p instead of ghostel--mode-enabled. Also give the extension .elc rule a dependency on the core .elc files so a parallel build cannot compile evil-ghostel against a stale ghostel.elc that predates a newly added core function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #539
New evil/Doom users starting a fullscreen TUI (e.g. Claude Code with
/tui fullscreen) felt trapped: with the defaultautorouting, alt-screen ESC goes to the app, so normal state is unreachable via ESC, the leader key is dead in insert state, and nothing pointed at the escape hatch.Discoverability (
febcb6d)autorouting sends ESC to an alt-screen app, the echo area showsESC sent to the terminal app (alt-screen); C-c C-r routes it to evil instead(once per session).C-c C-ris bound toevil-ghostel-toggle-send-escape, now a two-state toggle: fromautoit switches to whichever mode differs from auto's current effect (evilwhile an alt-screen app runs,terminalotherwise); from an explicit mode back toauto. Every press visibly changes the routing — previously, cyclingauto→terminalin an alt-screen app changed nothing observable, which is exactly what confused users in Need more visibility on evil-ghostel-toggle-send-esc #539. Numeric prefixes 1/2/3 still set a mode directly, and landing onautomessages the effective routing (auto (now → terminal)).C-c <escape>runsevil-force-normal-stateas a one-shot switch that leaves the routing untouched. It's bound on the<escape>function key, so it works on GUI frames and on ttys speaking the kitty keyboard protocol (via kkp.el); on legacy ttys the event never occurs, so it can't shadow theC-c M-…bindings.extensions/evil-ghostel/README.md, and an expanded package commentary.Alt-screen detection cleanup (
d206461)Three different alt-screen checks existed: the native
ghostel--alt-screen-p(reads the active screen), line-mode's 1049-or-1047 mode query, and evil-ghostel's 1049-only query. The mode queries miss alt screens entered via other DEC modes — e.g.autoESC routing kept ESC in evil for a TUI using mode 1047.A new public
ghostel-alt-screen-pwraps the native check and is now used for line-mode pause/resume and all evil-ghostel alt-screen decisions; tests stub the native function instead ofghostel--mode-enabled. The extension.elcMake rule also gained a dependency on the core.elcfiles so parallel builds can't compile evil-ghostel against a staleghostel.elc.Testing
make -j8 all(build, elisp + native tests, lint) andmake test-evil(130/130) pass.C-c <escape>on a GUI frame, and the mode-1047/47 coverage of the new predicate (where the old flag check provably returned nil).