Skip to content

Inconsistent behaviour in brace expansion #3004

Closed
@andgra2

Description

@andgra2

Brace expansion seems a bit inconsistent in its behaviour, see below. The documentation is also not so clear about this case.

Reproduction Steps:

  1. Run: begin; set -l arr a b; echo x{$arr,c}y; end
  2. Run: begin; set -l arr a b; echo x{{a,b},c}y; end

Expected behavior:

I expect 1. to give the same output as 2, ie: xay xby xcy.

That's the same output as echo x{a,b,c}y (ie things (arrays or other brace expressions) inside a brace expression should be unioned togheter when expanding).

This for consistency and simplicity reasons. I expect $arr and {a,b} to work in the same way in cases when they are both expanded.

Observed behavior:

  1. Outputs: xay xcy xby xcy
  2. Outputs: xay xby xcy

Additional information:


Fish version: fish, version 2.2.0-876-g1c6f6df
Operating system: ubuntu 64-bit, compiled fish from github source

Terminal or terminal emulator: The builtin terminal emulator of neovim.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions