mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-11 11:09:16 +02:00
When displaying scrollback fallback to less if the user configures a pager that is not in PATH
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user