From 3a1b6c2c51aca09c7ca162f5d5a0add60c935616 Mon Sep 17 00:00:00 2001 From: Ankit kumar yadav Date: Sat, 2 Aug 2025 20:21:49 +0530 Subject: [PATCH] appending the copied item, in the text area --- app/ui.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/ui.js b/app/ui.js index 51e57bd3..2bd9e2ef 100644 --- a/app/ui.js +++ b/app/ui.js @@ -45,6 +45,7 @@ const UI = { inhibitReconnect: true, reconnectCallback: null, reconnectPassword: null, + lastTextCopiedFromTerminal: null, async start(options={}) { UI.customSettings = options.settings || {}; @@ -996,8 +997,14 @@ const UI = { clipboardReceive(e) { Log.Debug(">> UI.clipboardReceive: " + e.detail.text.substr(0, 40) + "..."); - document.getElementById('noVNC_clipboard_text').value = e.detail.text; - Log.Debug("<< UI.clipboardReceive"); + const clipboard = document.getElementById('noVNC_clipboard_text'); + if(this.lastCopiedTextFromTerminal !== e.detail.text) { + clipboard.value += (clipboard.value ? "\n" : "") + e.detail.text; + Log.Debug("<< UI.clipboardReceive"); + this.lastCopiedTextFromTerminal = e.detail.text; + }else { + Log.Debug("<< UI.clipboardReceive, no change"); + } }, clipboardSend() {