@@ -315,7 +315,6 @@ func (a *appModel) handleKeyPressMsg(msg tea.KeyPressMsg) tea.Cmd {
315 // dialogs
315 // dialogs
316 case key.Matches(msg, a.keyMap.Quit):
316 case key.Matches(msg, a.keyMap.Quit):
317 if a.dialog.ActiveDialogID() == quit.QuitDialogID {
317 if a.dialog.ActiveDialogID() == quit.QuitDialogID {
318− // if the quit dialog is already open, close the app
319 return tea.Quit
318 return tea.Quit
321 return util.CmdHandler(dialogs.OpenDialogMsg{
320 return util.CmdHandler(dialogs.OpenDialogMsg{
@@ -324,20 +323,21 @@ func (a *appModel) handleKeyPressMsg(msg tea.KeyPressMsg) tea.Cmd {
325 case key.Matches(msg, a.keyMap.Commands):
324 case key.Matches(msg, a.keyMap.Commands):
326 if a.dialog.ActiveDialogID() == commands.CommandsDialogID {
325 if a.dialog.ActiveDialogID() == commands.CommandsDialogID {
327− // If the commands dialog is already open, close it
328 return util.CmdHandler(dialogs.CloseDialogMsg{})
326 return util.CmdHandler(dialogs.CloseDialogMsg{})
330 if a.dialog.HasDialogs() {
328 if a.dialog.HasDialogs() {
331− return nil // Don't open commands dialog if another dialog is active
329+ return nil
333 return util.CmdHandler(dialogs.OpenDialogMsg{
331 return util.CmdHandler(dialogs.OpenDialogMsg{
334 Model: commands.NewCommandDialog(a.selectedSessionID),
332 Model: commands.NewCommandDialog(a.selectedSessionID),
336 case key.Matches(msg, a.keyMap.Sessions):
334 case key.Matches(msg, a.keyMap.Sessions):
337 if a.dialog.ActiveDialogID() == sessions.SessionsDialogID {
335 if a.dialog.ActiveDialogID() == sessions.SessionsDialogID {
338− // If the sessions dialog is already open, close it
339 return util.CmdHandler(dialogs.CloseDialogMsg{})
336 return util.CmdHandler(dialogs.CloseDialogMsg{})
338+ if a.dialog.HasDialogs() && a.dialog.ActiveDialogID() != commands.CommandsDialogID {
341 var cmds []tea.Cmd
341 var cmds []tea.Cmd
342 if a.dialog.ActiveDialogID() == commands.CommandsDialogID {
342 if a.dialog.ActiveDialogID() == commands.CommandsDialogID {
343 // If the commands dialog is open, close it first
343 // If the commands dialog is open, close it first