Where does the bug appear (feature/product)?
Cursor CLI
Describe the Bug
When running Cursor Agent CLI on a Linux devbox through a remote terminal bridge, /copy last message does not copy the assistant response back to the macOS host clipboard.
This is not a Herdr topology issue. Herdr is launched correctly from the macOS host with --remote, so remote terminal clipboard writes can be bridged back to the Mac if the remote process emits OSC52. Herdr-native selection copy works, and OSC52 clipboard sequences from the remote shell are the correct mechanism for this topology.
The problem is Cursor Agent CLI’s Linux clipboard behavior. In a headless SSH session, Cursor appears to check for Linux GUI clipboard availability via WAYLAND_DISPLAY / DISPLAY, then gives up when neither exists. It does not emit OSC52 and does not provide a configurable clipboard command, so the terminal bridge has nothing to forward.
Environment
- Host machine: macOS
- Remote/devbox: Linux
- Terminal/mux: Herdr launched from macOS with
herdr --remote devbox - Cursor Agent CLI runs inside the remote Linux Herdr pane
- Remote session is headless over SSH: no
DISPLAY, noWAYLAND_DISPLAY
Related Public Reports
-
Cursor CLI clipboard fallback/config gap:
https://forum.cursor.com/t/cursor-cli-clipboard-fails-in-container-environment-despite-xclip-xel-being-present-can-we-fall-back-to-them/158413 -
Cursor CLI raw output
/copyfeature discussion:
Copy Cursor CLI's raw output -
Cursor OSC52 terminal clipboard tracking, separate but related:
Cursor integrated terminal corrupts UTF-8 OSC 52 clipboard text from tmux
Steps to Reproduce
-
On macOS, start a Herdr remote session:
herdr --remote devbox -
In the remote Linux pane, confirm it is a headless SSH/remote terminal session:
env | grep -E 'SSH_CONNECTION|DISPLAY|WAYLAND_DISPLAY'Expected shape:
SSH_CONNECTION=... # no DISPLAY # no WAYLAND_DISPLAY -
Start Cursor Agent CLI in that pane:
agent -
Ask any prompt that produces a response.
-
Run:
/copy last message -
Try pasting on the macOS host.
Actual Result
The latest assistant response is not copied to the macOS host clipboard.
Expected Behavior
In a headless SSH/remote terminal session, Cursor Agent CLI should copy via OSC52, so terminal bridges such as Herdr, tmux-compatible terminals, iTerm2, etc. can forward the clipboard write to the local host.
Expected architecture:
cursor-agent /copy
-> emits OSC52 clipboard sequence
-> terminal bridge observes OSC52
-> macOS host clipboard is updated
Current behavior appears to be:
cursor-agent /copy
-> checks Linux GUI clipboard env
-> no WAYLAND_DISPLAY/DISPLAY
-> gives up
-> emits no OSC52
-> host clipboard is not updated
Why This Matters
Remote/headless terminal sessions are a core Cursor Agent CLI use case. Linux GUI clipboard checks are not sufficient there. The standard terminal-native mechanism for copying from a remote TTY to a local clipboard is OSC52.
Requested Fix
Add one of:
- OSC52 fallback when running in a TTY/SSH session and native clipboard commands are unavailable.
- A configurable clipboard command, e.g.
cursor-agent.clipboardCommand, so users can set an OSC52 helper. - Both.
Operating System
Linux
Version Information
│ CLI Version 2026.06.24-00-45-58-9f61de7
│ Model Opus 4.8 300K Extra High
│ OS linux (x64)
│ Terminal unknown
│ Shell zsh
Does this stop you from using Cursor
No - Cursor works, but with this issue