Sublime Forum

Open With Sublime Text in Windows 11

#1

Windows 11 has a new context menu in explorer, which means users have to have an extra click to Show More Options in order to get the old Sublime Text shell extension. The new IExplorerCommand based system seems like it’ll be nicer long term-- no more crappy shell extensions that lock up the explorer process, but until if/when we get there, apps need to update. Is it planned to support this new system?

https://blogs.windows.com/windowsdeveloper/2021/07/19/extending-the-context-menu-and-share-dialog-in-windows-11/ has an implementation overview.

Thanks!

2 Likes

#2

ST4 registers to “Open With…” by some registry entries. Doesn’t ST4 appear in the “Open with…” sub menu anymore in Win11 as it does in Win10?

ST used to register a dedicated “Open with Sublime Text” menu item via registry before, but never came with its own shell extension (in form of a COM library, which registers special functions etc).

0 Likes

#3

Might be off in my terminology then.
image
Sublime doesn’t show up in here, nor in the top level menu. I’m not sure how that new popout gets populated. I think you can register filetypes as being supported somewhere?

If I click “Choose another app” Sublime pops up in here, but I think I had to manually select it once:

But if I click “Show more options” it appears here, this is the thing set inside the registry on install:

I was hoping Sublime could advertise an IShellExtension so that it can appear, for instance, next to “Open in Windows Terminal”:
image

0 Likes

#4

@deathaxe, he means that Windows 11 has a new context menu by default. There still access to the old menu, but it requires two clicks or pressing two keys.

@sponge, you should open a Feature Request on Github. It won’t be attended yet as in, Windows 11 hasn’t been released yet and won’t be pushed quickly as an upgrade. So they will take their time. In the meantime, I recommend using this to get the context menu by default.

0 Likes

#5

I’ve just been using Shift+F10 for now to pop directly into that menu. I generally like the new context menu, especially since every stupid app and Windows component crams everything into the old ones, and cleaning it up is a pain since it’s a free for all.

Didn’t know there was a GitHub issue tracker, thanks will post there!

0 Likes

#6

@bitsper2nd I am very well aware of W11 new context menu style.

The point is, ST already registers itself to Open With and therefore my expectation was it to already appear in W11’s new “Open With…” sub menu.

In other words it already follows the first point of the linked docs’ Context Menu Best Practices in some way.

ST not appearing there by default may be caused by it restricting supported file types to sublime-... or it not yet registering for open with of * file type.

Both could be fixed easily with some registry keys or should probably be added to the installer.

The point is it’s probably not required to implement a full fledged IExplorerCommand interface for it to appear in “Open With…”.

0 Likes

#7

@deathaxe do you have a solution for manually fixing this in the registry so that it appears in the new context menu?

All I currently understood was that to get the “Open in Sublimetext” back in the new Windows 11 context menu, it’s required to implement an IExplorerCommand interface.

Ah, here is the issue in Github:

0 Likes

#8

FWIW, Notepad++ does this right out of the box on install. very nice. maybe peek at that source for guidance?

0 Likes

#9

My current - not very good but working workaround by using pin to home:

  1. open registry editor
  2. go to HKEY_CLASSES_ROOT or *HKEY_USERS<userid>_Classes*
  3. go to “*” and then to “shell
  4. there create key “pintohome
  5. enter pintohome and create string value: MUIVerb with value “Sublime Text
  6. create sub key “command
  7. enter sub key “command” and edit default value:
"C:\Users\<username>\AppData\Local\Programs\SublimeText\sublime_text.exe" "%1"

(if installed to your local profile - otherwise use c:\Program Files)

0 Likes