Skip to content

Copy-mode jump broken #1

Done
Done

Description

@0111b

Copy-mode jump broken: "client actions were not delivered: no client is targeted" (grapple_copy_mode_jump queues client actions without a target)

Summary

Picking a token and choosing copy-mode jump (j in grapple_hints, j/Enter in
grapple_leap) closes the overlay and focuses the target pane, but the cursor never
lands in copy mode. The server reports:

rex-grapple: rex do grapple_copy_mode_jump failed: Error: grapple_copy_mode_jump ran,
but its 5 client actions were not delivered: no client is targeted. Use -C.

Environment

Component Version
rex-grapple v0.2.0 (24c4e4cf1f663e7886c542e4635b6c13f78147ce), prebuilt rex-grapple-v0.2.0-darwin-arm64.tar.gz
rex (server + CLI) 0.1.0-preview.25 (commit b070aae6, api_revision 24)
Rex for Mac (client) 0.1.0-preview.37
OS macOS 26.7.1 (arm64)
fzf 0.75.0 (for grapple_extract, not involved here)

Also reproducible when the binary is invoked manually; not specific to my install method
(managed by mise + the Amber plugin manager).

Steps to reproduce

  1. Bind keys and load the plugin as documented (any binding, e.g. ctrl+a>g → grapple_hints).
  2. Open hints or leap over a pane containing a URL/path token.
  3. Pick a token and press j (copy-mode jump).
  4. The overlay closes, the target pane is focused — then the error above is printed.

Direct reproduction without the overlay:

rex do -s <session> grapple_copy_mode_jump --args '{"row":2,"col":3}'

Root cause

The callback chain loses the client identity:

  1. src/actions.rs::execute_action calls RexClient::run_action(None, "grapple_copy_mode_jump", …),
    which runs rex do -s <session> grapple_copy_mode_jump --args …
    (src/rex.rs::run_action) with no -C <client>.
  2. lua/rex-grapple/init.lua's grapple_copy_mode_jump queues 5 client actions via
    rex.client.queue("pane.copy_mode.*", …).
  3. Per the Rex Lua API docs, rex.client.queue(name[, args]) asks "the client" and
    "raises an error when there is no client to ask". An action invoked from a CLI
    process has no asking client, so rex do reports the queued client actions as
    undelivered and suggests -C.

This affects both grapple_hints and grapple_leap. Copy (c), paste (p), open
(o), and edit/tab are unaffected — they use server APIs rather than client actions.

Activity

  1. PrayagS commented on Dec 1, 2026

    @PrayagS
    Owner

    Thanks for the detailed report, @0111b!

    I pushed a fix in ab4c6c3:

    • lua/rex-grapple/init.lua now forwards ctx.client_id as --client when opening hints and leap overlays.
    • rex-grapple passes -C <client> to rex do grapple_copy_mode_jump (falling back to REX_CLIENT or the sole connected app client on the session if --client is not provided, e.g. when invoked manually).

    Could you pull the latest main (ab4c6c3), rebuild (mise run install or cargo build --release), reload your Rex config (rex config reload), and let me know if copy-mode jump works for you now?

  2. PrayagS commented on Dec 1, 2026

    @PrayagS
    Owner

    I can confirm the following command isn't failing for me on this commit,

    rex do -s <session> grapple_copy_mode_jump --args '{"row":2,"col":3}'
    
  3. 0111b commented on Dec 1, 2026

    @0111b
    Author

    Fix confirmed working — could you cut a release, please?

    Test setup

    Component Version
    rex-grapple ab4c6c3cc35a0477106a88e6d6a8183596cf860a (built from source)
    rex (server + CLI) 0.1.0-preview.25
    Rex for Mac 0.1.0-preview.37
  4. PrayagS commented on Dec 2, 2026

    @PrayagS
    Owner

    Thanks for the quick response.

    The fix is live v0.2.1

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions