0

I'm following Udacity course on Git and GitHub and I'm trying to set Sublime Text 3 as the default text editor.

I must've screwed up because I got it to work before, but now it's not. Sorry, I'm just learning this stuff.

The problem now is that I can't even open Sublime Text on the Git Bash. I go to the Sublime directory and I call "sublime_text.exe" but it prompts "bash: sublime_text.exe: command not found".

What am I missing?

Cyrus
  • 84,225
  • 14
  • 89
  • 153
Makondo
  • 343
  • 4
  • 16
  • Does `./sublime_text.exe` from the Sublime directory work? The current directory isn't in the default `$PATH` on linux the way it is on Windows. Does using a full path to `sublime_text.exe` work? – Etan Reisner Nov 22 '15 at 20:56
  • Its probably something to do with the fact that you're trying to run an exe from bash but I rarely use windows. – 0xcaff Nov 22 '15 at 21:13
  • The question has nothing to do with bash or git - in order to run an executable from the command line using only its name, the executable's folder must be in the `PATH` environment variable. Sublime Text doesn;t update `PATH` during installation – Panagiotis Kanavos Nov 23 '15 at 10:20
  • Possible duplicate of [Sublime Text from Command Line (Win7)](http://stackoverflow.com/questions/9440639/sublime-text-from-command-line-win7) – Panagiotis Kanavos Nov 23 '15 at 10:21
  • I just checked and yes @EtanReisner, using full path works. And sublime works just fine. What could be the solution? – Makondo Nov 24 '15 at 22:31
  • The solution to making `sublime_text.exe` work? Don't use that. Use `./sublime_text.exe` or a full or other relative path to it. But if sublime works correctly then that isn't the problem with git bash and something else is. Check the editor configuration there? – Etan Reisner Nov 24 '15 at 23:06

1 Answers1

1

You'll need to edit your PATH variable so that it includes the directory that Sublime Text is installed in. This variable holds a list of directory names, separated by semicolons, containing the executables you can run. Both Bash and the Windows command line use the same variable, so editing it will fix this problem in both.

db48x
  • 3,108
  • 24
  • 16