myrlin-workbook 0.9.2 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -400,6 +400,13 @@ class TerminalPane {
|
|
|
400
400
|
const xtermTextarea = container.querySelector('.xterm-helper-textarea');
|
|
401
401
|
if (xtermTextarea) {
|
|
402
402
|
xtermTextarea.addEventListener('beforeinput', (e) => {
|
|
403
|
+
// Block paste events - we handle Ctrl+V/Cmd+V ourselves via
|
|
404
|
+
// pasteFromClipboard() to avoid xterm.js onData firing twice
|
|
405
|
+
if (e.inputType === 'insertFromPaste') {
|
|
406
|
+
e.preventDefault();
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
|
|
403
410
|
if (e.inputType === 'insertReplacementText') {
|
|
404
411
|
e.preventDefault();
|
|
405
412
|
const replacement = e.data || (e.dataTransfer && e.dataTransfer.getData('text/plain')) || '';
|
|
@@ -417,7 +424,13 @@ class TerminalPane {
|
|
|
417
424
|
const backspaces = '\x7f'.repeat(deleteCount) || '\b'.repeat(deleteCount);
|
|
418
425
|
this.ws.send(JSON.stringify({ type: 'input', data: backspaces + replacement }));
|
|
419
426
|
}
|
|
420
|
-
});
|
|
427
|
+
}, { capture: true });
|
|
428
|
+
|
|
429
|
+
// Also block native paste event as a fallback
|
|
430
|
+
xtermTextarea.addEventListener('paste', (e) => {
|
|
431
|
+
e.preventDefault();
|
|
432
|
+
e.stopPropagation();
|
|
433
|
+
}, { capture: true });
|
|
421
434
|
}
|
|
422
435
|
|
|
423
436
|
this.term.onData((data) => {
|