kovidgoyal/kitty · error · SystemExit

KITTY_PUBLIC_KEY has unknown version, if you are running on

Error message

KITTY_PUBLIC_KEY has unknown version, if you are running on a remote system, update kitty on this system

What it means

KITTY_PUBLIC_KEY is versioned ('<protocol-version>:<base85 key>'). If the version prefix doesn't match RC_ENCRYPTION_PROTOCOL_VERSION, the client refuses it — typically a kitty version mismatch between the machine running the kitten and the kitty instance.

Source

Thrown at kitty/remote_control.py:528

                    ans = f.read().rstrip()
            except OSError:
                pass
    if not ans and opts.password_env:
        ans = os.environ.get(opts.password_env, '')
    if not ans and opts.use_password == 'always':
        raise SystemExit('No password was found')
    if ans and len(ans) > 1024:
        raise SystemExit('Specified password is too long')
    return ans


def get_pubkey() -> tuple[str, bytes]:
    raw = os.environ.get('KITTY_PUBLIC_KEY', '')
    if not raw:
        raise SystemExit('Password usage requested but KITTY_PUBLIC_KEY environment variable is not available')
    version, pubkey = raw.split(':', 1)
    if version != RC_ENCRYPTION_PROTOCOL_VERSION:
        raise SystemExit('KITTY_PUBLIC_KEY has unknown version, if you are running on a remote system, update kitty on this system')
    from base64 import b85decode

    return version, b85decode(pubkey)

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Update kitty to the same version on both systems (the machine running the kitten command)
  2. Re-export KITTY_PUBLIC_KEY from the current kitty instance after upgrading
Defensive patterns

Strategy: fallback

Validate before calling

from kitty.remote_control import RC_ENCRYPTION_PROTOCOL_VERSION, get_pubkey
version,_ = get_pubkey()  # raises if mismatch

Try / catch

except SystemExit as e: print('update kitty on this machine to match the remote:', e)

Prevention

When it happens

Trigger: KITTY_PUBLIC_KEY exported by an older/newer kitty than the client binary, common when remote-controlling over SSH between systems with different kitty versions.

Common situations: SSH remote control between two machines with mismatched kitty versions after an upgrade on one side.

Related errors


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