This commit is contained in:
Lukáš Ondrejka 2024-12-31 08:48:37 +01:00 committed by GitHub
commit 02b373cdcb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -129,6 +129,15 @@ export default {
}
// Fit the terminal width to the div container size after terminal is created.
this.updateTerminalSize();
// Add paste event listener
this.terminal.textarea.addEventListener("paste", (event) => {
const textToPaste = event.clipboardData.getData("text").replace(/\n+$/, "");
this.cursorPosition += textToPaste.length;
this.terminalInputBuffer += textToPaste;
console.debug("Paste text: " + textToPaste);
this.terminal.write(textToPaste);
});
},
unmounted() {