Shell commands are broken in message history and in opencode run #3510

Closed
opened 2026-02-16 17:40:25 -05:00 by yindo · 4 comments
Owner

Originally created by @jdanbrown on GitHub (Dec 12, 2025).

Originally assigned to: @thdxr on GitHub.

Description

Bug 1: Shell commands are broken in message history

  • Send message !date → observe that ! changes the input box into "Shell" mode, and then date is input into the box and run as a shell command (correct)
  • Press up to recall your last message → date is recalled into the input box, but it isn't switched into Shell mode, so when you send it it's incorrectly sent as a message to the model instead of as a command to the shell

Bug 2: Shell commands are broken in opencode run

  • opencode run '!date' → sends the string !date to the model instead of running date as a shell command

Is the fancy switch into Shell mode actually worthwhile, or would it be better overall to remove that and just interpret messages that start with ! as shell commands? That would be one way to fix both of these issues by doing less, as well as any potential other issues that might be lurking.

OpenCode version

1.0.150

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

macOS 15.5

Terminal

VS Code terminal

Originally created by @jdanbrown on GitHub (Dec 12, 2025). Originally assigned to: @thdxr on GitHub. ### Description Bug 1: Shell commands are broken in message history - Send message `!date` → observe that `!` changes the input box into "Shell" mode, and then `date` is input into the box and run as a shell command (correct) - Press `up` to recall your last message → `date` is recalled into the input box, but it isn't switched into `Shell` mode, so when you send it it's incorrectly sent as a message to the model instead of as a command to the shell Bug 2: Shell commands are broken in `opencode run` - `opencode run '!date'` → sends the string `!date` to the model instead of running `date` as a shell command Is the fancy switch into `Shell` mode actually worthwhile, or would it be better overall to remove that and just interpret messages that start with `!` as shell commands? That would be one way to fix both of these issues by doing less, as well as any potential other issues that might be lurking. ### OpenCode version 1.0.150 ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System macOS 15.5 ### Terminal VS Code terminal
yindo added the bug label 2026-02-16 17:40:25 -05:00
yindo closed this issue 2026-02-16 17:40:25 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 12, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #2006: Shell commands are not stored in message history (directly addresses the message history recall problem)
  • #5310: Shell mode (! command) doesn't work on Windows (related shell command execution issues)
  • #4671: shell mode (!) is broken on Windows Powershell (Windows-specific shell execution)
  • #3213: opencode run and TUI exits hang on v0.15+ (related to opencode run command issues)
  • #4968: Shell sessions losing $PATH value from parent shell (environment inheritance for shell commands)
  • #2202: PATH is not inherited from invoking shell (similar environment inheritance issue)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Dec 12, 2025): This issue might be a duplicate of existing issues. Please check: - #2006: Shell commands are not stored in message history (directly addresses the message history recall problem) - #5310: Shell mode (! command) doesn't work on Windows (related shell command execution issues) - #4671: shell mode (`!`) is broken on Windows Powershell (Windows-specific shell execution) - #3213: `opencode run` and TUI exits hang on v0.15+ (related to `opencode run` command issues) - #4968: Shell sessions losing $PATH value from parent shell (environment inheritance for shell commands) - #2202: PATH is not inherited from invoking shell (similar environment inheritance issue) Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Dec 12, 2025):

Yeah run doesn't support shell mode, not sure how that'd work either since it just loads things into context, it doesn't trigger inference

@rekram1-node commented on GitHub (Dec 12, 2025): Yeah run doesn't support shell mode, not sure how that'd work either since it just loads things into context, it doesn't trigger inference
Author
Owner

@rekram1-node commented on GitHub (Dec 12, 2025):

The other part is a bug tho

@rekram1-node commented on GitHub (Dec 12, 2025): The other part is a bug tho
Author
Owner

@jdanbrown commented on GitHub (Dec 15, 2025):

Thanks! Confirmed working in 1.0.159.

@jdanbrown commented on GitHub (Dec 15, 2025): Thanks! Confirmed working in 1.0.159.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3510