fix(tui): skip Kitty query inside Zellij\n\nfixes #3163

This commit is contained in:
Mario Zechner
2026-04-15 18:43:14 +02:00
parent 9c1e6ef6d3
commit 3929e0c181
5 changed files with 98 additions and 0 deletions

View File

@@ -184,6 +184,17 @@ export class ProcessTerminal implements Terminal {
private queryAndEnableKittyProtocol(): void {
this.setupStdinBuffer();
process.stdin.on("data", this.stdinDataHandler!);
// Zellij forwards the Kitty query to the outer terminal, which can make
// Pi enable its Kitty parser even though Zellij still sends Alt as
// legacy ESC-prefixed sequences. Skip the Kitty query there and use
// modifyOtherKeys directly instead.
if (process.env.ZELLIJ) {
process.stdout.write("\x1b[>4;2m");
this._modifyOtherKeysActive = true;
return;
}
process.stdout.write("\x1b[?u");
setTimeout(() => {
if (!this._kittyProtocolActive && !this._modifyOtherKeysActive) {