alacritty / alacritty

A cross-platform, OpenGL terminal emulator.
https://alacritty.org
Apache License 2.0
56.06k stars 3.01k forks source link

expand OSC52 string before redirecting to file? #8042

Closed jrmd54 closed 4 months ago

jrmd54 commented 4 months ago

Hello,

I am trying to use the OSC52 feature of alacritty to automate some of my workflow on remote servers.

The following bash command works and put the string 'totoro' in my clipboard.

echo totoro | xargs echo -n | echo -en "\x1b]52;c;$(base64 -w0)\x07"

But i get mixed results when using OSC52 to perform a paste from clipboard:

The command echo -e "\x1b]52;c;?" works and displays 'dG90b3Jv' (the base64 encoding of 'totoro')

However if the result of the previous command is piped to another command or a file, the input has not been expanded by OSC52.

For example: echo -e "\x1b]52;c;?" > file && vim file displays '^]52;c;?' as the file content, instead of 'dG90b3Jv'

Is there a way to redirect the expanded string of OSC52 paste instead?

Thank you very much for your help

chrisduerr commented 4 months ago

Because that's not how escape sequences work. The response is sent to your shell.