question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ANSI OSC 52 support?

See original GitHub issue

ANSI OSC 52 is a sequence to transport some data from remote console app to client’s clipboard. For example, tmux can use it on remote side, and xterm (terminal app), Windows terminal and a number of others – on client side. It would be very convenient to have such a feature in xterm.js. Here is a simple test which sends a string from remote to local clipboard (taken here): printf "\033]52;c;$(printf "%s" "blabla" | base64)\a"

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:17
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Tyriarcommented, Aug 12, 2022

@YingboMa as with anything where the clipboard is touched we want to make sure there aren’t any security concerns (if you log into a malicious server, it could read your clipboard which may have a password in it?), we would need some API to plug the clipboard detection code in anyway I think so that would probably be solved by a warning on the API. Other than that potential issue, it just needs someone to come and help implement it.

1reaction
jaracocommented, Dec 7, 2021

Isn’t it worth to assume that since we are selecting text here in xterm session, we have a focus right now? Focus will be lost in situations like some “mirroring” of terminal output but I don’t think this is 1) majority of cases and 2) we should manipulate with clipboard in these situations…

OSC 52 doesn’t mean text is selected. It means the remote process has emitted this sequence. That could happen from a process that’s running, such as sleep 30; printf "\033]52;c;$(printf "%s" "blabla" | base64)\a". No selection necessary, and the terminal could easily be out of focus by the time the sequence is reached.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A guide on how to copy text from anywhere, including through ...
TL;DR: OSC52 is an ANSI escape sequence that allows you to copy text into your system clipboard from anywhere, including from remote SSH ......
Read more >
Support for ANSI OSC 52? · Issue #206 · realh/roxterm - GitHub
Does ROXTerm currently supports ANSI OSC 52 escape sequence? I currently can't copy/yank things from a remote server via SSH + tmux running...
Read more >
Copy from Remote Server to Local Clipboard via OSC 52 in ...
Recently, I have found out the OSC 52 terminal sequence, which is really useful when we want to copy text from remote to...
Read more >
Does Konsole support allowWindowOps (aka ANSI OSC-52)
i am using tmux and ssh to access remote servers using konsole i am trying to enable the ability to copy text from...
Read more >
Does urxvt support the OSC52 escape sequence?
urxvt/ext/52-osc; Source it in urxvt by adding the following line to your ~/.Xdefaults configuration file: URxvt.perl-ext-common: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found