beeyeas / shellinabox

Automatically exported from code.google.com/p/shellinabox
Other
0 stars 0 forks source link

Clipboard not integrated with client operating system #39

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Love the project! This is a minor gripe that may not have an easy (any?)
solution.

What steps will reproduce the problem?
1. Copy text from another application
2. Right click in the shellinabox console
3. Paste option is disabled

What is the expected output? What do you see instead?
Paste option is enabled and allows me to paste the contents of my system
clipboard.

What version of the product are you using? On what operating system?
Server: shellinabox-2.10 on Debian Testing (armel)
Client: Firefox 3.5 on Windows XP

Please provide any additional information below.
If it is not possible to integrate the copy/paste options in the
right-click menu with the operating system's clipboard, consider this
possible solution: Don't hijack the Common User Access
(http://en.wikipedia.org/wiki/Common_User_Access) shortcuts (e.g.
Shift+Ins). Instead leave them to the interpretation of the web
browser/operating system.

Original issue reported on code.google.com by taylor.j...@gmail.com on 4 Dec 2009 at 9:59

GoogleCodeExporter commented 8 years ago
This is a very tricky problem. For security reasons, JavaScript does not 
typically have 
access to the system clipboard.

There are various work-arounds (some them are already implemented in 
ShellInABox), that 
on some platforms give limited access to the clipboard. But in practice this is 
a hard 
problem to solve. And it never quite works seamlessly.

I have some ideas that I want to try out at some point. But for now, you will 
have to 
live with the internal clipboard (i.e. you can copy and paste within 
ShellInABox, but 
not exchange data with any other application). And even going forward, I might 
not be 
able to fix this completely.

I'll keep this issue open for a while, in case some of my experiments show that 
I can 
improve the user experience -- however gradually. Thanks for reporting this 
issue.

Original comment by zod...@gmail.com on 4 Dec 2009 at 10:19

GoogleCodeExporter commented 8 years ago
This is a bit of a hack, but their test seems to work for me in FF 3.5, Flash 
10.0 r42:
http://code.google.com/p/zeroclipboard/

Or maybe use a Java applet?
http://www.javaworld.com/javaworld/javatips/jw-javatip61.html

Other option is maybe making use of HTML5 drag and drop support?

Thoughts?

Original comment by taylor.j...@gmail.com on 12 Dec 2009 at 2:30

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
what about having a seperate "tab" with a form that you can paste text into and 
then
click a submit button and it submits that text to the shellinabox clipboard?

Original comment by pspsam...@gmail.com on 27 Mar 2010 at 12:26

GoogleCodeExporter commented 8 years ago
anyterm's approach is to allow the user to click a control that pops up an 
input box 
to allow the use of the browser's mechanism for pasting.

http://anyterm.org/

Original comment by gurdas...@gmail.com on 30 Mar 2010 at 11:21

GoogleCodeExporter commented 8 years ago
I would also like to see a way to input and output data into the system 
clipboard.
Best way would be a context menu option which can send and retrieve data from an
input box, like anyterms way. But maybe looking nicer with an jQuery Overlay or
something like that.

Hope to see this feature soon!

Original comment by Chrischt...@gmail.com on 11 May 2010 at 7:46

GoogleCodeExporter commented 8 years ago
Any update on this? HTML5 drag and drop support seems like a simple first step. 
I'd be happy to test out any alpha versions...

Original comment by taylor.j...@gmail.com on 22 Jul 2010 at 1:10

GoogleCodeExporter commented 8 years ago
This is the only reason I sometimes still need to SHH directly instead of using 
Shell in a Box.

The simple solution suggested by Chrischtian doesn't look so hard to implement 
and OK to live with.

Hope to see any update on this issue soon, too.

Original comment by renat...@gmail.com on 12 Aug 2010 at 2:53

GoogleCodeExporter commented 8 years ago
I'm with everyone else on this.  I LOVE this tool, but myself and my users 
really need this function.  Hope to hear something soon!

Original comment by d.the.d...@gmail.com on 16 Sep 2010 at 3:47

GoogleCodeExporter commented 8 years ago
Here is a quick proof-of-concept patch against the current SVN head that adds 
support for dragging and dropping text into a shellinabox session if the 
browser supports HTML5 drag-and-drop. It has only been tested with 
shellinabox/demo/demo.html

Original comment by taylor.j...@gmail.com on 22 Sep 2010 at 5:48

Attachments:

GoogleCodeExporter commented 8 years ago
thanks a lot for that but i tought is still something wrong when i vim a new 
file,
anyhow ,thanks ,i wanna you developed it to a full ssh terminal
thanks again

Original comment by hepin1989 on 1 Dec 2010 at 5:14

GoogleCodeExporter commented 8 years ago
I'm not quite sure I follow what your problem is. I just tried dragging some 
text into a shellinabox terminal session with vim in the foreground. Worked 
nicely. This is with the patch applied to a "real" installation of shellinabox 
on Ubuntu 10.04.

Maybe I should better explain how it works: Just highlight some text in another 
window then drag that highlighted text into the shellinabox browser window. 
Note that not all applications support dragging highlighted text. Any browser 
should support this, which is a common use case for me and probably others.

Original comment by taylor.j...@gmail.com on 1 Dec 2010 at 6:18

GoogleCodeExporter commented 8 years ago
To make it clear.  You can highlight, go to edit->copy and it will copy fine.  
What does not work is if you highlight right click copy.  That does not send to 
the OS clipboard, but it will allow you to right click paste inside the window. 

Original comment by d.the.d...@gmail.com on 1 Dec 2010 at 7:35

