parent
b1334bcc22
commit
6dbdea0ee3
@ -56,6 +56,7 @@ Changed
|
|||||||
- The `ui -> user-stylesheet` setting now also takes file paths relative to the config directory.
|
- The `ui -> user-stylesheet` setting now also takes file paths relative to the config directory.
|
||||||
- The `content -> cookies-accept` setting now has new `no-3rdparty` (default) and `no-unknown-3rdparty` values to block third-party cookies. The `default` value got renamed to `all`.
|
- The `content -> cookies-accept` setting now has new `no-3rdparty` (default) and `no-unknown-3rdparty` values to block third-party cookies. The `default` value got renamed to `all`.
|
||||||
- Improved startup time by reading the webpage history while qutebrowser is open.
|
- Improved startup time by reading the webpage history while qutebrowser is open.
|
||||||
|
- The way `:spawn` splits its commandline has been changed slightly to allow commands with flags.
|
||||||
|
|
||||||
Deprecated
|
Deprecated
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
|
@ -529,20 +529,24 @@ Preset the statusbar to some text.
|
|||||||
|
|
||||||
[[spawn]]
|
[[spawn]]
|
||||||
=== spawn
|
=== spawn
|
||||||
Syntax: +:spawn [*--userscript*] [*--verbose*] [*--detach*] 'args' ['args' ...]+
|
Syntax: +:spawn [*--userscript*] [*--verbose*] [*--detach*] 'cmdline'+
|
||||||
|
|
||||||
Spawn a command in a shell.
|
Spawn a command in a shell.
|
||||||
|
|
||||||
Note the {url} variable which gets replaced by the current URL might be useful here.
|
Note the {url} variable which gets replaced by the current URL might be useful here.
|
||||||
|
|
||||||
==== positional arguments
|
==== positional arguments
|
||||||
* +'args'+: The commandline to execute.
|
* +'cmdline'+: The commandline to execute.
|
||||||
|
|
||||||
==== optional arguments
|
==== optional arguments
|
||||||
* +*-u*+, +*--userscript*+: Run the command as an userscript.
|
* +*-u*+, +*--userscript*+: Run the command as an userscript.
|
||||||
* +*-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.
|
||||||
|
* With this command, +;;+ is interpreted literally instead of splitting off a second command.
|
||||||
|
|
||||||
[[stop]]
|
[[stop]]
|
||||||
=== stop
|
=== stop
|
||||||
Stop loading in the current/[count]th tab.
|
Stop loading in the current/[count]th tab.
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
|
import shlex
|
||||||
import posixpath
|
import posixpath
|
||||||
import functools
|
import functools
|
||||||
import xml.etree.ElementTree
|
import xml.etree.ElementTree
|
||||||
@ -919,8 +920,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, userscript=False, verbose=False, detach=False, *args):
|
maxsplit=0)
|
||||||
|
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} variable which gets replaced by the current URL might be
|
Note the {url} variable which gets replaced by the current URL might be
|
||||||
@ -930,11 +932,15 @@ class CommandDispatcher:
|
|||||||
userscript: Run the command as an userscript.
|
userscript: Run the command as an userscript.
|
||||||
verbose: Show notifications when the command started/exited.
|
verbose: Show notifications when the command started/exited.
|
||||||
detach: Whether the command should be detached from qutebrowser.
|
detach: Whether the command should be detached from qutebrowser.
|
||||||
*args: The commandline to execute.
|
cmdline: The commandline to execute.
|
||||||
"""
|
"""
|
||||||
log.procs.debug("Executing: {}, userscript={}".format(
|
try:
|
||||||
args, userscript))
|
cmd, *args = shlex.split(cmdline)
|
||||||
cmd, *args = args
|
except ValueError as e:
|
||||||
|
raise cmdexc.CommandError("Error while splitting command: "
|
||||||
|
"{}".format(e))
|
||||||
|
log.procs.debug("Executing {} with args {}, userscript={}".format(
|
||||||
|
cmd, args, userscript))
|
||||||
if userscript:
|
if userscript:
|
||||||
self.run_userscript(cmd, *args, verbose=verbose)
|
self.run_userscript(cmd, *args, verbose=verbose)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user