Skip to content

Terminal: a right-click menu that fits, Backspace deletes a selection (#44) - #46

Merged
Maxaubert merged 1 commit into
mainfrom
feat/terminal-menu-selection
Sep 23, 2026
Merged

Maxaubert merged 1 commit into
mainfrom
feat/terminal-menu-selection

Conversation

@Maxaubert

Copy link
Copy Markdown
Owner

Closes #44. Owner, 2026-09-23.

The right-click menu fits what was clicked (this app's menu):

  • Over a link: Copy link first, the whole link even across a wrap.
  • With text marked: Copy, exactly the selection.
  • Then Paste, Find in scrollback, Command help. Close tab is gone from this menu; the tab's own menu, Ctrl+W and the X keep it.
  • Copies go through main's clipboard (writeClipboard), like command help.

Backspace deletes a selection (in core/, so this is a change to Prism's terminals too):

  • Backspace or Delete, unmodified, over a selection that starts and ends on the line being edited sends Left/Right to the selection's end, then one DEL per character.
  • The click-to-place-caret refusals apply (a program owning the mouse, full screen, scrolled back, hidden cursor, text below); anywhere else the key is the shell's, untouched.
  • Pure rules in core/renderer/lib/termSelectionEdit.ts; termContextAt (core, read-only) answers what is under a point, which Prism's menu can use after the bump.

Versions: app 0.12.0 -> 0.13.0, core 0.10.0 -> 0.11.0.

Tests

  • Unit: termSelectionEdit.test.ts (gate, end/middle/backwards selections, trailing cells, wide characters, application cursor keys, linkAt). 882 passed; typecheck; lint 0 errors.
  • e2e selectionEdit, real pwsh, real drag and keys: Backspace over a selected word at the end, and in the middle; a selection in old output leaves Backspace to the shell; right-click on a link shows Copy link first and copies it (read back in main); plain text offers no Copy; marked text offers Copy and copies it exactly; no Close tab. Fails on the old code. dropAndMenu now asserts Close tab is absent.
  • Full e2e: all scenarios passed except spawn once ("an empty launch lands on the start screen"), as the first scenario right after a hung earlier run's processes were killed; it passes on a rerun, on this branch and on main.

🤖 Generated with Claude Code

…ection (#44)

- Right-click over a link offers Copy link, with text marked offers Copy;
  Close tab leaves the terminal's menu (the tab's own menu keeps it).
- Backspace or Delete over a selection on the line being edited deletes it,
  by the presses a user would make (core, so Prism's terminals too).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Maxaubert
Maxaubert merged commit 158465e into main Sep 23, 2026
2 checks passed
@Maxaubert
Maxaubert deleted the feat/terminal-menu-selection branch September 23, 2026 09:15
github-actions Bot pushed a commit that referenced this pull request Sep 23, 2026
…ection (#44) (#46)

- Right-click over a link offers Copy link, with text marked offers Copy;
  Close tab leaves the terminal's menu (the tab's own menu keeps it).
- Backspace or Delete over a selection on the line being edited deletes it,
  by the presses a user would make (core, so Prism's terminals too).

Co-authored-by: Claude Opus 5.5 <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.

Terminal: a right-click menu that fits (Copy, Copy link), Backspace deletes a selection, no Close tab in it

1 participant