Skip to content

zsh: support leading parens for zsh glob alternations and flags in command arguments #1279

Closed

Description

@LangLangBart

Follow up to: #1276 (comment)

  • ✅ 1cf3c19: added support for it inside [[ ]] test expressions

Usage in regular command arguments is not supported when ( is a leading paren

# Alternation
./shfmt -ln zsh <<<'echo (foo|bar).baz'
# <standard input>:1:6: a command can only contain words and redirects; encountered `(`

# Case-insensitive flag (requires EXTENDED_GLOB)
./shfmt -ln zsh <<<'setopt extendedglob; ls (#i)*.mod'
# <standard input>:1:25: a command can only contain words and redirects; encountered `(`

Activity

  1. added a commit that references this issue on May 2, 2026
    47d4aad
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址