From 1aa4d7d24b0c756e293889cc6e38f9cd6c13b13a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 21 Jan 2024 09:22:02 +0530 Subject: [PATCH] When displaying scrollback fallback to less if the user configures a pager that is not in PATH --- kitty/boss.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kitty/boss.py b/kitty/boss.py index f8e9eaeb9..62255700a 100644 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -1860,7 +1860,11 @@ class Boss: cmd = list(map(prepare_arg, get_options().scrollback_pager)) if not os.path.isabs(cmd[0]): - cmd[0] = which(cmd[0]) or cmd[0] + resolved_exe = which(cmd[0]) + if not resolved_exe: + log_error(f'The scrollback_pager {cmd[0]} was not found in PATH, falling back to less') + resolved_exe = which('less') or 'less' + cmd[0] = resolved_exe if os.path.basename(cmd[0]) == 'less': cmd.append('-+F') # reset --quit-if-one-screen