{"record":{"id":"5f978e0d41b27355","repo":"kovidgoyal/kitty","slug":"the-colors-configuration-file-emph-err-filename","errorCode":null,"errorMessage":"The colors configuration file {emph(err.filename)} was not found.","messagePattern":"The colors configuration file (.+?) was not found\\.","errorType":"validation","errorClass":"ParsingOfArgsFailed","httpStatus":null,"severity":"error","filePath":"kitty/rc/set_colors.py","lineNumber":86,"sourceCode":"        + MATCH_TAB_OPTION.replace('--match -m', '--match-tab -t')\n    )\n    args = RemoteCommand.Args(\n        spec='COLOR_OR_FILE ...',\n        json_field='colors',\n        special_parse='parse_colors_and_files(args)',\n        completion=RemoteCommand.CompletionSpec.from_string('type:file group:\"CONF files\", ext:conf'),\n    )\n\n    def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType:\n        final_colors: dict[str, int | None | str] = {}\n        transparent_background_colors: tuple[tuple[Color, float], ...] = ()\n        from kitty.colors import parse_colors\n\n        if not opts.reset:\n            try:\n                fc, transparent_background_colors = parse_colors(args)\n            except FileNotFoundError as err:\n                raise ParsingOfArgsFailed(f'The colors configuration file {emph(err.filename)} was not found.') from err\n            except Exception as err:\n                raise ParsingOfArgsFailed(str(err)) from err\n            final_colors.update(fc)\n        if transparent_background_colors:\n            final_colors['transparent_background_colors'] = ' '.join(f'{c.as_sharp}@{f}' for c, f in transparent_background_colors)\n        ans = {\n            'match_window': opts.match,\n            'match_tab': opts.match_tab,\n            'all': opts.all or opts.reset,\n            'configured': opts.configured or opts.reset,\n            'colors': final_colors,\n            'reset': opts.reset,\n        }\n        return ans\n\n    def response_from_kitty(self, boss: Boss, window: Window | None, payload_get: PayloadGetType) -> ResponseType:\n        from kitty.colors import patch_colors\n","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/rc/set_colors.py#L68-L104","documentation":"set-colors parses the given colors file; if the file path does not exist, FileNotFoundError is wrapped into ParsingOfArgsFailed with the filename highlighted.","triggerScenarios":"kitten @set-colors /path/to/theme.conf where the path does not exist or is not readable (e.g. NFS/sshfs not mounted).","commonSituations":"Theme-switching scripts referencing themes by relative path from a different cwd, or paths from another machine over SSH.","solutions":["Verify the colors file path exists (os.path.isfile) before calling","Use an absolute path to the theme file","Ensure the filesystem holding the theme is mounted"],"exampleFix":"# before\nkitten @set-colors ~/themes/missing.conf\n# after\nkitten @set-colors $(realpath ~/themes/nord.conf)","handlingStrategy":"validation","validationCode":"import os\nassert os.path.isfile(path), f'missing theme file: {path}'","typeGuard":null,"tryCatchPattern":"try: ... except ParsingOfArgsFailed as e: report missing theme path from message","preventionTips":["Use absolute paths for theme files","Check mounts before theme switching on network filesystems"],"tags":["kitty","theme","file-not-found"],"backgroundTag":"file-not-found","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}