Skip to content

fish wrap: a typed rtk run --shell fish -c behind a leading line continuation is wrapped again #4923

Open

Description

@KuSh

With hooks.wrap_fish_scripts = true, fish on PATH, and settings allowing Bash(rtk:*) and Bash(git:*), rtk hook claude answers:

typed command permissionDecision updatedInput.command
rtk run --shell fish -c 'echo ok'; and git status (no output)
\, newline, rtk run --shell fish -c 'echo ok'; and git status ask rtk run --shell fish -c '\⏎rtk run --shell fish -c '\''echo ok'\''; and git status'

try_wrap (src/discover/fish_script.rs) refuses a script whose first word is rtk, read as script.split_whitespace().next() on the trimmed text. Behind a leading \ and newline, that first word is the \, so the check passes and a command the agent already typed in the wrap form is wrapped a second time. Bash drops the continuation, and the rewrite rules drop it too (#4762's row for the && form).

Measured on 32b2ec4 (#4127's merge, shipped in v1.1.0) and on #4785's head. The outcome is an extra prompt: the wrap carries an explicit ask, and a settings deny still blocks it.

A fix reads the first word as bash does, after the leading continuations. Test: the second row leaves the command unwrapped, as the first row does.

Activity

  1. added
    bug
    on Nov 1, 2026
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

    bughooks

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions