isontheline / pro.webssh.net

iOS / iPadOS / macOS SSH Client
https://apps.apple.com/us/app/id497714887
MIT License
321 stars 46 forks source link

Ability to copy output to clipboard #717

Closed mbierman closed 2 years ago

mbierman commented 2 years ago

Feature description

I often use pbcopy on the mac to grab command output to the clipboard.

This can be used with webssh too via: xclip -sel clip. For example:

cat filename | xclip -sel clip

but currently this error is given:

Error: Can't open display: (null)

This explanation (with 56 votes) seems to address it, but I am not sure how to put this into effect with Web SSH?

This will require webssh to support X11 Forwarding which would allow copying output of a command to the clipboard!

Screenshots / Draws

isontheline commented 2 years ago

Thank you @mbierman 🙏

isontheline commented 2 years ago

For @isontheline :

iTerm2 is asking to allow access to clipboard :

Image

isontheline commented 2 years ago

Hello @mbierman 👋

As I can't implement X11 Forwarding inside WebSSH - yet - I have implemented OSC 52 Terminal Sequence (https://chromium.googlesource.com/apps/libapps/+/a5fb83c190aa9d74f4a9bca233dac6be2664e9e9/hterm/doc/ControlSequences.md#osc)

In order to copy some data to your macOS / iOS clipboard from the terminal you will need to use this for example : echo "WebSSH is awesome!" | wshcopy cat filename | wshcopy

wshcopy command can be installed on your servers using : pip3 install webssh-sh

Hope this will stick to your need

isontheline commented 2 years ago

I've also added documentation about this feature here : https://webssh.net/documentation/help/howtos/copying-text-to-clipboard-from-terminal/