Problem
On macOS Terminal.app, the /copy command silently fails to copy text to the clipboard.
The current implementation in _write_osc52_clipboard relies exclusively on the OSC 52 escape sequence. Terminal.app does not support OSC 52 (unlike iTerm2 or Warp), so the sequence is sent but has no effect — the user gets the success message but the clipboard is unchanged.
Steps to reproduce
- Open Hermes TUI in macOS Terminal.app (
hermes)
- Ask anything, wait for a response
- Type
/copy and press Enter
- Try to paste — clipboard is empty
Expected behavior
The last assistant response is copied to the clipboard.
Environment
- macOS 15.x
- Terminal.app (built-in, no iTerm2)
- Hermes Agent v0.11.0
mouse_support=False is already set (not the cause)
Suggested fix
Add a native clipboard fallback after the OSC 52 attempt. On macOS, pbcopy is always available and requires no extra dependencies:
def _write_osc52_clipboard(self, text: str) -> None:
# ... existing OSC 52 code ...
# Fallback for terminals that don't support OSC 52 (e.g. Terminal.app)
import subprocess as _sp
import platform as _platform
try:
if _platform.system() == 'Darwin':
_sp.run(['pbcopy'], input=text.encode('utf-8'), check=True, timeout=3)
elif _platform.system() == 'Linux':
# try xclip / xsel
...
except Exception:
pass # OSC 52 already sent, native fallback failure is non-fatal
This is a two-line fix with zero new dependencies on macOS and gracefully degrades if pbcopy is somehow unavailable.
Workaround (for users hitting this now)
The fix can be applied locally to ~/.hermes/hermes-agent/cli.py until it lands upstream. Note that hermes update will overwrite the patch.
Problem
On macOS Terminal.app, the
/copycommand silently fails to copy text to the clipboard.The current implementation in
_write_osc52_clipboardrelies exclusively on the OSC 52 escape sequence. Terminal.app does not support OSC 52 (unlike iTerm2 or Warp), so the sequence is sent but has no effect — the user gets the success message but the clipboard is unchanged.Steps to reproduce
hermes)/copyand press EnterExpected behavior
The last assistant response is copied to the clipboard.
Environment
mouse_support=Falseis already set (not the cause)Suggested fix
Add a native clipboard fallback after the OSC 52 attempt. On macOS,
pbcopyis always available and requires no extra dependencies:This is a two-line fix with zero new dependencies on macOS and gracefully degrades if
pbcopyis somehow unavailable.Workaround (for users hitting this now)
The fix can be applied locally to
~/.hermes/hermes-agent/cli.pyuntil it lands upstream. Note thathermes updatewill overwrite the patch.