@@ -265,6 +265,8 @@ func New(com *common.Common) *UI {
265 completions: comp,
265 completions: comp,
266 attachments: attachments,
266 attachments: attachments,
267 todoSpinner: todoSpinner,
267 todoSpinner: todoSpinner,
268+ lspStates: make(map[string]app.LSPClientInfo),
269+ mcpStates: make(map[string]mcp.ClientInfo),
270 status := NewStatus(com, ui)
272 status := NewStatus(com, ui)
@@ -1106,6 +1108,7 @@ func (m *UI) handleDialogMsg(msg tea.Msg) tea.Cmd {
1108 cmds = append(cmds, m.initializeProject())
1110 cmds = append(cmds, m.initializeProject())
1111+ m.dialog.CloseDialog(dialog.CommandsID)
1110 case dialog.ActionSelectModel:
1113 case dialog.ActionSelectModel:
1111 if m.isAgentBusy() {
1114 if m.isAgentBusy() {
@@ -1329,6 +1332,13 @@ func (m *UI) handleKeyPressMsg(msg tea.KeyPressMsg) tea.Cmd {
1330 return true
1333 return true
1335+ case key.Matches(msg, m.keyMap.Suspend):
1336+ if m.isAgentBusy() {
1337+ cmds = append(cmds, uiutil.ReportWarn("Agent is busy, please wait..."))
1340+ cmds = append(cmds, tea.Suspend)
1333 return false
1343 return false
@@ -1430,10 +1440,12 @@ func (m *UI) handleKeyPressMsg(msg tea.KeyPressMsg) tea.Cmd {
1431 m.newSession()
1441 m.newSession()
1432 case key.Matches(msg, m.keyMap.Tab):
1442 case key.Matches(msg, m.keyMap.Tab):
1443+ if m.state != uiLanding {
1433− m.focus = uiFocusMain
1444+ m.focus = uiFocusMain
1434− m.textarea.Blur()
1445+ m.textarea.Blur()
1435− m.chat.Focus()
1446+ m.chat.Focus()
1436− m.chat.SetSelected(m.chat.Len() - 1)
1447+ m.chat.SetSelected(m.chat.Len() - 1)
1437 case key.Matches(msg, m.keyMap.Editor.OpenEditor):
1449 case key.Matches(msg, m.keyMap.Editor.OpenEditor):
1438 if m.isAgentBusy() {
1450 if m.isAgentBusy() {
1439 cmds = append(cmds, uiutil.ReportWarn("Agent is working, please wait..."))
1451 cmds = append(cmds, uiutil.ReportWarn("Agent is working, please wait..."))
@@ -1506,6 +1518,16 @@ func (m *UI) handleKeyPressMsg(msg tea.KeyPressMsg) tea.Cmd {
1506 m.focus = uiFocusEditor
1518 m.focus = uiFocusEditor
1507 cmds = append(cmds, m.textarea.Focus())
1519 cmds = append(cmds, m.textarea.Focus())
1508 m.chat.Blur()
1520 m.chat.Blur()
1521+ case key.Matches(msg, m.keyMap.Chat.NewSession):
1522+ if !m.hasSession() {
1525+ if m.isAgentBusy() {
1526+ cmds = append(cmds, uiutil.ReportWarn("Agent is busy, please wait before starting a new session..."))
1529+ m.focus = uiFocusEditor
1509 case key.Matches(msg, m.keyMap.Chat.Expand):
1531 case key.Matches(msg, m.keyMap.Chat.Expand):
1510 m.chat.ToggleExpandedSelectedItem()
1532 m.chat.ToggleExpandedSelectedItem()
1511 case key.Matches(msg, m.keyMap.Chat.Up):
1533 case key.Matches(msg, m.keyMap.Chat.Up):