term.js
term.js copied to clipboard
Paste (and copy) are broken on Safari
Trying to copy/paste in safari using cmd + c / cmd + v on latest Safari and term.js (v0.0.7
) doesn't work.
copy
The keypress handler swallows cmd + c, and doesn't let the browser do its thing.
paste
Paste events are tricky in Safari - you need some kind of input element or contenteditable target for the paste
event to fire. Traditional workarounds include catching a keydown for cmd + v and quickly focusing an editable element and catching paste on that.
Upon further investigation I think the proper course of action is probably for term.js to always have a hidden input element. It seems like it already does this in a limited fashion for mobile browsers. A hidden text element will allow you to much more reliably capture paste events.
Hello, can you test the firefox patch https://github.com/chjj/term.js/issues/51 ? it fix also for Chrome. But CTRL+C don't work also in firefox (it deselect the text) but menubar copy work.
@vincentwoo I made a Pull-Request that enable Copy and Paste using hidden text area. https://github.com/chjj/term.js/pull/97