Changeset 708d95144c97…
Parent eb1e0092d34f…
by
Changes to 7 files · Browse files at 708d95144c97 Showing diff from parent eb1e0092d34f Diff from another changeset...
@@ -306,7 +306,7 @@ def terminal(self):
root = self._repo.wjoin(self.path)
if os.path.isdir(root):
- qtlib.openshell(root)
+ qtlib.openshell(root, self.path)
def showEvent(self, event):
QWidget.showEvent(self, event)
|
@@ -134,13 +134,14 @@ return False
_user_shell = None
-def openshell(root):
+def openshell(root, reponame):
global _user_shell
if _user_shell:
cwd = os.getcwd()
try:
+ shellcmd = _user_shell % {'reponame': reponame}
os.chdir(root)
- QProcess.startDetached(_user_shell)
+ QProcess.startDetached(shellcmd)
finally:
os.chdir(cwd)
else:
@@ -155,9 +156,9 @@ if sys.platform == 'darwin':
return # Terminal.App does not support open-to-folder
elif os.name == 'nt':
- _user_shell = 'cmd.exe'
+ _user_shell = 'cmd.exe /K title %(reponame)s'
else:
- _user_shell = 'xterm'
+ _user_shell = 'xterm -T "%(reponame)s"'
# _styles maps from ui labels to effects
# _effects maps an effect to font style properties. We define a limited
|
@@ -427,8 +427,8 @@ QDesktopServices.openUrl(QUrl.fromLocalFile(root))
def terminal(self):
- root = self.selitem.internalPointer().rootpath()
- qtlib.openshell(root)
+ repoitem = self.selitem.internalPointer()
+ qtlib.openshell(repoitem.rootpath(), repoitem.shortname())
def addNewRepo(self):
'menu action handler for adding a new repository'
|
@@ -409,7 +409,7 @@ def terminal(self):
root = self.repo.wjoin(self.filelist.currentFile())
if os.path.isdir(root):
- qtlib.openshell(root)
+ qtlib.openshell(root, self.filelist.currentFile())
#@pyqtSlot(QModelIndex)
def onDoubleClick(self, index):
|
@@ -370,7 +370,13 @@ 'See <a href="%s">OpenAtLine</a>'
% 'http://bitbucket.org/tortoisehg/thg/wiki/OpenAtLine')),
_fi(_('Shell'), 'tortoisehg.shell', genEditCombo,
- _('Specify your preferred terminal shell application'),
+ _('Specify the command to launch your preferred terminal shell '
+ 'application. If the value includes the string %(reponame)s, the '
+ 'name of the repository will be substituted in place of '
+ '%(reponame)s. (restart needed)<br>'
+ 'Default, Windows: cmd.exe /K title %(reponame)s<br>'
+ 'Default, OS X: not set<br>'
+ 'Default, other: xterm -T "%(reponame)s"'),
globalonly=True),
_fi(_('Immediate Operations'), 'tortoisehg.immediate', genEditCombo,
_('Space separated list of shell operations you would like '
|
@@ -532,7 +532,7 @@ qtlib.InfoMsgBox(_('Repository not local'),
_('A terminal shell cannot be opened for remote'))
return
- qtlib.openshell(folder)
+ qtlib.openshell(folder, 'repo ' + folder)
def removeurl(self):
if qtlib.QuestionMsgBox(_('Confirm path delete'),
|
@@ -863,7 +863,7 @@ def terminal(self):
w = self.repoTabsWidget.currentWidget()
if w:
- qtlib.openshell(w.repo.root)
+ qtlib.openshell(w.repo.root, w.repo.displayname)
def editSettings(self):
tw = self.repoTabsWidget
|
Loading...