As a Windows application, Sublime has no direct connection to WSL; neither does VSC except that VSC runs a task within WSL that it communicates back and forth with to seem more integrated than it actually is (arguably).
Running the Windows version of Sublime Text and editing Linux files in WSL will work, but since the Linux file system is shared with Windows as a remote file share, it will not be as fast (most likely you will not notice that in regular usage) but more importantly Sublime relies on notifications from the file system to tell it when files are added, deleted or modified, but file shares don’t support that.
As a result, you will need to use the Project > Refresh
option to force a rescan; while not the end of the world, depending on what you’re doing it’s easier to miss changes that way.
You can use Terminus with WSL (presuming you mean being able to have WSL terminals from within Sublime), but you’d need to add a custom terminal to your Terminus preferences in order to do that; for example:
{
"name": "WSL",
"cmd": ["wsl"],
"default": false,
"enable": true,
"env": {},
"platforms": [
"windows"
]
},
You may want to set this one as "default"
instead of the default you currently have set, if you’d like to mostly use this. Terminus uses the default configuration for executing builds (if you use that feature) so setting this as a default saves you from having to manually tell each build to use it as well.
That will launch the default WSL distribution; if you have more than one installed and want to target a specific one, you need to add to the arguments to give it the name, such as the following example
"cmd": ["wsl", "-d", "Ubuntu"],
You can get around all of the problems mentioned above by running the Linux version of Sublime Text directly within WSL; in that case it’s a native Linux application in which using Terminus will Just Work , file notifications work, etc.
The downside to this is that WSL’s support for GUI applications is a bit lackluster currently; in particular:
- Linux windows don’t respond to requests to rearrange themselves, so you can’t snap to the sides of a monitor and so on; you need to size and move them manually
- By default, the window caption bar won’t have all of the buttons on it you probably want; you can tweak that with the commands outlined below though
- Linux apps in a window know they’re in a window, but Windows doesn’t tell them where on the screen they are; so menus that are opened too close to the bottom or side of the screen will go off the edge rather than changing their orientation to remain visible.
All that said, I use WSL daily for production work (and on my streams as well) and it works just fine; in my case I use Sublime maximized to make the most of the space in the editing area, so apart from occasionally having to click a little higher on the screen to see a context menu entry, I have had no issues with it.
If you’d like to alter the buttons available in the caption bar of WSL windows, you can use gsettings
for that. As the following example shows, the default button arrangement has only the close button, but you can also add others; here the standard minimize and maximize buttons.
tmartin:PCTERM:~> gsettings get org.gnome.desktop.wm.preferences button-layout
'appmenu:close'
tmartin:PCTERM:~> gsettings set org.gnome.desktop.wm.preferences button-layout ":minimize,maximize,close"
tmartin:PCTERM:~> gsettings get org.gnome.desktop.wm.preferences button-layout
':minimize,maximize,close'