mirror of
https://github.com/louislam/dockge.git
synced 2024-11-23 19:34:04 +00:00
Added support for pasting text into the terminal
This commit is contained in:
parent
109222f024
commit
adda2e15c1
1 changed files with 9 additions and 0 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue