Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support osc 52 in tty backend #1416

Closed
unxed opened this issue Nov 21, 2022 · 10 comments
Closed

Support osc 52 in tty backend #1416

unxed opened this issue Nov 21, 2022 · 10 comments

Comments

@unxed
Copy link
Contributor

unxed commented Nov 21, 2022

Microsoft have merged OSC 52 support for clipboard access to Windows Terminal. If far2l's tty backend support it, WSL far2l users will have much better experience.

microsoft/terminal#5823

Send 'far2l' to clipboard:
echo -en "\e]52;;ZmFyMmw=\a"

@unxed
Copy link
Contributor Author

unxed commented Nov 21, 2022

Duplicates #788 , #641

@unxed
Copy link
Contributor Author

unxed commented Nov 22, 2022

Some OSC 52 support charts:

https://github.com/jirutka/tty-copy#tty-copy
https://github.com/ojroques/vim-oscyank#vim-oscyank

Looks like iTerm2 also supports it

@unxed
Copy link
Contributor Author

unxed commented Nov 22, 2022

This script makes ANY terminal OSC52-compatible then using ssh connections:
https://github.com/matvore/pb52

(it's for Mac, but can be easily adopted for Linux. tested, working)

@elfmz
Copy link
Owner

elfmz commented Nov 22, 2022

if you have something beside this tiny tool - plz check if it (just merged) works as needed, for me it works with this tool (after changing to use xclip) but with some glitches - it seems it (or gnome terminal) echoes OSC sequence to screen

@unxed
Copy link
Contributor Author

unxed commented Nov 22, 2022

Tested in kovidgoyal's kitty (https://github.com/kovidgoyal/kitty/, binaries: https://sw.kovidgoyal.net/kitty/binary/), works as expected, great! Will ask to test in Windows Terminal people in far2l users telegram chat.

Meanwhile, shouldn't we also support it in far2l's internal VT?

@unxed
Copy link
Contributor Author

unxed commented Nov 22, 2022

Oh, there is some problem. Looks like there is a kind of limit of content length that can be written to clipboard such way.
Maybe it's kovidgoyal's kitty limitation, maybe far2l's. To reproduce, try to copy entire content of this file to clipboard in far2l --notty --nodetect with enabled OSC52 under kitty, download link above.

demo.txt

@unxed
Copy link
Contributor Author

unxed commented Nov 22, 2022

Oh, there is some problem. Looks like there is a kind of limit of content length that can be written to clipboard such way. Maybe it's kovidgoyal's kitty limitation, maybe far2l's. To reproduce, try to copy entire content of this file to clipboard in far2l --notty --nodetect with OSC52 on under kitty, download link above.

demo.txt

Not reproduced with pb52 script. Also not reproduced in st (it needs osc 52 to be specially enabled). Probably kovidgoyal's kitty limitation.

@unxed
Copy link
Contributor Author

unxed commented Nov 22, 2022

Ok, let's close this one and open new issue for internal VT's OSC52 support.

@unxed
Copy link
Contributor Author

unxed commented Nov 22, 2022

pb52 adopted for xclip:
https://github.com/unxed/pb52l

@unxed
Copy link
Contributor Author

unxed commented Oct 18, 2023

To enable OSC52, run

far2l --tty --nodetect

And then go to Menu -> Options -> Interface settings

[x] Use OSC52 to set clipboard data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants