Skip to content

Change the name of the "Bash" language to "Shell". - #1174

Closed
7heo wants to merge 2 commits into
alecthomas:masterfrom
7heo:master
Closed

Change the name of the "Bash" language to "Shell".#1174
7heo wants to merge 2 commits into
alecthomas:masterfrom
7heo:master

Conversation

@7heo

@7heo 7heo commented Dec 10, 2025

Copy link
Copy Markdown

Bash, while extremely widespread, is a richer language than just any shell. Having the lexer report a shell script as a Bash script can be confusing, or even error-inducing.

For correctness, the only thing the lexer can (correctly) assume is that the file is shell script.

Beyond that, a syntactic analysis would be required.

I changed the file name too, for completeness.

7heo added 2 commits December 10, 2025 21:47
Change the name of the language to "Shell".

Bash, while extremely widespread, is a richer language than any shell. Having the lexer report a shell script as a Bash script can be confusing, or even error-inducing.

For correctness, the only thing the lexer can (correctly) assume is that the file is shell script.

Beyond that, a syntactic analysis would be required.

I guess the file name should be changed too.
@alecthomas

Copy link
Copy Markdown
Owner

I'm really not sure what purpose this would serve, but regardless, Chroma tries to stay in sync with Pygmenst, where this naming originates.

@alecthomas alecthomas closed this Dec 11, 2025
@7heo

7heo commented Dec 11, 2025

Copy link
Copy Markdown
Author

I'm really not sure what purpose this would serve

As mentioned, correctness. If correctness doesn't concern you, there's not much I can do, indeed.

but regardless, Chroma tries to stay in sync with Pygmenst, where this naming originates.

Understood. Thanks.

@mahlzahn

Copy link
Copy Markdown

I'm really not sure what purpose this would serve, but regardless, Chroma tries to stay in sync with Pygmenst, where this naming originates.

I just found this pull request here, while looking into an issue on Forgejo, where we use Chroma’s detected language name at the header of a file. It would make sense there to show Shell instead for files that aren’t bash files. But anyhow, up to your decision, and we might fix it another way (e.g., using go-enry dependency).

saschazepter pushed a commit to saschazepter/forgejo that referenced this pull request May 14, 2026
…les (#12562)

This is a quick hack to show "Shell" instead of "Bash" which is an upstream issue that likely won’t be fixed.

This makes it also slightly more consistent with the repository’s language statistics, which show "Shell", too.

Closes: Codeberg/Community#2627
Related: alecthomas/chroma#1174

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/12562
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
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.

3 participants