Skip to content

fix: paste on right-click in Windows terminals - #571

Merged
Jinwoo-H merged 3 commits into
stablyai:mainfrom
zerone0x:fix/issue-560-windows-right-click-paste
Apr 14, 2026
Merged

Jinwoo-H merged 3 commits into
stablyai:mainfrom
zerone0x:fix/issue-560-windows-right-click-paste

Conversation

@zerone0x

@zerone0x zerone0x commented Apr 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #560 by pasting on right-click in Windows terminal panes instead of opening the context menu, so focus stays in the input.

Screenshots

No visual change.

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm build
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed

Not run (UI-only change, no local pnpm install in this environment).

AI Review Report

Reviewed the terminal context menu flow to ensure the right-click path now reuses the existing clipboard paste helper on Windows only. Confirmed macOS/Linux behavior is unchanged, and the targeted pane is still resolved before pasting. Cross-platform check: the change gates on navigator.userAgent.includes('Windows'), so shortcuts, labels, and paths on macOS/Linux are unaffected.

Security Audit

Reviewed clipboard access and paste plumbing. The change reuses existing IPC clipboard reads and image temp-file handling without adding new input sources, command execution, or path manipulation. No new auth, IPC, or dependency risks introduced.

Notes

Windows-only behavior: right-click now pastes directly and does not open the terminal context menu.

Update: added a Windows-only "Right-click to paste" terminal setting (default on) and kept Ctrl+right-click as the escape hatch for the context menu. Non-Windows platforms do not show the setting.

@nwparker

Copy link
Copy Markdown
Contributor

Added the Windows-only "Right-click to paste" terminal setting (default on) and preserved Ctrl+right-click for the context menu. The option is hidden on macOS/Linux, and the terminal search index now matches the visible controls.

@nwparker

Copy link
Copy Markdown
Contributor

Pushed the actual code changes to the PR branch now — the Windows-only "Right-click to paste" terminal setting is in the diff, and Ctrl+right-click still opens the context menu.

@theofbonin

theofbonin commented Apr 13, 2026 •

Copy link
Copy Markdown
Contributor

Tested this locally on Windows. Two issues found:

1. Typecheck failure — broken import

TerminalPane.tsx imports TERMINAL_RIGHT_CLICK_TO_PASTE_SEARCH_ENTRY, but terminal-search.ts exports TERMINAL_WINDOWS_SEARCH_ENTRIES. Three references to update (lines 36, 242, 300).

2. Right-click should copy when text is selected

Standard Windows terminal behavior: right-click with a selection copies the selected text and clears the selection. Right-click with no selection pastes. Currently it always pastes.

Fix in use-terminal-pane-context-menu.ts:

if (rightClickToPaste && !event.ctrlKey) {
  event.stopPropagation()
  const selection = clickedPane?.terminal.getSelection()
  if (selection) {
    void window.api.ui.writeClipboardText(selection)
    clickedPane?.terminal.clearSelection()
  } else {
    void onPaste()
  }
  return
}

What worked:

  • Right-click paste (no selection) ✓
  • Ctrl+right-click opens context menu ✓
  • Disabling the setting restores normal context menu on right-click ✓
  • Lint, typecheck (after fix), build all pass ✓

zerone0x and others added 3 commits April 13, 2026 21:48
Add the TERMINAL_RIGHT_CLICK_TO_PASTE_SEARCH_ENTRY export that
TerminalPane.tsx imports — the build was failing with TS2305.
Reword "still opens" to "Use Ctrl+right-click to open" for clarity.
@Jinwoo-H
Jinwoo-H force-pushed the fix/issue-560-windows-right-click-paste branch from 43f7a35 to ca06ce0 Compare April 14, 2026 02:20
@Jinwoo-H

Copy link
Copy Markdown
Contributor

Thanks for the PR! Pushed a commit to fix a missing export that was breaking the build, and a minor wording tweak on the setting description. Looks good otherwise.

@Jinwoo-H
Jinwoo-H merged commit 75ce59c into stablyai:main Apr 14, 2026
1 check passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
Co-authored-by: Claude <[email protected]>
Co-authored-by: Neil <[email protected]>
Co-authored-by: Jinwoo Hong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Right-click should paste in terminal instead of opening context menu (Windows)

4 participants