parent
94d49b4801
commit
8f1b074595
@ -26,6 +26,7 @@ Changed
|
|||||||
~~~~~~~
|
~~~~~~~
|
||||||
|
|
||||||
- `QUTE_HTML` and `QUTE_TEXT` for userscripts now don't store the contents directly, and instead contain a filename.
|
- `QUTE_HTML` and `QUTE_TEXT` for userscripts now don't store the contents directly, and instead contain a filename.
|
||||||
|
- `:spawn` now shows the command being executed in the statusbar, use `-q`/`--quiet` for the old behavior.
|
||||||
|
|
||||||
https://github.com/The-Compiler/qutebrowser/releases/tag/v0.2.1[v0.2.1]
|
https://github.com/The-Compiler/qutebrowser/releases/tag/v0.2.1[v0.2.1]
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
|
@ -510,7 +510,7 @@ Preset the statusbar to some text.
|
|||||||
|
|
||||||
[[spawn]]
|
[[spawn]]
|
||||||
=== spawn
|
=== spawn
|
||||||
Syntax: +:spawn [*--userscript*] 'args' ['args' ...]+
|
Syntax: +:spawn [*--userscript*] [*--quiet*] 'args' ['args' ...]+
|
||||||
|
|
||||||
Spawn a command in a shell.
|
Spawn a command in a shell.
|
||||||
|
|
||||||
@ -521,6 +521,7 @@ Note the {url} variable which gets replaced by the current URL might be useful h
|
|||||||
|
|
||||||
==== optional arguments
|
==== optional arguments
|
||||||
* +*-u*+, +*--userscript*+: Run the command as an userscript.
|
* +*-u*+, +*--userscript*+: Run the command as an userscript.
|
||||||
|
* +*-q*+, +*--quiet*+: Don't print the commandline being executed.
|
||||||
|
|
||||||
[[stop]]
|
[[stop]]
|
||||||
=== stop
|
=== stop
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
|
import shlex
|
||||||
import subprocess
|
import subprocess
|
||||||
import posixpath
|
import posixpath
|
||||||
import functools
|
import functools
|
||||||
@ -823,7 +824,8 @@ class CommandDispatcher:
|
|||||||
tabbed_browser.setUpdatesEnabled(True)
|
tabbed_browser.setUpdatesEnabled(True)
|
||||||
|
|
||||||
@cmdutils.register(instance='command-dispatcher', scope='window')
|
@cmdutils.register(instance='command-dispatcher', scope='window')
|
||||||
def spawn(self, userscript=False, *args):
|
def spawn(self, win_id: {'special': 'win_id'}, userscript=False,
|
||||||
|
quiet=False, *args):
|
||||||
"""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
|
||||||
@ -836,10 +838,14 @@ class CommandDispatcher:
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
userscript: Run the command as an userscript.
|
userscript: Run the command as an userscript.
|
||||||
|
quiet: Don't print the commandline being executed.
|
||||||
*args: The commandline to execute.
|
*args: The commandline to execute.
|
||||||
"""
|
"""
|
||||||
log.procs.debug("Executing: {}, userscript={}".format(
|
log.procs.debug("Executing: {}, userscript={}".format(
|
||||||
args, userscript))
|
args, userscript))
|
||||||
|
if not quiet:
|
||||||
|
fake_cmdline = ' '.join(shlex.quote(arg) for arg in args)
|
||||||
|
message.info(win_id, 'Executing: ' + fake_cmdline)
|
||||||
if userscript:
|
if userscript:
|
||||||
cmd = args[0]
|
cmd = args[0]
|
||||||
args = [] if not args else args[1:]
|
args = [] if not args else args[1:]
|
||||||
|
Loading…
Reference in New Issue
Block a user