gitui icon indicating copy to clipboard operation
gitui copied to clipboard

Add OSC52 Support

Open ikey4u opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe.

I do development on a remote server using ssh, I love gitui and use it daily on my remote server. it seems that gitui uses xsel on Linux to copy text, but in my case it will give error likes:

copy to clipboard error: 
`"xsel"`: /usr/bin/xsel: Can't open display: (null)  
 Inappropriate ioctl for device

This error is caused that I do not forward X11 when login into the server using ssh. We know that gitui does not need to run any graphics since it works great on terminal without X on Linux, and the error will mislead the user.

As a result, I think gitui should have a better solution to support text copy.

Describe the solution you'd like

I hope that gitui will support OSC52 encoding. This encoding is supported by many terminals, for example wezterm, iterm. OSC52 supports you copy text from remote server to your clipboard of local machine.

Additional context

vim has a plugin vim-oscyank to support OSC52, it should be a good reference implmentation.

ikey4u avatar Sep 23 '24 02:09 ikey4u

more info on OSC52 here: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands

extrawurst avatar Sep 24 '24 07:09 extrawurst