mirror of
https://github.com/jixishi/SerialTerminalForWindowsTerminal.git
synced 2026-08-02 18:22:18 +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 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
319ed108d8
commit
b1c499b340
@@ -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