mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 16:04:03 +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
|
|
@ -10,6 +10,7 @@
|
|||
### Fixed
|
||||
|
||||
- Fixed unnecessary full redraws when appending many lines after content had previously shrunk (viewport check now uses actual previous content size instead of stale maximum)
|
||||
- Fixed Ctrl+D exit closing the parent SSH session due to stdin buffer race condition ([#1185](https://github.com/badlogic/pi-mono/issues/1185))
|
||||
|
||||
## [0.51.0] - 2026-02-01
|
||||
|
||||
|
|
|
|||
|
|
@ -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