summaryrefslogtreecommitdiff
path: root/src/tui_components.zig
diff options
context:
space:
mode:
authort <t@tjp.lol>2026-06-08 12:24:09 -0600
committert <t@tjp.lol>2026-06-08 12:25:55 -0600
commitb5eb3f1776a540a55d5675f786a4421c49a6283d (patch)
treea6ba0a59d7dc736f833b69280b089563ee93ca64 /src/tui_components.zig
parente5ed00c52bb10aec811734c5568c881c41e58474 (diff)
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.
Diffstat (limited to 'src/tui_components.zig')
-rw-r--r--src/tui_components.zig9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/tui_components.zig b/src/tui_components.zig
index 1832fc2..3dfe817 100644
--- a/src/tui_components.zig
+++ b/src/tui_components.zig
@@ -527,6 +527,9 @@ pub const InputBox = struct {
switch (step.decoded) {
.key => |k| self.applyKey(k) catch return,
.paste => |p| self.insertText(p) catch return,
+ // Negotiation replies are consumed by the app before input is
+ // routed here; ignore defensively if one slips through.
+ .negotiation => {},
}
}
}
@@ -749,14 +752,14 @@ pub const Footer = struct {
var fps_buf: [48]u8 = undefined;
const fps = self.fpsText(&fps_buf);
- // Build the PLAIN content: "<fps> <model>" (model only if set).
+ // Build the PLAIN content: "<model> <fps>" (model only if set).
var plain: std.ArrayList(u8) = .empty;
defer plain.deinit(a);
- try plain.appendSlice(a, fps);
if (self.model.items.len != 0) {
- try plain.appendSlice(a, " ");
try plain.appendSlice(a, self.model.items);
+ try plain.appendSlice(a, " ");
}
+ try plain.appendSlice(a, fps);
const vis = truncateToCols(plain.items, width);