Repository navigation
fix: paste on right-click in Windows terminals - #571
Conversation
|
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. |
|
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. |
|
Tested this locally on Windows. Two issues found: 1. Typecheck failure — broken import
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 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:
|
Fixes stablyai#560 Co-Authored-By: Claude <[email protected]>
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.
43f7a35 to
ca06ce0
Compare
|
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. |
Co-authored-by: Claude <[email protected]> Co-authored-by: Neil <[email protected]> Co-authored-by: Jinwoo Hong <[email protected]>
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 lintpnpm typecheckpnpm testpnpm buildNot 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.