Sublime Text 3 subl command not working in Windows 10
Asked Answered
W

5

6

when I run the subl command, it just pauses for a moment and doesn't give me any feedback as to what happened and doesn't open. I am currently on windows 10 running the latest sublime text 3 build. I already copied my subl.exe from my sublime text 3 directory to my system32 directory. What am I missing? I've tried subl.exe ., subl.exe detect.py, subl, subl.exe

Please help me with this setup

Wilsonwilt answered 25/9, 2016 at 20:31 Comment(1)
Instead of copying subl.exe, try adding your Sublime Text installation directory to your PATH. For security reasons, you shouldn't be adding anything to system32.Inexpensive
M
15

I'm assuming that when you invoke subl.exe via an absolute path then it works.

> "C:\Program Files\Sublime Text 3\subl.exe"

Assuming the above works, then the location of subl.exe can be added to the system path so that there is no need to specify the absolute path.

Go to Control Panel > System and Security > System > Advanced system settings and add C:\Program Files\Sublime Text 3 to the PATH environment variable.

Check that the PATH variable does not already contain the path to subl.exe so to avoid adding it twice.

You essentially are going to append ;C:\Program Files\Sublime Text 3 to the PATH variable. Note the ; which is a path separator.

You may need to restart Windows for the change to take effect.

See What are PATH and other environment variables, and how can I set or use them? for in depth information on PATH and other environment variables in general.

Mucoviscidosis answered 26/9, 2016 at 22:41 Comment(0)
H
1

You can add gitbash alias like below open a gitbash terminal and type alias subl="/c/Program\ Files/Sublime\ Text\ 3/subl.exe"

then try subl . from gitbash

you can also add permanent alias for git bash like below

  1. Go to: C:\Users\ [youruserdirectory] \
  2. make a .bash_profile file
  3. open it with text editor
  4. add the alias .

    alias subl="/c/Program\ Files/Sublime\ Text\ 3/subl.exe"

Huba answered 22/2, 2020 at 6:33 Comment(0)
B
1

After adding a path environmental variable, you have just to type subl.exe in command prompt

Binucleate answered 23/7, 2020 at 7:21 Comment(0)
B
0

Simply make a link from your installation directory to the System32 directory like:

mklink c:\Windows\System32\subl.exe "c:\Program Files\Sublime Text 3\subl.exe"
Brnaba answered 3/3, 2019 at 6:7 Comment(1)
NO. You shouldn't be modifying System32 in any way!Inexpensive
F
0

After adding the path variable, restart your PC, worked like a charm.

Fingerling answered 28/3, 2021 at 11:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.