From 1320ebceb941662f2e8eb5795790361b5608e8bc Mon Sep 17 00:00:00 2001 From: Jacob Richman Date: Thu, 22 Jan 2026 10:11:56 -0800 Subject: [PATCH] Remove redundant calls setting linuxClipboardTool. getUserLinuxClipboardTool() now handles the caching internally (#17320) --- packages/cli/src/ui/utils/clipboardUtils.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/cli/src/ui/utils/clipboardUtils.ts b/packages/cli/src/ui/utils/clipboardUtils.ts index c9c34d3ccc..0804a7ef9e 100644 --- a/packages/cli/src/ui/utils/clipboardUtils.ts +++ b/packages/cli/src/ui/utils/clipboardUtils.ts @@ -163,10 +163,10 @@ async function checkXclipForImage() { */ export async function clipboardHasImage(): Promise { if (process.platform === 'linux') { - linuxClipboardTool = getUserLinuxClipboardTool(); - if (linuxClipboardTool === 'wl-paste') { + const tool = getUserLinuxClipboardTool(); + if (tool === 'wl-paste') { if (await checkWlPasteForImage()) return true; - } else if (linuxClipboardTool === 'xclip') { + } else if (tool === 'xclip') { if (await checkXclipForImage()) return true; } return false; @@ -264,12 +264,13 @@ export async function saveClipboardImage( if (process.platform === 'linux') { const tempFilePath = path.join(tempDir, `clipboard-${timestamp}.png`); + const tool = getUserLinuxClipboardTool(); - if (linuxClipboardTool === 'wl-paste') { + if (tool === 'wl-paste') { if (await saveFileWithWlPaste(tempFilePath)) return tempFilePath; return null; } - if (linuxClipboardTool === 'xclip') { + if (tool === 'xclip') { if (await saveFileWithXclip(tempFilePath)) return tempFilePath; return null; }