summaryrefslogtreecommitdiffhomepage
path: root/internal/tui/page
diff options
context:
space:
mode:
Diffstat (limited to 'internal/tui/page')
-rw-r--r--internal/tui/page/chat.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/tui/page/chat.go b/internal/tui/page/chat.go
index 378575f4d..14c514278 100644
--- a/internal/tui/page/chat.go
+++ b/internal/tui/page/chat.go
@@ -11,6 +11,7 @@ import (
"github.com/opencode-ai/opencode/internal/session"
"github.com/opencode-ai/opencode/internal/status"
"github.com/opencode-ai/opencode/internal/tui/components/chat"
+ "github.com/opencode-ai/opencode/internal/tui/components/dialog"
"github.com/opencode-ai/opencode/internal/tui/layout"
"github.com/opencode-ai/opencode/internal/tui/util"
)
@@ -64,6 +65,16 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
if cmd != nil {
return p, cmd
}
+ case dialog.CommandRunCustomMsg:
+ // Check if the agent is busy before executing custom commands
+ if p.app.CoderAgent.IsBusy() {
+ return p, util.ReportWarn("Agent is busy, please wait before executing a command...")
+ }
+ // Handle custom command execution
+ cmd := p.sendMessage(msg.Content)
+ if cmd != nil {
+ return p, cmd
+ }
case chat.SessionSelectedMsg:
if p.session.ID == "" {
cmd := p.setSidebar()