feat: add keyboard shortcut Ctrl+L/Cmd+L to clear terminal#496
feat: add keyboard shortcut Ctrl+L/Cmd+L to clear terminal#496grishabhatia wants to merge 1 commit into
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
👋 Thanks for opening a PR, @grishabhatia!Your PR has entered the 🚦 PR Review Pipeline.
What happens next
A pipeline status comment will appear below and update automatically as your PR progresses. While you wait
This comment is posted only once. |
Walkthrough
ChangesTerminal Clear Keyboard Shortcut
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Update on implementation@piyushdotcomm Instead of adding a duplicate feature, I have: |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
modules/webcontainers/components/terminal.tsx (1)
437-437: 💤 Low valueRemove the "✅ NEW" marker from the comment.
The "✅ NEW" prefix appears to be a development artifact. Consider either removing it or converting to a standard descriptive comment.
♻️ Suggested change
- // ✅ NEW: Keyboard shortcut for clearing terminal (Ctrl+L / Cmd+L) + // Keyboard shortcut for clearing terminal (Ctrl+L / Cmd+L)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@modules/webcontainers/components/terminal.tsx` at line 437, Remove the "✅ NEW:" marker from the comment at the terminal keyboard shortcut section. The comment currently contains a development artifact prefix that should be removed, leaving only the descriptive text about the keyboard shortcut functionality (Ctrl+L / Cmd+L for clearing terminal). Convert it to a standard, clean comment format without the emoji prefix.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@modules/webcontainers/components/terminal.tsx`:
- Around line 437-449: The keyboard shortcut listener in the useEffect hook is
attached globally to window and will trigger Ctrl+L/Cmd+L regardless of whether
the terminal is focused, potentially clearing all terminal instances and
interfering with other input fields. Add a focus check inside the
handleKeyboardShortcut function before calling clearTerminal to verify the
terminal has focus using the terminal instance's hasActiveFocus() method (or
equivalent focus state), ensuring the shortcut only works when the terminal is
actually focused, consistent with standard terminal behavior like VS Code and
native terminals.
---
Nitpick comments:
In `@modules/webcontainers/components/terminal.tsx`:
- Line 437: Remove the "✅ NEW:" marker from the comment at the terminal keyboard
shortcut section. The comment currently contains a development artifact prefix
that should be removed, leaving only the descriptive text about the keyboard
shortcut functionality (Ctrl+L / Cmd+L for clearing terminal). Convert it to a
standard, clean comment format without the emoji prefix.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: b71b6ae6-38f2-47a7-bce7-71b24f6d72f7
📒 Files selected for processing (1)
modules/webcontainers/components/terminal.tsx
|
@piyushdotcomm pls review when you get chance; |
✅ Build & Lint PassedAll checks have passed:
Ready for review! 🚀 Changes:
Testing:
|
|
@piyushdotcomm please review |
|
@piyushdotcomm please review asap |
Changes
##closes [Feature] Add Clear Terminal Button to Terminal Panel #494
Testing
Summary by CodeRabbit