REPL: Handle missing clipboard tools gracefully with OSC52 fallback
When clipboard utilities (xsel, xclip, or wl-clipboard) are unavailable
on Linux/FreeBSD systems, the REPL history search now falls back to
OSC52 escape sequences instead of displaying an error.
Changes:
- Added clipboard(io::IO, x) method supporting OSC52 escape sequences
- Implemented XTGETTCAP-based detection for OSC52 terminal support
- OSC52 is now preferred over traditional clipboard tools when available
- Supports modern terminal emulators (iTerm2, Windows Terminal, Alacritty,
kitty, wezterm, foot, and others)
- Detection uses DCS + q sequence to query the 'Ms' capability
- Results are cached in JULIA_OSC52_SUPPORTED environment variable
- Falls back to traditional tools if OSC52 is not supported
- Only shows error if both OSC52 and traditional tools fail
OSC52 is preferred because it works seamlessly over SSH and in remote
environments where traditional clipboard tools may not be available.
Note: tmux users may need to configure `set-clipboard on` for OSC52 to work
properly. See tmux/tmux#4275 for details on tmux clipboard limitations.
Fixes #60145