zed/crates/languages/src
Richard Feldman b7e11b38f4
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>
2026-01-29 06:08:05 +00:00
..
bash Revert " Add vim/emacs modeline support " (#47479) 2026-01-23 15:24:37 +00:00
c languages: Add highlighting for document comments in C/C++ (#47556) 2026-01-28 11:25:49 +01:00
cpp languages: Add first-line C++ language detection for extensionless libcpp headers (#47443) 2026-01-28 10:33:28 +00:00
css Add '#' to word_characters in JSON/CSS config (#45400) 2026-01-08 21:04:21 +02:00
diff Fix diff highlights (#38384) 2025-11-20 15:52:15 +01:00
gitcommit Add comment language injection for supported languages (#39884) 2025-10-20 14:45:51 +02:00
go languages: Add highlighting for Go directives (#47621) 2026-01-28 21:16:33 +00:00
gomod languages: Add ignore keyword for gomod (#41520) 2025-11-03 09:11:50 -06:00
gowork Add comment injections for gowork and gomod (#40842) 2025-10-22 11:07:20 -06:00
javascript Improve TypeScript keyword syntax highlighting (#47435) 2026-01-26 15:16:51 +01:00
jsdoc Improve TS/TSX/JS syntax highlighting for parameters, types, and punctuation (#44532) 2025-12-11 12:02:28 +01:00
json Add '#' to word_characters in JSON/CSS config (#45400) 2026-01-08 21:04:21 +02:00
jsonc language: Remove embeds support (#46076) 2026-01-05 19:38:25 +01:00
markdown Revert " Add vim/emacs modeline support " (#47479) 2026-01-23 15:24:37 +00:00
markdown-inline markdown: Add LaTeX syntax highlighting injection (#41110) 2025-11-21 16:57:56 +00:00
python Revert " Add vim/emacs modeline support " (#47479) 2026-01-23 15:24:37 +00:00
regex Improve Regex highlighting (#28183) 2025-04-18 12:44:13 -04:00
rust Revert " Add vim/emacs modeline support " (#47479) 2026-01-23 15:24:37 +00:00
tsx Improve TypeScript keyword syntax highlighting (#47435) 2026-01-26 15:16:51 +01:00
typescript Improve TypeScript keyword syntax highlighting (#47435) 2026-01-26 15:16:51 +01:00
yaml Revert " Add vim/emacs modeline support " (#47479) 2026-01-23 15:24:37 +00:00
zed-keybind-context keymap_ui: Create language for Zed keybind context (#34558) 2025-07-16 17:00:47 +00:00
bash.rs buffer: Keep the shorter language setting names for the common operation (#43915) 2025-12-01 18:55:33 +01:00
c.rs Fail early if clangd is downloaded on aarch Linux (#46346) 2026-01-08 11:05:15 +00:00
cpp.rs buffer: Keep the shorter language setting names for the common operation (#43915) 2025-12-01 18:55:33 +01:00
css.rs gpui: Actually remove the Result from AsyncApp (#45809) 2026-01-07 12:48:24 -08:00
eslint.rs gpui: Actually remove the Result from AsyncApp (#45809) 2026-01-07 12:48:24 -08:00
go.rs go: Add support for running sub-tests in table tests without explicit variables for test cases (#46645) 2026-01-27 05:54:22 +00:00
json.rs Revert " Add vim/emacs modeline support " (#47479) 2026-01-23 15:24:37 +00:00
lib.rs Revert " Add vim/emacs modeline support " (#47479) 2026-01-23 15:24:37 +00:00
package_json.rs typescript: Runners support for bun:test & node:test (#39238) 2025-10-13 09:05:04 +02:00
python.rs Allow always_allow patterns for Nushell, Elvish, and Rc shells (#47908) 2026-01-29 06:08:05 +00:00
rust.rs Revert " Add vim/emacs modeline support " (#47479) 2026-01-23 15:24:37 +00:00
tailwind.rs gpui: Actually remove the Result from AsyncApp (#45809) 2026-01-07 12:48:24 -08:00
tailwindcss.rs gpui: Actually remove the Result from AsyncApp (#45809) 2026-01-07 12:48:24 -08:00
typescript.rs Revert " Add vim/emacs modeline support " (#47479) 2026-01-23 15:24:37 +00:00
vtsls.rs gpui: Actually remove the Result from AsyncApp (#45809) 2026-01-07 12:48:24 -08:00
yaml.rs gpui: Actually remove the Result from AsyncApp (#45809) 2026-01-07 12:48:24 -08:00