-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[terminal] Cmd + click doesn't work on iPad (iOS 12) #6320
Comments
Part of #3557. |
@akosyakov @vince-fugnitto @marcdumais-work Do you have any thoughts on making all Terminal links immediately clickable on touch devices? I personally believe that accidental link clicks are less likely with touch-screens than on desktop, and having some way to follow links there would be great. |
Hi @jankeromnes ,
Sounds reasonable. Is an iPad detected as "OSX" in the code above? If so is there a way to distinguish from a Mac laptop? Would it be possible and worth the trouble to do this generally for other devices similar to an iPad, like Android tablets? |
It might be worthwhile to attempt to debug and see what is happening, and also try out to see what happens when listening to |
Thanks a lot for your input, Marc and Vince!
I'm not sure how to detect these different platforms yet, but I agree that the "always-clickable terminal link" special case should apply only to tablets like iPad and Android, and not to laptops (even if they have touchscreens).
I already did some debugging (see top comment), and what's happening is that the click is detected, but not the modifier keys, so we currently ignore the link "taps". But you're right, maybe listening to |
👍 |
Update: I'm able to detect Terminal
Unfortunately, Here is the handler that XtermJS calls when a Terminal link is clicked or tapped (even when the link won't open): theia/packages/terminal/src/browser/terminal-linkmatcher.ts Lines 38 to 45 in 10d526f
Maybe we can correlate event times / targets / coordinates in order to known when the In my testing on iPad, here is the full sequence of events I see:
(In this run, all coordinates are exactly the same, but I've seen many cases where the touch and click coordinates are off by one, so some fuzzy-matching may be necessary.) |
Actually, with iOS 1.13, Cmd + click now works now on iPad if you have an external keyboard. |
Description
There is currently no way to click on Terminal links on iPad.
The
Cmd + click to follow link
tooltip does show up, but pressingCmd
on my external bluetooth keyboard and tapping the link doesn't work.Reproduction Steps
echo "https://theia-ide.org"
in a TerminalCmd
as indicated and click. It doesn't work.OS and Theia version:
master
Diagnostics:
The good news is that tapping on the link is detected, because this listener is being called:
theia/packages/terminal/src/browser/terminal-linkmatcher.ts
Lines 62 to 64 in 629240b
The bad news is that
isOSX ? event.metaKey : event.ctrlKey
is always false on iPad.In fact, I've tried to detect several different modifier keys, but pressing any of these on my iPad's external bluetooth keyboard is never detected by the event listener. I've tried:
event.altKey
event.metaKey
event.ctrlKey
event.shiftKey
event.getModifierState('Alt')
event.getModifierState('Control')
event.getModifierState('Shift')
event.getModifierState('CapsLock')
event.getModifierState('Fn')
event.getModifierState('Super')
event.getModifierState('Accel')
They're all
false
, always. And even on https://keycode.info/ it's quite hard to get theCmd
/Control
/Alt
/Shift
keys of my iPad keyboard detected.Maybe we should make Terminal links directly clickable on iPad? I think that would be a huge improvement over the current situation.
The text was updated successfully, but these errors were encountered: