summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAiden Cline <[email protected]>2025-09-11 13:03:12 -0500
committerGitHub <[email protected]>2025-09-11 13:03:12 -0500
commit4614e4983ec667c3ab188516793c458fc9ee246b (patch)
treea350e59fdccc8ab61e8af86435b9d94ad946f846
parent84f0c63fa15061d7f9c29a32f20a0f60b6debead (diff)
downloadopencode-4614e4983ec667c3ab188516793c458fc9ee246b.tar.gz
opencode-4614e4983ec667c3ab188516793c458fc9ee246b.zip
fix: command being passed as arg when no args present (#2553)
-rw-r--r--packages/tui/internal/components/chat/editor.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/tui/internal/components/chat/editor.go b/packages/tui/internal/components/chat/editor.go
index dd24dcf15..31de346f5 100644
--- a/packages/tui/internal/components/chat/editor.go
+++ b/packages/tui/internal/components/chat/editor.go
@@ -507,7 +507,10 @@ func (m *editorComponent) Submit() (tea.Model, tea.Cmd) {
commandName := strings.Split(expandedValue, " ")[0]
command := m.app.Commands[commands.CommandName(commandName)]
if command.Custom {
- args := strings.TrimPrefix(expandedValue, command.PrimaryTrigger()+" ")
+ args := ""
+ if strings.HasPrefix(expandedValue, command.PrimaryTrigger()+" ") {
+ args = strings.TrimPrefix(expandedValue, command.PrimaryTrigger()+" ")
+ }
cmds = append(
cmds,
util.CmdHandler(app.SendCommand{Command: string(command.Name), Args: args}),