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:
JiXieShi
2026-05-24 02:50:42 +08:00
parent b4b63ce1a4
commit 40709dadda
+1 -2
View File
@@ -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)