From 82722e9f414bb7fb280f4e5434364059c672b0c2 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 4 Nov 2020 18:16:05 +0100 Subject: [qutebrowser] fix external editing when using termite Some terminals consider all arguments in argv after an '-e' as command and others only the next arg. Build up the commandline appropriately. --- config/qutebrowser/config.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/qutebrowser/config.py b/config/qutebrowser/config.py index b0b4049..8448af4 100644 --- a/config/qutebrowser/config.py +++ b/config/qutebrowser/config.py @@ -6,7 +6,11 @@ config.bind(',x', 'hint links spawn mpv {hint-url}') config.bind('', 'spawn --userscript password_fill') -c.editor.command = [os.environ["TERMINAL"], "-e", os.environ["VISUAL"], "{}"] +terminal = os.environ['TERMINAL'] +if terminal in ["st", "urxvt"]: + c.editor.command = [terminal, "-e", os.environ['VISUAL'], "{}"] +else: + c.editor.command = [terminal, "-e", f"{os.environ['VISUAL']} {{}}"] c.content.headers.do_not_track = True @@ -20,6 +24,5 @@ config.load_autoconfig() import theme # set qutebrowser colors - for setting, color in theme.theme.items(): config.set(setting, color) -- cgit v1.2.3