Skip to content

Commit 579fe7f

Browse files
author
Sathvik Ponangi
committed
Better cross-platform support & non-blocking call
1 parent 934908f commit 579fe7f

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

bash.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
import os, sublime_plugin
1+
import os, sublime_plugin, subprocess
22
class BashCommand(sublime_plugin.TextCommand):
33
def run(self, edit):
4-
file_name=self.view.file_name()
5-
path=file_name.split(os.sep)
6-
current_driver=path[0]
7-
path.pop()
8-
current_directory=os.sep.join(path)
9-
command= 'cd '+current_directory+' & '+current_driver+' & bash --login -i'
10-
os.system(command)
11-
4+
current_directory = os.path.dirname(os.path.realpath(self.view.file_name()))
5+
os.chdir(current_directory)
6+
# os.system('start "' + r'C:\Program Files\Git\bin\bash.exe' + ' --login -i"')
7+
# subprocess.Popen([os.path.join(r'C:\Program Files','Git','bin','bash.exe'), '--login', '-i'])
8+
subprocess.Popen(['bash', '--login', '-i'])

0 commit comments

Comments
 (0)