Skip to content

Allow always_allow for nushell, elvish, and rc#48395

Merged
rtfeldman merged 2 commits intomainfrom
expand-shell-coverage
Feb 4, 2026
Merged

Allow always_allow for nushell, elvish, and rc#48395
rtfeldman merged 2 commits intomainfrom
expand-shell-coverage

Conversation

@rtfeldman
Copy link
Contributor

@rtfeldman rtfeldman commented Feb 4, 2026

brush-parser handles ; (sequential execution) and | (piping) which all these shells use, so we can safely parse their commands for always_allow pattern matching.

(No release notes because granular tool permissions haven't been released yet.)

Release Notes:

  • N/A

This un-reverts commit 72b151e which reverted PR #47908.

The original PR introduced ShellKind::Posix(PosixShell) with sub-variants
(Sh, Bash, Zsh, etc.) but caused a regression where Python toolchains
(like uv) weren't detected. The bug was that activation scripts were
stored with Posix(Sh) as the HashMap key, but looked up with the user's
actual shell (e.g., Posix(Bash)), causing the lookup to fail.

The fix uses activation_script_key() to normalize POSIX shell variants
to Posix(Sh) before HashMap lookups.

Added test_activation_script_key_normalizes_posix_shells to verify:
- Direct lookup fails for different POSIX variants (the bug)
- Lookup with activation_script_key() succeeds (the fix)
- Non-POSIX shells are not normalized

Fixes #48047
brush-parser handles ';' (sequential execution) and '|' (piping) which
all these shells use, so we can safely parse their commands for
always_allow pattern matching.

This is a targeted AI-only change: supports_posix_chaining() is only
called by agent/thread.rs and agent/tool_permissions.rs.
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 4, 2026
@rtfeldman rtfeldman changed the title Allow always_allow patterns for Nushell, Elvish, and Rc shells in agent Allow always_allow for Nushell, Elvish, and Rc Feb 4, 2026
@rtfeldman rtfeldman changed the title Allow always_allow for Nushell, Elvish, and Rc Allow always_allow for nushell, elvish, and rc Feb 4, 2026
@rtfeldman rtfeldman marked this pull request as ready for review February 4, 2026 19:42
@rtfeldman rtfeldman enabled auto-merge (squash) February 4, 2026 19:42
@rtfeldman rtfeldman merged commit 54588a1 into main Feb 4, 2026
58 checks passed
@rtfeldman rtfeldman deleted the expand-shell-coverage branch February 4, 2026 19:49
adb-sh pushed a commit to adb-sh/zed that referenced this pull request Feb 5, 2026
`brush-parser` handles `;` (sequential execution) and `|` (piping) which
all these shells use, so we can safely parse their commands for
`always_allow` pattern matching.

(No release notes because granular tool permissions haven't been
released yet.)

Release Notes:

- N/A
rtfeldman added a commit that referenced this pull request Feb 5, 2026
`brush-parser` handles `;` (sequential execution) and `|` (piping) which
all these shells use, so we can safely parse their commands for
`always_allow` pattern matching.

(No release notes because granular tool permissions haven't been
released yet.)

Release Notes:

- N/A
naaiyy added a commit to Glass-HQ/Glass that referenced this pull request Feb 16, 2026
Key changes:
- Semantic highlighting support (zed-industries#46356) - major new editor feature
- Edit predictions via Ollama (zed-industries#48233) - local AI edit predictions
- Side-by-side diff: staging/unstaging/restoring on LHS, hunk controls, gutter highlights
- Branch diff fix when committing/changing branches (zed-industries#48388)
- Settings UI: AI tool permissions page (zed-industries#48277)
- Version bump to v0.224 (kept our v0.0.1)
- Close toasts on middle mouse click (zed-industries#48208)
- DAP settings made optional (zed-industries#43647)
- REPL quality of life improvements (zed-industries#47533)
- Mercury accept/reject tracking (zed-industries#48306)
- Toolbar menu and EP menu telemetry (zed-industries#48225, zed-industries#48229)
- lsp::Symbol now includes container_name (zed-industries#46822)
- Nushell/Elvish/Rc always_allow patterns (zed-industries#48395)
- Agent terminal security rules expanded (zed-industries#48399)

Conflict resolution:
- collab/rpc.rs, collab_ui, collab editor_tests: deleted (collab removed)
- vim (yank, replace, test): deleted (vim removed)
- util/shell.rs: deleted (extracted to Obsydian-HQ/gpui)
- GPUI (app.rs, windows/platform.rs, platform_scheduler.rs): deleted (Obsydian)
- editor/items.rs: merged imports (added ExcerptId, ExcerptRange, kept SearchWithinRange)
- lsp_store.rs: added SemanticTokensData import, removed GlobalLogStore/LanguageServerKind
- proto.rs: added SemanticTokens to entity_messages, removed JoinProject/LeaveProject
- lsp_button.rs: kept empty server UI, added is_via_ssh check from upstream
- edit_prediction_button.rs: kept TitleBarItemView import
- vscode_import.rs: added semantic_token_rules, removed helix_mode (not in our struct)
- zed/Cargo.toml: kept v0.0.1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant