You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Terminal input stuck after exit (raw mode not restored) #423
After exiting happy-cli (via Ctrl+C or normal exit), the terminal input becomes stuck at whitespace. Users need to run stty sane or reset to restore normal terminal behavior.
Root Cause
The terminal raw mode is enabled in src/claude/claudeRemoteLauncher.ts:64:
process.stdin.setRawMode(true);
The cleanup code that restores terminal state is in a finally block at line 446-448:
However, when SIGINT/SIGTERM is caught, the cleanup() function in src/claude/runClaude.ts:406 calls process.exit(0) directly:
constcleanup=async()=>{// ... cleanup code that does NOT restore terminal stateprocess.exit(0);// Immediately terminates, skipping finally blocks};process.on('SIGINT',cleanup);
process.exit() terminates the process immediately, bypassing the finally block in claudeRemoteLauncher.ts. The terminal is left in raw mode.
Steps to Reproduce
Run happy
Wait for remote mode to start (raw mode enabled)
Press Ctrl+C to exit
Try typing in terminal - input appears stuck/doesn't echo
Proposed Fix
Add terminal state restoration to the cleanup function in src/claude/runClaude.ts before calling process.exit():
constcleanup=async()=>{try{// ... existing cleanup code ...// Restore terminal state before exitif(process.stdin.isTTY){process.stdin.setRawMode(false);}logger.debug('[START] Cleanup complete, exiting');process.exit(0);}catch(error){// Also restore terminal in error pathif(process.stdin.isTTY){process.stdin.setRawMode(false);}logger.debug('[START] Error during cleanup:',error);process.exit(1);}};
Activity
Fix: Resolve orphaned processes and keyboard input issues (slopus#422, …
Fix: Resolve orphaned processes and keyboard input issues (slopus#422, …
NvL-WEAP commentedon Jan 29, 2026
Love happy code, but this is killing the workflow. Would love to see this fixed!
fix: restore terminal state after remote→local mode switch
fix: restore terminal state after remote→local mode switch
fix: restore terminal state after remote→local mode switch
fix: restore terminal state after remote→local mode switch
fix: restore terminal state after remote→local mode switch