mirror of
https://github.com/jixishi/SerialTerminalForWindowsTerminal.git
synced 2026-06-16 00:52:44 +00:00
fix: TUI 'g' key input, EndStr panel editing, and mode validation
- 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>
This commit is contained in:
@@ -439,8 +439,14 @@ func (d *CommandDispatcher) handleModeCommand(args []string) error {
|
||||
|
||||
switch field {
|
||||
case "in":
|
||||
if value == "" {
|
||||
return fmt.Errorf("input charset must not be empty")
|
||||
}
|
||||
d.app.cfg.InputCode = value
|
||||
case "out":
|
||||
if value == "" {
|
||||
return fmt.Errorf("output charset must not be empty")
|
||||
}
|
||||
d.app.cfg.OutputCode = value
|
||||
case "end":
|
||||
d.app.cfg.EndStr = value
|
||||
@@ -457,6 +463,9 @@ func (d *CommandDispatcher) handleModeCommand(args []string) error {
|
||||
}
|
||||
d.app.cfg.TimesTamp = enabled
|
||||
case "timefmt":
|
||||
if value == "" && d.app.cfg.TimesTamp {
|
||||
return fmt.Errorf("timestamp format must not be empty")
|
||||
}
|
||||
d.app.cfg.TimesFmt = value
|
||||
default:
|
||||
return fmt.Errorf("unknown mode field: %s", field)
|
||||
|
||||
Reference in New Issue
Block a user