Skip to content

feat: in the shell tool, enable fish/nu shells and extend dynamic shell naming to all POSIX shells#278

Open
ariane-emory wants to merge 157 commits into
devfrom
feat/shell-tool-unblacklist-fish-and-extend-dynamic-naming
Open

feat: in the shell tool, enable fish/nu shells and extend dynamic shell naming to all POSIX shells#278
ariane-emory wants to merge 157 commits into
devfrom
feat/shell-tool-unblacklist-fish-and-extend-dynamic-naming

Conversation

@ariane-emory
Copy link
Copy Markdown
Owner

What does this PR do?

Resolves anomalyco#4866

Dev recently refactored the Bash tool into a generic Shell tool with shell-aware prompts for PowerShell and cmd. However, two gaps remain:

  1. Fish and nu shells are blacklisted — dev still rejects these shells even though they work fine with the existing -c command flag.
  2. Non-PowerShell shells still get hardcoded "bash" language — dev dynamically names PowerShell and cmd in the tool description, but falls back to "bash command" / "bash commands" / "git bash commands" for all other shells.

This PR fixes both issues:

  • Removes the shell blacklist, allowing fish and nu to be selected and used
  • Extends dynamic shell naming (${name}) to the default POSIX shell profile, so fish users see "fish command", zsh users see "zsh command", etc.
  • Adds tests verifying shell detection, dynamic description language, and acceptance of fish/nu shells

Benefits

  • Fish and nu users can now use their preferred shell without opencode falling back to bash
  • The model is told the actual shell name (e.g., "fish", "zsh", "nu") instead of always seeing "bash", reducing the "shell rediscovery loop" where the model tries bash syntax on a non-bash shell
  • Fewer failed shell tool calls and wasted context on error messages

ariane-emory and others added 30 commits November 28, 2025 17:58
Remove the fish/nu blacklist so commands execute in the user's actual
shell. Previously, fish and nu were blacklisted and commands would fall
back to zsh/bash, causing the tool description to incorrectly report
the shell being used.

Changes:
- Remove fish/nu blacklist from bash.ts shell detection
- Remove unused BLACKLIST constant and Shell.acceptable() from shell.ts
- Add fish shell test case to bash.test.ts

Resolves anomalyco#4866
ariane-emory and others added 30 commits February 26, 2026 01:31
# Conflicts:
#	packages/opencode/src/shell/shell.ts
#	packages/opencode/src/tool/bash.ts
…ynamic-naming

# Conflicts:
#	packages/opencode/test/tool/shell.test.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Inform the model what shell it's running inside of in Bash tool's description

2 participants