{"record":{"id":"8f74202765648ab6","repo":"kovidgoyal/kitty","slug":"eperm","errorCode":"EPERM","errorMessage":"permission denied","messagePattern":"permission denied","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/clipboard/read.go","lineNumber":240,"sourceCode":"\t}\n\tif len(payload) > 0 {\n\t\tans.WriteString(\";\")\n\t\tans.WriteString(enc_payload)\n\t}\n\tans.WriteString(\"\\x1b\\\\\")\n\treturn ans.String()\n}\n\nfunc encode(metadata map[string]string, payload string) string {\n\treturn Encode_bytes(metadata, utils.UnsafeStringToBytes(payload))\n}\n\nfunc error_from_status(status string) error {\n\tswitch status {\n\tcase \"ENOSYS\":\n\t\treturn fmt.Errorf(\"no primary selection available on this system\")\n\tcase \"EPERM\":\n\t\treturn fmt.Errorf(\"permission denied\")\n\tcase \"EBUSY\":\n\t\treturn fmt.Errorf(\"a temporary error occurred, try again later.\")\n\tdefault:\n\t\treturn fmt.Errorf(\"%s\", status)\n\t}\n}\n\nfunc parse_escape_code(etype loop.EscapeCodeType, data []byte) (metadata map[string]string, payload []byte, err error) {\n\tif etype != loop.OSC || !bytes.HasPrefix(data, utils.UnsafeStringToBytes(OSC_NUMBER+\";\")) {\n\t\treturn\n\t}\n\tparts := bytes.SplitN(data, utils.UnsafeStringToBytes(\";\"), 3)\n\tmetadata = make(map[string]string)\n\tif len(parts) > 2 && len(parts[2]) > 0 {\n\t\tpayload, err = base64.StdEncoding.DecodeString(utils.UnsafeBytesToString(parts[2]))\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(\"Received OSC %s packet from terminal with invalid base64 encoded payload\", OSC_NUMBER)\n\t\t\treturn","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/clipboard/read.go#L222-L258","documentation":"The remote clipboard peer returned status EPERM, mapped to 'permission denied'. The user denied or is not permitted to perform the clipboard operation — typically because the confirmation dialog (enabled via password/confirm settings) was rejected.","triggerScenarios":"Requesting clipboard data when a password/confirmation is configured and the user cancels or enters the wrong password, so the answering side replies EPERM; sandboxed environments (snap/flatpak) blocking clipboard access also produce this.","commonSituations":"kitty's clipboard_control settings requiring confirmation for reads; clicking 'No' on the allow dialog; sandboxed apps lacking clipboard permissions; headless contexts where nobody can approve the prompt.","solutions":["Approve the confirmation prompt or supply the correct --password for the read","Loosen kitty.conf clipboard_control if interactive confirmation is unwanted (e.g. allow read-clipboard without confirm)","Grant clipboard permissions to the sandboxed app or run outside the sandbox","For scripts, use --password with --human-name so authorization succeeds non-interactively"],"exampleFix":"# before\nkitten clipboard get out.txt   # user denies prompt -> EPERM\n# after\nkitten clipboard get --human-name my-script --password text:pw out.txt","handlingStrategy":"retry","validationCode":"null","typeGuard":null,"tryCatchPattern":"for i in 1 2 3; do kitten clipboard get f && break; sleep 1; done  # re-prompt user","preventionTips":["Use --password + --human-name for non-interactive authorization","Ensure clipboard_control allows the operation"],"tags":["kitty","clipboard","permissions","eperm","access-denied"],"backgroundTag":"permission-denied","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}