# Allow always_allow patterns for Nushell, Elvish, and Rc shells \(\#47908\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/b7e11b38f4ce04a12b50022e86eac4d7aafff66e)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: b7e11b38f4ce04a12b50022e86eac4d7aafff66e

Requested commit: b7e11b38f4ce04a12b50022e86eac4d7aafff66e

Commit: b7e11b38f4ce04a12b50022e86eac4d7aafff66e

Tree: 846cd76761a55c2b17366213e3f234334606aed0

Author: Richard Feldman

Committer: GitHub

## Message

```
Allow always_allow patterns for Nushell, Elvish, and Rc shells (#47908)

## Summary

This PR extends the `always_allow` tool permission patterns to work with
Nushell, Elvish, and Rc shells. Previously, these shells were
incorrectly excluded because they don't use `&&`/`||` operators for
command chaining. However, brush-parser can safely parse their command
syntax since they all use `;` for sequential execution.

## Changes

- Add `ShellKind::Nushell`, `ShellKind::Elvish`, and `ShellKind::Rc` to
`supports_posix_chaining()`
- Split `ShellKind::Unknown` into `ShellKind::UnknownWindows` and
`ShellKind::UnknownUnix` to preserve platform-specific fallback behavior
while still denying `always_allow` patterns for unrecognized shells
- Add comprehensive tests for the new shell support
- Clarify documentation about shell compatibility

## Shell Notes

- **Nushell**: Uses `;` for sequential execution. The `and`/`or`
keywords are boolean operators on values, not command chaining.
- **Elvish**: Uses `;` to separate pipelines. Does not have `&&` or `||`
operators. Its `and`/`or` are special commands operating on values.
- **Rc (Plan 9)**: Uses `;` for sequential execution and `|` for piping.
Does not have `&&`/`||` operators.

## Security

Unknown shells still return `false` from `supports_posix_chaining()`, so
`always_allow` patterns are denied for safety when we can't verify the
shell's syntax.

(No release notes because granular tool permissions are still
feature-flagged.)

Release Notes:

- N/A

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
```

## Parents

- [8bdfbfe5918316f5b8434240f9e55ad136e5531b](https://git.cafe/gitcafe/zed/commit/8bdfbfe5918316f5b8434240f9e55ad136e5531b?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/b7e11b38f4ce04a12b50022e86eac4d7aafff66e?format=markdown)
