GitSquared / edex-ui

A cross-platform, customizable science fiction terminal emulator with advanced monitoring & touchscreen support.
GNU General Public License v3.0
40.9k stars 2.59k forks source link

[UI] [keyboard?] Provide copy and paste functions #37

Closed GitSquared closed 6 years ago

GitSquared commented 6 years ago

Currently you can't copy/paste something from/to the TTY.

GitSquared commented 6 years ago

Update:

"Copy" button: Use window.term.term.getSelection() "Paste" button: Use window.term.write(<data>)

Currently i'm kind of blocked on this because of a weird bug when selecting text after more than one page of TTY text has been printed (selection happens from the beginning of the screen instead of where i'm actually pointing at). Needs further research.

GitSquared commented 6 years ago

OK, bug fixed in 2d2ac17 - expect this issue to be closed soon (FINALLY)

GitSquared commented 6 years ago

OK, so, seems we're not there yet. DOM access to clipboard is experimental and not implemented on the current Chromium version bundled with Electron, meaning i can't really build my own copy/pasting solution or whatever.

State of things: You can copy and paste using the CTRL+C and CTRL+V keys. When the shell is not in a ncurses-style application (forget vim and nano). And it probably doesn't work for touchscreens.

Marking as "ahead of its time".

GitSquared commented 6 years ago

Damned, forgot i had a node process available. Shame on me.

GitSquared commented 6 years ago

:tada:

annogram commented 5 years ago

This still doesn't work for me on Ubuntu

GitSquared commented 5 years ago

@annogram Use Shift+Ctrl+C/V keyboard shortcuts.

unix4you2 commented 5 years ago

Hi there. This is not working for me with Ctrl+C Ctrl+V or the tradditional shortcuts for terminals like Shit+Ctrl+C or Shit+Ctrl+V Regards

GitSquared commented 5 years ago

@unix4you2 What version of eDEX are you using? This feature has been implemented for a long time now and I haven't heard of any issues with it. The shortcuts are indeed shift+ctrl+c/v, and you can use them either with your physical keyboard or the on-screen one.

unix4you2 commented 5 years ago

Hi @GitSquared I'm using the last version (eDEX-UI v2.1.0) in AppImage under Elementary (an ubuntu derivated). But i have the same problem in my office desktop (Xubuntu)

If I try to use that shortcuts under an standar terminal that works fine, but not under edex. And when I type it under edex I can see the keys pressed in the virtual keyboard.

Thanks for your time

GitSquared commented 5 years ago

@unix4you2 Does copying something from another window and pasting it into edex with the shortcut works?

unix4you2 commented 5 years ago

Nop. I tried to copy for example a simple command to install something from a web browser "yum -y install httpd" and try to copy that to edex using keyboard or mouse and doesnt work.

The only thing I can see different in the virtual keyboard (VK) is that:

Regards

GitSquared commented 5 years ago

The C or V not going on is because it's triggering the internal copy/paste functions instead of the regular keys.

Would you be willing to try and run edex from source to see if the issue has been resolved since v2.1? If you don't have node on your system, I can give you a prebuilt AppImage of the latest development version, but I'm afraid you will have to wait a bit.

unix4you2 commented 5 years ago

Yeah, I supossed that. The event of that keypressed is captured. But the method that should copy or paste the clipboard content (writting to the terminal) is not working. I dont have node here. If you want to share another AppImage I can wait and test it. Take your time and tell me if I can help in another way. Regards.

GitSquared commented 5 years ago

I will get back to you with a test build, and do some testing myself in the meantime. Thanks for reaching out.

unix4you2 commented 5 years ago

Hi @GitSquared an important info:

Copy and paste using Ctrl+Shit+C from eDEX to another application works fine. The problem is only when you copy from another app and try to paste into eDEX using Ctrl+Shit+V.

Regards.

unix4you2 commented 5 years ago

Please excuse me again... too many messages I sent but I found a temporally sollution.

I already tested and in the other combination or shortcut that you can use in another terminals and editor works fine to paste: Shift + Insert So people that have the problem with Ctrl+Shift+V can use that shortcut instead.

Regards.

GitSquared commented 5 years ago

@unix4you2 Interesting. Internally eDEX uses clipboardy to retrieve the system's clipboard content. Maybe that dependency is failing on Elementary..?

I use Debian myself and haven't had any issue with it, but maybe there is an additional package you need to install to make it work - i'm not sure. I'll look into it.

GitSquared commented 5 years ago

@unix4you2 Here's a test build from the latest dev branch.

unix4you2 commented 5 years ago

Hi @GitSquared two things:

1) I already tested the version that you shared to me. The problem continues but Shift + Insert works again so I will use that shortcut instead.

2) I searched for the package clipboardy and doesnt exists as a packeage under ubuntu. Should I install something more like nodejs or something to get that package in my system? Maybe the problem is that the package requieres that the user have nodejs or something similar installed before to get the utility that you use to get clipboard content. Because if you check the way to install it is using node package manager (npm) npm install clipboardy and I dont have (and dont like) to install npm.... maybe include the library in your AppImage.

Regards.

GitSquared commented 5 years ago

@unix4you2 Sorry, I wasn't clear enough; clipboardy is a Node dependency that is included inside eDEX, not something that you should install yourself.

I'm going to replace that component with another API, hopefully that will work better on your system. Test build incoming.

GitSquared commented 5 years ago

@unix4you2 This one should fix it.

unix4you2 commented 5 years ago

Hi @GitSquared

I already tested the new binary you shared to me and it works like a charm. Using the new API is working everything.

Anyway I will be using the Shift+Insert shortcut in the middle because I supose this change will be available in the next stable release, so I will wait for that.

Thanks for your time. Best regards.

GitSquared commented 5 years ago

@unix4you2 Glad we got this fixed. Thank you for your help, it will indeed ship in the next stable release.

RamDerp commented 5 years ago

hey man can you make it so you can use the short key to quit a command

GitSquared commented 5 years ago

@RamDerp ...what short key?