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
Note: install(1) is not really specified and the -D option does not
seem to be portable. For example the FreeBSD manual page documents a
different behavior.
We therefore use a somewhat ugly two step process with an installdirs
target.
Even when no session name was provided the passthrough flag was still
implicitly enabled in case stdin was not a terminal. This behavior
prevented the session list from being printed i.e.
abduco < /dev/null
would not work as expected. Only enable implicit passthrough if stdin
is not a terminal *and* a session name is given.
Fix#34
The supervised command can use it to determine in which session it
is running. It is not necessarily identical to the file name of the
underlying socket as stored in the file system.
This allows commands to be send interactively (i.e. when stdin refers
to a terminal). Also imply attach action if none is given, hence:
$ abduco -p session
cowsay hi
^D
can also be used to send input to a session.
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!).