input: make keymap backwards compatible (#579)

Co-authored-by: Maas Lalani <maas@lalani.dev>
This commit is contained in:
Mikael Fangel 2024-05-25 18:53:42 +00:00 committed by GitHub
parent a8712df2a7
commit efb70a1302
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,6 +5,7 @@ import (
"os"
"github.com/charmbracelet/bubbles/key"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/huh"
"github.com/charmbracelet/lipgloss"
@ -29,7 +30,9 @@ func (o Options) Run() error {
theme.Focused.TextInput.Prompt = o.PromptStyle.ToLipgloss()
theme.Focused.Title = o.HeaderStyle.ToLipgloss()
// Keep input keymap backwards compatible
keymap := huh.NewDefaultKeyMap()
keymap.Quit = key.NewBinding(key.WithKeys("ctrl+c", "esc"))
var echoMode huh.EchoMode