Issue with an alias

I discovered that we can add aliases to a flox environment, that’s great.

However flox is choking on this one:

[aliases]
  ...
  ff="fzf --preview=\"bat {} --color=always\""

I get

○ flox -v activate
+ /nix/store/psgcq0br49h5pgnc4pzmpz88fspzx48w-jq-1.6-bin/bin/jq -r -f /nix/store/0cra2f2fjmxnlrxyx1hn8cksc7bdmgnn-flox-prerelease-0.0.6-r54/lib/manifestTOML.jq -s --arg system x86_64-darwin --argjson verbose 1 --arg profileOwner etorreborre --arg profileName default --arg FLOX_PATH_PREPEND /Users/etorreborre/.local/share/flox/environments/etorreborre/default/bin --args -- bashInit
flox: setting etorreborre/default aliases
+ alias ff="fzf --preview=bat {} --color=always"
/dev/fd/63: line 3: alias: {}: not found

If I replace the escaped double-quotes with single quotes then everything works ok.

1 Like

Yes, that would be the recommended solution. In truth the TOML method of defining aliases and hooks will soon be replaced with more standard hooks as defined using the Nix expression language, so if that workaround works for you then I’d suggest you just keep running with that for now.

Thanks for the feedback!

1 Like