Skip to content

Brace expansion broken in v3.44.1 due to over-escaping of curly braces #2401

@junhaoliao

Description

@junhaoliao

Description

In version 3.44.1, commit d2bd834 introduced an escape function that incorrectly escapes curly braces { and } in shell commands. This breaks brace expansion functionality, causing commands like ls file.{txt,md} to fail because the braces are escaped to \{ and \}, preventing shell expansion.

Steps to Reproduce

  1. Create a Taskfile.yaml with brace expansion as shown in the "Example Taskfile"
  2. Run the task: task

Expected behavior

The first command should create file.txt and file.md, and the second command should find and list these files.

Actual Behavior

The brace expansion is broken due to escaping, so the commands fail to work as intended. The ls command looks for a literal file named file.{txt,md} instead of expanding to file.txt and file.md.

Version

3.44.1

Operating system

Ubuntu 22.04.5 LTS (Jammy Jellyfish) # $ bash --version GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)

Experiments Enabled

No response

Example Taskfile

version: "3"

tasks:
  default:
    cmds:
      - "touch file.{txt,md}"
      - >-
        ls "file."{txt,md} || echo 'Files not found'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions