kovidgoyal/kitty · error
Failed to read data from the clipboard with error: %w
Error message
Failed to read data from the clipboard with error: %w
What it means
In the data-transfer phase, once the peer has agreed on a MIME type, any response status other than DATA/OK/DONE is wrapped as 'Failed to read data from the clipboard' around error_from_status. The inner message names the concrete failure that aborted the payload download.
Source
Thrown at kittens/clipboard/read.go:414
}
getting_data_for = current_mime
}
if !o.all_data_received {
o.add_data(payload)
}
}
case "OK":
case "DONE":
if prev := requested_mimes[getting_data_for]; getting_data_for != "" && prev != nil && !prev.all_data_received {
prev.all_data_received = true
wg.Go(func() {
prev.commit()
})
getting_data_for = ""
}
lp.Quit(0)
default:
return fmt.Errorf("Failed to read data from the clipboard with error: %w", error_from_status(metadata["status"]))
}
}
return
}
esc_count := 0
lp.OnKeyEvent = func(event *loop.KeyEvent) error {
if event.MatchesPressOrRepeat("ctrl+c") || event.MatchesPressOrRepeat("esc") {
event.Handled = true
esc_count++
if esc_count < 2 {
key := "Esc"
if event.MatchesPressOrRepeat("ctrl+c") {
key = "Ctrl+C"
}
lp.QueueWriteString(fmt.Sprintf("Waiting for response from terminal, press %s again to abort. This could cause garbage to be spewed to the screen.\r\n", key))
} else {
return fmt.Errorf("Aborted by user!")View on GitHub (pinned to 6d5d0c4406)
Solutions
- Inspect the inner status message: EPERM → approve/authorize; EBUSY → retry after a delay; unknown → update kitty versions
- Re-copy the content on the sender and retry the whole get operation
- For large payloads prefer getfile to avoid inline transfer limits
- Stabilize the transport (avoid tmux reflow, enable passthrough)
Example fix
# before kitten clipboard get big.png # aborts mid-transfer # after kitten clipboard getfile --mime image/png big.png
Defensive patterns
Strategy: retry
Try / catch
for i in 1 2 3; do kitten clipboard getfile --mime image/png out.png && break; sleep 1; done
Prevention
- Retry the full get after re-copying on the sender
- Prefer getfile for large payloads
- Authorize non-interactively with --password/--human-name to avoid mid-transfer EPERM
When it happens
Trigger: `kitten clipboard get dest` after the MIME negotiation succeeded, when the peer aborts mid-transfer with EPERM (revoked permission), EBUSY (owner busy), or an unknown status; large payloads failing partway also surface here.
Common situations: User denying the confirmation after negotiation started; clipboard owner replacing content mid-read; ssh/mosh connections dropping during transfer; tmux mangling long sequences.
Related errors
- Failed to read list of available data types in the clipboard
- Too much piped data
- Failed to read from STDIN pipe with error: %w
- Failed to create a temporary from STDIN pipe with error: %w
- Failed to copy data from STDIN pipe to temp file with error:
AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27).
Data as JSON: /api/errors/acaa8960568e4c7a.
Report an issue: GitHub.