Skip to content

Clipboard image paste always resolves to one fixed remote path, ignoring which of 3 attached sessions (local + 2 remotes) is focused #4005

Description

@hjma29

Current behavior

When multiple Herdr sessions are attached at the same time — one local session plus two (or more) --remote <host> sessions — clipboard image paste does not seem to be aware of which of the three hosts the currently-focused pane actually belongs to.

In practice, once any remote session has been attached during the run, subsequent image pastes (e.g. Cmd+V of a screenshot) keep landing as a temp file path on one fixed remote host (/tmp/cmux-drop-*.jpg style path), even when:

  • the focused pane is the local session, or
  • the focused pane belongs to the other remote host (remote2, not remote1).

This means an agent/tool running in the local pane, or in remote2, tries to read an image path that doesn't exist on its own filesystem, because the file was actually written to remote1 (or wherever the "last used"/default target host happens to be).

Expected behavior

Clipboard image paste should resolve the destination host from the currently focused pane's session, not from a single cached/default remote target:

  • Local session focused → image written to a local tmp path.
  • Remote1 pane focused → image written to remote1's tmp path.
  • Remote2 pane focused → image written to remote2's tmp path.

Setup

  • 1 local Herdr session
  • 2 separate --remote <host> sessions attached concurrently (different remote hosts)
  • Paste behavior tested by copying a screenshot/image to the system clipboard and pasting into panes belonging to each of the three sessions in turn

Why this matters

With herdr increasingly supporting multiple remote servers in one sidebar (see #334), this ambiguity gets worse as more hosts are attached — users/agents can silently receive a path for the wrong machine with no error, only a downstream "file not found" from whatever they paste into.

Additional context

I don't see an existing issue that covers this specific 1-local + N-remote host-resolution ambiguity for clipboard image paste (closest related issues I found: #3975, #828, #1741, #334, #2448 — none of which describe routing to the wrong host among 3+ concurrently attached sessions specifically).

Activity

  1. added
    p2valid narrow or ordinary defect with limited impact or a practical workaround
    inputkeyboard, mouse, clipboard, selection, or IME behavior
    remoteaffects SSH, headless, or remote attachment behavior
    maintainer-neededrequires maintainer judgment or maintainer-only reproduction
    on Sep 12, 2026
  2. ogulcancelik commented on Sep 12, 2026

    @ogulcancelik
    Collaborator

    are you running herdr inside cmux and if so, can you try this outside of cmux please?

  3. hjma29 commented on Sep 13, 2026

    @hjma29
    Author

    Thank you for the prompt response. I tried Wezterm and it worked. I also tried cmux again and it worked this time so I'm sort of puzzled.

    when it's working, my pasted clipboard image will show the following format.

    (remote host 1)
    client-198-clipboard-17893328584033760.jpg

    (remote host 2)
    client-116-clipboard-1789332819466154041-0.jpg

    so they have different client ID.

    when it's not working inside cmux, it had that
    /tmp/cmux-drop/...

    for all local and remote connections.

    I'm not sure why it's working now even for cmux and it doesn't show the oriignal /tmp/cmux-drop file format anymore. Just want to share what I see here.

    I'd interested to know if it's herdr injected the new file path and how does it work but don't want to take too much of your time.

    You may close this anytime if you like.

    Thank you again!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    inputkeyboard, mouse, clipboard, selection, or IME behaviormaintainer-neededrequires maintainer judgment or maintainer-only reproductionp2valid narrow or ordinary defect with limited impact or a practical workaroundremoteaffects SSH, headless, or remote attachment behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions