[TxMt] Re: File with shebang always set to executable

Martin Kühl martin.kuehl at gmail.com
Wed Oct 26 16:56:47 UTC 2016


On 26 October 2016 at 18:08, Siame Rafiq <siame at rolepoint.com> wrote:
> I've noticed that any file that has a shebang at the top (#! /path/to/exec),
> is automatically set to executable when saved. Is there any way to turn off
> this functionality?

You can use “Bundles»Select Bundle Item…” (⌃⌘T),
then in that dialog’s Gear menu select “Search All Scopes” (⌘3) (just
to be safe)
and search for “exec”, say (since the command makes files executable,
it’s a good guess that it’s name would indicate this)
to find the command “Make Script Executable” from the Source bundle.
(There’s a command with the same name in the Shell Script bundle, but
that’s not the one you’re after.)
Then hit “Edit” to open it in the bundle editor, where you can disable
or modify it to your liking.

Alternatively, since the command is run on save,
you can search for it by its semantic class.
Choose “Semantic Class” from the Gear menu,
and search for “save” to find it.

If you don’t mind me asking, why would you like to disable this functionality?
I don’t quite see why one would want to have shebang lines
in files that aren’t supposed to be executable…


More information about the textmate mailing list