kovidgoyal/kitty · error

%s

Error message

%s

What it means

error_from_status's default branch: the remote peer returned a status string that is not one of ENOSYS/EPERM/EBUSY, and it is surfaced verbatim. This usually indicates a protocol-level error or an unrecognized failure code from the terminal/client.

Source

Thrown at kittens/clipboard/read.go:244

	}
	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 {
			err = fmt.Errorf("Received OSC %s packet from terminal with invalid base64 encoded payload", OSC_NUMBER)
			return
		}
	}
	if len(parts) > 1 {
		for record := range bytes.SplitSeq(parts[1], utils.UnsafeStringToBytes(":")) {

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Inspect the raw status string in the message to identify its origin
  2. Update kitty on both ends (local and remote over ssh) to matching versions
  3. If using a non-kitty terminal, verify it implements the kitty clipboard protocol fully or disable the feature
  4. Report the unknown status to kitty's issue tracker with both versions
Defensive patterns

Strategy: try-catch

Try / catch

out=$(kitten clipboard get f 2>&1) || { echo "$out" >> clipboard-errors.log; exit 1; }  # capture unknown status for triage

Prevention

When it happens

Trigger: A remote client replying with an unexpected status (malformed handshake, an error string from a different kitty version, or a bug in the peer implementation) over the OSC clipboard channel.

Common situations: Version skew between kitty and the remote kitten/ssh kitten forwarding the clipboard; third-party terminal emulators implementing the kitty clipboard protocol partially; corrupted OSC packets.

Related errors


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