From e93b4d1dcdccacbcd00c7cc2adc6c0b6cea4a687 Mon Sep 17 00:00:00 2001 From: teknium1 Date: Thu, 5 Mar 2026 22:48:39 -0800 Subject: [PATCH] feat: Alt+V keybinding for clipboard image paste Alt key combos pass through all terminal emulators (sent as ESC + key), unlike Ctrl+V which terminals intercept for text paste. This is the reliable way to attach clipboard images on WSL2, Windows Terminal, VSCode, and SSH sessions where Ctrl+V never reaches the application for image-only clipboard content. Also adds 'Paste image: Alt+V (or /paste)' hint to /help output. --- cli.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/cli.py b/cli.py index eec569749..5aa87d413 100755 --- a/cli.py +++ b/cli.py @@ -1246,7 +1246,8 @@ class HermesCLI: _cprint(f" {_GOLD}{cmd:<22}{_RST} {_DIM}-{_RST} {info['description']}") _cprint(f"\n {_DIM}Tip: Just type your message to chat with Hermes!{_RST}") - _cprint(f" {_DIM}Multi-line: Alt+Enter for a new line{_RST}\n") + _cprint(f" {_DIM}Multi-line: Alt+Enter for a new line{_RST}") + _cprint(f" {_DIM}Paste image: Alt+V (or /paste){_RST}\n") def show_tools(self): """Display available tools with kawaii ASCII art.""" @@ -2644,6 +2645,22 @@ class HermesCLI: if self._try_attach_clipboard_image(): event.app.invalidate() + @kb.add('escape', 'v') + def handle_alt_v(event): + """Alt+V — paste image from clipboard. + + Alt key combos pass through all terminal emulators (sent as + ESC + key), unlike Ctrl+V which terminals intercept for text + paste. This is the reliable way to attach clipboard images + on WSL2, VSCode, and any terminal over SSH where Ctrl+V + can't reach the application for image-only clipboard. + """ + if self._try_attach_clipboard_image(): + event.app.invalidate() + else: + # No image found — show a hint + pass # silent when no image (avoid noise on accidental press) + # Dynamic prompt: shows Hermes symbol when agent is working, # or answer prompt when clarify freetext mode is active. cli_ref = self