mirror of
https://github.com/jixishi/SerialTerminalForWindowsTerminal.git
synced 2026-06-16 00:52:44 +00:00
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>
This commit is contained in:
@@ -189,13 +189,15 @@ func RunConsole(appInst *apppkg.App) error {
|
||||
break
|
||||
}
|
||||
escBuf = append(escBuf, nb)
|
||||
if nb >= 0x40 && nb <= 0x7e {
|
||||
// 2-byte non-CSI: ESC + letter (not [)
|
||||
if len(escBuf) == 2 && escBuf[1] != '[' {
|
||||
if flushESC(escBuf) {
|
||||
return nil
|
||||
}
|
||||
break
|
||||
}
|
||||
if len(escBuf) == 2 && escBuf[1] != '[' {
|
||||
// CSI terminator: final byte of ESC [ ... <char> sequence
|
||||
if len(escBuf) > 2 && escBuf[1] == '[' && nb >= 0x40 && nb <= 0x7e {
|
||||
if flushESC(escBuf) {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user