Previously all three panel handlers (forward/plugin/mode) returned
true for unrecognized keys, swallowing Ctrl+Alt+M/F/P/H combos.
Now return false so hotkeys can switch panels without closing.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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>
Extract processChunk and readLoopError helpers to eliminate ~30
lines of duplicated read-validate-notify logic across readLoop,
readLoopPacket, and readLoopSerial.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- 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>
- Remove duplicate labels from renderForm (textinput.Prompt already shows label)
- Pass modifier key combos through form handler to global hotkey handlers
- Update forward form footer for clarity
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Revert fillScreen to Left/Top (normal terminal behavior)
- Simplify startForwardForm to 2 fields: Type (Tab cycle) + Address
- Remove splitAddr/netSplit helpers
- Add huh form library dependency for future use
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Change fillScreen from lipgloss.Left to lipgloss.Center for horizontal
positioning so content is centered based on actual terminal dimensions.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace single-line prompt with form-based forward input:
- Separate Type/Host/Port fields
- Tab/Shift+Tab cycles focus, Tab on Type field cycles mode values
- Address auto-split into host+port for edit
- COM port excludes port field
- Form render with focused field indicator
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace loadDefaultDemoPlugin with loadPluginsFromDir that scans the
plugins/ directory for .lua files and loads them all. All plugins are
disabled by default; user enables them via .plugin enable or TUI panel.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- 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>
Extend Mode constants (3=TCPServer, 4=UDPServer, 5=COMPort) with
explicit values. Refactor Target to support multiple connection types
(listener+conns map, packetConn, serialPort). Add acceptLoop,
readLoopPacket, readLoopSerial. Mode-aware Broadcast dispatches to
all accepted conns (TCP-S), known remotes (UDP-S), or serial port.
Update flag help, command completions, and TUI panel hints.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Remove 'g' and 'shift+g' from viewport handler (conflicted with
text input; home/end keys already provide same functionality)
- Add rawValue field to modeItem to preserve EndStr control chars
during TUI panel editing (fixes %q round-trip corruption)
- Add validation for empty charset names and timefmt fields
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Rewrite README.md in Chinese and English with flag tables, command
reference, plugin API, and architecture diagram. Update CLAUDE.md
to reflect the new package layout and build commands.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Consolidate remaining package main files into internal/termapp for
clean separation: cmd/serialterminal/ is the sole entry point.
Update .goreleaser.yaml to build from ./cmd/serialterminal.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace complex ptrVal/Val/Flag type machinery with direct pflag
calls. Move flag logic and interactive wizard to internal/flag
package. Eliminate ~200 lines of flag boilerplate.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Move serial port, trzsz filter, and pipe lifecycle into
internal/session.SerialSession. Replace 8 global I/O vars
(serialPort, trzszFilter, stdinPipe, stdoutPipe, clientIn,
clientOut, termch, termchOnce) with single sess variable.
Delete utils.go.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Move Config struct to internal/config with exported fields. Replace
global var config with package-level cfg pointer. Add OpenLogFile to
config package. Add type alias Config = appconfig.Config in main
package for backward compatibility.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Move ForwardManager → pkg/forward/Manager and PluginManager →
pkg/luaplugin/Manager. Move FoeWardMode (now forward.Mode) with
ParseMode/Network/String into pkg/forward. Rename constants:
NOT→None, TCPC→TCP, UDPC→UDP. Update all references in main
package.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Extract ConvertChunk/FormatHexFrame into pkg/charset (zero external deps).
Extract UIEvent/UIEventKind/UIPanelKind types into internal/event.
Update all references across main package to use qualified imports.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Rename module from COM to github.com/jixishi/SerialTerminalForWindowsTerminal.
Create target directory tree: cmd/serialterminal/, internal/{app,command,config,
console,event,flag,session,tui}, pkg/{charset,forward,luaplugin}.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Remove unused global var `in`, func `strout`, func `echoConsoleInput`,
func `padRight`, func `ErrorP`, and func `ErrorF`. Inline error check
in CloseSerial. Add COM.exe and coverage.out to .gitignore.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>