Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions frontend/src/components/Terminal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Comment on lines +134 to +140

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would probably be better to use the xterm addon to this
https://github.com/xtermjs/xterm.js/tree/master/addons/addon-clipboard

},

unmounted() {
Expand Down
Loading