@@ -406,6 +406,16 @@ func (a *appModel) handleWindowResize(width, height int) tea.Cmd {
// handleKeyPressMsg processes keyboard input and routes to appropriate handlers.
func (a *appModel) handleKeyPressMsg(msg tea.KeyPressMsg) tea.Cmd {
+ // Check this first as the user should be able to quit no matter what.
+ if key.Matches(msg, a.keyMap.Quit) {
+ if a.dialog.ActiveDialogID() == quit.QuitDialogID {
+ return tea.Quit
+ }
+ return util.CmdHandler(dialogs.OpenDialogMsg{
+ Model: quit.NewQuitDialog(),
+ })
+ }
+
if a.completions.Open() {
// completions
keyMap := a.completions.KeyMap()
@@ -430,14 +440,6 @@ func (a *appModel) handleKeyPressMsg(msg tea.KeyPressMsg) tea.Cmd {
a.showingFullHelp = !a.showingFullHelp
return a.handleWindowResize(a.wWidth, a.wHeight)
// dialogs
- case key.Matches(msg, a.keyMap.Quit):- if a.dialog.ActiveDialogID() == quit.QuitDialogID {- return tea.Quit- }- return util.CmdHandler(dialogs.OpenDialogMsg{- Model: quit.NewQuitDialog(),- })-
case key.Matches(msg, a.keyMap.Commands):
// if the app is not configured show no commands
if !a.isConfigured {