mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 20:03:05 +00:00
fix(tui): drain Kitty key release events before exit to prevent SSH leak
Adds Terminal.prepareForExit() to disable Kitty protocol and wait for in-flight release events before fully stopping. This prevents escape sequences from leaking to the parent shell over slow SSH connections. Fixes #1204
This commit is contained in:
parent
c9a20a3aa4
commit
9a4d043b28
5 changed files with 43 additions and 1 deletions
|
|
@ -2552,6 +2552,10 @@ export class InteractiveMode {
|
|||
// requestRender() uses process.nextTick(), so we wait one tick
|
||||
await new Promise((resolve) => process.nextTick(resolve));
|
||||
|
||||
// Drain any in-flight Kitty key release events before stopping.
|
||||
// This prevents escape sequences from leaking to the parent shell over slow SSH.
|
||||
await this.ui.terminal.prepareForExit();
|
||||
|
||||
this.stop();
|
||||
process.exit(0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue