mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Copy and Paste seem to work.
This commit is contained in:
+5
-3
@@ -416,10 +416,12 @@ Terminal.prototype.initGlobal = function() {
|
||||
*/
|
||||
Terminal.bindPaste = function(term) {
|
||||
on([term.textarea, term.element], 'paste', function(ev) {
|
||||
ev.stopPropagation();
|
||||
if (ev.clipboardData) {
|
||||
term.send(ev.clipboardData.getData('text/plain'));
|
||||
} else if (term.context.clipboardData) {
|
||||
term.send(term.context.clipboardData.getData('Text'));
|
||||
var text = ev.clipboardData.getData('text/plain');
|
||||
for (var i=0; i<text.length; i++) {
|
||||
term.write(text[i]);
|
||||
}
|
||||
}
|
||||
term.textarea.value = '';
|
||||
return term.cancel(ev);
|
||||
|
||||
Reference in New Issue
Block a user