-
-
Notifications
You must be signed in to change notification settings - Fork 570
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 on Mobile #458
Comments
How to you paste text on iOS, never did that before. Is this the same as on Android where you hold the finger and system popup with paste select all, came up? I believe this will be the same on Android. |
It will be problematic, but I think it will probably be possible to have paste and copy on mobile in same time. It will require completely new implementation though, using content editable + hiding the caret. This is how Codemirror make it work on mobile, but he don't use custom cursor on content editable. This will be challenging to match content editable cursor with terminal cursor. And copy or paste will only work for command line - you will be able to hold finger only on command line - NOTE to self: to hide the cursor: |
Thank you for the acknowledgement of the issue. Yes, I believe that the mechanism for copy, paste, select all, etc. is the same on iOS and Android. I have started experimenting with some workarounds using things like the Clipboard API, and keep seeing it mentioned that iOS makes it difficult to programatically access the clipboard for security reasons, though other than things like that it would seem that support for paste in Android should theoretically translate to support in iOS. Being able to paste into the command line would be wonderful. If anything comes from my fiddling with workarounds, I'll report back. |
I've forget to write, the code is working on Desktop (with contentedtiable) but still don't on Android. It's in new expermimental branch. |
A super ugly but 100% working idea would be to toggle a real input or open a browser prompt on mobile via a button. JuiceSSH (a SSH App) dies this with the most used keys like tab, strg/cmd and so on. |
@Gummibeer this can be easily implementation outside of the library, but if you want something like this and terminal don't allow this I can add some option to make this easier. Still I will want content editable paste implemented, but I don't know if this will be usable if not I'll mark this issue as wont fix, but I will try to make it work. |
I think it's doable, I've created POC with input and dummy content editable on top of normal text and it seems to work. I only need to incorporate this into terminal will create new code that remove the old one since that one was using contenteditable on .cmd and you where able to delete prompt because you can't prevent default input event. But with dummy content editable that sit on top of terminal that is also invisible ( |
The POC can be seen here https://jcubic.pl/x.html |
Forget to mention that version on experimental branch will never work on mobile because input event is not cancelable so it's possible to delete prompt with keyboard on Android. |
It's only POC for paste, cursor is always at the end. It should work correctly when added to terminal. I hope the matching of terminal cursor and android cursor will be possible. |
It's been a while (more then a year) but I finally added mobile paste, after adding touch scroll for less (so you can scroll wikipedia articles on 404 page on mobile). |
Upfront: This is a fantastic piece of software... It is a lot of fun to work with and for the most part it has been working exceptionally well.
Although, there doesn't seem to be a way to paste text into a jQuery Terminal cursor line with a browser running on iOS (Firefox, Safari, or Chrome on iOS 12.1.2). Is this an erroneous assumption?
(An increasingly complicated route has begun in trying to circumvent this seeming limitation, though confirmation that this is actually an issue before going further down the road is probably wise, as a work-around might already be known.)
Loading jQuery Terminal without its CSS —thus exposing the raw inputs—allows an ability to paste and parse text in the expected ways, though it would be fantastic if the same affordances were offered in 'proper' emulation.
The primary use case is pasting complex passwords into jQuery Terminal's
login
feature.The text was updated successfully, but these errors were encountered: