Skip to content

Prioritize shebang if no file extension is provided #5869

Open
@Brixy

Description

@Brixy
Helix: compiled from master branch
OS: Void

Hi!

In my bin folder there are some single letter POSIX/Bash executables: c (calendar), p (password script) and f (fuzzy finder).

Although the correct shebangs are provided (#!/usr/bin/[sh,bash]) Helix recognizes the files’ languages as c, perl and fortran.

It is easy to solve this problem, e.g. by renaming the files and using the shells abbreviations or aliases, by adding [.sh,.bash] file extensions or by adding file-types to languales.toml like this:

[[language]]
name = "bash"
file-types = ["c", "f", "t"]
shebangs = ["sh", "bash", "dash", "zsh"]
# …

I just wanted to mention this in case it is a Helix issue.

Should helix generelly prioritize the shegang if no file extension is provided?

Thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-language-supportArea: Support for programming/text languagesC-enhancementCategory: ImprovementsR-breaking-changeThis PR is a breaking change for some behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions