fix(clipboard): write OSC52 to /dev/tty instead of stdout#12129
Open
alse-sym wants to merge 1 commit intoanomalyco:devfrom
Open
fix(clipboard): write OSC52 to /dev/tty instead of stdout#12129alse-sym wants to merge 1 commit intoanomalyco:devfrom
alse-sym wants to merge 1 commit intoanomalyco:devfrom
Conversation
Fixes clipboard copy failing in terminal multiplexers like Zellij, tmux, and screen. These tools intercept OSC52 escape sequences written to stdout but do not forward them to the outer terminal. Writing to /dev/tty (or SSH_TTY when connected via SSH) bypasses the multiplexer's PTY layer and sends OSC52 directly to the terminal emulator. Falls back to stdout if /dev/tty is unavailable (e.g., on Windows). Fixes anomalyco#12082 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate Found:
This PR appears to address a related clipboard OSC52 issue with SSH compatibility. Since PR #12129 also handles SSH scenarios (using Recommendation: Check PR #9008 to determine if it's already solving this issue or if there are differences in approach (writing to |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/dev/ttyinstead ofstdoutto bypass terminal multiplexersSSH_TTYenvironment variable when connected via SSH/dev/ttyis unavailable (e.g., Windows)Problem
Clipboard copy fails in terminal multiplexers (Zellij, tmux, screen) because they intercept OSC52 sequences written to stdout and don't pass them through to the outer terminal.
Solution
Write directly to
/dev/ttywhich bypasses the multiplexer's PTY layer. This is how tools like lazygit and neovim handle clipboard operations in multiplexers.Fixes #12082
Test plan
🤖 Generated with Claude Code