{"record":{"id":"e433c40e602cbe46","repo":"kovidgoyal/kitty","slug":"enosys","errorCode":"ENOSYS","errorMessage":"no primary selection available on this system","messagePattern":"no primary selection available on this system","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/clipboard/read.go","lineNumber":238,"sourceCode":"\t\tans.WriteString(\"=\")\n\t\tans.WriteString(escape_metadata_value(k, v))\n\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 {","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/clipboard/read.go#L220-L256","documentation":"The remote peer (the process answering the clipboard query over the OSC 52-style channel) returned status ENOSYS, which the kitten maps to 'no primary selection available on this system'. It means the responding side does not implement primary selection transfers at all.","triggerScenarios":"Requesting the PRIMARY selection (kitten clipboard with the primary/selection option targeting primary) from a terminal or remote client whose clipboard implementation does not support primary selection, answering ENOSYS.","commonSituations":"SSH/mosh sessions where the remote or intermediary terminal emulator lacks primary-selection support; Wayland compositors or terminals that only implement CLIPBOARD; older terminal emulators or multiplexers (tmux passthrough) dropping the capability.","solutions":["Use the standard clipboard selection instead of primary if the tool exposes a flag (e.g. --use-primary off / selection=clipboard)","Upgrade or switch the terminal/multiplexer to one that supports primary selection (kitty itself does)","When tunneling through tmux, enable passthrough of OSC 52 sequences (allow-passthrough on)"],"exampleFix":"# before\nkitten clipboard get --use-primary   # peer answers ENOSYS\n# after\nkitten clipboard get   # use the default CLIPBOARD selection","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"out=$(kitten clipboard get --use-primary f 2>&1) || { echo \"$out\" | grep -q 'primary selection' && kitten clipboard get f; }","preventionTips":["Detect 'no primary selection' and fall back to the default CLIPBOARD selection","Verify the terminal/peer supports primary before relying on it"],"tags":["kitty","clipboard","primary-selection","enosys","terminal"],"backgroundTag":"operation-not-supported","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}