[arch-general] Copy remote command server to clipboard
Hi, I like copy command return server in my clipboard with xclip. Is possible? For example: ssh 192.168.0.3 # pwd /home/archlniux (I like copy the command return to my clipboard archlinux desktop client) Thanks in advanced.
Hi Maykel,
ssh 192.168.0.3 # pwd /home/archlniux (I like copy the command return to my clipboard archlinux desktop client)
ssh 192.168.0.3 pwd | xsel -b -- Cheers, Ralph.
El vie., 23 ago. 2019 a las 11:23, Ralph Corderoy (<ralph@inputplus.co.uk>) escribió:
Hi Maykel,
ssh 192.168.0.3 # pwd /home/archlniux (I like copy the command return to my clipboard archlinux desktop client)
ssh 192.168.0.3 pwd | xsel -b
-- Cheers, Ralph.
Many thanks Ralph, it works, but... Is possible launch the command in my server? First: ssh 192.168.0.3 Second: pwd | xsel -b This is because I exec multiple same commands every day and copy the return manually with mouse is tedious!
Am 26.08.19 um 13:47 schrieb Maykel Franco via arch-general: ...
Many thanks Ralph, it works, but... Is possible launch the command in my server?
... Hello Maykel, You can run a local server that copies everything it receives to the clipboard. Then set up ssh remote port forwarding and send clipboard data to this port. You need either netcat (nc) or socat as well as xsel, xclip or wl-clipboard. Server: $ socat TCP-LISTEN:6789,reuseaddr,fork EXEC:"/usr/bin/xsel -ib" SSH: $ ssh user@example.com -R 6789:localhost:6789 Or set RemoteForward in your config. copy on server: $ uname -a | nc -c localhost 6789 or $ uname -a | socat -u - TCP:localhost:6789 https://gist.github.com/dergachev/8259104 -- Andy
On 26.08.19 14:30, ProgAndy wrote:
Many thanks Ralph, it works, but... Is possible launch the command in my server? […] You can run a local server that copies everything it receives to
Am 26.08.19 um 13:47 schrieb Maykel Franco via arch-general: the clipboard. Then set up ssh remote port forwarding and send clipboard data to this port.
How about these two alternatives: 1) Use “termite” as terminal and select and copy text with its selection mode¹ using either the keyboard or the mouse. 2) Run “ssh” from within “neovim” by using its terminal emulator² and select and copy text with the regular vim commands (visual mode, yank). Regards, Olli ¹ https://wiki.archlinux.org/index.php/Termite#Usage ² https://neovim.io/doc/user/nvim_terminal_emulator.html
El lun., 26 ago. 2019 a las 14:48, Olli (<olli@suruatoel.xyz>) escribió:
On 26.08.19 14:30, ProgAndy wrote:
Many thanks Ralph, it works, but... Is possible launch the command in my server? […] You can run a local server that copies everything it receives to
Am 26.08.19 um 13:47 schrieb Maykel Franco via arch-general: the clipboard. Then set up ssh remote port forwarding and send clipboard data to this port.
How about these two alternatives:
1) Use “termite” as terminal and select and copy text with its selection mode¹ using either the keyboard or the mouse.
2) Run “ssh” from within “neovim” by using its terminal emulator² and select and copy text with the regular vim commands (visual mode, yank).
Regards, Olli
¹ https://wiki.archlinux.org/index.php/Termite#Usage ² https://neovim.io/doc/user/nvim_terminal_emulator.html
Many thanks, it works.
On 11.09.19 16:30, Maykel Franco via arch-general wrote:
El lun., 26 ago. 2019 a las 14:48, Olli (<olli@suruatoel.xyz>) escribió:
How about these two alternatives:
1) Use “termite” as terminal and select and copy text with its selection mode¹ using either the keyboard or the mouse.
2) Run “ssh” from within “neovim” by using its terminal emulator² and select and copy text with the regular vim commands (visual mode, yank).
Many thanks, it works.
Out of curiosity: which option did you choose?
participants (4)
-
Maykel Franco
-
Olli
-
ProgAndy
-
Ralph Corderoy