mirror of
https://github.com/jixishi/SerialTerminalForWindowsTerminal.git
synced 2026-06-15 16:42:46 +00:00
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>
This commit is contained in:
@@ -65,8 +65,7 @@ func Run() {
|
|||||||
|
|
||||||
if cfg.EnableGUI {
|
if cfg.EnableGUI {
|
||||||
model := tui.New(appInst)
|
model := tui.New(appInst)
|
||||||
p := tea.NewProgram(model, tea.WithAltScreen(), tea.WithoutSignalHandler())
|
p := tea.NewProgram(model, tea.WithAltScreen(), tea.WithInputTTY(), tea.WithoutSignalHandler())
|
||||||
enableVTInput(int(os.Stdin.Fd())) // Restore VT input for Ctrl+Alt+Key hotkeys
|
|
||||||
if _, err = p.Run(); err != nil {
|
if _, err = p.Run(); err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "tui failed: %v\n", err)
|
fmt.Fprintf(os.Stderr, "tui failed: %v\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user