theimpostor / osc

Access the system clipboard from anywhere using the ANSI OSC52 sequence
MIT License
55 stars 4 forks source link

copy/paste not working on remote screen sessions with kitty #8

Open jrmd54 opened 1 month ago

jrmd54 commented 1 month ago

Hello,

This tool is amazing; i integrated it in my workflow to copy/paste over ssh when the remote server has no X server.

I tested it with alacritty and kitty, and i found a small issue with kitty:

By using the osc binary, i am able to do the following: alacritty/kitty + screen : copy/paste alacritty/kitty + ssh : copy/paste

However, when opening a screen session after having connected to a remote server, copy/paste does not work if the used terminal is kitty.

Steps to reproduce:

open kitty terminal (tested with version 0.35.2) $ssh remote $screen $echo foo | osc copy # 'foo' is not copied to clipboard

Using alacritty (tested with version 0.13.2) does not reproduce the issue.

In both case, the verbose option produced the same output: 2024-07-24T14:34:43+02:00 DEBUG logging started 2024-07-24T14:34:43+02:00 DEBUG term name: screen.xterm-256color, aliases: [] 2024-07-24T14:34:43+02:00 DEBUG Setting screen dcs passthrough 2024-07-24T14:34:43+02:00 DEBUG Beginning osc52 copy operation 2024-07-24T14:34:43+02:00 DEBUG Ended osc52

(i assumed that since osc52 does not work within screen unless osc binary is used, the issue is related to osc and not kitty but i may be wrong)

jrmd54 commented 1 month ago

By running kitty from another terminal (to obtain debug logs), using 'osc copy' through ssh+screen gives the following errors: [157,734] [PARSE ERROR] Unknown DCS escape code: ␛]52;c;dG90bw== [157,734] [PARSE ERROR] Unknown char after ESC: 0x5c

(where ␛ corresponds to 0x241b)