Skip to content

feat(terminal): configurable shell for bash tool (port upstream PR #260)#303

Merged
quangdang46 merged 1 commit into
masterfrom
feat/configurable-shell
May 24, 2026
Merged

feat(terminal): configurable shell for bash tool (port upstream PR #260)#303
quangdang46 merged 1 commit into
masterfrom
feat/configurable-shell

Conversation

@quangdang46
Copy link
Copy Markdown
Owner

Port of upstream PR 1jehuang/jcode#260 (open). Lets users on nu / zsh / fish / pwsh have agent-spawned bash tool calls run through their preferred shell.

# ~/.jcode/config.toml
[terminal]
shell = 'nu'        # or 'zsh', 'fish', 'pwsh', '/bin/dash'
JCODE_SHELL=zsh

Behavior

  • shell unset → platform default (bash on Unix, cmd.exe on Windows) — preserves existing behavior
  • shell set → spawn named binary with -c <command>
  • shell name resolved via PATH; absolute paths supported

Caveats

PowerShell users wanting full pwsh syntax should still wrap commands in pwsh -Command \"...\" inside the agent prompt.

Refs upstream PR 1jehuang/jcode#260.

Port of upstream PR 1jehuang#260 (open). Lets users on nu /
zsh / fish / pwsh have agent-spawned bash tool calls run through
their preferred shell instead of the platform default.

Config:
  [terminal]
  shell = 'nu'        # or 'zsh', 'fish', 'pwsh', '/bin/dash'

Env override:
  JCODE_SHELL=zsh

Behavior:
- shell unset → platform default (bash on Unix, cmd.exe on Windows)
  preserves existing behavior
- shell set → spawn the named binary with '-c <command>'
- shell name resolved via PATH; absolute paths supported

Caveats (intentionally same as upstream):
- Most shells accept '-c'; nu, zsh, bash, sh, fish (in some modes),
  pwsh (with '-Command' which we approximate via -c)
- PowerShell users wanting full pwsh syntax should still wrap
  commands in 'pwsh -Command "..."' inside the agent prompt.

Refs upstream PR 1jehuang#260.
@quangdang46 quangdang46 merged commit f3c9b04 into master May 24, 2026
@quangdang46 quangdang46 deleted the feat/configurable-shell branch May 24, 2026 22:10
quangdang46 added a commit that referenced this pull request May 24, 2026
After merging 13 PRs in sequence (#290 + #292-#303), two squash-merges
collided on shared schema state:

1. crates/jcode-provider-metadata/src/catalog.rs:
   - Both VERTEX_AI (#283, prior) and BIGMODEL (#297) added entries.
   - Both #19 (#263 GitLab Duo, prior) and #297 declared array size,
     each thinking they were +1 from baseline. Net actual: +2 from
     baseline but final declared count was off by 1.
   - Fixed: OPENAI_COMPAT_PROFILES 35→36, LOGIN_PROVIDERS 48→49 to
     match actual entry count.

2. src/cli/commands/provider_setup.rs:
   - PR #299 added headers: BTreeMap<String, String> field to
     NamedProviderConfig but didn't update this constructor (which
     pre-dated #299 in master).
   - Fixed: added headers: BTreeMap::new() in the configure
     constructor.

cargo check -p jcode --bin jcode now clean. No behavioral change
beyond what each PR brought.
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.

1 participant