- Add proper cleanup of all intervals and FIFO streams on exit
- Detect exit events directly from asciinema stream for faster response
- Reduce session monitoring polling from 1000ms to 500ms
- Remove redundant createControlPipeForExternalSession function
- fwd.ts now creates its own control pipe, PtyManager no longer needs to create them
This should eliminate the hanging issue when exiting processes wrapped with fwd.ts.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Replace blocking spawnSync calls with direct stdin pipe writes
- Change from 100ms polling to fs.watchFile for immediate file notifications
- Use appendFileSync instead of writeFileSync for better performance
- Add platform-specific key mapping for tty-fwd input path
- Reduce polling interval from 100ms to 50ms for watchFile
This eliminates the 5-second timeout blocking and improves input responsiveness from 1-2 seconds to near-instantaneous.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Change enter key from \n (line feed) to \r (carriage return) on Windows
- Maintains \n for Unix/macOS compatibility
- Fixes enter key behavior in Windows terminals
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add proper type guards for control message fields (cols, rows, signal)
- Handle string | Buffer types for stream data events correctly
- Fix null assignment issue in control pipe creation
- Add type conversion for chunk data in FIFO streams
All TypeScript errors resolved.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Create control as FIFO instead of regular file using mkfifo
- Use same read+write streaming approach as stdin FIFO
- Rename 'control-pipe' to 'control' for consistency
- Replace polling mechanism with continuous FIFO streaming
- Update session type to use 'control' field name
- Fix PtyManager to reference correct control field
This should fix the issue where resize only worked once due to
control pipe closing after first write.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Change enter key from '\r' to '\n' for correct shell behavior
- Swap enter and ctrl_enter mappings to match terminal expectations
- Most shells expect newline (\n) to execute commands, not carriage return (\r)
This fixes the issue where commands typed in frontend would hang
after pressing enter instead of executing properly.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add automatic control pipe creation for existing external sessions
- Update session.json retroactively when control pipe is created
- Implement SIGWINCH fallback when control pipe is not available
- Support resize operations for legacy external sessions
This enables resize functionality for sessions created before
the control pipe feature was implemented.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add control-pipe field to session types for external command communication
- Create ResizeControlMessage and KillControlMessage interfaces
- Update PtyManager to send control messages via pipe for external sessions
- Enhance fwd.ts to create and monitor control pipe for resize/kill commands
- Support real-time resize operations for external sessions via IPC
- Add proper cleanup of control pipes on session exit
This enables full PTY control (resize, kill) for sessions created by
external tools like fwd.ts through a file-based IPC mechanism.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Modify sendInput to write to stdin pipe for external sessions
- Update resizeSession to handle external sessions gracefully
- Fix killSession to work with sessions created by fwd.ts
- Check filesystem for session info when not in memory map
- Support both in-memory and disk-only session management
This fixes frontend operations failing with "Session not found"
when interacting with sessions created by external tools.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add ProcessUtils class with Windows/Unix process detection methods
- Replace raw process.kill(pid, 0) calls with ProcessUtils.isProcessRunning()
- Support Windows tasklist and Unix kill signal 0 approaches
- Add process killing and waiting utilities for better process management
- Update SessionManager, PtyManager, and PtyService to use ProcessUtils
- Improves reliability of cmd.exe session detection on Windows
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Replace @lydell/node-pty with @homebridge/node-pty-prebuilt-multiarch
- Update imports in PtyManager.ts
- Simplify auto-detection logic in PtyService.ts by removing explicit require check
- Improves reliability and cross-platform compatibility with prebuilt binaries
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
## Major Features Implemented
### 🔄 Enhanced Process Termination
- Async kill operations with proper SIGTERM → SIGKILL escalation
- 3-second timeout with 500ms check intervals for graceful termination
- Process status monitoring using signal 0 checks
- Comprehensive logging of termination process
### 📊 Process State Detection
- Waiting state detection using `ps -p <pid> -o stat=` like tty-fwd
- Unix process state analysis (R=running, S/D/T=waiting, Z=zombie)
- Real-time status updates during session listing
- Automatic zombie process cleanup
### 🖥️ Improved UI Event Handling
- `session-killed` event dispatched AFTER successful termination
- Immediate UI feedback with session card removal
- `session-kill-error` event for failed operations
- Proper error handling and user notification
### 🔧 Node-pty Migration
- Switched from `node-pty` to `@lydell/node-pty` with prebuilt binaries
- Express downgraded from v5 to v4 for better compatibility
- Added `signal-exit` dependency for cleanup handlers
- Enhanced fallback mechanisms for both implementations
### 📡 API Enhancements
- Kill endpoint now waits for actual process termination
- New `/api/pty/status` endpoint for implementation monitoring
- Enhanced session metadata with waiting state
- Improved error responses with detailed messages
### 🎯 Key Technical Improvements
- Type-safe async operations throughout PTY stack
- Proper cleanup on process exit with signal handlers
- Compatible session file structure with tty-fwd
- Enhanced asciinema recording with UTF-8 handling
All changes maintain full backward compatibility while providing
significant improvements in reliability and user experience.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Removed lint_output.txt from git tracking
- Added lint_output.txt to .gitignore to prevent future commits
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove automatic session snapshot loading on exit in session-view
- Update cast-converter to properly parse exit events in new format
- Handle exit events when timestamp field is "exit" string
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>