{"record":{"id":"a0cdeb261324db66","repo":"kovidgoyal/kitty","slug":"kitty-public-key-has-unknown-version-if-you-are-r-a0cdeb","errorCode":null,"errorMessage":"KITTY_PUBLIC_KEY has unknown version, if you are running on a remote system, update kitty on this system","messagePattern":"KITTY_PUBLIC_KEY has unknown version, if you are running on a remote system, update kitty on this system","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"tools/cmd/at/main.go","lineNumber":87,"sourceCode":"\tstruct_in_interface.FieldByName(field).SetString(data)\n\tpayload_interface.Set(struct_in_interface) // copies struct_in_interface back to payload\n}\n\nfunc get_pubkey(encoded_key string) (encryption_version string, pubkey []byte, err error) {\n\tif encoded_key == \"\" {\n\t\tencoded_key = os.Getenv(\"KITTY_PUBLIC_KEY\")\n\t\tif encoded_key == \"\" {\n\t\t\terr = fmt.Errorf(\"Password usage requested but KITTY_PUBLIC_KEY environment variable is not available\")\n\t\t\treturn\n\t\t}\n\t}\n\tencryption_version, encoded_key, found := strings.Cut(encoded_key, \":\")\n\tif !found {\n\t\terr = fmt.Errorf(\"KITTY_PUBLIC_KEY environment variable does not have a : in it\")\n\t\treturn\n\t}\n\tif encryption_version != kitty.RC_ENCRYPTION_PROTOCOL_VERSION {\n\t\terr = fmt.Errorf(\"KITTY_PUBLIC_KEY has unknown version, if you are running on a remote system, update kitty on this system\")\n\t\treturn\n\t}\n\tpubkey = make([]byte, base85.DecodedLen(len(encoded_key)))\n\tn, err := base85.Decode(pubkey, []byte(encoded_key))\n\tif err == nil {\n\t\tpubkey = pubkey[:n]\n\t}\n\treturn\n}\n\ntype escaped_string string\n\nfunc (s escaped_string) MarshalJSON() ([]byte, error) {\n\t// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON\n\t// we additionally escape all non-ascii chars so they can be safely transmitted inside an escape code\n\tsrc := utf16.Encode([]rune(s))\n\tbuf := make([]byte, 0, len(src)+128)\n\ta := func(x ...byte) {","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/tools/cmd/at/main.go#L69-L105","documentation":"The version prefix of KITTY_PUBLIC_KEY does not match the RC_ENCRYPTION_PROTOCOL_VERSION this kitty @ binary supports. The kitty instance that exported the key speaks a different (usually newer or much older) remote-control encryption protocol.","triggerScenarios":"Mixing kitty versions: e.g. a newer kitty exports KITTY_PUBLIC_KEY with version 2 while the remote host's kitty @ binary only understands version 1, or vice versa.","commonSituations":"Running kitty @ on a remote machine over ssh where the remote kitty package is older/newer than the local kitty that set the variable.","solutions":["Update kitty so both systems run the same version (the message explicitly suggests this for remote setups)","Or run the kitty @ binary that matches the running kitty (fix PATH so the correct binary is found)","Check 'kitty --version' on both ends to confirm they match"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"local, remote := kittyVersion(), remoteVersion()\nif local != remote { /* align versions before using password RC */ }","typeGuard":null,"tryCatchPattern":"if _, _, err := get_pubkey(key); err != nil { /* update kitty on the mismatched side and retry */ }","preventionTips":["Keep kitty versions identical across hosts","Check kitty --version on both sides after updates"],"tags":["kitty","remote-control","version-mismatch","encryption"],"backgroundTag":"protocol-version-mismatch","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}