Symptom
Run a raw-mode terminal UI inside a Kolu (split) terminal and quit it, and the terminal is left frozen — the shell prompt returns but no keystrokes are echoed or processed (the PTY is stuck in raw mode). You have to recreate the terminal.
Discovered while testing mini-ci, a small TUI (#1073): just run → press q to quit → terminal frozen, can't type anymore.
Minimal repro (independent of mini-ci)
A ~6-line Node program that sets raw mode and exits:
// freeze.mjs
process.stdin.setRawMode(true);
process.stdin.resume();
process.stdin.on('data', (b) => {
if (b.toString() === 'q') { process.stdin.setRawMode(false); process.exit(0); }
});
console.log('raw mode on — press q to quit');
- Open a Kolu terminal,
node freeze.mjs.
- Press
q.
- Observed: the shell returns but is frozen — typed characters don't appear, Enter does nothing. (
stty sane typed blind + Enter usually recovers it, which confirms a leftover termios state.)
- Expected: the terminal returns to cooked mode after the program exits — as it does in a standard emulator (xterm/alacritty/iTerm), where the shell restores its own termios when it regains the foreground.
Where to look / bisection
- First confirm whether it reproduces only in a Kolu terminal vs a standard emulator with the same snippet. If Kolu-specific, the suspect is the pty-host's handling of a foreground child that exits in raw mode — a real terminal's shell self-heals via
tcsetattr on regaining the foreground; something in the Kolu PTY path may not be letting that happen.
- Relevant:
packages/pty-host/ (PTY ownership) and the xterm.js client's input handling after a child exit.
- App-side angle to rule out: calling
process.exit() immediately after setRawMode(false) can in some runtimes race the tcsetattr reset — but a frozen shell (not just the TUI) points at the terminal layer, since the shell should self-heal regardless.
Notes
Symptom
Run a raw-mode terminal UI inside a Kolu (split) terminal and quit it, and the terminal is left frozen — the shell prompt returns but no keystrokes are echoed or processed (the PTY is stuck in raw mode). You have to recreate the terminal.
Discovered while testing
mini-ci, a small TUI (#1073):just run→ pressqto quit → terminal frozen, can't type anymore.Minimal repro (independent of mini-ci)
A ~6-line Node program that sets raw mode and exits:
node freeze.mjs.q.stty sanetyped blind + Enter usually recovers it, which confirms a leftover termios state.)Where to look / bisection
tcsetattron regaining the foreground; something in the Kolu PTY path may not be letting that happen.packages/pty-host/(PTY ownership) and the xterm.js client's input handling after a child exit.process.exit()immediately aftersetRawMode(false)can in some runtimes race thetcsetattrreset — but a frozen shell (not just the TUI) points at the terminal layer, since the shell should self-heal regardless.Notes