I’ve been using Herdr to manage local and remote agent sessions, connecting to my Mac Studio with:
herdr --remote mac-studio OSC 52 clipboard copy worked perfectly in Herdr terminals and Cursor CLI, but not inside Codex CLI 0.157.1.
Getting Codex to use OSC 52 The remote session looked like:
COLORTERM=truecolor TERM=xterm-256color TERM_PROGRAM=ghostty There was no SSH_CONNECTION. Herdr isn’t SSH, but this also meant Codex didn’t recognise the session as remote.