From 5b864275f22a7e6d8e156ea190f74556b569c13c Mon Sep 17 00:00:00 2001 From: Kunall Banerjee Date: Thu, 4 Jun 2026 17:48:52 -0400 Subject: [PATCH] grammars: Stop treating `fish` modelines as Shell Script (#58550) Bash listed `fish` in `modeline_aliases`, so a `filetype=fish` modeline resolved to Shell Script before the real [Fish language](https://zed.dev/extensions/fish) could match by name or grammar. Fish is intentionally non-POSIX, so the Bash grammar is the wrong fit here. | Header | After | |--------|--------| | image | image | Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [ ] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [ ] Performance impact has been considered and is acceptable Closes #58532. Release Notes: - Dropped `fish` from `modeline_aliases` which forced the file to be detected as Shell Script instead of Fish --- crates/grammars/src/bash/config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/grammars/src/bash/config.toml b/crates/grammars/src/bash/config.toml index 9f74985027..a4fdecd2ff 100644 --- a/crates/grammars/src/bash/config.toml +++ b/crates/grammars/src/bash/config.toml @@ -2,7 +2,7 @@ name = "Shell Script" code_fence_block_name = "bash" grammar = "bash" path_suffixes = ["sh", "bash", "bashrc", "bash_profile", "bash_aliases", "bash_logout", "bats", "profile", "zsh", "zshrc", "zshenv", "zsh_profile", "zsh_aliases", "zsh_histfile", "zlogin", "zprofile", ".env", "PKGBUILD", "APKBUILD"] -modeline_aliases = ["sh", "shell", "shell-script", "zsh", "fish"] +modeline_aliases = ["sh", "shell", "shell-script", "zsh"] line_comments = ["# "] first_line_pattern = '^#!.*\b(?:ash|bash|bats|dash|sh|zsh)\b' autoclose_before = "}])"