chrissimpkins / glue

Glue is a plugin that joins your shell to Sublime Text in quasi-perfect harmony.
http://gluedocs.readthedocs.org/
MIT License
254 stars 10 forks source link

ST3 not working with Cygwin bash #42

Open jasteele12 opened 8 years ago

jasteele12 commented 8 years ago

If I place this in the User settings file, it doesn't work (path is correct):

{ "glue_shellpath" : "C:\bin\bash.exe" }

After restarting ST3, attempting a "set" command looks like this:

[ C:\web\ ] set /c: /c: No such file or directory

Windows XP, bash --version GNU bash, version 2.02.1(2)-release (i586-pc-cygwin32)

m-sostero commented 8 years ago

@jasteele12 you need to point to the path, not the binaries, and escape backslashes (\\). This should work (assuming bash.exe is in C:\bin)

{
"glue_shellpath" : "C:\\bin"
}
Chovin commented 7 years ago

I am also having this issue.

█ [ C:\Users\me] ls /c: /c: is a directory

I'm pretty sure glue_shellpath needs the path to the executable (the binaries). Looking at the source, at time of writing, it checks if glue_shellpath is a file and gives it to subprocess.check_output/Popen as the executable

elif os.path.exists(self.shellpath) and os.path.isfile(self.shellpath):
    response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True, executable=self.shellpath)
taqtiqa-mark commented 6 years ago

It would be useful to have the option of passing parameters to the execuatable that glue_shellpath points to. So we could do something like:

"glue_shellpath": "C:\\Users\\<snip>\\.babun\\cygwin\\bin\\mintty.exe --hold always --log %APPDATA%\\Glue.sublime --exe bash --rcfile ~/.babunrc --login",

It seems the minimal change would be to allow this in the following way:

"glue_shellpath": "C:\\Users\\<snip>\\.babun\\cygwin\\bin\\mintty.exe",
"glue_shellargs": "--hold always --log %APPDATA%\\Glue.sublime --exe bash --rcfile ~/.babunrc --login",
chrissimpkins commented 6 years ago

Thanks for the suggestion. This hasn't been under active development for a few years but would be happy to consider a PR if you guys want to test it to see if it addresses this issue. Or feel free to fork and push improvements up to the Sublime packages!