GoogleCodeExporter commented 8 years ago
Yes, copying text out of a shellinabox terminal session is already possible. My 
patch is currently the only way to get text *into* a shellinabox terminal 
session.

Original comment by taylor.j...@gmail.com on 1 Dec 2010 at 7:45

GoogleCodeExporter commented 8 years ago
aha,thanks alot ,zod..

Original comment by hepin1989 on 4 Dec 2010 at 2:00

GoogleCodeExporter commented 8 years ago
One possible solution
a) Open some site like http://www.pastebin.com and post your text
b) Use wget inside the shell if ssh to download the snippet 

Other solutions 

a) Use your own server (simpler and safer) for pastebin 
b) Use some kind of remote control automation (cnee or something on Linux)

Original comment by ramkumar...@gmail.com on 9 Dec 2010 at 3:45

GoogleCodeExporter commented 8 years ago
This is the only thing keeping me from using shellinabox. If true copy, paste 
becomes available and works dependably, I will switch to using shellinabox full 
time. It's great otherwise!

Original comment by chre...@gmail.com on 15 Dec 2010 at 8:06

GoogleCodeExporter commented 8 years ago
Firefox users can avail themselves of the add-on "AllowClipboard Helper", which 
will add a policy override for clipboard access to a Firefox configuration file 
on a per site basis. The only "problem" is that it's necessary to use the mouse 
to select Edit/Paste from the Firefox menu (since the alt-e key is intercepted 
by the shellinabox.) 

A second workaround is AutoHotKey on Windows and Autokey on Linux. These 
keyboard macro utilities stuff clipboard contents into the keyboard directly 
(as if typed.) An added benefit of these solutions might be the ability to 
create other sorts of scripts to automate various server processes on the 
client/browser side. 

By the way, Autokey is written in Python and uses Python as its scripting 
interface, so that its capabilities are pretty much open-ended. I'm not sure if 
there's anything similar for Windows.

Original comment by david2an...@gmail.com on 18 Jan 2011 at 3:11

GoogleCodeExporter commented 8 years ago
Solution:
Use the browser's Edit->[Copy|Paste] menu to copy and paste from/to the 
application as opposed to using the shellinabox console menu via right click.

Original comment by abufatim...@gmail.com on 17 Aug 2011 at 5:25

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Wow, this does work now (in both Chrome-13/Linux and Firefox-5/Linux). I know I 
tried this before and was only able to copy data _out_ of a shellinabox session 
using this method. The only way I was ever able to get data to paste _into_ a 
shellinabox session was with my patch. Apparently browser upgrades have fixed 
this issue!

I think the drag-and-drop patch should still be considered though, it can be 
very useful in certain work-flows.

Original comment by taylor.j...@gmail.com on 17 Aug 2011 at 6:28

GoogleCodeExporter commented 8 years ago
Mint, thanks for announcing that it works! You are absolutely right... I'm 
using Chrome 15.0.856.0 (Developer Build 97128) and it works great.

Thanks again taylor :)

Original comment by chre...@gmail.com on 17 Aug 2011 at 6:31

GoogleCodeExporter commented 8 years ago
Here is a simple patch that prompts the user to enter the text he'd like to 
paste.
It is not integrated to the OS clipboard because to be honnest I've never seen 
any such hack work reliably among browsers, but at least it's a quick way to 
transfer text.

It adds a menu entry in the context menu "Paste from browser"

Original comment by decoy113...@gmail.com on 7 Mar 2012 at 12:25

Attachments:

GoogleCodeExporter commented 8 years ago
Patch applied to 2.11.

Original comment by beewoo...@gmail.com on 31 Mar 2012 at 7:13

GoogleCodeExporter commented 8 years ago
Any chance drag-and-drop will make it in? Are there changes that need to be 
made to get the patch accepted?

Original comment by taylor.j...@gmail.com on 1 Apr 2012 at 12:55

GoogleCodeExporter commented 8 years ago
Path for html5_drop_support applied to 2.11.

Original comment by beewoo...@gmail.com on 1 Apr 2012 at 1:55

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Going forward it should be perfect if one could copy/paste between shellinabox 
terminal and os clipboard as it is with standard terminal. I am not a 
programmer so I do not know how much effort it requires though.

But definitely this would make shellinabox top killer app:-) 

Original comment by pafcio...@gmail.com on 16 Jun 2012 at 4:11

GoogleCodeExporter commented 8 years ago
Excellent product!

Me, too, using Google Chrome, am missing the ability to paste plain text into 
the command window.  I can do it through Microsoft Internet Explorer 8.

Original comment by tepoo...@gmail.com on 9 Jul 2012 at 5:45

GoogleCodeExporter commented 8 years ago
Pasting works for me in Chrome, but no Firefox, using Ctrl+Shift+V (I'm using 
Windows).

Original comment by gomez...@gmail.com on 29 Aug 2012 at 7:23

GoogleCodeExporter commented 8 years ago
Cool! I don't know know why I didn't think to try that keyboard shortcut
before.

For me on Linux (EL6.1 derivative), it works on Chrome 21 but not on
Firefox 11.

Original comment by taylor.j...@gmail.com on 29 Aug 2012 at 9:24

GoogleCodeExporter commented 8 years ago
I'm using this patch in 2.11 and it makes things a lot nicer.

However, one issue that I have is that it looses all formatting in the process.

If I past in a list of names, what appears in the shell is all those names with 
the newlines replaced by spaces.

Is there any way to preserve newlines, tabs, etc in this process?

Original comment by david.eu...@gmail.com on 1 Oct 2012 at 11:23