Revert spawn's splitting, blacklist from doc
Blacklist spawn from getting the no_replace_variables doc note.
This commit is contained in:
parent
8a527b5faf
commit
1e97247c63
@ -696,7 +696,7 @@ You can use the `{url}` and `{url:pretty}` variables here which will get replace
|
|||||||
|
|
||||||
[[spawn]]
|
[[spawn]]
|
||||||
=== spawn
|
=== spawn
|
||||||
Syntax: +:spawn [*--userscript*] [*--verbose*] [*--detach*] 'cmdline' ['cmdline' ...]+
|
Syntax: +:spawn [*--userscript*] [*--verbose*] [*--detach*] 'cmdline'+
|
||||||
|
|
||||||
Spawn a command in a shell.
|
Spawn a command in a shell.
|
||||||
|
|
||||||
@ -715,6 +715,9 @@ Note the `{url}` and `{url:pretty}` variables might be useful here. `{url}` gets
|
|||||||
* +*-v*+, +*--verbose*+: Show notifications when the command started/exited.
|
* +*-v*+, +*--verbose*+: Show notifications when the command started/exited.
|
||||||
* +*-d*+, +*--detach*+: Whether the command should be detached from qutebrowser.
|
* +*-d*+, +*--detach*+: Whether the command should be detached from qutebrowser.
|
||||||
|
|
||||||
|
==== note
|
||||||
|
* This command does not split arguments after the last argument and handles quotes literally.
|
||||||
|
|
||||||
[[stop]]
|
[[stop]]
|
||||||
=== stop
|
=== stop
|
||||||
Stop loading in the current/[count]th tab.
|
Stop loading in the current/[count]th tab.
|
||||||
|
@ -991,8 +991,9 @@ class CommandDispatcher:
|
|||||||
finally:
|
finally:
|
||||||
self._tabbed_browser.setUpdatesEnabled(True)
|
self._tabbed_browser.setUpdatesEnabled(True)
|
||||||
|
|
||||||
@cmdutils.register(instance='command-dispatcher', scope='window')
|
@cmdutils.register(instance='command-dispatcher', scope='window',
|
||||||
def spawn(self, *cmdline, userscript=False, verbose=False, detach=False):
|
maxsplit=0, no_replace_variables=True)
|
||||||
|
def spawn(self, cmdline, userscript=False, verbose=False, detach=False):
|
||||||
"""Spawn a command in a shell.
|
"""Spawn a command in a shell.
|
||||||
|
|
||||||
Note the `{url}` and `{url:pretty}` variables might be useful here.
|
Note the `{url}` and `{url:pretty}` variables might be useful here.
|
||||||
@ -1011,7 +1012,14 @@ class CommandDispatcher:
|
|||||||
detach: Whether the command should be detached from qutebrowser.
|
detach: Whether the command should be detached from qutebrowser.
|
||||||
cmdline: The commandline to execute.
|
cmdline: The commandline to execute.
|
||||||
"""
|
"""
|
||||||
cmd, *args = cmdline
|
try:
|
||||||
|
cmd, *args = shlex.split(cmdline)
|
||||||
|
except ValueError as e:
|
||||||
|
raise cmdexc.CommandError("Error while splitting command: "
|
||||||
|
"{}".format(e))
|
||||||
|
|
||||||
|
args = runners.replace_variables(self._win_id, args)
|
||||||
|
|
||||||
log.procs.debug("Executing {} with args {}, userscript={}".format(
|
log.procs.debug("Executing {} with args {}, userscript={}".format(
|
||||||
cmd, args, userscript))
|
cmd, args, userscript))
|
||||||
if userscript:
|
if userscript:
|
||||||
|
@ -240,7 +240,7 @@ def _get_command_doc_notes(cmd):
|
|||||||
Strings which should be added to the docs.
|
Strings which should be added to the docs.
|
||||||
"""
|
"""
|
||||||
if (cmd.maxsplit is not None or cmd.no_cmd_split or
|
if (cmd.maxsplit is not None or cmd.no_cmd_split or
|
||||||
cmd.no_replace_variables):
|
cmd.no_replace_variables and cmd.name != "spawn"):
|
||||||
yield ""
|
yield ""
|
||||||
yield "==== note"
|
yield "==== note"
|
||||||
if cmd.maxsplit is not None:
|
if cmd.maxsplit is not None:
|
||||||
@ -249,7 +249,7 @@ def _get_command_doc_notes(cmd):
|
|||||||
if cmd.no_cmd_split:
|
if cmd.no_cmd_split:
|
||||||
yield ("* With this command, +;;+ is interpreted literally "
|
yield ("* With this command, +;;+ is interpreted literally "
|
||||||
"instead of splitting off a second command.")
|
"instead of splitting off a second command.")
|
||||||
if cmd.no_replace_variables:
|
if cmd.no_replace_variables and cmd.name != "spawn":
|
||||||
yield r"* This command does not replace variables like +\{url\}+."
|
yield r"* This command does not replace variables like +\{url\}+."
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user