feat: add auto copy on select#1194
Merged
arnestrickmann merged 1 commit intogeneralaction:mainfrom Mar 1, 2026
Merged
Conversation
|
@liamhess is attempting to deploy a commit to the General Action Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryAdds optional auto-copy on selection feature to the terminal, allowing users to automatically copy selected text to clipboard. The implementation includes:
The feature is well-isolated, properly initialized from settings, and updates immediately when toggled. Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| src/main/settings.ts | Added autoCopyOnSelection boolean field to terminal settings with proper defaults and normalization |
| src/renderer/components/TerminalSettingsCard.tsx | Added Switch UI component for auto-copy setting with proper state management and event dispatching |
| src/renderer/terminal/TerminalSessionManager.ts | Implemented auto-copy functionality with 150ms debounce, proper event handling, and cleanup in disposables |
| src/renderer/types/electron-api.d.ts | Updated TypeScript definitions to include autoCopyOnSelection field in terminal settings types |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User selects text in terminal] --> B{Auto-copy enabled?}
B -->|No| Z[End - no action]
B -->|Yes| C{Has selection?}
C -->|No| Z
C -->|Yes| D[Clear existing debounce timer]
D --> E[Start 150ms debounce timer]
E --> F{Timer expires}
F --> G{Terminal disposed?}
G -->|Yes| Z
G -->|No| H{Still has selection?}
H -->|No| Z
H -->|Yes| I[Get selected text]
I --> J[Clean terminal text<br/>remove ANSI codes]
J --> K{navigator.clipboard available?}
K -->|Yes| L[Copy via navigator.clipboard]
K -->|No| M[Copy via electronAPI fallback]
L --> N[Success]
M --> N
L -.->|Error| M
N --> Z
Last reviewed commit: 00fae83
Contributor
|
Hi @liamhess, Thanks for opening the PR - the addition makes sense. LGTM, merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1193 by adding auto copy on selection.