3 Commits

Author SHA1 Message Date
JiXieShi b1c499b340 fix: TUI CSI u key parsing and console escape sequence order
- TUI: Add parseCSIuBytes to handle CSI u sequences that bubbletea
  v1.3.6 returns as []byte (unknownCSISequenceMsg). Parses codepoint
  and modifier bits to reconstruct key string for hotkey routing.
- Console: Reorder escape parser checks. Check 2-byte non-CSI
  sequences first, then CSI terminator only after ESC[ introducer.
  Fixes CSI u sequences being truncated at '[' byte (0x5b).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 03:25:40 +08:00
JiXieShi 885f6a68cf fix: restore Ctrl+Alt+Key hotkeys and dedup normalizeHotkey
- Call enableVTInput after tea.NewProgram to restore VT input mode
  on Windows (bubbletea v1 conInputReader disables it, breaking
  Ctrl+Alt+Key combos)
- Move normalizeHotkey to internal/config.NormalizeHotkey, eliminate
  duplicate implementations in tui and console packages
- Remove unused Sess() getter from App

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 02:45:30 +08:00
JiXieShi d8fc9d7374 refactor: split termapp into proper internal packages
Replace monolithic internal/termapp with proper separation:
- internal/app: App struct, lifecycle, output loops
- internal/command: CommandHost interface, Dispatcher, handlers
- internal/tui: Model, hotkeys, panels, render (with panelError + border fixes)
- internal/console: RunConsole, escape parsing, entry point logic
- cmd/serialterminal: thin main() calling console.Run()

Eliminate global vars (cfg, sess, out) via dependency injection.
Break App->CommandDispatcher cycle via CommandHost interface.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 22:46:02 +08:00