fix(tui,coding-agent): handle tmux xterm extended keys and warn on tmux setup fixes #1872

This commit is contained in:
Mario Zechner
2026-03-07 23:01:08 +01:00
parent e3decbcdd6
commit 9a8bc61300
7 changed files with 214 additions and 61 deletions

View File

@@ -118,6 +118,42 @@ describe("matchesKey", () => {
});
});
describe("modifyOtherKeys matching", () => {
it("should match xterm modifyOtherKeys Ctrl+c", () => {
setKittyProtocolActive(false);
assert.strictEqual(matchesKey("\x1b[27;5;99~", "ctrl+c"), true);
assert.strictEqual(parseKey("\x1b[27;5;99~"), "ctrl+c");
});
it("should match xterm modifyOtherKeys Ctrl+d", () => {
setKittyProtocolActive(false);
assert.strictEqual(matchesKey("\x1b[27;5;100~", "ctrl+d"), true);
assert.strictEqual(parseKey("\x1b[27;5;100~"), "ctrl+d");
});
it("should match xterm modifyOtherKeys Ctrl+z", () => {
setKittyProtocolActive(false);
assert.strictEqual(matchesKey("\x1b[27;5;122~", "ctrl+z"), true);
assert.strictEqual(parseKey("\x1b[27;5;122~"), "ctrl+z");
});
it("should match xterm modifyOtherKeys Enter variants", () => {
setKittyProtocolActive(false);
assert.strictEqual(matchesKey("\x1b[27;5;13~", "ctrl+enter"), true);
assert.strictEqual(matchesKey("\x1b[27;2;13~", "shift+enter"), true);
assert.strictEqual(matchesKey("\x1b[27;3;13~", "alt+enter"), true);
assert.strictEqual(parseKey("\x1b[27;5;13~"), "ctrl+enter");
assert.strictEqual(parseKey("\x1b[27;2;13~"), "shift+enter");
assert.strictEqual(parseKey("\x1b[27;3;13~"), "alt+enter");
});
it("should match xterm modifyOtherKeys symbol combos", () => {
setKittyProtocolActive(false);
assert.strictEqual(matchesKey("\x1b[27;5;47~", "ctrl+/"), true);
assert.strictEqual(parseKey("\x1b[27;5;47~"), "ctrl+/");
});
});
describe("Legacy key matching", () => {
it("should match legacy Ctrl+c", () => {
setKittyProtocolActive(false);