Skip to content

fix: restore terminal focus after context menu copy/paste - #819

Merged
nwparker merged 1 commit into
mainfrom
nwparker/please-fix-https-github.com-stablyai-orca-issues
Apr 19, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/please-fix-https-github.com-stablyai-orca-issues

Conversation

@nwparker

Copy link
Copy Markdown
Contributor

Summary

  • Fixes [Bug]: Terminal loses focus after context menu Copy/Paste #592: selecting Copy or Paste from the terminal right-click context menu left the terminal unfocused, so the user had to click the pane again before typing.
  • Radix returns focus to the menu trigger (the pane container) when the menu closes, but xterm.js only receives keyboard input when its own helper textarea is focused. After each context-menu Copy/Paste action we now call pane.terminal.focus() so input continues to flow immediately.
  • Only touches onCopy and onPaste in use-terminal-pane-context-menu.ts; no other code paths or platforms are affected.

Test plan

  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • Manual (Orca dev via /electron + playwright-cli): right-clicked a terminal pane, confirmed context menu opens; clicked Paste — verified document.activeElement is .xterm-helper-textarea after menu closes; repeated for Copy — same result.
  • Manual verification on Windows (Windows-specific right-click-to-paste path is untouched, but worth a sanity check since the bug was reported there).

@nwparker
nwparker merged commit 34ebcbf into main Apr 19, 2026
1 check passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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.

[Bug]: Terminal loses focus after context menu Copy/Paste

1 participant