Brandon Benefield
Brandon Benefield

Reputation: 1672

Git Bash cant run commands after running subl

So I run $ subl and sublime opens, but then my command line goes blank, or infinite, not sure what its called.
example

$ subl
|

I can type anything i want hit enter, goes to next line and so forth but nothing will actually happen until i close sublime. I've tried the solution from Can't type in git bash after I launch subl (windows 8.1 os) but adding the & after sublime_text.exe does not work. echo 'alias subl="C:/Program\ Files/Sublime\ Text\ 3/sublime_text.exe&"' >> ~/.bashrc. This used to work perfectly for awhile but out of nowhere it started openning up the SAME file no matter what. Now its just openning up a blank page or whatever I was working on the last time sublime was open. Also just for clarity this is on windows 10 gnu bash 4.4.12(1) and sublime text 3.

Upvotes: 1

Views: 488

Answers (1)

VonC
VonC

Reputation: 1325966

Instead of defining an alias, try instead a script named subl that you can set in your $PATH (PATH a seen in your bash session)

#!/bin/bash
"C:\Program Files\Sublime Text 3\sublime_text.exe" $1 &

Then try and type subl or subl aText.

As the OP Brandon Benefield comments below:

The solution was after creating a file "subl" with the content mentioned above, I moved it to a folder simply named "bin" sitting in my home directory.
Now typing "subl" and "subl 'file_name.txt'" works.

Upvotes: 1

Related Questions