try icon indicating copy to clipboard operation
try copied to clipboard

Fish shell instructions quote command substitution, so try init never runs

Open mcotdev opened this issue 2 months ago • 1 comments

When following the fish setup instructions emitted by try init (and the Homebrew caveat), fish rejects the command because it disallows (...) command substitutions in command position. The published line is:

eval "(try init ~/src/tries | string collect)"

Fish treats the whole (try …) as a literal string, errors with “command substitutions not allowed in command position,” and the helper function never gets defined.

🔍 Repro

fish -c 'eval "(try init ~/src/tries | string collect)"'
# fish: command substitutions not allowed in command position. Try var=(your-cmd) $var ...

## Fix

Remove the surrounding quotes so fish actually executes the substitution:

eval (try init ~/src/tries | string collect)

This matches what the README already recommends and is the same form used in the latest Formula documentation.

## Impact

Any existing fish user who copied the “quoted” instruction (from Homebrew caveats or earlier docs) will see the error and never get the try wrapper set up, even though the command itself is valid.

mcotdev avatar Nov 09 '25 05:11 mcotdev