{"record":{"id":"250fe3d701dd6a68","repo":"kovidgoyal/kitty","slug":"failed-to-setup-shell-integration-for-shell","errorCode":null,"errorMessage":"Failed to setup shell integration for: {shell}","messagePattern":"Failed to setup shell integration for: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kitty/shell_integration.py","lineNumber":256,"sourceCode":"\n\ndef modify_shell_environ(opts: Options, env: dict[str, str], argv: list[str]) -> None:\n    shell = get_supported_shell_name(argv[0])\n    ksi = get_effective_ksi_env_var(opts)\n    if shell is None or not ksi:\n        return\n    env['KITTY_SHELL_INTEGRATION'] = ksi\n    if not shell_integration_allows_rc_modification(opts):\n        return\n    f = ENV_MODIFIERS.get(shell)\n    if f is not None:\n        try:\n            f(env, argv)\n        except Exception:\n            import traceback\n\n            traceback.print_exc()\n            log_error(f'Failed to setup shell integration for: {shell}')\n","sourceCodeStart":238,"sourceCodeEnd":257,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/shell_integration.py#L238-L257","documentation":"The shell-integration hook for the detected shell (bash/zsh/fish) raised an exception while modifying the environment; kitty logs it and continues launching without (complete) shell integration.","triggerScenarios":"Any exception from the per-shell f(env, argv) function in modify_shell_environ, e.g. unexpected argv shape or a missing expected binary.","commonSituations":"Unusual shell wrappers/paths (custom bash via Nix/homebrew), kitty version changes to shell integration logic, or PATH issues where the real shell binary can't be located.","solutions":["Check the printed traceback to identify which shell hook failed","Update kitty — shell integration bugs for specific shell versions are commonly fixed","Set shell_integration to a reduced set of options or disable it to silence the failure","Ensure the configured shell resolves to the real binary: kitty --debug-config shows the shell path"],"exampleFix":"# before\nshell /opt/my-wrapper/bash\n\n# after\nshell /bin/bash","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Point shell at the real binary path, not wrappers","Read the traceback kitty prints; most fixes are upstream shell-integration bugs solved by updating kitty"],"tags":["kitty","shell-integration","startup","environment"],"backgroundTag":"shell-integration-failed","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}