From 239b56c1b174e531cdbe7104b23ee8707f91ce4c Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Wed, 26 Aug 2026 17:26:30 -0600 Subject: [PATCH] fix(zellij): disable kitty keyboard protocol to fix post-TUI typing lag --- docs/CHANGELOG.md | 6 ++++++ .../modules/nmasur/presets/programs/zellij.nix | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index cd87ef77..5341919d 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 2026-08-26 + +- Fixed persistent Fish typing lag after long TUI sessions (Neovim, jjui, Yazi) inside Zellij + Ghostty, which the `no-query-term` / Ghostty-integration fixes from 2026-08-25 did not resolve: + - Verified on Fish 4.8.1 that the `query-term` feature already defaults to `off`, so exporting `fish_features = no-query-term` is a no-op on this Fish version — it isn't the cause of (or fix for) this class of lag. + - Set `support_kitty_keyboard_protocol = false` in `zellij.nix`. Zellij and Ghostty have several open upstream bugs (zellij-org/zellij#3887, #3723, #4178) where the Kitty keyboard protocol's enhancement-flag stack is left in an elevated state after a full-screen TUI exits without properly popping it. Every subsequent keystroke then arrives as a CSI-u sequence that Fish must wait out an escape-disambiguation timeout to parse, which reads as typing lag that worsens the longer the TUI session ran, and persists until the pane's protocol state resets (e.g. a fresh shell/pane). Disabling the protocol support in Zellij avoids the whole bug class; trades off precise modifier reporting (e.g. distinguishing Ctrl+Shift+key) for TUIs running inside Zellij panes, which this setup doesn't otherwise depend on (Shift+Enter is handled via a literal Ghostty `text:` keybind, not the Kitty protocol). + ## 2026-08-25 - Fixed Nix evaluation warnings for `stdenv` deprecation and `gemini-cli`: diff --git a/platforms/home-manager/modules/nmasur/presets/programs/zellij.nix b/platforms/home-manager/modules/nmasur/presets/programs/zellij.nix index ab2209dd..0baa2c92 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/zellij.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/zellij.nix @@ -134,6 +134,15 @@ in # default_layout = "compact-top"; # Remove border pane_frames = false; + # Ghostty + Zellij have several open upstream bugs where the Kitty + # keyboard protocol's "enhancement" flags get left in a stuck/elevated + # state after a full-screen TUI exits (e.g. zellij-org/zellij#3887, + # #3723, #4178), causing every subsequent keystroke to be sent as a + # CSI-u sequence that fish has to wait out an escape-timeout to + # disambiguate. This shows up as typing lag that builds up the longer + # you were inside the TUI, until the pane's protocol state resets. + # Disabling it entirely avoids the whole bug class. + support_kitty_keyboard_protocol = false; # Scrollback scrollback_editor = config.home.sessionVariables.EDITOR;