-
-
Notifications
You must be signed in to change notification settings - Fork 58
feat: add clipboard support for terminal input and output #515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add clipboard support for terminal input and output #515
Conversation
WalkthroughAdds Ctrl/Cmd+C handling to the terminal hook to copy the current selection (with error handling and selection clearing) and preserves Ctrl/Cmd+J suppression; narrows the StopExecution shortcut to require Shift; renames a docker-compose service from Changes
Sequence Diagram(s)sequenceDiagram
participant UI as Terminal UI
participant Hook as useTerminal hook
participant Clip as Clipboard API
participant Term as Terminal backend
Note over UI,Hook: User presses keys
UI->>Hook: keydown (Ctrl/Cmd + C)
alt Selection exists & Shift not required
Hook->>Clip: writeText(selection) color:#4CAF50
Clip-->>Hook: success
Hook->>UI: clear selection
Hook-->>UI: return false (suppress default)
else Ctrl/Cmd + J
Hook-->>UI: suppress (return false) color:#FFC107
else Other keys
Hook->>Term: forward key event
end
sequenceDiagram
participant UI as Terminal UI
participant Stop as stopExecution
participant Term as Terminal backend
UI->>Stop: keydown (Ctrl/Cmd + C [+/- Shift])
alt Shift pressed
Stop->>Term: trigger stop execution
else Shift not pressed
Stop-->>UI: ignore (no-op)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docker-compose-dev.yml (1)
28-28: Critical: Update connection URI to match the renamed service.The
SUPERTOKENS_CONNECTION_URIstill references the old service namesupertokens, but the service was renamed tonixopus-supertokenson line 108. Docker Compose DNS resolution uses service names, not container names, so this will cause the API to fail when attempting to connect to SuperTokens.Apply this diff to fix the connection URI:
- - SUPERTOKENS_CONNECTION_URI=http://supertokens:3567 + - SUPERTOKENS_CONNECTION_URI=http://nixopus-supertokens:3567
🧹 Nitpick comments (1)
view/app/terminal/utils/stopExecution.ts (1)
9-9: Consider removing or replacing the console.log statement.The
console.log('Stopped execution')statement appears to be debug code. Consider removing it or replacing it with a proper logging mechanism if needed for production debugging.Apply this diff to remove the console.log:
- console.log('Stopped execution');
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
docker-compose-dev.yml(1 hunks)view/app/terminal/utils/stopExecution.ts(1 hunks)view/app/terminal/utils/useTerminal.ts(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- view/app/terminal/utils/useTerminal.ts
🔇 Additional comments (1)
view/app/terminal/utils/stopExecution.ts (1)
7-7: LGTM! Shift key requirement correctly separates clipboard copy from stop execution.The addition of
&& e.shiftKeyappropriately narrows the stop execution shortcut to Ctrl/Cmd+Shift+C, freeing up Ctrl/Cmd+C for clipboard copy operations handled inuseTerminal.ts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, revert the docker-compose file change for now.
cc: @raghavyuva
Issue
Link to related issue(s):
Description
Adds Ctrl +c, Ctrl +v and Ctrl + Shift + C support
Scope of Change
Select all applicable areas impacted by this PR:
Screenshot / Video / GIF (if applicable)
Screen.Recording.2025-10-20.at.7.49.32.AM.mov
Developer Checklist
To be completed by the developer who raised the PR.
Reviewer Checklist
To be completed by the reviewer before merge.
Summary by CodeRabbit
New Features
Bug Fixes
Behavior Changes
Chores