fix: enable right click to paste#13064
Merged
Merged
Conversation
OutThisLife
reviewed
Apr 20, 2026
ulasbilgen
pushed a commit
to ulasbilgen/hermes-adhd-agent
that referenced
this pull request
May 1, 2026
…ck-paste fix: enable right click to paste
aj-nt
pushed a commit
to aj-nt/hermes-agent
that referenced
this pull request
May 1, 2026
…ck-paste fix: enable right click to paste
Luminet2023
pushed a commit
to Luminet2023/hermes-agent
that referenced
this pull request
May 1, 2026
…ck-paste fix: enable right click to paste
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
…ck-paste fix: enable right click to paste
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
…ck-paste fix: enable right click to paste
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 2026
…ck-paste fix: enable right click to paste
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds right-click-to-paste in the React/Ink TUI. Previously, SGR mouse tracking inside the alt screen swallowed right-clicks (
handleMouseEventearly-returned on non-left presses), which meant the terminal's native right-click paste was intercepted by the app but never wired to anything — users had to reach for Alt+V or/paste.The fix dispatches middle/right-button presses through the DOM event system just like left-clicks, and has
TextInputlisten for button 2 and route it into the existing clipboard-paste hotkey path (same as Alt+V //paste). This reuses the gateway'sclipboard.pasteRPC for free, so right-click handles both text and image clipboard content identically to the existing hotkey.Approach rationale:
@hermes/ink'sApp.tsxto forward non-left presses (instead of swallowing them) is the minimal change and doesn't touch selection, multi-click, or hyperlink logic. Non-left presses intentionally skipmouseCaptureTargetso they don't start a drag capture.emitPaste({ hotkey: true })inTextInputkeeps all clipboard logic (image attach, text surface, OSC 52 fallback, Linux clipboard tool probing) in one place — the composer'shandleTextPastealready branches onhotkey: trueto callonClipboardPaste.Related Issue
Fixes #
Type of Change
Changes Made
ui-tui/packages/hermes-ink/src/ink/components/App.tsx— inhandleMouseEvent, forward middle/right-button presses (baseButton !== 0) toonMouseDownAtinstead of dropping them. Deliberately does not setmouseCaptureTargetso non-left releases stay a no-op in the existing release path.ui-tui/src/components/textInput.tsx— addonMouseDownon the outerBoxthat filters for SGR button 2 (right-click) and callsemitPaste({ hotkey: true, text: '', ... }), which funnels into the existing Alt+V path viauseComposerState.handleTextPaste.ui-tui/packages/hermes-ink/dist/ink-bundle.js— rebuilt (npm run build --prefix packages/hermes-ink).How to Test
cd hermes-agent/ui-tui && npm run dev📎 Image #N attached from clipboard.Automated:
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests pass — N/A (TUI-only change; rannpm testinui-tui/, 92/92 pass)ui-tui/src/__tests__/Documentation & Housekeeping
docs/, docstrings) — or N/A (behavior parallels existing Alt+V hotkey;content/hotkeys.tsalready lists the clipboard paste affordance)cli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/Aclipboard.pastegateway RPC which already handles pbpaste / wl-paste / xclip / xsel / PowerShell; no new platform codeScreenshots / Logs