Shell commands are broken in message history and in `opencode run`
Description
Bug 1: Shell commands are broken in message history
- Send message
!date→ observe that!changes the input box into "Shell" mode, and thendateis input into the box and run as a shell command (correct) - Press
upto recall your last message →dateis recalled into the input box, but it isn't switched intoShellmode, 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!dateto the model instead of runningdateas 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
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 runand TUI exits hang on v0.15+ (related toopencode runcommand 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.
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
The other part is a bug tho
Thanks! Confirmed working in 1.0.159.