Sublime Forum

Executable scripts: open in editor, not launch

#1

If you click “Open in Editor” on an executable script on Windows it tries to launch the script instead of opening it in the Editor (if you have double-click to launch these scripts enabled)

Is there a way to always force opening in an editor?

0 Likes

#2

What editor do you have configured? Are you using Sublime Text?

0 Likes

#3

No editor explicitly configured, it opens in Sublime Text automatically

0 Likes

#4

I can’t reproduce this using either a python script nor a batch script.

0 Likes

#5

Are those both configured to autoexecute on your system?

For me it fails, i.e., autoruns, for .bat files, but not for .py (opens in Sublime), but then I don’t have autoexecute set for .py

Otherwise no idea why this behaves this way.

0 Likes

#6

What do you mean by “autoexecute”? Double clicking on the files run them for me.

0 Likes

#7

Yes, that’s what I meant - double click executes

0 Likes

#8

Hi @eugenesv,

This behavior can happen if Sublime Merge cannot find the install path of Sublime Text.
In this case, it defaults to the system to open the file using the default open behavior for that filetype.

To fix this you can explicitly set the editor path to the Sublime Text binary in the preference.
I’ll be adding a fix for this in the next build.

Kind regards,
- Dylan from Sublime HQ

1 Like

#9

Ok, that partially explains it since my install is in a non-default location.

But then on the system editor fallback side: is it possible, though, to always fallback to the default TEXT file handler instead of to the default open behavior for that file type? This would avoid such issues completely, there is no reason to use the default filetype behavior for a “open in an editor” command.

0 Likes

#10

But then on the system editor fallback side: is it possible, though, to always fallback to the default TEXT file handler instead of to the default open behavior for that file type?

I believe that’s what Dylan meant by “I’ll be adding a fix for this in the next build”.

0 Likes