kovidgoyal/kitty · error
ENOSYS
ENOSYS
Error message
no primary selection available on this system
What it means
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.
Source
Thrown at kittens/clipboard/read.go:238
ans.WriteString("=")
ans.WriteString(escape_metadata_value(k, v))
}
if len(payload) > 0 {
ans.WriteString(";")
ans.WriteString(enc_payload)
}
ans.WriteString("\x1b\\")
return ans.String()
}
func encode(metadata map[string]string, payload string) string {
return Encode_bytes(metadata, utils.UnsafeStringToBytes(payload))
}
func error_from_status(status string) error {
switch status {
case "ENOSYS":
return fmt.Errorf("no primary selection available on this system")
case "EPERM":
return fmt.Errorf("permission denied")
case "EBUSY":
return fmt.Errorf("a temporary error occurred, try again later.")
default:
return fmt.Errorf("%s", status)
}
}
func parse_escape_code(etype loop.EscapeCodeType, data []byte) (metadata map[string]string, payload []byte, err error) {
if etype != loop.OSC || !bytes.HasPrefix(data, utils.UnsafeStringToBytes(OSC_NUMBER+";")) {
return
}
parts := bytes.SplitN(data, utils.UnsafeStringToBytes(";"), 3)
metadata = make(map[string]string)
if len(parts) > 2 && len(parts[2]) > 0 {
payload, err = base64.StdEncoding.DecodeString(utils.UnsafeBytesToString(parts[2]))
if err != nil {View on GitHub (pinned to 6d5d0c4406)
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)
Example fix
# before kitten clipboard get --use-primary # peer answers ENOSYS # after kitten clipboard get # use the default CLIPBOARD selection
Defensive patterns
Strategy: fallback
Try / catch
out=$(kitten clipboard get --use-primary f 2>&1) || { echo "$out" | grep -q 'primary selection' && kitten clipboard get f; } Prevention
- Detect 'no primary selection' and fall back to the default CLIPBOARD selection
- Verify the terminal/peer supports primary before relying on it
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Unknown marker type: {ftype}
- {rest} is not a valid marker specification
- {rest} is not a valid scroll_to_mark destination
- {name} is not a valid color
- Too much piped data
AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27).
Data as JSON: /api/errors/e433c40e602cbe46.
Report an issue: GitHub.