mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 20:01:24 +00:00
fix(tui): pause stdin before restoring raw mode to prevent SSH session close
Fixes #1185
This commit is contained in:
parent
111a31e4db
commit
f431f62609
2 changed files with 6 additions and 0 deletions
|
|
@ -178,6 +178,11 @@ export class ProcessTerminal implements Terminal {
|
|||
this.resizeHandler = undefined;
|
||||
}
|
||||
|
||||
// Pause stdin to prevent any buffered input (e.g., Ctrl+D) from being
|
||||
// re-interpreted after raw mode is disabled. This fixes a race condition
|
||||
// where Ctrl+D could close the parent shell over SSH.
|
||||
process.stdin.pause();
|
||||
|
||||
// Restore raw mode state
|
||||
if (process.stdin.setRawMode) {
|
||||
process.stdin.setRawMode(this.wasRaw);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue