extrawurst / gitui

Blazing 💥 fast terminal-ui for git written in rust 🦀
MIT License
18.33k stars 562 forks source link

Add OSC52 Support #2366

Open ikey4u opened 1 week ago

ikey4u commented 1 week ago

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.

extrawurst commented 1 week ago

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