Complete terminal rewrite for full TUI compatibility

- Alternate screen buffer (smcup/rmcup) for mc, vim, htop, less
- 256-color and truecolor rendering (dynamic tag creation)
- Reverse video and strikethrough attributes
- write_process_input bridge (DA/DSR responses to SSH)
- DECCKM application cursor keys for arrow navigation
- Alt+key combinations (mc panels, readline word nav)
- Shift+Arrow / Ctrl+Arrow with xterm modifier encoding
- Shift+Tab (backtab) for reverse completion
- Bracketed paste mode for clean multi-line paste
- Mouse tracking (basic, button, any-event, SGR extended)
- Incremental UTF-8 decoder (handles split multi-byte)
- Cursor hidden state (DECTCEM) respected
- pyte dirty set for optimized rendering
- Numpad key support
- Professional copy/paste UX:
  - Ctrl+C always sends SIGINT
  - Ctrl+Shift+C/V for copy/paste
  - Right-click context menu with Copy/Paste/Select All
  - Double-click to select word
- Smooth mousewheel scroll (3 lines in alt screen)
- Thread-safe session management (all state on main thread)
- Resize debounce reduced to 100ms
- Send errors trigger disconnect notification

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
chrome-storm-c442
2026-02-23 14:57:55 -05:00
parent 38d2387cd5
commit 59163f0469
3 changed files with 505 additions and 210 deletions

View File

@@ -136,7 +136,9 @@ class ShellSession:
try:
self._channel.sendall(data)
except OSError:
pass
self._running = False
if self.on_disconnect:
self.on_disconnect()
def resize(self, cols: int, rows: int):
self.cols = cols