Always expand ~ when starting scripts.

This commit is contained in:
Florian Bruhin 2015-08-27 20:28:16 +02:00
parent 84a41cf9cf
commit 4891fe9457
2 changed files with 3 additions and 1 deletions

View File

@ -967,8 +967,10 @@ class CommandDispatcher:
log.procs.debug("Executing {} with args {}, userscript={}".format(
cmd, args, userscript))
if userscript:
# ~ expansion is handled by the userscript module.
self.run_userscript(cmd, *args, verbose=verbose)
else:
cmd = os.path.expanduser(cmd)
proc = guiprocess.GUIProcess(self._win_id, what='command',
verbose=verbose,
parent=self._tabbed_browser)
@ -992,7 +994,6 @@ class CommandDispatcher:
args: Arguments to pass to the userscript.
verbose: Show notifications when the command started/exited.
"""
cmd = os.path.expanduser(cmd)
env = {
'QUTE_MODE': 'command',
}

View File

@ -343,6 +343,7 @@ def run(cmd, *args, win_id, env, verbose=False):
user_agent = config.get('network', 'user-agent')
if user_agent is not None:
env['QUTE_USER_AGENT'] = user_agent
cmd = os.path.expanduser(cmd)
runner.run(cmd, *args, env=env, verbose=verbose)
runner.finished.connect(commandrunner.deleteLater)
runner.finished.connect(runner.deleteLater)