Skip to content

Add right-click context menu for terminal panes#116

Open
PiratesIRC wants to merge 11 commits intoelirantutia:mainfrom
PiratesIRC:pr/terminal-context-menu
Open

Add right-click context menu for terminal panes#116
PiratesIRC wants to merge 11 commits intoelirantutia:mainfrom
PiratesIRC:pr/terminal-context-menu

Conversation

@PiratesIRC
Copy link
Copy Markdown
Contributor

@PiratesIRC PiratesIRC commented Apr 30, 2026

Summary

  • Adds a DOM-based right-click context menu on terminal panes with Copy, Paste, Select All, Clear Terminal actions. Reuses the shared tab-context-menu CSS classes for consistent styling and adds a small shortcut-hint style.
  • New module src/renderer/components/terminal-context-menu.ts exposes showTerminalContextMenu() / hideTerminalContextMenu(); integrated via a contextmenu listener on xtermWrap in terminal-pane.ts.
  • Refactors a small pasteWithBracketedMode helper out of terminal-pane.ts into terminal-utils.ts so it can be reused by both the keyboard-paste path and the context menu Paste action.
  • Co-located vitest coverage; CLAUDE.md updated.

Test plan

  • Build passes (npm run build)
  • All tests pass (npm test)
  • Right-click in a terminal shows the menu at the cursor
  • Copy works with an active selection (and is disabled/no-op when empty)
  • Paste inserts clipboard contents using bracketed paste mode
  • Select All highlights the full terminal buffer
  • Clear Terminal wipes the buffer without killing the PTY
  • Click outside / Escape dismisses the menu

Dependencies

Stacked on #115 (close-confirmation). The diff currently shows 23 commits because the branch is layered on top of #115's 15 commits — the actual feature is the last 8 commits (c99ef95a460a3c). Once #115 merges, I'll rebase this branch onto fresh main and force-push so the diff drops to a clean 8-commit / context-menu-only view. Reviewing only the terminal-context-menu commits is also a reasonable workflow.

🤖 Generated with Claude Code

@elirantutia
Copy link
Copy Markdown
Owner

Hey @PiratesIRC — could you rebase this onto current main and resolve the conflicts before I review? Note that #115 already shipped (commented over there), so the dependency chain doesn't apply — this should rebase straight onto main as a standalone PR. Thanks!

PiratesIRC and others added 10 commits May 4, 2026 06:29
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…sary comments

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nnerHTML

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@PiratesIRC PiratesIRC force-pushed the pr/terminal-context-menu branch from a460a3c to 41c3dd2 Compare May 4, 2026 11:37
@PiratesIRC
Copy link
Copy Markdown
Contributor Author

@elirantutia rebased onto current main and dropped the close-confirm commits — this is now standalone with 10 context-menu-only commits. Resolved conflicts in .gitignore, terminal-pane.ts (merged with the upstream WebGL/copy-on-select integration), and CLAUDE.md (kept upstream's board/team entries, added the terminal-context-menu component line). Build clean, 1525/1525 tests pass. Ready for review whenever you have time — thanks!

…ed listeners

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

2 participants