mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-07 02:51:50 +00:00
fix(tui): call process.exit(0) after Ink exit to trigger terminal cleanup
Ink's exit() calls unmount() which resets terminal modes (kitty keyboard,
mouse, etc.) but does NOT call process.exit(). The Node process stays
alive because stdin is still open (Ink listens on it), so the
process.on('exit') handler in entry.tsx — which sends the final
resetTerminalModes() — never fires.
This left kitty keyboard protocol and other terminal modes enabled in the
parent shell after /quit, Ctrl+C, or Ctrl+D, breaking arrow keys and
other input in subsequent programs.
Add explicit process.exit(0) after exit() in die() so the process
actually terminates and the exit handler runs.
Fixes #19194
This commit is contained in:
parent
74c997d985
commit
9c93fc5775
1 changed files with 7 additions and 0 deletions
|
|
@ -358,6 +358,13 @@ export function useMainApp(gw: GatewayClient) {
|
|||
const die = useCallback(() => {
|
||||
gw.kill()
|
||||
exit()
|
||||
// Ink's exit() calls unmount() which resets terminal modes but does NOT
|
||||
// call process.exit(). Without an explicit exit the Node process stays
|
||||
// alive (stdin listener keeps the event loop open), so the process.on('exit')
|
||||
// handler in entry.tsx — which sends the final resetTerminalModes() — never
|
||||
// fires. This leaves kitty keyboard protocol, mouse modes, etc. enabled
|
||||
// in the parent shell. See issue #19194.
|
||||
process.exit(0)
|
||||
}, [exit, gw])
|
||||
|
||||
const session = useSessionLifecycle({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue