From 5fe4d10f3899138a74ec2cfdddac6bb1e26a09d7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 3 Feb 2020 08:05:34 +0530 Subject: [PATCH] Only do processing if pager is not an absolute path --- kitty/window.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/kitty/window.py b/kitty/window.py index 38e63e129..9be4db127 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -542,14 +542,15 @@ def show_scrollback(self): text = self.as_text(as_ansi=True, add_history=True, add_wrap_markers=True) data = self.pipe_data(text, has_wrap_markers=True) cmd = [x.replace('INPUT_LINE_NUMBER', str(data['input_line_number'])) for x in self.opts.scrollback_pager] - import shutil - exe = shutil.which(cmd[0]) - if not os.path.isabs(cmd[0]) and not exe: - env = read_shell_environment(self.opts) - if env and 'PATH' in env: - exe = shutil.which(cmd[0], path=env['PATH']) - if exe: - cmd[0] = exe + if not os.path.isabs(cmd[0]): + import shutil + exe = shutil.which(cmd[0]) + if not exe: + env = read_shell_environment(self.opts) + if env and 'PATH' in env: + exe = shutil.which(cmd[0], path=env['PATH']) + if exe: + cmd[0] = exe get_boss().display_scrollback(self, data['text'], cmd) def paste_bytes(self, text):