Skip to content

Terminal UX fixes: preview panel, right-click menu, native image paste - #8

Merged
ohernandezdev merged 2 commits into
mainfrom
handoff/macos-terminal-verification
Jul 26, 2026
Merged

Terminal UX fixes: preview panel, right-click menu, native image paste#8
ohernandezdev merged 2 commits into
mainfrom
handoff/macos-terminal-verification

Conversation

@ohernandezdev

Copy link
Copy Markdown
Owner

Summary

  • Right-click in the terminal now opens a real context menu (Copy, Paste, Copy Command Output, Select All, Find, Scroll to Bottom, Clear Screen, Stop Process, Show in File Explorer, New Tab, Close Tab) instead of silently pasting the clipboard.
  • File preview panel: Escape now actually closes it, the X button always works, state is released on close (no more stale content from another tab), and it can no longer be opened by a keyboard-only "click" (e.g. from Shift+Tab inside Claude Code).
  • Pasting into a Claude Code session with an image (no text) on the clipboard now feeds the raw Ctrl+V keystroke through so Claude Code's own native clipboard-image paste runs ([Image #1]), instead of substituting a temp-file path. Non-Claude CLIs keep the path fallback.
  • Version bumped to 0.8.18.

Verification

All of the above was verified live against an isolated test build (separate Tauri app identifier so tauri-plugin-single-instance wouldn't collide with the running dev instance), driven via CDP + Playwright — not just read from the code. Root causes confirmed along the way:

  • The Escape bug: xterm.js intercepts Escape internally and stops propagation before it reaches app-level listeners while the terminal has focus. Fixed by moving focus onto the panel when it opens (same pattern the confirm dialog already used).
  • The stuck-preview bug: the panel is a page-global singleton, so a file opened once and never properly closed (X was broken) kept showing across tab switches.

Test plan

  • Right-click a terminal — menu appears, nothing gets pasted
  • Right-click on a line with a file path — "Show in File Explorer" appears and opens the folder
  • Click a file link in the terminal to open the preview, press Escape — it closes
  • Open the preview, click X — it closes and a re-open shows fresh content (no stale file from a previous tab)
  • In a Claude Code tab, copy an image (no text) and paste — see native [Image #1], not a path

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
https://claude.ai/code/session_01GHgSVKPsaWRfuJMo1rc2AN

ohernandezdev and others added 2 commits July 27, 2026 01:40
…se z-index; feed Ctrl+V through for claude's native image paste

Escape and outside-click now share one closeFilePreview() path that also
clears previewPath/previewText/DOM so a stale file never lingers behind
the next open. File links only activate on a real pointer click (event
.detail === 0 marks a keyboard-synthesized click), and the panel now
sits above every other overlay so its close button can't be covered.
`claude` gets the raw Ctrl+V keystroke instead of AFKode's own
clipboard-image substitution, since Claude Code already reads the OS
clipboard itself on that keystroke.
Replaces the old copy-or-paste right-click with a real menu (Copy, Paste,
Copy Command Output, Select All, Find, Scroll to Bottom, Clear Screen, Stop
Process, Show in File Explorer when the click lands on a detected path,
New Tab, Close Tab) — right-click no longer silently pastes the clipboard.

Verified live against an isolated test build (separate app identifier, CDP
+ Playwright) rather than just by reading the code:
- Shift+Tab / keyboard-synthesized clicks can no longer open the file
  preview panel (activate() now requires a real pointer click).
- Escape now actually closes the preview: xterm.js intercepts Escape
  internally and stops its propagation before it reaches app-level
  listeners while the terminal still has focus, so opening the panel now
  moves focus onto it (matching the existing confirm-dialog pattern).
- The close button and outside-click both release preview state
  immediately (title/body/path), so a stale file from another tab can't
  linger behind the next open.
- The panel's z-index is raised above every other in-page overlay so its
  close button can never be covered and unclickable.

Also: pasting into a Claude Code session now feeds the raw Ctrl+V
keystroke through to the pty when the clipboard holds no text, so Claude
Code's own native clipboard-image handling runs (shows "[Image #1]")
instead of AFKode substituting a temp-file path. Non-Claude CLIs keep the
path-substitution fallback.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GHgSVKPsaWRfuJMo1rc2AN
@ohernandezdev
ohernandezdev force-pushed the handoff/macos-terminal-verification branch from 8c8dfe1 to 75f464b Compare July 26, 2026 23:40
@ohernandezdev
ohernandezdev merged commit 84e2edf into main Jul 26, 2026
3 checks passed
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.

1 participant