Skip to content

Commit 0075548

Browse files
authored
fix(terminal): support kitty keyboard protocol setting with "=" (#3942)
From https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement: > The escape code for requesting enhancements is: > CSI = flags ; mode u That means it can be *set* with CSI =, not just pushed/popped onto the stack with CSI < and CSI >. This is important because otherwise zellij would interpret this as restore_cursor_position, which would move the cursor. This would be hit by the next fish-shell release, which sends CSI = 5 u and CSI = 0 u to enable/disable the kitty keyboard enhancements unconditionally, so if you used any program that saved the cursor position it would constantly move your cursor back on every prompt. Fixes #3852
1 parent 9690783 commit 0075548

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

zellij-server/src/panes/grid.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2992,6 +2992,17 @@ impl Perform for Grid {
29922992
"\u{1b}[?0u"
29932993
};
29942994
self.pending_messages_to_pty.push(reply.as_bytes().to_vec());
2995+
} else if c == 'u' && intermediates == &[b'='] {
2996+
// kitty keyboard protocol without the stack, just setting.
2997+
// 0 disables, everything else enables.
2998+
let count = next_param_or(0);
2999+
if !self.explicitly_disable_kitty_keyboard_protocol {
3000+
if count > 0 {
3001+
self.supports_kitty_keyboard_protocol = true;
3002+
} else {
3003+
self.supports_kitty_keyboard_protocol = false;
3004+
}
3005+
}
29953006
} else if c == 'u' {
29963007
self.restore_cursor_position();
29973008
} else if c == '@' {

0 commit comments

Comments
 (0)