/copy fails after successful output in SSH session (regression in 0.116.0)
Resolved 💬 6 comments Opened Mar 22, 2026 by Pein2017 Closed Jul 21, 2026
💡 Likely answer: A maintainer (won-openai, contributor)
responded on this thread — see the highlighted reply below.
What version of Codex CLI is running?
0.116.0
What subscription do you have?
ChatGPT Pro
Which model were you using?
All models
What platform is your computer?
Linux x86_64 Ubuntu
What terminal emulator and version are you using (if applicable)?
SSH remote session (from local machine) → Ubuntu server Terminal: bash
What issue are you seeing?
Issue: /copy fails even after successful model output
Environment:
- Codex CLI version: 0.116.0
- OS: Ubuntu (remote)
- Access method: SSH into remote machine
- Terminal: (fill in if known, e.g. bash / zsh / tmux)
Reproduction steps:
- Start a fresh Codex CLI session
- Enter a simple prompt:
hi - Wait until the model output fully completes and CLI is idle
- Run
/copy
Expected behavior:
/copyshould copy the latest completed model output
Actual behavior:
- Error message:
/copy is unavailable before the first Codex output or right after a rollback
Notes:
- The model output is clearly visible and completed before running
/copy - No rollback or undo actions were performed
- This worked correctly in earlier Codex CLI versions (regression)
- Issue is reproducible consistently
Additional context:
- Running entirely in a remote SSH session (no local GUI clipboard)
- Unsure if related to TUI state sync or SSH environment handling
What steps can reproduce the bug?
Uploaded thread: 019d15a0-162b-78b1-8610-7ea7469cfd26
What is the expected behavior?
_No response_
Additional information
_No response_
6 Comments
Does it happen only for the first turn of messages? or does /copy not work in general?
I am experiencing the exact same issue on the newer version.
Environment:
Codex App Version: v0.117.0
Model: gpt-5.3 codex xhigh (Plus subscription)
Platform: Windows 11 running WSL (Ubuntu)
Like the OP, the error /copy is unavailable before the first Codex output or right after a rollback appears every time I try to use /copy after a generated response. It seems the CLI is failing to access the system clipboard properly in headless/subsystem environments like SSH and WSL.
I am also on a Plus subscription using version v0.117.0, and I am experiencing the exact same
/copyissue. The previous version was working perfectly fine for me.Note: I am not using SSH, WSL, or any remote/headless environment. I am running the CLI directly on my local machine. The
/copycommand was working initially on this version as well, but then it suddenly started failing with this error.My Environment:
@no1x0, it sounds like you might be seeing a different issue. You mentioned that it was previously working for you in 0.116.0. Can you confirm by downgrading? If that's the case, then it's likely that you're seeing a regression. The OP is not reporting a regression but rather a limitation in the current implementation. If you're seeing a regression, please open a new bug so we can track and prioritize it as such.
I dug through the current TUI
/copypath. I haven't reproduced this end-to-end locally because my local Cargo setup is currently blocked by unrelated mirror/dependency resolution issues, so this is source inspection only.What looks important is that
/copyfails before it ever reaches the SSH / OSC52 clipboard backend iflast_copyable_outputisNone. That cache is updated from completed plan output and, for normal assistant replies, mainly fromTurnComplete.last_agent_message.There are also existing TUI tests covering the case where assistant text was already rendered, but
TurnComplete.last_agent_messageis stillNone. In that case,/copyis expected to show the same "unavailable before the first Codex output..." message.So my current read is that this is probably upstream of the SSH clipboard layer. A visible reply can exist in the transcript while the "latest copyable output" cache is still empty. If
0.116changed some turn-completion path so the final visible reply is no longer propagated intoTurnComplete.last_agent_message, that would fit this symptom pretty well.So this looks more like a copy-state / final-message propagation regression than an OSC52-specific failure.
Merged PR #16966 addresses this. If you're still seeing related problems, please open a new bug report with repro steps.