fix(tui): support copying over ssh with set-clipboard on tmux config - #30472
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found two related PRs that are worth reviewing:
These PRs are related in that they all address OSC52 clipboard functionality, though they target different scenarios (tmux vs screen, and different output approaches). PR #30472 (the current PR) is specifically focused on fixing tmux's |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
set-clipboard onset-clipboard on tmux config
set-clipboard on tmux configset-clipboard on tmux config
533aaaa to
a9093dd
Compare
set-clipboard on tmux configset-clipboard on tmux config
set-clipboard on tmux configset-clipboard on tmux config
a9093dd to
695a311
Compare
695a311 to
d8e561e
Compare
8c7098a to
bff21b8
Compare
bff21b8 to
6117315
Compare
6117315 to
5f7d102
Compare
|
While simple this pr sends multiple of the |
in what case would a user be using tmux passthrough but not i'm fine not double-sending the sequence; i only proposed that so it would be easier to accept the PR on the grounds of backwards compatibility. i've modified it to only send one, so now it's a one-liner |
5f7d102 to
07cfcfb
Compare
Yeah, i buy that. |
is that sarcasm .. ? i genuinely cant tell o.o it really was my intention, as i even mentioned it in the PR description long before you reviewed
|
No, i meant i think your argument is sound and that this looks good. |
oh i see, sorry it's difficult to read the intentions on text; thank you for your time |
|
changed my mind and went back to y our original impl. |
|
I'll test this and merge tomorrow. |
anomalyco#30472) Co-authored-by: Simon Klee <hello@simonklee.dk>




Issue for this PR
Closes #25253
Closes #25252
Closes #19982
Closes #15907
Maybe Closes #36646
(possibly more?)
Type of change
What does this PR do?
the appropriate config for clipboard management in modern tmux versions is
set-clipboard: https://github.com/tmux/tmux/wiki/Clipboardthis PR makes it so that the copy to clipboard feature sends raw OSC52 when inside tmux, because that is what the
set-clipboardfeature is expecting (see tmux maintainer commentary: tmux/tmux#4214 (comment))because opencode currently sends the
\x1bPtmux;\x1bescape sequence when it recognizes theTMUXenv, theset-clipboardfeature does not function as-intended, forcing people to useallow-passthrough(which has its own security implications)How did you verify your code works?
i built the darwin and x86 binaries, and tested locally + on my remote by sending a prompt and then using the copy feature to copy the text. then, i pasted elsewhere to validate
set-clipboard ontmux config:allow-passthrough ontmux config:set-clipboard on)Screenshots / recordings
N/A
Checklist