Skip to content

[Bug]: Security scan approval overlay: Ctrl+C treated as "deny" prevents copying command text #18375

@Hubedge

Description

@Hubedge

Bug Description

When Hermes TUI (hermes --tui) triggers a dangerous-command security scan and shows the approval overlay, pressing Ctrl+C is treated as "deny" — immediately rejecting the command — instead of allowing copy. This makes it impossible to select and copy the displayed command text for review before making a security decision.

The TUI (xterm.js-based interface) already has special handling for text-selection-aware copy in general use (#16181 mentions this), but the approval overlay intercepts Ctrl+C as its own "deny" binding, overriding any copy behavior even when text is selected.

Steps to Reproduce

  1. Start Hermes in TUI mode: hermes --tui
  2. Trigger a dangerous-command security scan (any terminal command matching DANGEROUS_PATTERNS)
  3. The approval overlay appears showing the command and approve/deny buttons
  4. Select text with the mouse (the command text, or any part of the overlay)
  5. Press Ctrl+C to copy the selection
  6. Observe: text is not copied; instead the command is denied immediately

Expected Behavior

When text is selected in the approval overlay, Ctrl+C should copy the selection. Deny should be triggered only when no text is selected, or via a separate keybinding. This is consistent with how the TUI already handles the text-selection vs interrupt distinction (#16181).

Actual Behavior

Ctrl+C is always intercepted by the approval overlay and treated as "deny", regardless of whether text is selected. The command is rejected immediately instead of being copied. Copy via right-click context menu also does not work because the approval overlay is a modal state with limited interaction.

Affected Component

Other (TUI — hermes --tui)

Messaging Platform (if gateway-related)

N/A (TUI)

Debug Report

Unable to run hermes debug share in this environment. Known details:

  • Hermes: v0.12.0 (2026.4.30)
  • Python: 3.11.15
  • OS: Ubuntu 24.04 (WSL2 on Windows 11)
  • Terminal: Windows Terminal

Operating System

Ubuntu 24.04 (WSL2 on Windows 11)

Python Version

3.11.15

Hermes Version

v0.12.0 (2026.4.30)

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/tuiTerminal UI (ui-tui/ + tui_gateway/)type/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