diff --git a/ui/model.go b/ui/model.go index 90aeb82..0a08aa7 100644 --- a/ui/model.go +++ b/ui/model.go @@ -240,9 +240,18 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { case "enter": cmdInput := m.input.Value() - if len(cmdInput) == 0 || string(cmdInput[0]) != "/" { + if len(cmdInput) == 0 { break } + + if string(cmdInput[0]) != "/" && m.menuState == 0 { + cmds = append(cmds, func() tea.Msg { + errMsg := "Woops, this is not a chat buffer. Only commands are allowed" + return cmdMsg{output: []string{errMsg}} + }) + break + } + cmds = append(cmds, func() tea.Msg { return handleCommand(cmdInput[1:], m.hiddenInput) })