Skip to content

Commit

Permalink
Merge pull request #5 from Kristinita/SashaGoddess
Browse files Browse the repository at this point in the history
[Fixed] Spaces in folder name bug + I replace cmd to powershell
  • Loading branch information
kilihorse authored Nov 11, 2016
2 parents 637384e + a177393 commit 80214b1
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions ConEmuOpen.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,43 +19,43 @@ def get_project(self):
return (project_name, project_dir, has_project)

def open_conemu(self, dirname, title):
command= "start conemu.exe /Single /Dir "+dirname+" /cmdlist cmd -new_console:t:\""+title+"\""
command= "start conemu.exe /Single /Dir \""+dirname+"\" /cmdlist powershell -new_console:t:\""+title+"\""
os.system(command)

# open project folder
class OpenConemuProjectCommand(sublime_plugin.WindowCommand, ConEmuOpenCommand):
def run(self):
project_name, project_dir, has_project = self.get_project()
if not project_name:
return

self.open_conemu(project_dir, project_name)

# open "here" folder
class OpenConemuHereCommand(sublime_plugin.WindowCommand, ConEmuOpenCommand):
def run(self, paths=[]):
project_name, project_dir, has_project = self.get_project()
if not project_name:
return

if paths:
heredir = paths[0]
if os.path.isfile(heredir):
heredir = os.path.dirname(heredir)
elif self.window.active_view().file_name():
elif self.window.active_view().file_name():
heredir = os.path.dirname(self.window.active_view().file_name())
else: # if no active file open, then try to open project folder
heredir = project_dir

# get the tab title
title = heredir
if has_project:
if has_project:
rel_path = os.path.relpath(heredir, project_dir)
if rel_path == '.':
title = project_name
elif rel_path[:2] == '..': # not in project, show the whole path
title = heredir
else:
else:
title = project_name + ': ' + rel_path

self.open_conemu(heredir, title)

0 comments on commit 80214b1

Please sign in to comment.