0

I'm using Windows Terminal to access my Linux boxes and I have a need for copying data from the Linux console to the Windows host clipboard, it that possible?

More specific I run a .Net core application on Linux which need to copy a string to the clipboard.

MrCal
  • 305

2 Answers2

1

From the Linux shell:

printf $'\e]52;c;%s\a' "$(base64 <<<'hello world')"
MrCal
  • 305
1

I created this little script based on @MrCalvin brilliant answer:

# clipfile
#  - Sends a file into the windows terminal clipboard
printf $'\e]52;c;%s\a' "$(base64 ${1:?})"

Saves me loads of time copying files into clipboard for pasting into Windows apps.

mrkbutty
  • 111
  • 2