googlecolab / colabtools

Python libraries for Google Colaboratory
Apache License 2.0
2.2k stars 722 forks source link

Copy Paste doesn’t work on iPad Chrome or Safari #1340

Open kechan opened 4 years ago

kechan commented 4 years ago

IPad Pro 2020, Apple magic keyboard (hardware).

Command C or V doesn’t work for cut paste with either Chrome or Safari

Bonecrusher707 commented 4 years ago

Exactly same set up, and doesn’t work for me either! Extremely annoying and makes it unusable! Please google take a look at this!

deganza commented 4 years ago

For me the same. I've tested it on different ipad's and ipad's Pro with different keyboards even with the new magic keyboard. Copy paste doesn't work either.

kechan commented 4 years ago

Can someone pls try this out on non apple tablet? I suspect our use case is not common enough (I.e. writing code on mobile devices) as a higher priority fix.

deganza commented 4 years ago

on a Chromebook it's working. Is this surprising?

kechan commented 4 years ago

on a Chromebook it's working. Is this surprising?

@deganza I think a fairer comparison will be Chrome browser in Android on a tablet (maybe Samsung).I just aint sure if chromebook is a laptop or a tablet (in terms of underlying OS). If I don't have to cut/paste, iPad+Magic KB is excellent. I like a "diversification" in input device here: mouse, trackpad, keyboard, touchscreen and the pencil. I could switch around and not get repetitive strain.

collinbentley1 commented 4 years ago

iPadOS checks for text selection when calling copy(_:) (see methods), and using the native UI is a prerequisite for accessing the clipboard, as of iPadOS 13.1 (link). Colab isn't using the native UI for accessing the clipboard, so this might be the stem of these issues. Microsoft CodeSpaces and code-server for VS have similar open issues here, and current workarounds involve server-side copy/paste (not helpful outside of Colab notebook), using a keyboard shortcut to expose the native UI (kind of like cmd+F, then use cmd+C to copy), or using methods within an iOS app to intercept copy/paste signals.

deganza commented 4 years ago

using a keyboard shortcut (kind of like cmd+F, then use cmd+C to copy) is not working

KR-78 commented 4 years ago

Same issue here, iPad + iOS 14 + magic keyboard, copying and cutting is not working at all, pasting pastes some text which has been copied from another app :(

abegehr commented 4 years ago

Copy and paste with cmd-c and cmd-v is working in the Chrome browser (from iOS App Store) on iPadOS 14.2 with Magic Keyboard sometimes, very inconsistently. I have not identified a pattern yet, but it does sometimes work.

NikitaGordia commented 4 years ago

does anyone care about this issue? or we have to feel pain every time when we want to copy-paste smth?!

kechan commented 4 years ago

@abegehr @NikitaGordia I continued to work with my iPad+MagicKB, despite the shortcomings. Here's what I further found after few weeks

A) cmd-c and v works if you cut/paste cell computational result, it just doesn't work for cell content. B) I used this hack if the cell content is just too long and error prune to retype 1) at the top of cell, enter '%%writefile tmp.py' and run. Rather than executing the content, this will write the content to a file on your disk 2) then in a new cell, run this: !cat tmp.py This will print the content out as cell result. Then u can use cmd-c to copy the content and paste it elsewhere.

This is very inconvenient. At other times, there are also intermittent failures if you switch to "Scratch" tab and back. I guess you care almost only if you do deep learning, own ipad+MagicKB and happen to use colab. Just don't know if that's a big enough set for google to care.

flavourabbit commented 3 years ago

any news on this? I think it's not a problem of using an external keyboard but of iPad OS's internet browsing. This is too painful!

tolgadiz commented 3 years ago

I hope someone is working on this.

parityviolation commented 3 years ago

Yes! Crazy i have the same problem on chrome safari and firefox. Thanks for the details above as to 'why' this is happening. It makes colabs broken for iPad coding as far as I'm concerned.

Piotru92 commented 3 years ago

Hey, actually I found the solution just by trying different key combination.

1.First just pick what you want to copy, you can use touch screen or this key combination: By clicking shift and arrows you can mark/highlight (when you add to shift+arrow other keys you can speed it up, like: shift+cmd+left/right [start-end line curosor position] then shift+up/down arrow [highlight whole line] etc.)

2.When u have your lines chosen (highlighted) you can copy them up or down by this key combination: shift+alt+up/down arrow

3.When u have it copied and want to move it somewhere else, just stay it highlighted after you copied it and then move it by this key combination: alt+up/down arrow This wont reorganize your code, it will swap the lines, so you can pick any place you want your lines to be copied.

Hope it works for you! For me it works even on Safari without any problems, and when you practice it its actually quite good and easy.

kechan commented 3 years ago

@Piotru92 This is for copying a whole line within a single cell? was aware of this feature but...

It doesn't look like this is true generic cut/paste. E.g. can you cut a substring (not entire line) and paste it on another cell, or on google search?

Piotru92 commented 3 years ago

@As far as I tried it doesnt work this way that u can copy by this key combination and paste it outside the code. Only works within actual key cell and can be simple moved to other lines of this cell, but thats better than nothing 😅 I know that if your cell is not active, you can just hold finger on the text and when it highlights - move finger without taking it off the screen, then pick part u want to copy, then copy/paste menu should appear and you should be able to copy this time wherever you want - but this is really uncomfortable.

Acatsama0871 commented 3 years ago

Same problem here, please fix this

seanmccurdy commented 3 years ago

+1 on this issue. Will be canceling my colab pro subscription until this is rectified. In the meantime, I’ll be using datalore, which doesn’t seem to have this issue.

yusabar commented 3 years ago

The workaround I use is to transform code cells to text cells, then I copy the text that I want, and I transform back the cell to code cell:

Code cell —> Text cell: Cmd+MM Text cell —> Code cell: Cmd+MY

You can change these keyboard shortcuts to custom shortcuts in Tools>Keyboard shortcuts. Surprisingly, in this menu there is an option for “copy cells or selections” which has an empty keyboard shortcut. I tried to set Cmd/Ctrl+C to this action, but it is forbidden. Alternatively I set this copy shortcut to something else (Alt+C) but it still does’t work for me. So for now I use the code—>text cell conversion workaround when possible.

pittwolfe commented 3 years ago

@yusabar Which browser are you using? Even with the code ➝ text conversion I can’t get it to work with Firefox.

coopercunliffe commented 3 years ago

What a nightmare! I commend everyone here trying to find a solution. Having the same issue on iPad 11 in with magic keyboard.

cperry-goog commented 3 years ago

Tracked internally at b/142615543

kechan commented 3 years ago

@cperry-goog Tracked internally? Does that mean it is getting some attention at google?

It is easy to underrate copy/paste as a power feature, and forgot the genius who invented this (I am guessing some bearded unix gurus?). Much much appreciation if this gets fixed, so i can do some ML "on the run" again without frustration. Coding is 90% cut/paste... ;-)

tonyc128 commented 3 years ago

Try to long tap the text you want to copy “with your hand” on your ipad, and it will pop up the iPad build-in copy button on the screen. Press it to copy the text.

Then use cmd+v on the keyboard to paste the text.

It works for me. Device: iPad Air 4 + iOS 15 beta 4

BugQualia commented 3 years ago

Try inspect browser on appstore. This is the only solution that I found. It costs money, but at least its not a subscription.