You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After PR #16069, on Windows, my agent is still proactively using tail to filter the compile result, even with newly created sessions.
It seems that the agent is at least somewhat aware of it's using PowerShell, not Bash, but still frequently forgets about it.
My hypotheses are:
The tool is still called bash, the prompt is also saying "Executes a given bash command..." (in bash.txt);
It sees command lines starting with $;
It sees previous tail usage when continuing from a previous session.
Adding an environment variable mentioned here works, but it's undocumented.
Please optimize the prompts for PowerShell, or just revert to use git bash by default.
If your issue is distinct from these (specifically about the bash tool description/prompt misleading the agent into using bash commands like tail on PowerShell), feel free to clarify and a maintainer will confirm.
If your issue is distinct from these (specifically about the bash tool description/prompt misleading the agent into using bash commands like tail on PowerShell), feel free to clarify and a maintainer will confirm.
I think this issue is distinct enough. It's about the prompt, not the shell itself.
As this issue is not fixed, here's a personal anecdote on a temporary fix.
From https://github.com/anomalyco/opencode/blob/v1.14.20/packages/opencode/src/shell/shell.ts, you can see how the shell is selected. You can set SHELL environment variable to other values, like bash, if you have it in your PATH, either from WSL or something else. Personally I don't use WSL, so I set it to use MSYS2's bash.
Activity
github-actions commentedon Apr 1, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is distinct from these (specifically about the bash tool description/prompt misleading the agent into using bash commands like
tailon PowerShell), feel free to clarify and a maintainer will confirm.ShibuyaCyana commentedon Apr 1, 2026
I think this issue is distinct enough. It's about the prompt, not the shell itself.
Hona commentedon Apr 2, 2026
Yeah - I am refactoring this to make agents better here
soltrac commentedon Apr 7, 2026
I'm having this problem, always try a tail and after that, it won't try again. If opencode knows it is on windows it should no try to tail
CCRcmcpe commentedon Apr 22, 2026
As this issue is not fixed, here's a personal anecdote on a temporary fix.
From https://github.com/anomalyco/opencode/blob/v1.14.20/packages/opencode/src/shell/shell.ts, you can see how the shell is selected. You can set
SHELLenvironment variable to other values, likebash, if you have it in yourPATH, either from WSL or something else. Personally I don't use WSL, so I set it to use MSYS2's bash.kouhe3 commentedon Jun 1, 2026
can we support multi shell in opencode.
bash -> bash
pwsh -> pwsh
powershell -> powershell
github-actions commentedon Aug 1, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.