-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Paste doesn't work #364
Comments
Thanks for opening this @goflatworld. I think I have spotted the bug and will get on top of this within the week hopefully. |
Thanks Parisk. Great to know that you have spotted the bug. Waiting for your solution. |
@goflatworld can you let us know if any of xterm.js' element parents use the Seems like this is causing an issue and misplaces the hidden textarea, so the right-click won't work.
From: https://developer.mozilla.org/en/docs/Web/CSS/position#Values Also, I am removing this from the milestone, as it will need more work than initially thought, in order to calculate appropriately the position of the hidden textarea on the user's right click. |
Hi Parisk, Below is all the HTML code I have (it is a PHP file). You can see that the CSS are from xterm.js. I suppose that they don't use transform? I also tried to search transform in these CSS. but did not see it.
The main.js is the code from xterm.js example, I modified it a bit. and it is as follow:
For the attach.js, I modifed a bit, the modified part is as below:
Would these modification cause any issue? |
@goflatworld these modifications do not seem like causing issues. OK, I put this in the 2.3.0 milestone, in order to find an appropriate solution for this issue. What would help though are the following details:
|
Hi Parisk, I tried Firefox on MAC the most. However I also tried IE, Chrome on Windows, Linux. None of them worked for me. The system is not in public domain yet, but you can test it via below:
-----BEGIN CERTIFICATE----- In IE, you need import it under "Trusted Root Certification Authority". Need do it via the IE "Internet options"->Content -> certificates. The certificate is not publicly signed because the DNS was registered by other party. that's why you need do above. We are working on different names but not now. Once above is done: Go to login username: demo@company1.com You can see "Dural" is green (if it is not green, please email me your prefered test time, I can make sure it is green), click it and then click "connect". You can test copy and paste in there. |
Basic paste works fine for me, but let me throw a monkey wrench into things. Use tmux to split the screen into two panes. Run something that repeatedly updates the display in one pane, such as top (I'm using htop). Now, try and cut text from either pane. What happens is that the screen update on one pane either deselects the text before you can cut it or it acts as if you started selecting from the top of the screen and selects multiple lines (I was going for one word). Update: just noticed #318 and #468 (likely dups), which is where this should have been noted. Sorry. |
@uudruid74 no prob. Indeed what you describe is a side-effect of not optimal rendering. The issue here is that the hidden textarea used for input is not positioned correctly in some cases. |
@parisk Getting more offtopic, but ... why would it need to be positioned at all? Aren't you just giving it focus and then stealing keyDown events with it? So, why would that have anything to do with the mouse? |
The This is also the reason we are using a |
Hi Parisk, I have upgraded the website. Now, you can reproduce the issue follow below steps: Go to Username: demo@company1.com Once you login, on the left pane, click "Menu->City->Stingray->Home Router" After that, a new window popup and states: "Press Enter to Start.". You can test copy and paste in this window. Thanks George |
any update? |
Do I need node.js to be able to use paste? |
No, you do not need node.js to paste. Node.js lives outside the browser, while the paste happens inside the browser :). |
I tried the demo application. When the demo server is active. I can paste to the terminal but when I stop the server, I can not paste to the terminal anymore. Do I need to write any special code on the server side to make copy and paste work? |
@goflatworld Here is what happens: The demo sends your inputs to a tty process that is spawned by the server. Any input that you make on the console is sent to the server, received by the tty process, then output from the tty process is generated (for example it will echo the characters you just typed or pasted), sent from the tty to the server to the demo frontend client, and then rendered by |
Thanks mofux. I get quite lost on this. So the demo doesn't echo locally and it only display message from server. This is exactly what my application also behaviors. but why my application can not paste even when my server is active? My client code has been pasted in previous post in the same thread. That code is a slightly modified demo client version. Is there anything wrong with my client code? |
Can you please shed some lights on whether the code is correct or not? |
No, there is a much simpler way to do things. Instead of listening for the
|
Great mofux! That fixed the issue after 8 months of wondering what am I doing wrong!... Thanks a lot for your great help. Cheers George |
\(^_^)/ |
Hi Thomas,
Paste works but I noticed that it doesn't paste "enter". Does it need special handling?
Thanks
George
On Wednesday, 23 August 2017, 22:34, Thomas Zilz <notifications@github.com> wrote:
No, there is a much simpler way to do things. Instead of listening for the key and paste events,
you should actually listen to the data event. This event is emitted whenever you type or paste in the terminal, and it already contains the correct, xterm compatible data (string):term.on('data', function(data) {
socket.send(data);
})
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
You mean |
Hi Daniel,
You are correct. I have found that paste works. Now I want to identify \n or \r\n in the text so that I can send this one by one to the server. Do you know a quick way to do it? I'll do my own research if you don't have one.
Thanks
George
On Friday, 25 August 2017, 1:27, Daniel Imms <notifications@github.com> wrote:
You mean \n or \r\n? Both should work as the text is filtered through this function: https://github.com/sourcelair/xterm.js/blob/6e9d60d76d6cfb3d279f9e58499ba62ca6af479c/src/handlers/Clipboard.ts#L23—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
The issue I opened in below link, it is not fixed yet. The issue is that when I right click the and choose "paste", it doesn't paste anything.
#344
The text was updated successfully, but these errors were encountered: