diff options
Diffstat (limited to 'internal/tui/page')
| -rw-r--r-- | internal/tui/page/chat.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/internal/tui/page/chat.go b/internal/tui/page/chat.go index ece36b59a..1b31c838c 100644 --- a/internal/tui/page/chat.go +++ b/internal/tui/page/chat.go @@ -3,6 +3,7 @@ package page import ( "context" "fmt" + "strings" "github.com/charmbracelet/bubbles/key" tea "github.com/charmbracelet/bubbletea" @@ -81,8 +82,19 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) { status.Warn("Agent is busy, please wait before executing a command...") return p, nil } + + // Process the command content with arguments if any + content := msg.Content + if msg.Args != nil { + // Replace all named arguments with their values + for name, value := range msg.Args { + placeholder := "$" + name + content = strings.ReplaceAll(content, placeholder, value) + } + } + // Handle custom command execution - cmd := p.sendMessage(msg.Content, nil) + cmd := p.sendMessage(content, nil) if cmd != nil { return p, cmd } |
