From 40709daddad536c3f7e08d3e00d7a3668ef6498b Mon Sep 17 00:00:00 2001 From: JiXieShi Date: Sun, 24 May 2026 02:50:42 +0800 Subject: [PATCH] fix: use tea.WithInputTTY for proper VT key handling on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- internal/console/console.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/console/console.go b/internal/console/console.go index e122db1..47a8a8d 100644 --- a/internal/console/console.go +++ b/internal/console/console.go @@ -65,8 +65,7 @@ func Run() { if cfg.EnableGUI { model := tui.New(appInst) - p := tea.NewProgram(model, tea.WithAltScreen(), tea.WithoutSignalHandler()) - enableVTInput(int(os.Stdin.Fd())) // Restore VT input for Ctrl+Alt+Key hotkeys + p := tea.NewProgram(model, tea.WithAltScreen(), tea.WithInputTTY(), tea.WithoutSignalHandler()) if _, err = p.Run(); err != nil { fmt.Fprintf(os.Stderr, "tui failed: %v\n", err) os.Exit(1)