kovidgoyal/kitty · warning

Could not find included config file: {val}, ignoring

Error message

Could not find included config file: {val}, ignoring

What it means

An `include` directive referenced a config file that does not exist; kitty logs and continues parsing.

Source

Thrown at kitty/conf/utils.py:355

                            memory,
                            accumulate_bad_lines,
                            effective_config_lines,
                            allow_geninclude=allow_geninclude,
                        )
            return
        else:
            if not os.path.isabs(val):
                val = os.path.join(base_path_for_includes, val)
            vals = (val,)
        for val in vals:
            if memory.seen(val):
                continue
            try:
                with open(val, encoding='utf-8', errors='replace') as include:
                    with currently_parsing.set_file(val):
                        _parse(include, parse_conf_item, ans, memory, accumulate_bad_lines, effective_config_lines, allow_geninclude=allow_geninclude)
            except FileNotFoundError:
                log_error(f'Could not find included config file: {val}, ignoring')
            except OSError:
                log_error('Could not read from included config file: {}, ignoring'.format(val))
        return
    if parse_conf_item(key, val, ans):
        effective_config_lines(key, line)
    else:
        log_error(f'Ignoring unknown config key: {key}')


def _parse(
    lines: Iterable[str],
    parse_conf_item: ItemParser,
    ans: dict[str, Any],
    memory: Memory,
    accumulate_bad_lines: list[BadLine] | None = None,
    effective_config_lines: Callable[[str, str], None] | None = None,
    allow_geninclude: bool = True,
) -> None:

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Fix the path or create the file
  2. Use globinclude if the file is optional (globs that match nothing are skipped silently)

Example fix

# before
include themes/mytheme.conf   # file absent
# after
include current-theme.conf    # or create the file
Defensive patterns

Strategy: validation

Validate before calling

import os
for inc in includes:
    if not os.path.isfile(os.path.expanduser(inc)):
        print(f'warning: missing include {inc}')

Prevention

When it happens

Trigger: open(val) raises FileNotFoundError for an included file path (after ~ and env expansion).

Common situations: Typos in include paths, referencing theme files not yet installed, moving configs between machines where a shared file is absent.

Related errors


AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27). Data as JSON: /api/errors/dc1e8ff604a35021. Report an issue: GitHub.