From 68320577ae48afc8901d05cb5a247547c1f22497 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Sat, 29 Aug 2026 10:15:21 -0600 Subject: [PATCH] troubleshoot zellij alt-shift-p latency --- docs/CHANGELOG.md | 6 ++++++ .../modules/nmasur/presets/programs/ghostty.nix | 3 +++ 2 files changed, 9 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 327e6a62..79472dc1 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 2026-08-29 + +- Fixed 1.5-second latency when pressing `Alt-Shift-P` to trigger `zellij-session` in Zellij 0.45.0 + Ghostty: + - **Root Cause**: Zellij 0.45.0 introduced `StdinAnsiParser` (`zellij-client/src/stdin_ansi_parser.rs`) using `termwiz::InputParser` to parse ANSI control strings (OSCs, CSIs, DCSs) arriving on stdin. When pressing `Alt-Shift-P` (Option-Shift-P) with `support_kitty_keyboard_protocol = false`, Ghostty sent `\x1bP` (`ESC` + uppercase `P`). In ECMA-48 / VT100 standards, `ESC P` is the 7-bit ASCII representation of `DCS` (Device Control String). `StdinAnsiParser` buffered `\x1bP` waiting for a DCS string payload and string terminator (`ST` / `\x1b\`), hitting a ~1.5-second escape timeout before flushing `\x1bP` as residue to the keyboard handler. + - **Fix**: Added `alt+shift+p=text:\x1b[112;4u` and `super+shift+p=text:\x1b[112;4u` in `ghostty.nix` to send the explicit CSI-u sequence for `Alt+Shift+p` (`'p'` with modifier 4 = `ALT | SHIFT`). `StdinAnsiParser` immediately recognizes `\x1b[112;4u` as non-DCS input and passes it straight to the keyboard handler with 0ms latency. + ## 2026-08-26 - Fixed macOS shortcuts (`Cmd+T`, `Ctrl+Tab`, `Cmd+Shift+]`, `Cmd+Shift+[`, `Cmd+K`, `Cmd+Shift+E`) in Zellij + Ghostty after disabling the Kitty keyboard protocol: diff --git a/platforms/home-manager/modules/nmasur/presets/programs/ghostty.nix b/platforms/home-manager/modules/nmasur/presets/programs/ghostty.nix index 9be005b9..cf61f211 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/ghostty.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/ghostty.nix @@ -45,6 +45,9 @@ in "ctrl+shift+tab=text:\\x1b{" "super+k=text:\\x1bK" "super+shift+e=text:\\x1bE" + # Send CSI-u sequence for Alt+Shift+P / Super+Shift+P to bypass Zellij 0.45's DCS (ESC P) parser timeout (~1.5s delay) + "alt+shift+p=text:\\x1b[112;4u" + "super+shift+p=text:\\x1b[112;4u" ]; }; themes."gruvbox" = {