diff --git a/qutebrowser/commands/runners.py b/qutebrowser/commands/runners.py index 16c790eca..aca88db6b 100644 --- a/qutebrowser/commands/runners.py +++ b/qutebrowser/commands/runners.py @@ -66,6 +66,9 @@ def replace_variables(win_id, arglist): 'clipboard': utils.get_clipboard, 'primary': lambda: utils.get_clipboard(selection=True), } + for key in list(variables): + modified_key = '{' + key + '}' + variables[modified_key] = lambda x=modified_key: x values = {} args = [] tabbed_browser = objreg.get('tabbed-browser', scope='window', diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature index 8f21b7421..e15af8ad5 100644 --- a/tests/end2end/features/misc.feature +++ b/tests/end2end/features/misc.feature @@ -436,6 +436,11 @@ Feature: Various utility commands. And I run :message-info {clipboard}bar{url} Then the message "foobarhttp://localhost:*/hello.txt" should be shown + Scenario: escaping {{url}} variable + When I open data/hello.txt + And I run :message-info foo{{url}}bar + Then the message "foo{url}bar" should be shown + @xfail_norun Scenario: {url} in clipboard should not be expanded When I open data/hello.txt