Whilst posix shells are traditionally the most common on linux, there are many options now. Not all shell scripts end in `.sh`, and whether a file can be executed or not is determined by the execute bit on linux - and not by any file extension or similar conventions. With many shells to choose from, and not to mention other languages, such as Ruby or Python, and the ability to have more complex shebanhgs, there's an increasing range of text files one might want to execute directly. I use fish a lot, and now more nushell aswell, and whilst often I do want to open my scripts to edit them, it is also convenient to be able to execute them with a double-click with no arguments from within dolphin. I would like to be prompted if I want to open or execute an executable text file of any type, the same way I would if it is evidently a script for one of the posix-style shells. I think on linux, the execute bit trumps the extension, which seems to me to be a deciding factor. This is the behaviour I have had on Nemo (and I assume nautilus too). At the least, if there are disagreements on whether users would prefer this or not, I think this should be a configurable option. E.g. "Treat all files with execute bit set as executable" (for the purposes of determining whether to open in an application, execute, or always ask), or "Only treat certain known executable file formats as executable". On linux: STEPS TO REPRODUCE 1. Create a shell script in a language of your choice. 1. Give it the extension ".sh" 1. Set the execute bit 1. Double-click in Dolphin. It should execute, or prompt, according to your preference in the settings. 1. Now name it ending in e.g. .fish., .nu, .xonsh, ... OBSERVED RESULT 1. Double-clicking opens it in Kate (for me) EXPECTED RESULT 1. Double-clicking it still executes it SOFTWARE/OS VERSIONS (Skipped as not sure is relevant) Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION
Don't see a "related" field above, so adding manually: https://bugs.kde.org/show_bug.cgi?id=456356
Symbolic links also seem to be affected - double-clicking a script ending in .sh executes it, whilst double-clicking a symlink in the same directory pointing to it, opens it in Kate.
You can add ".fish" extension to mimetype `application/x-executable`. It will then be recognized as executable by dolphin (an d KDE apps). You can `keditfiletype5` utility to do so.
FYI I submitted an upstream MR to add proper support for nu scripts and fish scripts everywhere: https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/231 Feel free to do the same for xonsh (or open a bug specific for it).