diff --git a/doc/help/commands.asciidoc b/doc/help/commands.asciidoc index 44624e9dd..1c67f9d23 100644 --- a/doc/help/commands.asciidoc +++ b/doc/help/commands.asciidoc @@ -40,6 +40,7 @@ possible to run or bind multiple commands by separating them with `;;`. |<>|Clear all message notifications. |<>|Click the element matching the given filter. |<>|Close the current window. +|<>|Execute a command after some time. |<>|Repeat a given command. |<>|Set all settings back to their default. |<>|Cycle an option between multiple values. @@ -76,7 +77,6 @@ possible to run or bind multiple commands by separating them with `;;`. |<>|Insert text at cursor position. |<>|Evaluate a JavaScript string. |<>|Jump to the mark named by `key`. -|<>|Execute a command after some time. |<>|Start or stop recording a macro. |<>|Run a recorded macro. |<>|Show an error message in the statusbar. @@ -281,6 +281,21 @@ The given filter needs to result in exactly one element, otherwise, an error is === close Close the current window. +[[cmd-later]] +=== cmd-later +Syntax: +:cmd-later 'duration' 'command'+ + +Execute a command after some time. + +==== positional arguments +* +'duration'+: Duration to wait in format XhYmZs or a number for milliseconds. +* +'command'+: The command to run, with optional args. + +==== 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. +* This command does not replace variables like +\{url\}+. + [[cmd-repeat]] === cmd-repeat Syntax: +:cmd-repeat 'times' 'command'+ @@ -798,21 +813,6 @@ Jump to the mark named by `key`. ==== positional arguments * +'key'+: mark identifier; capital indicates a global mark -[[later]] -=== later -Syntax: +:later 'duration' 'command'+ - -Execute a command after some time. - -==== positional arguments -* +'duration'+: Duration to wait in format XhYmZs or a number for milliseconds. -* +'command'+: The command to run, with optional args. - -==== 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. -* This command does not replace variables like +\{url\}+. - [[macro-record]] === macro-record Syntax: +:macro-record ['register']+ diff --git a/qutebrowser/misc/utilcmds.py b/qutebrowser/misc/utilcmds.py index 971dd40b0..6ec83bea8 100644 --- a/qutebrowser/misc/utilcmds.py +++ b/qutebrowser/misc/utilcmds.py @@ -26,9 +26,10 @@ from qutebrowser.utils.version import pastebin_version from qutebrowser.qt import sip -@cmdutils.register(maxsplit=1, no_cmd_split=True, no_replace_variables=True) +@cmdutils.register(maxsplit=1, no_cmd_split=True, no_replace_variables=True, + deprecated_name='later') @cmdutils.argument('win_id', value=cmdutils.Value.win_id) -def later(duration: str, command: str, win_id: int) -> None: +def cmd_later(duration: str, command: str, win_id: int) -> None: """Execute a command after some time. Args: diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py index 73689ea88..b55624b8d 100755 --- a/scripts/dev/build_release.py +++ b/scripts/dev/build_release.py @@ -119,7 +119,7 @@ def _smoke_test_run( '--temp-basedir', *args, 'about:blank', - ':later 500 quit', + ':cmd-later 500 quit', ] return subprocess.run(argv, check=True, capture_output=True) diff --git a/scripts/dev/quit_segfault_test.sh b/scripts/dev/quit_segfault_test.sh index 389f125b9..e8bfaed6b 100755 --- a/scripts/dev/quit_segfault_test.sh +++ b/scripts/dev/quit_segfault_test.sh @@ -7,7 +7,7 @@ while :; do exit=0 while (( exit == 0 )); do duration=$(( RANDOM % 10000 )) - python3 -m qutebrowser --debug ":later $duration quit" http://www.heise.de/ + python3 -m qutebrowser --debug ":cmd-later $duration quit" http://www.heise.de/ exit=$? done echo "$(date) $exit $duration" >> crash.log diff --git a/tests/end2end/features/prompts.feature b/tests/end2end/features/prompts.feature index 673c4f567..9cf880061 100644 --- a/tests/end2end/features/prompts.feature +++ b/tests/end2end/features/prompts.feature @@ -487,7 +487,7 @@ Feature: Prompts Scenario: Getting question in command mode When I open data/hello.txt - And I run :later 500 quickmark-save + And I run :cmd-later 500 quickmark-save And I run :set-cmd-text : And I wait for a prompt And I run :prompt-accept prompt-in-command-mode diff --git a/tests/end2end/features/utilcmds.feature b/tests/end2end/features/utilcmds.feature index 75e99ec70..da99e62d3 100644 --- a/tests/end2end/features/utilcmds.feature +++ b/tests/end2end/features/utilcmds.feature @@ -4,27 +4,27 @@ Feature: Miscellaneous utility commands exposed to the user. Given I open data/scroll/simple.html And I run :tab-only - ## :later + ## :cmd-later - Scenario: :later before - When I run :later 500 scroll down + Scenario: :cmd-later before + When I run :cmd-later 500 scroll down Then the page should not be scrolled # wait for scroll to execute so we don't ruin our future And the page should be scrolled vertically - Scenario: :later after - When I run :later 500 scroll down + Scenario: :cmd-later after + When I run :cmd-later 500 scroll down And I wait 0.6s Then the page should be scrolled vertically # for some reason, argparser gives us the error instead, see #2046 @xfail - Scenario: :later with negative delay - When I run :later -1 scroll down + Scenario: :cmd-later with negative delay + When I run :cmd-later -1 scroll down Then the error "I can't run something in the past!" should be shown - Scenario: :later with humongous delay - When I run :later 36893488147419103232 scroll down + Scenario: :cmd-later with humongous delay + When I run :cmd-later 36893488147419103232 scroll down Then the error "Numeric argument is too large for internal int representation." should be shown ## :cmd-repeat