From 8a4ec4e85605539410d7ed359793675134e8b1e1 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sat, 11 Jul 2026 15:02:46 -0700 Subject: [PATCH] feat(terminal): expose right-click paste on every platform (#8322) * WIP: Changes before auto-review fixes * fix: preserve terminal paste defaults across platforms --- src/main/persistence.test.ts | 59 +++++++++++++++++++ src/main/persistence.ts | 14 +++++ .../settings/TerminalInteractionSection.tsx | 16 ++--- .../src/components/settings/TerminalPane.tsx | 3 +- .../settings/terminal-search.test.ts | 8 ++- .../components/settings/terminal-search.ts | 2 +- .../settings/terminal-windows-search.ts | 6 +- .../components/terminal-pane/TerminalPane.tsx | 6 +- .../use-terminal-pane-context-menu.ts | 6 +- src/renderer/src/i18n/locales/en.json | 6 +- src/renderer/src/i18n/locales/es.json | 6 +- src/renderer/src/i18n/locales/ja.json | 6 +- src/renderer/src/i18n/locales/ko.json | 6 +- src/renderer/src/i18n/locales/zh.json | 6 +- src/shared/constants.test.ts | 9 +++ src/shared/constants.ts | 12 ++-- src/shared/types.ts | 8 ++- tests/e2e/terminal-paste-ownership.spec.ts | 4 +- 18 files changed, 127 insertions(+), 56 deletions(-) diff --git a/src/main/persistence.test.ts b/src/main/persistence.test.ts index 6fefe9983..4ae746a1f 100644 --- a/src/main/persistence.test.ts +++ b/src/main/persistence.test.ts @@ -6061,6 +6061,65 @@ describe('Store', () => { expect(store.getSettings().terminalMacOptionAsAltMigrated).toBe(true) }) + it('migrates inherited right-click paste to each platform default once', async () => { + for (const [platform, expected] of [ + ['win32', true], + ['darwin', false], + ['linux', false] + ] as const) { + await withPlatform(platform, async () => { + writeDataFile({ + schemaVersion: 1, + repos: [], + worktreeMeta: {}, + settings: { terminalRightClickToPaste: true }, + ui: {}, + githubCache: { pr: {}, issue: {} }, + workspaceSession: {} + }) + const store = await createStore() + expect(store.getSettings().terminalRightClickToPaste).toBe(expected) + expect(store.getSettings().terminalRightClickToPasteDefaultedForPlatform).toBe(true) + }) + } + }) + + it('preserves an explicit Windows right-click paste opt-out during migration', async () => { + await withPlatform('win32', async () => { + writeDataFile({ + schemaVersion: 1, + repos: [], + worktreeMeta: {}, + settings: { terminalRightClickToPaste: false }, + ui: {}, + githubCache: { pr: {}, issue: {} }, + workspaceSession: {} + }) + const store = await createStore() + expect(store.getSettings().terminalRightClickToPaste).toBe(false) + expect(store.getSettings().terminalRightClickToPasteDefaultedForPlatform).toBe(true) + }) + }) + + it('preserves right-click paste choices after the platform migration', async () => { + await withPlatform('darwin', async () => { + writeDataFile({ + schemaVersion: 1, + repos: [], + worktreeMeta: {}, + settings: { + terminalRightClickToPaste: true, + terminalRightClickToPasteDefaultedForPlatform: true + }, + ui: {}, + githubCache: { pr: {}, issue: {} }, + workspaceSession: {} + }) + const store = await createStore() + expect(store.getSettings().terminalRightClickToPaste).toBe(true) + }) + }) + it('migrates inherited terminal bar cursor defaults to block on first load', async () => { writeDataFile({ schemaVersion: 1, diff --git a/src/main/persistence.ts b/src/main/persistence.ts index 2fc2704f4..44d0827bc 100644 --- a/src/main/persistence.ts +++ b/src/main/persistence.ts @@ -2999,6 +2999,11 @@ export class Store { const migratedTerminalLineHeight = normalizeTerminalLineHeight( parsed.settings?.terminalLineHeight ) + const terminalRightClickToPasteDefaultedForPlatform = + parsed.settings?.terminalRightClickToPasteDefaultedForPlatform === true + if (!terminalRightClickToPasteDefaultedForPlatform) { + this.loadNeedsSave = true + } if ( parsed.settings?.terminalLineHeight !== undefined && parsed.settings.terminalLineHeight !== migratedTerminalLineHeight @@ -3138,6 +3143,15 @@ export class Store { ...migratedAutoRenameBranchFromWork, ...migratedTerminalCursorStyle, terminalLineHeight: migratedTerminalLineHeight, + // Why: the old global true default was inherited, while false was + // always an explicit opt-out and must survive this one-shot reset. + terminalRightClickToPaste: terminalRightClickToPasteDefaultedForPlatform + ? (parsed.settings?.terminalRightClickToPaste ?? + defaults.settings.terminalRightClickToPaste) + : parsed.settings?.terminalRightClickToPaste === false + ? false + : defaults.settings.terminalRightClickToPaste, + terminalRightClickToPasteDefaultedForPlatform: true, ...migratedTerminalTuiScrollSensitivity.settings, experimentalActivity: migratedExperimentalActivity, experimentalActivityDefaultedOffForAllUsers: true, diff --git a/src/renderer/src/components/settings/TerminalInteractionSection.tsx b/src/renderer/src/components/settings/TerminalInteractionSection.tsx index 2d4f55bec..40bac911e 100644 --- a/src/renderer/src/components/settings/TerminalInteractionSection.tsx +++ b/src/renderer/src/components/settings/TerminalInteractionSection.tsx @@ -24,7 +24,6 @@ type TerminalInteractionSectionProps = { settings: GlobalSettings updateSettings: (updates: Partial) => void searchQuery: string - isWindows: boolean } type ScrollSpeedSliderProps = { @@ -89,8 +88,7 @@ function ScrollSpeedSlider({ export function TerminalInteractionSection({ settings, updateSettings, - searchQuery, - isWindows + searchQuery }: TerminalInteractionSectionProps): React.JSX.Element { return (
@@ -223,11 +221,7 @@ export function TerminalInteractionSection({ - {/* Why: the Windows-only right-click toggle lives in this section, so the - section must also match that search term or settings search would hide - the control even though it is present. */} - {isWindows && - matchesSettingsSearch(searchQuery, getTerminalRightClickToPasteSearchEntry()) ? ( + {matchesSettingsSearch(searchQuery, getTerminalRightClickToPasteSearchEntry()) ? ( diff --git a/src/renderer/src/components/settings/TerminalPane.tsx b/src/renderer/src/components/settings/TerminalPane.tsx index 679589846..ca962de25 100644 --- a/src/renderer/src/components/settings/TerminalPane.tsx +++ b/src/renderer/src/components/settings/TerminalPane.tsx @@ -79,13 +79,12 @@ export function TerminalPane({ /> ) : null, matchesSettingsSearch(searchQuery, getTerminalPaneInteractionSearchEntries()) || - (isWindows && matchesSettingsSearch(searchQuery, getTerminalRightClickToPasteSearchEntry())) ? ( + matchesSettingsSearch(searchQuery, getTerminalRightClickToPasteSearchEntry()) ? ( ) : null, matchesSettingsSearch(searchQuery, getTerminalSetupScriptSearchEntries()) ? ( diff --git a/src/renderer/src/components/settings/terminal-search.test.ts b/src/renderer/src/components/settings/terminal-search.test.ts index 4d4d9e05e..5811f5dcf 100644 --- a/src/renderer/src/components/settings/terminal-search.test.ts +++ b/src/renderer/src/components/settings/terminal-search.test.ts @@ -24,7 +24,7 @@ describe('getTerminalPaneSearchEntries', () => { expect(entries.some((entry) => entry.title === 'Default Shell')).toBe(true) expect(entries.some((entry) => entry.title === 'PowerShell Version')).toBe(true) - expect(entries.some((entry) => entry.title === 'Right-click to paste')).toBe(false) + expect(entries.some((entry) => entry.title === 'Right-click to paste')).toBe(true) }) it('omits legacy WSL distribution terminal settings on Windows', () => { @@ -33,9 +33,11 @@ describe('getTerminalPaneSearchEntries', () => { expect(matchesSettingsSearch('ubuntu distro', entries)).toBe(false) }) - it('omits the Windows right-click setting elsewhere', () => { + it('includes the right-click setting on macOS and Linux', () => { const entries = getTerminalPaneSearchEntries({ isWindows: false, isMac: false }) - expect(entries.some((entry) => entry.title === 'Right-click to paste')).toBe(false) + const macEntries = getTerminalPaneSearchEntries({ isWindows: false, isMac: true }) + expect(entries.some((entry) => entry.title === 'Right-click to paste')).toBe(true) + expect(macEntries.some((entry) => entry.title === 'Right-click to paste')).toBe(true) }) it('omits the PowerShell version setting elsewhere', () => { diff --git a/src/renderer/src/components/settings/terminal-search.ts b/src/renderer/src/components/settings/terminal-search.ts index 783f7085d..2a460bd64 100644 --- a/src/renderer/src/components/settings/terminal-search.ts +++ b/src/renderer/src/components/settings/terminal-search.ts @@ -115,7 +115,7 @@ export function getTerminalPaneSearchEntries(platform: { ...getTerminalWindowsPowershellImplementationSearchEntry() ] : []), - ...(platform.isWindows ? getTerminalRightClickToPasteSearchEntry() : []), + ...getTerminalRightClickToPasteSearchEntry(), ...getTerminalSetupScriptSearchEntries(), ...getManageSessionsSearchEntries(), ...getTerminalAdvancedSearchEntries(), diff --git a/src/renderer/src/components/settings/terminal-windows-search.ts b/src/renderer/src/components/settings/terminal-windows-search.ts index fae8b6fca..9aa765177 100644 --- a/src/renderer/src/components/settings/terminal-windows-search.ts +++ b/src/renderer/src/components/settings/terminal-windows-search.ts @@ -113,17 +113,13 @@ export const getTerminalRightClickToPasteSearchEntry = createLocalizedCatalog(() ), description: translate( 'auto.components.settings.terminal.windows.search.8ba875c132', - 'On Windows, right-click pastes the clipboard into the terminal. Use Ctrl+right-click to open the context menu.' + 'Right-click pastes the clipboard into the terminal. Use Ctrl+right-click to open the context menu.' ), keywords: [ ...translateSearchKeyword( 'auto.components.settings.terminal.windows.search.e7d2793b03', 'terminal' ), - ...translateSearchKeyword( - 'auto.components.settings.terminal.windows.search.28ff08ed35', - 'windows' - ), ...translateSearchKeyword( 'auto.components.settings.terminal.windows.search.e55186fe2b', 'right click' diff --git a/src/renderer/src/components/terminal-pane/TerminalPane.tsx b/src/renderer/src/components/terminal-pane/TerminalPane.tsx index a3d0286ef..4f6e1ecbe 100644 --- a/src/renderer/src/components/terminal-pane/TerminalPane.tsx +++ b/src/renderer/src/components/terminal-pane/TerminalPane.tsx @@ -785,11 +785,7 @@ export default function TerminalPane({ const updateSettings = useAppStore((store) => store.updateSettings) const requestLinkRoutingPreference = useLinkRoutingPreferenceDialog() const keybindings = useAppStore((store) => store.keybindings) - // Why: Windows is the only platform where bare right-click is repurposed as - // a paste gesture; on macOS/Linux the terminal still owns right-click for the - // context menu. The settings default keeps the Windows shortcut feeling native - // without changing the other platforms' interaction model. - const rightClickToPaste = isWindowsUserAgent() && (settings?.terminalRightClickToPaste ?? true) + const rightClickToPaste = settings?.terminalRightClickToPaste ?? isWindowsUserAgent() // Why: Windows ConPTY does not forward DECSET 2004 from foreground TUIs, so // xterm may not know multi-line text needs bracketed-paste protection. const forceBracketedMultilineTextPaste = isWindowsUserAgent() diff --git a/src/renderer/src/components/terminal-pane/use-terminal-pane-context-menu.ts b/src/renderer/src/components/terminal-pane/use-terminal-pane-context-menu.ts index d84f1a080..b55961b4e 100644 --- a/src/renderer/src/components/terminal-pane/use-terminal-pane-context-menu.ts +++ b/src/renderer/src/components/terminal-pane/use-terminal-pane-context-menu.ts @@ -480,10 +480,8 @@ export function useTerminalPaneContextMenu({ : null contextPaneIdRef.current = clickedPane?.id ?? null - // Why: Windows terminals treat right-click as copy-or-paste depending on - // whether text is selected. With a selection, right-click copies it and - // clears the selection; without one, it pastes. Ctrl+right-click still - // reaches the app menu so the menu remains discoverable. + // Why: when users opt into terminal-style right-click, a selection copies + // and no selection pastes. Ctrl+right-click keeps the app menu reachable. if (rightClickToPaste && !event.ctrlKey) { event.stopPropagation() if (!clickedPane) { diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index 3475f335e..05574797b 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -6768,9 +6768,9 @@ "348246b06f": "false", "5936387ddd": "auto", "adbafefe56": "custom", - "16753eea48": "On Windows, right-click pastes the clipboard. Ctrl+right-click opens the context menu.", + "16753eea48": "Right-click pastes the clipboard. Ctrl+right-click opens the context menu.", "9c178cf8aa": "Right-click to paste", - "af0c3b6e39": "On Windows, right-click pastes the clipboard into the terminal. Use Ctrl+right-click to open the context menu.", + "af0c3b6e39": "Right-click pastes the clipboard into the terminal. Use Ctrl+right-click to open the context menu.", "29154326bb": "on", "ab20575a8a": "off", "ab3a1f9068": "wsl.exe", @@ -8496,7 +8496,7 @@ "e55186fe2b": "right click", "28ff08ed35": "windows", "e7d2793b03": "terminal", - "8ba875c132": "On Windows, right-click pastes the clipboard into the terminal. Use Ctrl+right-click to open the context menu.", + "8ba875c132": "Right-click pastes the clipboard into the terminal. Use Ctrl+right-click to open the context menu.", "f0b8448570": "Right-click to paste", "04994f6929": "default", "fc564eadaf": "debian", diff --git a/src/renderer/src/i18n/locales/es.json b/src/renderer/src/i18n/locales/es.json index 0cd02c7e9..5b5f73cf6 100644 --- a/src/renderer/src/i18n/locales/es.json +++ b/src/renderer/src/i18n/locales/es.json @@ -6731,9 +6731,9 @@ "348246b06f": "FALSO", "5936387ddd": "auto", "adbafefe56": "personalizado", - "16753eea48": "En Windows, hacer clic derecho pega el portapapeles. Ctrl+clic derecho abre el menú contextual.", + "16753eea48": "Hacer clic derecho pega el portapapeles. Ctrl+clic derecho abre el menú contextual.", "9c178cf8aa": "Clic derecho para pegar", - "af0c3b6e39": "En Windows, hacer clic derecho pega el portapapeles en el terminal. Usa Ctrl+clic derecho para abrir el menú contextual.", + "af0c3b6e39": "Hacer clic derecho pega el portapapeles en el terminal. Usa Ctrl+clic derecho para abrir el menú contextual.", "29154326bb": "activado", "ab20575a8a": "apagado", "ab3a1f9068": "wsl.exe", @@ -8459,7 +8459,7 @@ "e55186fe2b": "clic derecho", "28ff08ed35": "Windows", "e7d2793b03": "terminal", - "8ba875c132": "En Windows, hacer clic derecho pega el portapapeles en el terminal. Usa Ctrl+clic derecho para abrir el menú contextual.", + "8ba875c132": "Hacer clic derecho pega el portapapeles en el terminal. Usa Ctrl+clic derecho para abrir el menú contextual.", "f0b8448570": "Clic derecho para pegar", "04994f6929": "predeterminado", "fc564eadaf": "debian", diff --git a/src/renderer/src/i18n/locales/ja.json b/src/renderer/src/i18n/locales/ja.json index 37ba7f699..a1c295e55 100644 --- a/src/renderer/src/i18n/locales/ja.json +++ b/src/renderer/src/i18n/locales/ja.json @@ -6753,9 +6753,9 @@ "348246b06f": "false", "5936387ddd": "自動", "adbafefe56": "カスタム", - "16753eea48": "Windows では、右クリックしてクリップボードを貼り付けます。 Ctrl キーを押しながら右クリックすると、コンテキスト メニューが開きます。", + "16753eea48": "右クリックしてクリップボードを貼り付けます。 Ctrl キーを押しながら右クリックすると、コンテキスト メニューが開きます。", "9c178cf8aa": "右クリックして貼り付けます", - "af0c3b6e39": "Windows では、右クリックしてクリップボードを terminal に貼り付けます。 Ctrl キーを押しながら右クリックしてコンテキスト メニューを開きます。", + "af0c3b6e39": "右クリックしてクリップボードを terminal に貼り付けます。 Ctrl キーを押しながら右クリックしてコンテキスト メニューを開きます。", "29154326bb": "の上", "ab20575a8a": "オフ", "ab3a1f9068": "wsl.exe", @@ -8481,7 +8481,7 @@ "e55186fe2b": "右クリック", "28ff08ed35": "窓", "e7d2793b03": "ターミナル", - "8ba875c132": "Windows では、右クリックしてクリップボードを terminal に貼り付けます。 Ctrl キーを押しながら右クリックしてコンテキスト メニューを開きます。", + "8ba875c132": "右クリックしてクリップボードを terminal に貼り付けます。 Ctrl キーを押しながら右クリックしてコンテキスト メニューを開きます。", "f0b8448570": "右クリックして貼り付けます", "04994f6929": "デフォルト", "fc564eadaf": "デビアン", diff --git a/src/renderer/src/i18n/locales/ko.json b/src/renderer/src/i18n/locales/ko.json index ce2ed02e3..93a3b8a52 100644 --- a/src/renderer/src/i18n/locales/ko.json +++ b/src/renderer/src/i18n/locales/ko.json @@ -6716,9 +6716,9 @@ "348246b06f": "false", "5936387ddd": "자동", "adbafefe56": "custom", - "16753eea48": "Windows에서는 마우스 오른쪽 버튼을 클릭하여 클립보드를 붙여넣습니다. Ctrl+마우스 오른쪽 버튼을 클릭하면 컨텍스트 메뉴가 열립니다.", + "16753eea48": "마우스 오른쪽 버튼을 클릭하여 클립보드를 붙여넣습니다. Ctrl+마우스 오른쪽 버튼을 클릭하면 컨텍스트 메뉴가 열립니다.", "9c178cf8aa": "붙여넣으려면 마우스 오른쪽 버튼을 클릭하세요.", - "af0c3b6e39": "Windows에서는 마우스 오른쪽 버튼을 클릭하여 클립보드를 terminal에 붙여넣습니다. 컨텍스트 메뉴를 열려면 Ctrl+오른쪽 클릭을 사용하세요.", + "af0c3b6e39": "마우스 오른쪽 버튼을 클릭하여 클립보드를 terminal에 붙여넣습니다. 컨텍스트 메뉴를 열려면 Ctrl+오른쪽 클릭을 사용하세요.", "29154326bb": "켜기", "ab20575a8a": "끄기", "ab3a1f9068": "wsl.exe", @@ -8444,7 +8444,7 @@ "e55186fe2b": "오른쪽 클릭", "28ff08ed35": "창", "e7d2793b03": "터미널", - "8ba875c132": "Windows에서는 마우스 오른쪽 버튼을 클릭하여 클립보드를 terminal에 붙여넣습니다. 컨텍스트 메뉴를 열려면 Ctrl+오른쪽 클릭을 사용하세요.", + "8ba875c132": "마우스 오른쪽 버튼을 클릭하여 클립보드를 terminal에 붙여넣습니다. 컨텍스트 메뉴를 열려면 Ctrl+오른쪽 클릭을 사용하세요.", "f0b8448570": "붙여넣으려면 마우스 오른쪽 버튼을 클릭하세요.", "04994f6929": "기본값", "fc564eadaf": "데비안", diff --git a/src/renderer/src/i18n/locales/zh.json b/src/renderer/src/i18n/locales/zh.json index aeb2bec07..97398b88c 100644 --- a/src/renderer/src/i18n/locales/zh.json +++ b/src/renderer/src/i18n/locales/zh.json @@ -6716,9 +6716,9 @@ "348246b06f": "false", "5936387ddd": "自动", "adbafefe56": "风俗", - "16753eea48": "在 Windows 上,右键单击粘贴剪贴板。 Ctrl+右键单击打开上下文菜单。", + "16753eea48": "右键单击粘贴剪贴板。 Ctrl+右键单击打开上下文菜单。", "9c178cf8aa": "右键单击粘贴", - "af0c3b6e39": "在 Windows 上,右键单击将剪贴板粘贴到终端中。使用 Ctrl+右键单击打开上下文菜单。", + "af0c3b6e39": "右键单击将剪贴板粘贴到终端中。使用 Ctrl+右键单击打开上下文菜单。", "29154326bb": "开", "ab20575a8a": "关", "ab3a1f9068": "执行程序", @@ -8444,7 +8444,7 @@ "e55186fe2b": "右键单击", "28ff08ed35": "视窗", "e7d2793b03": "终端", - "8ba875c132": "在 Windows 上,右键单击将剪贴板粘贴到终端中。使用 Ctrl+右键单击打开上下文菜单。", + "8ba875c132": "右键单击将剪贴板粘贴到终端中。使用 Ctrl+右键单击打开上下文菜单。", "f0b8448570": "右键单击粘贴", "04994f6929": "默认", "fc564eadaf": "德比安", diff --git a/src/shared/constants.test.ts b/src/shared/constants.test.ts index 76afe5caa..e185c4d07 100644 --- a/src/shared/constants.test.ts +++ b/src/shared/constants.test.ts @@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest' import { getDefaultNotificationSettings, getDefaultPrimarySelectionMiddleClickPaste, + getDefaultTerminalRightClickToPaste, getDefaultSettings } from './constants' @@ -126,6 +127,14 @@ describe('getDefaultPrimarySelectionMiddleClickPaste', () => { }) }) +describe('getDefaultTerminalRightClickToPaste', () => { + it('defaults on only for Windows', () => { + expect(getDefaultTerminalRightClickToPaste('win32')).toBe(true) + expect(getDefaultTerminalRightClickToPaste('darwin')).toBe(false) + expect(getDefaultTerminalRightClickToPaste('linux')).toBe(false) + }) +}) + describe('MiniMax defaults', () => { it('starts MiniMax with empty group id and the canonical default model', () => { const settings = getDefaultSettings('/tmp') diff --git a/src/shared/constants.ts b/src/shared/constants.ts index a14ec445f..e476825e2 100644 --- a/src/shared/constants.ts +++ b/src/shared/constants.ts @@ -101,6 +101,10 @@ export const getDefaultPrimarySelectionMiddleClickPaste = ( platform = typeof process !== 'undefined' ? process.platform : '' ): boolean => platform === 'linux' || platform === 'darwin' +export const getDefaultTerminalRightClickToPaste = ( + platform = typeof process !== 'undefined' ? process.platform : '' +): boolean => platform === 'win32' + /** * Why: ProseMirror builds an in-memory tree for the entire document, so large * markdown files cause noticeable typing lag in the rich editor. Files above @@ -240,10 +244,10 @@ export function getDefaultSettings(homedir: string): GlobalSettings { terminalActivePaneOpacity: 1, terminalPaneOpacityTransitionMs: 140, terminalDividerThicknessPx: 3, - // Default true so Windows users get native right-click paste out of the - // box. Other platforms ignore this field because the UI never exposes it, - // and Ctrl+right-click still opens the context menu when paste is enabled. - terminalRightClickToPaste: true, + // Why: Windows follows its native terminal paste convention, while macOS + // and Linux keep right-click available for the context menu by default. + terminalRightClickToPaste: getDefaultTerminalRightClickToPaste(), + terminalRightClickToPasteDefaultedForPlatform: true, terminalWindowsShell: 'powershell.exe', terminalWindowsWslDistro: null, localAccountRuntime: 'host', diff --git a/src/shared/types.ts b/src/shared/types.ts index 232811d59..882ddb2a2 100644 --- a/src/shared/types.ts +++ b/src/shared/types.ts @@ -2573,10 +2573,12 @@ export type GlobalSettings = { * system tray instead of quitting Orca; off keeps the default quit-on-close. * The tray icon itself is always present on Windows regardless of this flag. */ minimizeToTrayOnClose?: boolean - /** Why: Windows terminals conventionally use right-click as a paste gesture. - * The setting stays Windows-only so macOS/Linux keep their existing context - * menu behavior and users can still reach the menu with Ctrl+right-click. */ + /** Why: Windows terminals conventionally use right-click as a paste gesture, + * while macOS/Linux default to their existing context menu behavior. */ terminalRightClickToPaste: boolean + /** One-shot guard that distinguishes the old global true default from a + * choice made after the setting became available on every platform. */ + terminalRightClickToPasteDefaultedForPlatform?: boolean /** Why: COMSPEC always points to cmd.exe on stock Windows, so without an * explicit setting the terminal would always open CMD instead of the * user's preferred shell. Defaults to 'powershell.exe' which is the diff --git a/tests/e2e/terminal-paste-ownership.spec.ts b/tests/e2e/terminal-paste-ownership.spec.ts index 3e95b02f1..cfca49401 100644 --- a/tests/e2e/terminal-paste-ownership.spec.ts +++ b/tests/e2e/terminal-paste-ownership.spec.ts @@ -362,13 +362,11 @@ test.describe('terminal paste ownership', () => { } }) - test('Windows right-click paste sends clipboard text to the focused terminal exactly once', async ({ + test('right-click paste sends clipboard text to the focused terminal exactly once', async ({ electronApp, orcaPage, testRepoPath }) => { - test.skip(process.platform !== 'win32', 'Windows right-click paste is Windows-only') - await waitForSessionReady(orcaPage) await waitForActiveWorktree(orcaPage) await ensureTerminalVisible(orcaPage)