Commit graph

3 commits

Author SHA1 Message Date
c0cb22a85f Add SSH read timeout and PTY handling improvements
Fixes thread accumulation and blocking issues:

1. SSH read timeouts
   - Use ssh_channel_read_timeout() with 30s timeout
   - Handle SSH_AGAIN, SSH_ERROR return codes properly
   - 60s timeout for username input
   - Prevents threads blocking forever on dead connections

2. Improved PTY request handling
   - Exit loop after PTY + SHELL received
   - Don't loop on WINDOW_CHANGE during init
   - Clear termination conditions

3. Better UTF-8 validation
   - Check multi-byte read completeness
   - Skip incomplete sequences gracefully

Prevents "zombie threads" and eliminates need to restart
after extended operation.
2025-12-01 14:00:00 +08:00
a4d67be103 Replace telnet with SSH and fix full-screen display
- Implement SSH server using libssh for secure connections
- Replace insecure telnet with encrypted SSH protocol
- Add automatic terminal size detection via PTY requests
- Support dynamic window resize (SIGWINCH handling)
- Fix UI display bug by using SSH channel instead of fd
- Update tui_clear_screen to work with SSH connections
- Add RSA host key auto-generation on first run
- Update README with SSH instructions and security notes
- Add libssh dependency to Makefile with auto-detection
- Remove all telnet-related code

Security improvements:
- All traffic now encrypted
- Host key authentication
- No more plaintext transmission
2025-11-24 16:48:14 +08:00
63274b92ba Initial commit 2025-07-01 09:00:00 +08:00