Skip to content

fix(herdr): seed mouse_capture=false so select-to-copy works under code-server - #39

Open
gitricko wants to merge 1 commit into
mainfrom
fm/ship-task-webtop-herdr-mouse-capture-off
Open

fix(herdr): seed mouse_capture=false so select-to-copy works under code-server#39
gitricko wants to merge 1 commit into
mainfrom
fm/ship-task-webtop-herdr-mouse-capture-off

Conversation

@gitricko

Copy link
Copy Markdown
Owner

Root cause

Inside hermes-webtop, Hermes is served through code-server (a browser web terminal). In a herdr pane, drag-select-to-copy to the system clipboard silently fails.

  • herdr defaults to mouse_capture = true, which intercepts pane mouse (SGR) events so xterm.js never gets the drag — native selection never starts.
  • herdr defaults to copy_on_select = true, auto-copying each selection via OSC 52. Per herdr release note #2015, the OSC 52 clipboard fix is scoped to VS Code Remote Tunnels ONLY, not code-server. So 0.7.4 (baked into the image, PR feat(docker): bake herdr + tmux into webtop image #38) is on the broken path.

The fix

Set ui.mouse_capture = false in herdr's config. This hands the mouse back to xterm.js and restores native select/copy. Setting copy_on_select = false alone is insufficient (the drag is still herdr-captured, nothing copies), so the fix is mouse_capture = false only.

Implementation

Added docker/start-herdr.sh (auto-copied into /custom-cont-init.d/ by the Dockerfile's COPY *.sh). It:

  • Sources common.sh, runs under runuser -l abc (matching the other seed scripts).
  • Gates on first boot only: seeds /config/.config/herdr/config.toml only if it does not already exist, so an existing user config is never overwritten on restart / image update.
  • Writes the exact [ui] TOML block (with the explanatory comment) and runs herdr config check to validate; skips the check gracefully if the binary is not yet on PATH at seed time.
  • Runs ensure_ownership on the config dir and logs a skip on second run.

Trade-off

Disabling mouse_capture turns off herdr's right-click context menu and click-to-focus pane features. In the webtop (always browser-served) this is acceptable in exchange for working select-to-copy. Desktop/local herdr users are unaffected — this config is webtop-specific.

Verification

  • bash -n docker/start-herdr.sh passes.
  • Seed test wrote a config that herdr config check reports as config: ok and that contains mouse_capture = false; TOML parses cleanly.
  • Idempotent: second run logs [start-herdr] config already present, skipping and does not overwrite.
  • git diff --stat shows only docker/start-herdr.sh added.

Copilot AI lite review requested due to automatic review settings August 18, 2026 06:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants