ekzhang / sshx

Fast, collaborative live terminal sharing over the web
https://sshx.io
MIT License
5.97k stars 187 forks source link

[BUG] Cannot copy content into clipboard inside web browser #77

Open DawnMagnet opened 7 months ago

DawnMagnet commented 7 months ago

Whether Ctrl+C or Ctrl+Shift+C is unavilable inside browser

jack9603301 commented 6 months ago

sshx's terminal does not support copy and paste at all, can it be supported?

ekzhang commented 6 months ago

Hey, Cmd+C and Cmd+V work for me on macOS / Chrome. Do you know which operating system and browser that copy/paste is unavailable in? I can see if I can reproduce and develop the appropriate change.

jack9603301 commented 6 months ago

Hey, Cmd+C and Cmd+V work for me on macOS / Chrome. Do you know which operating system and browser that copy/paste is unavailable in? I can see if I can reproduce and develop the appropriate change.

Operating system, customized system based on Linux from scratch Browser chromium Wayland environment

Other web pages can be copied normally, and the chat window can also be copied, but the terminal of sshx can not be copied at all, but can be pasted.

ekzhang commented 6 months ago

Thanks, if anyone else wants to chime in feel free! So far it sounds the keyboard shortcut is working on macOS but not on Linux.

jack9603301 commented 6 months ago

Thanks, if anyone else wants to chime in feel free! So far it sounds the keyboard shortcut is working on macOS but not on Linux.

When will it be resolved?

xiebruce commented 6 months ago

I test it on windows, I can paste commands into the web terminal, but can not copy contents in the web terminal and paste it into other place

ekzhang commented 6 months ago

Hi @xiebruce, what is your Windows version and browser version?

xiebruce commented 6 months ago

Hi @xiebruce, what is your Windows version and browser version?

Actually I'm using macOS and it works fine, I can paste contents into the web terminal or copy contents out from the web terminal.

And the Windows(x86_64) is installed in parallels desktop on my Mac(Intel cpu), here is the version:

jameszhou02 commented 6 months ago

Just tested on Windows, Ctrl+C sends a SIGINT and Ctrl+Shift+C opens up inspect element.

Version: Windows 10 Home Version Number: 22H2 Chrome: Version 122.0.6261.69 (64-bit)

xiebruce commented 6 months ago

Hi @xiebruce, what is your Windows version and browser version?

Actually I'm using macOS and it works fine, I can paste contents into the web terminal or copy contents out from the web terminal.

And the Windows(x86_64) is installed in parallels desktop on my Mac(Intel cpu), here is the version:

  • Version: Windows 10 Professional
  • Version Number: 22H2
  • OS Internal Version: 19045.4291
image

Oh, the browser that I use on Windows is: Edge 124.0.2478.67 (64bit)

jameszhou02 commented 6 months ago

Based on normal windows terminal behavior, this seems about the same. Only difference is Ctrl+V allows pasting which doesn't seem to work in sshx.

My guess is that it has to do with how Ctrl in windows terminals is reserved while in Mac, the default is also Ctrl but there's Cmd for copy paste instead.

xiebruce commented 6 months ago

Hi @xiebruce, what is your Windows version and browser version?

Actually I'm using macOS and it works fine, I can paste contents into the web terminal or copy contents out from the web terminal. And the Windows(x86_64) is installed in parallels desktop on my Mac(Intel cpu), here is the version:

  • Version: Windows 10 Professional
  • Version Number: 22H2
  • OS Internal Version: 19045.4291
image

Oh, the browser that I use on Windows is: Edge 124.0.2478.67 (64bit)

Oh, sorry, I forgot to tell you that I run the sshx on macOS(not windows), and then visit the link on Windows and test it.

nslieske commented 6 months ago

Control-shift-c does not work at all Control-shift-v works great Right click, no option to copy or paste text

Chrome Version 124.0.6367.91 (Official Build) (64-bit)

noah@zn210:~/bin$ cat /proc/version Linux version 6.5.0-28-generic (buildd@lcy02-amd64-001) (x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0, GNU ld (GNU Binutils for Ubuntu) 2.41) #29-Ubuntu SMP PREEMPT_DYNAMIC Thu Mar 28 23:46:48 UTC 2024

Same with Debian Bookworm.

I do not see any way to copy in my environment with the mouse, so I revert to vi commands for copy.

gregor160300 commented 6 months ago

On Fedora 40 with Brave browser Control-shift-v works perfectly all the time for pasting. Control-shift-c opens the command panel instead. Trying to copy with right click thinks the text is an image. Firefox works better, there at least the right click option works.

nslieske commented 6 months ago

Firefox works fine for copy & paste on inux version 6.5.0-28-generic (buildd@lcy02-amd64-001) (x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0, GNU ld (GNU Binutils for Ubuntu) 2.41) https://github.com/ekzhang/sshx/pull/29-Ubuntu SMP PREEMPT_DYNAMIC Thu Mar 28 23:46:48 UTC 2024

gregor160300 commented 1 month ago

On Firefox for me this extension works: https://addons.mozilla.org/en-US/firefox/addon/ctrl-shift-c-should-copy/