Skip to content

[Bug]: [WebUI] Cannot select arbitrary text in chat on macOS — xterm.js mouse-events mode blocks selection #25720

@aw0318

Description

@aw0318

Bug Description

Description

The Hermes Agent WebUI (/chat route) renders chat output via xterm.js with the enable-mouse-events class active. This effectively disables standard text selection in the chat area:

  • Click-and-drag does not select text
  • Double-click does not select a word
  • Triple-click does not select a line
  • Option/Alt + drag (standard xterm.js bypass) does not work
  • Shift + Option + drag does not work
  • Only right-click (rightClickSelectsWord) works, but it copies a single word at the pointer

Cmd+C with no active selection copies the entire visible buffer, which is rarely what the user wants.

Environment

Steps to Reproduce

  1. Start Hermes Agent WebUI
  2. Open http://127.0.0.1:9119/chat
  3. Have a chat session with some agent output
  4. Attempt to select any portion of the chat output by clicking and dragging

Result: Nothing is selected.

Investigation

DOM inspection confirms chat is rendered inside:

... Text is painted to . CSS overrides (user-select: text !important, -webkit-user-select: text !important, pointer-events: auto !important) and event blocking via stopImmediatePropagation at document capture phase for selectstart, mousedown, mouseup, dragstart, copy, contextmenu, pointerdown, and touchstart have no effect — confirming the issue is at the xterm.js configuration layer, not in standard DOM event handling.

Expected Behavior

Standard text selection should work in the chat output panel, either:

  • Always (direct drag-to-select, like a normal chat UI), or
  • With a documented modifier (e.g., Option + drag, the standard xterm.js bypass for mouse-events mode)

Selected text should be copyable via Cmd+C / Ctrl+C.

Suggested Fixes (any of)

  1. Disable enable-mouse-events for the chat output panel — mouse-events mode is meant for interactive TUI apps, not chat transcripts
  2. Ensure xterm.js Option-click selection bypass works as documented
  3. Add a per-message copy button (hover-revealed) as a UX workaround
  4. Provide a /copy slash command or "Export transcript" feature for the active session

Impact

Users cannot copy specific portions of agent output — code snippets, commands, URLs, file paths, etc. Current workaround is to copy the entire visible buffer to a text editor and manually trim, which is a significant productivity hit for a core chat interaction.

Steps to Reproduce

  1. Start Hermes Agent WebUI
  2. Open http://127.0.0.1:9119/chat
  3. Have a chat session with some agent output
  4. Attempt to select any portion of the chat output by clicking and dragging

Result: Nothing is selected.

Expected Behavior

Standard text selection should work in the chat output panel, either:

  • Always (direct drag-to-select, like a normal chat UI), or
  • With a documented modifier (e.g., Option + drag, the standard xterm.js bypass for mouse-events mode)

Selected text should be copyable via Cmd+C / Ctrl+C.

Actual Behavior

  • Click-and-drag in the chat area selects nothing — no text is highlighted
  • Cmd+C (with no selection) copies the entire visible chat buffer instead of a user-chosen portion
  • Double-click and triple-click do not select a word or line
  • Option + drag and Shift + Option + drag have no effect
  • Right-click (two-finger tap) opens a context menu that copies only the single word under the pointer — not a usable selection range
  • The chat output is therefore effectively read-only from a copy-paste perspective; users cannot extract code snippets, commands, file paths, or URLs from agent responses without copying the entire buffer and manually trimming in an external editor

Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

No response

Debug Report

UX/frontend

Operating System

macOS Tahoe 26.4.1

Python Version

Python 3.9.6

Hermes Version

v0.13.0 (2026.5.7)

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/gatewayGateway runner, session dispatch, deliverycomp/tuiTerminal UI (ui-tui/ + tui_gateway/)javascriptPull requests that update javascript codetype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions