{"record":{"id":"ba85491d1e6ac9aa","repo":"kovidgoyal/kitty","slug":"the-scrollback-pager-cmd-0-was-not-found-in-pat","errorCode":null,"errorMessage":"The scrollback_pager {cmd[0]} was not found in PATH, falling back to less","messagePattern":"The scrollback_pager (.+?) was not found in PATH, falling back to less","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kitty/boss.py","lineNumber":2440,"sourceCode":"            s.connect(address)\n            s.sendall(b'c')\n            with suppress(OSError):\n                s.shutdown(socket.SHUT_RDWR)\n            s.close()\n\n    def display_scrollback(self, window: Window, data: bytes | str, input_line_number: int = 0, title: str = '', report_cursor: bool = True) -> Window | None:\n\n        def prepare_arg(x: str) -> str:\n            x = x.replace('INPUT_LINE_NUMBER', str(input_line_number))\n            x = x.replace('CURSOR_LINE', str(window.screen.cursor.y + 1) if report_cursor else '0')\n            x = x.replace('CURSOR_COLUMN', str(window.screen.cursor.x + 1) if report_cursor else '0')\n            return x\n\n        cmd = list(map(prepare_arg, get_options().scrollback_pager))\n        if not os.path.isabs(cmd[0]):\n            resolved_exe = which(cmd[0])\n            if not resolved_exe:\n                log_error(f'The scrollback_pager {cmd[0]} was not found in PATH, falling back to less')\n                resolved_exe = which('less') or 'less'\n            cmd[0] = resolved_exe\n\n        if os.path.basename(cmd[0]) == 'less':\n            cmd.append('-+F')  # reset --quit-if-one-screen\n        tab = self.active_tab\n        if tab is not None:\n            bdata = data.encode('utf-8') if isinstance(data, str) else data\n            if is_macos and cmd[0] == '/usr/bin/less' and macos_version()[:2] < (12, 3):\n                # the system less before macOS 12.3 barfs up OSC codes, so sanitize them ourselves\n                sentinel = os.path.join(cache_dir(), 'less-is-new-enough')\n                if not os.path.exists(sentinel):\n                    if less_version(cmd[0]) >= 581:\n                        open(sentinel, 'w').close()\n                    else:\n                        bdata = re.sub(rb'\\x1b\\].*?\\x1b\\\\', b'', bdata)\n\n            return tab.new_special_window(","sourceCodeStart":2422,"sourceCodeEnd":2458,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/boss.py#L2422-L2458","documentation":"kitty logs this when the first word of the scrollback_pager option is a relative command name that cannot be resolved via PATH; it silently falls back to `less`. It is a warning, not a crash: the pager simply changes.","triggerScenarios":"Setting `scrollback_pager` to something like `nvim` or `moar` when that binary is not installed or not on kitty's PATH (e.g. kitty launched from a GUI launcher with a minimal PATH).","commonSituations":"User configures a favorite pager that is installed via a user-local tool (~/bin, homebrew, nix) but kitty inherits a stripped PATH when started from a desktop file; typos in the option value.","solutions":["Verify the binary exists: `which <pager>` in the same environment kitty runs in","Use an absolute path in kitty.conf: `scrollback_pager /usr/bin/nvim`","Install the missing pager or fix PATH in the environment that spawns kitty","Accept the fallback to less if intentional"],"exampleFix":"# before\nscrollback_pager moar\n# after\nscrollback_pager /home/user/.cargo/bin/moar","handlingStrategy":"validation","validationCode":"import shutil\npager = 'moar'\nif shutil.which(pager) is None:\n    pager = '/usr/bin/less'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer absolute paths in scrollback_pager","Confirm kitty's PATH when launching from GUI session files"],"tags":["kitty","pager","path","config","scrollback"],"backgroundTag":"command-not-found-in-path","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}