From b5eb3f1776a540a55d5675f786a4421c49a6283d Mon Sep 17 00:00:00 2001 From: t Date: Mon, 8 Jun 2026 12:24:09 -0600 Subject: proper terminal capability negotiation determine support for the kitty protocol and then pick output sequences accordingly. tested on ghostty (supports kitty) and tmux-in-ghostty (tmux does not support kitty protocol) with shift+enter as newline. --- src/tui_terminal.zig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/tui_terminal.zig') diff --git a/src/tui_terminal.zig b/src/tui_terminal.zig index c4545e9..0f8b3d9 100644 --- a/src/tui_terminal.zig +++ b/src/tui_terminal.zig @@ -116,7 +116,13 @@ fn winchHandler(sig: posix.SIG) callconv(.c) void { pub const Capabilities = struct { /// Terminal is believed to support synchronized output (mode 2026). synchronized_output: bool, - /// Terminal is believed to support the Kitty keyboard protocol. + /// Whether the Kitty keyboard protocol is in effect. Initially an env-sniffed + /// best guess (see `detectCapabilities`); the app then runs a startup + /// query/response handshake (`negotiate_query`) and overwrites this with the + /// confirmed result — true if the terminal acknowledged Kitty flags, false + /// if it fell back to modifyOtherKeys. Decode logic that depends on the live + /// protocol reads the module-global `tui_input.kittyActive()`, which the app + /// keeps in sync. kitty_keyboard: bool, }; -- cgit v1.3