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

[FEAT]: Support ANSI OSC52 as a "clipboard" for "Copy command" #82

Open
anku94 opened this issue Jun 24, 2024 · 0 comments
Open

[FEAT]: Support ANSI OSC52 as a "clipboard" for "Copy command" #82

anku94 opened this issue Jun 24, 2024 · 0 comments
Labels
enhancement New feature or request needs-triage needs to be reviewed

Comments

@anku94
Copy link

anku94 commented Jun 24, 2024

Describe the need

If using Copilot CLI on remote servers over ssh, xclip/xsel etc. are rarely available. In such environments, OSC52 sequences are a simple and convenient way to access clipboards.

I tried writing a proxy script to handle xclip -in -sel clipboard (which is what Copilot CLI calls), and was only partially successful.

echo -ne "\e]52;c;$(echo -n "$data" | base64)\a"

This does not work, as the output of this command is not written to stdout for a terminal emulator to access. The following works:

data=$(cat)
echo -ne "\e]52;c;$(echo -n "$data" | base64)\a" > $OSC52_TTY

if called using

export OSC52_TTY=$(tty)
gh copilot suggest "git branch"

It is a hack, and it would be much more straightforward for Copilot CLI to emit the sequence to stdout.

Thank you!!

@anku94 anku94 added enhancement New feature or request needs-triage needs to be reviewed labels Jun 24, 2024
@anku94 anku94 changed the title [FEAT]: Support ANSI OSC2 as a "clipboard" for "Copy command" [FEAT]: Support ANSI OSC52 as a "clipboard" for "Copy command" Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs-triage needs to be reviewed
Projects
None yet
Development

No branches or pull requests

1 participant