Skip to content

fix(wezterm): prevent Herdr from swallowing Escape#15

Merged
kunchenguid merged 2 commits into
mainfrom
fm/dpub-wez-kitty-w5
Jul 11, 2026
Merged

fix(wezterm): prevent Herdr from swallowing Escape#15
kunchenguid merged 2 commits into
mainfrom
fm/dpub-wez-kitty-w5

Conversation

@kunchenguid

Copy link
Copy Markdown
Owner

Intent

Fix the confirmed Herdr Escape-swallow bug for viewers who follow this public dotfiles setup. Inside Herdr, a lone Escape is held ~150ms and coalesces with a tailgating SGR mouse event which Herdr drops, swallowing Escape in editors like Neovim. The clean, minimal fix is to enable the kitty keyboard protocol in this repo's tracked WezTerm config so WezTerm emits Escape as an atomic key event (\x1b[27u), and Herdr never enters the hold/fold path.

Scope: add exactly one config option, config.enable_kitty_keyboard = true (matching WezTerm's Lua API), to home/.config/wezterm/wezterm.lua, plus one concise comment explaining it makes Esc atomic so Herdr does not swallow it. Purely additive; nothing else changed. Placed at the end of the config block before 'return config', matching the file's existing 'config.xxx = value' style.

This is a PUBLIC on-camera teaching repo. Intentional constraints a reviewer should not flag: the change is deliberately minimal (single option + comment); no root AGENTS.md/CLAUDE.md agent-scaffolding should be added to this repo (project knowledge for viewers lives in the README); .no-mistakes/ stays untracked and must not be committed.

What Changed

  • Enable WezTerm's kitty keyboard protocol so Escape is emitted atomically and is not swallowed by Herdr when followed closely by a mouse event.
  • Document the Herdr-safe Escape behavior in the README.

Risk Assessment

✅ Low: The change is narrowly scoped, uses the documented WezTerm option correctly, and introduces no material correctness, compatibility, security, or maintainability concerns.

Testing

Inspected the complete baseline-to-target diff, loaded the tracked configuration with installed WezTerm 20240203, and captured evidence that the intended option is accepted. The change passed; direct Escape-byte capture was not feasible without an interactive Herdr terminal session.

Evidence: WezTerm configuration verification transcript

wezterm 20240203-110809-5046fc22 config file: home/.config/wezterm/wezterm.lua resolved option source: 15:config.enable_kitty_keyboard = true config load: wezterm show-keys completed successfully changed paths and line counts: 4 0 home/.config/wezterm/wezterm.lua

wezterm 20240203-110809-5046fc22
config file: home/.config/wezterm/wezterm.lua
resolved option source: 15:config.enable_kitty_keyboard = true
config load: wezterm show-keys completed successfully
changed paths and line counts:
4	0	home/.config/wezterm/wezterm.lua

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • git diff --no-ext-diff ad6fe1d9f43dfbf96d577b619fb8d5d99ce3174b b2115553b829bb3023e1d256f222798cff93f30f -- home/.config/wezterm/wezterm.lua
  • wezterm --config-file home/.config/wezterm/wezterm.lua show-keys
  • rg -n '^config\.enable_kitty_keyboard = true$' home/.config/wezterm/wezterm.lua
  • git diff --numstat ad6fe1d9f43dfbf96d577b619fb8d5d99ce3174b b2115553b829bb3023e1d256f222798cff93f30f
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Herdr holds a lone Escape ~150ms and coalesces it with a tailgating SGR
mouse event, then drops the pair - swallowing Escape in editors like
Neovim. Enabling the kitty keyboard protocol makes WezTerm emit Escape as
an atomic key event (\x1b[27u), so Herdr never enters the hold/fold path.
@kunchenguid
kunchenguid merged commit 95cf01b into main Jul 11, 2026
1 check passed
kunchenguid added a commit that referenced this pull request Jul 11, 2026
The enable_kitty_keyboard option added in PR #15 caused a total-loss
regression: physical Escape never registered in Neovim under Herdr after
a rebuild. Remove the option and its README explainer so viewers who
follow this setup are not broken.
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.

1 participant