Modern terminals (kitty, wezterm, foot, ghostty) and shell/editor
applications (fish, neovim, helix) increasingly use the kitty keyboard
protocol, which encodes key presses as CSI u sequences instead of raw
control bytes:
Ctrl-\ legacy: 0x1C -> kitty protocol: ESC [ 92 ; <mod> u
The modifier field encodes all active modifiers including lock keys:
modifier = 1 + (shift:1|alt:2|ctrl:4|super:8|...|capslock:64|numlock:128)
For example, Ctrl-\ with numlock on produces ESC[92;133u, not 0x1C.
Since abduco only checked for the single-byte value, the detach key was
silently ignored whenever the keyboard protocol was active — which is
the default state at a fish shell prompt or inside neovim/helix.
This adds a CSI u parser alongside the existing single-byte check in the
client read loop. The parser:
- Extracts the Unicode codepoint and verifies it matches the detach key
- Extracts the modifier bitmask and checks that ctrl (bit 2) is set
- Ignores other modifier bits (numlock, capslock, shift, etc.)
- Handles the optional event type suffix (:1 press, :2 repeat, :3 release)
- Works with any detach key configured via -e
Closes#66
This should make it possible to connect with a 32bit client to a 64bit
server. This might also make it possible to forward the abduco socket
over SSH as described in #25. Different endianness are not supported at
this time.
This is a breaking protocol change. Make sure to use the same version
as client and server (anything else is unsupported anyway!).
This means it wont take control over the window size until
it is the last remaining one, unless another client connects
with the -l option set at a later time.
Instead of simply moving the cursor to the bottom of the screen
use the alternate screen buffer i.e. the smcup/rmcup capabilities.
This is currently hardcoded to the xterm originated \e[?1047{h,l}
sequence. I also patched dvtm to support these.