Skip to content

fix(web): make terminal selection actions reliable - #1

Closed
Adamulek123 wants to merge 10 commits into
mainfrom
fix/terminal-context-menu
Closed

Adamulek123 wants to merge 10 commits into
mainfrom
fix/terminal-context-menu

Conversation

@Adamulek123

Copy link
Copy Markdown
Owner

What Changed

Terminal text could be selected but then become effectively stuck: Copy was disabled in the desktop fallback menu, Ctrl+Shift+C and Ctrl+Shift+V did nothing while the initial selection popup was open, Paste did not work, and Add to chat disappeared after dismissing the first popup. Scrolling the terminal could leave the popup inconsistent with its selection.

This makes the initial selection popup and the reopened right-click menu use the same terminal-aware actions. Both expose Add to chat, Copy, and Paste; show the platform shortcut (Ctrl+Shift+C/V on Windows and Linux, ⌘C/V on macOS); execute those shortcuts while open; dismiss on outside clicks or terminal scrolling; and can be reopened without losing the selection.

Why

Electron's generic edit menu reads Chromium edit flags, but the terminal renders and owns selection through its canvas-backed Ghostty surface. Those edit flags therefore disabled valid terminal actions and could not paste into the PTY. A shared in-app terminal menu keeps selection, clipboard handling, shortcut behavior, and lifecycle cancellation under the terminal's control while still routing through the local host API.

The menu is aborted when its terminal closes or is replaced, and stale requests cannot act on a removed terminal. Clipboard and chat-context eligibility are tracked separately so newline-only selections remain copyable without creating empty chat context.

UI Changes

Before

Video upload pending: before_terminal.mp4 could not be attached because GitHub's video upload endpoint requires a browser user_session cookie that is unavailable in this environment.

After

Video upload pending: after_terminal.mp4 could not be attached for the same reason.

Validation

  • 70 focused terminal, context-menu, local API, and desktop-menu tests passed
  • Web, desktop, and contracts typechecks passed
  • Targeted lint, formatting, and git diff --check passed
  • Desktop behavior was exercised by the contributor; automated browser/computer-use verification was not run

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Generated with gpt-5.6-sol in the T3 Code Codex harness.

@Adamulek123

Copy link
Copy Markdown
Owner Author

Closing this duplicate fork-local PR. The intended contribution is upstream at pingdotgg#6555.

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.

6 participants