Skip to content

Commit 6582b27

Browse files
committed
feat: block input completely when Docker not running (like herm)
1 parent 73b5f6d commit 6582b27

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

cmd/chat.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,9 @@ func (m chatModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
529529
return m, nil
530530
}
531531
case tea.KeyEnter:
532+
if m.containerEnabled && m.containerErr != nil {
533+
return m, nil
534+
}
532535
text := strings.TrimSpace(m.input.Value())
533536
if text == "" {
534537
return m, nil
@@ -709,7 +712,8 @@ func (m chatModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
709712
m.containerSandbox = msg.sandbox
710713
}
711714
if msg.err != nil {
712-
m.messages = append(m.messages, displayMsg{role: "system", content: "Container: " + msg.err.Error()})
715+
m.messages = append(m.messages, displayMsg{role: "system", content: msg.err.Error()})
716+
m.input.Blur()
713717
}
714718
m.viewDirty = true
715719
m.updateViewportContent()

0 commit comments

Comments
 (0)