5 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 40709dadda fix: use tea.WithInputTTY for proper VT key handling on Windows
tea.WithInputTTY forces bubbletea to use raw ANSI/VT input on Windows
instead of the conInputReader, which correctly parses Ctrl+Alt+Key
combos as VT sequences (e.g. \x1b[102;6u → ctrl+alt+f).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 02:50:50 +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 209ecac2d5 feat: enhance plugin system with Go helpers and add Modbus plugin
- Register Go helper functions (modbus.crc16, hex.encode/decode,
  util.bytes) into Lua states for Modbus RTU support
- Add plugins/modbus.lua with .modbus read/write commands
- Fix Reload race condition (hold lock across Unload+Load)
- Make App.Close nil-safe for sess
- Restore internal/console/console_test.go

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 00:01:22 +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