earendil-works/pi · error · Error

Failed to copy to clipboard

Error message

Failed to copy to clipboard

What it means

Thrown by copyToClipboard when every copy strategy failed: platform clipboard tools errored (caught and fallen through) and the OSC 52 terminal-escape fallback also did not succeed. It is the final guard after all fallbacks were exhausted.

Solutions

  1. Install a platform clipboard utility (pbcopy, wl-copy, xclip, or xsel)
  2. Use a terminal that supports OSC 52 clipboard sequences
  3. On SSH/remote sessions, ensure the terminal emulator handles OSC 52
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at packages/coding-agent/src/utils/clipboard.ts:173 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24). Data as JSON: /api/errors/92ec549136b3b1e9. Report an issue: GitHub.

Appendix: source

Thrown at packages/coding-agent/src/utils/clipboard.ts:173

						}
					} else if (hasX11Display) {
						copyToX11Clipboard(options);
						copied = true;
					}
				}
			}
		} catch {
			// Fall through to OSC 52 fallback.
		}
	}

	if (remote || !copied) {
		const osc52Copied = emitOsc52(text);
		copied = copied || osc52Copied;
	}

	if (!copied) {
		throw new Error("Failed to copy to clipboard");
	}
}

View on GitHub (pinned to 4af9d21d3b)