From 93473959ca9c97ed764cf41678695cb7d52461a8 Mon Sep 17 00:00:00 2001 From: Pluto Date: Sun, 10 May 2026 20:05:56 +0530 Subject: [PATCH 1/2] fix: terminal paste button opens another paste option from chromium --- src/extensionsIntegrated/Terminal/main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/extensionsIntegrated/Terminal/main.js b/src/extensionsIntegrated/Terminal/main.js index 2caa47661d..f020033aee 100644 --- a/src/extensionsIntegrated/Terminal/main.js +++ b/src/extensionsIntegrated/Terminal/main.js @@ -846,10 +846,12 @@ define(function (require, exports, module) { const active = _getActiveTerminal(); if (active && active.isAlive) { active.focus(); - navigator.clipboard.readText().then(function (text) { + Phoenix.app.clipboardReadText().then(function (text) { if (text) { nodeConnector.execPeer("writeTerminal", {id: active.id, data: text}); } + }).catch(function (err) { + console.error("Terminal paste failed:", err); }); } }); From a66428406645eed314bf446ce6e3f15544a7058b Mon Sep 17 00:00:00 2001 From: Pluto Date: Mon, 11 May 2026 21:05:21 +0530 Subject: [PATCH 2/2] fix: terminal paste tests fails --- test/spec/Terminal-integ-test.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/spec/Terminal-integ-test.js b/test/spec/Terminal-integ-test.js index 3066abd287..9ebca685f8 100644 --- a/test/spec/Terminal-integ-test.js +++ b/test/spec/Terminal-integ-test.js @@ -708,14 +708,14 @@ define(function (require, exports, module) { await openTerminal(); await waitForShellReady(); - // Mock clipboard.readText to return a known string, - // since the test iframe may not have clipboard - // permission (no window focus). + // Mock Phoenix.app.clipboardReadText to return a + // known string, since the test iframe may not have + // clipboard permission (no window focus). const pasteText = "PASTEMARKER456"; - const clipboard = testWindow.navigator.clipboard; - spyOn(clipboard, "readText").and.returnValue( - testWindow.Promise.resolve(pasteText) - ); + spyOn(testWindow.Phoenix.app, "clipboardReadText") + .and.returnValue( + testWindow.Promise.resolve(pasteText) + ); // Execute the paste command await CommandManager.execute("terminal.paste");