diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 52e466018..51301965d 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -150,6 +150,7 @@ Changed - `:hint` has a new `--add-history` argument to add the URL to the history for yank/spawn targets. - `:set` now cycles through values if more than one argument is given. +- `:open` now opens `default-page` without an URL even without `-t`/`-b`/`-w` given. Deprecated ~~~~~~~~~~ diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index c13cde990..97fc8c186 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -257,13 +257,10 @@ class CommandDispatcher: count: The tab index to open the URL in, or None. """ if url is None: - if tab or bg or window: - urls = [config.get('general', 'default-page')] - else: - raise cmdexc.CommandError("No URL given, but -t/-b/-w is not " - "set!") + urls = [config.get('general', 'default-page')] else: urls = self._parse_url_input(url) + for i, cur_url in enumerate(urls): if not window and i > 0: tab = False diff --git a/tests/end2end/features/open.feature b/tests/end2end/features/open.feature index 3f6715e6a..89d6c9aa2 100644 --- a/tests/end2end/features/open.feature +++ b/tests/end2end/features/open.feature @@ -14,9 +14,10 @@ Feature: Opening pages - active: true url: http://localhost:*/data/numbers/1.txt - Scenario: :open without URL and no -t/-b/-w - When I run :open - Then the error "No URL given, but -t/-b/-w is not set!" should be shown + Scenario: :open without URL + When I set general -> default-page to http://localhost:(port)/data/numbers/11.txt + And I run :open + Then data/numbers/11.txt should be loaded Scenario: :open without URL and -t When I set general -> default-page to http://localhost:(port)/data/numbers/2.txt