Sublime Forum

Open_dir always uses Explorer.exe even if custom dir handler

#1

Many Windows users have Explorer replacements such as Total Commander, XYPlorer, Directory Opus, xplorer2, etc. These usually replace explorer.exe via changing the Folder handler in the registry at: [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell]

However - even when someone has a custom folder handler setup - SublimeText currently always opens a folder via Explorer.exe and not through an os-specific way. An alternative to fix this that I have tested is to use os.startfile(“C:\folderpath”). For example the following will respect the user’s custom directory handler:

[code]import sublime, sublime_plugin, os

class OpenContainingDirCommand(sublime_plugin.TextCommand):
def run(self, edit):
branch, leaf = os.path.split(self.view.file_name())
os.startfile(branch)[/code]

So please use os.startfile(dirpath) for things such as “Browse Package”.

Link to this suggestion on Userecho. Please vote.

0 Likes

Sublime doesn't use use custom dir handler