Skip to content

[1.x] fix: Handle paths with parentheses in sbt.bat on Windows#8682

Merged
eed3si9n merged 1 commit intosbt:1.12.xfrom
eed3si9n:bport/8656
Feb 3, 2026
Merged

[1.x] fix: Handle paths with parentheses in sbt.bat on Windows#8682
eed3si9n merged 1 commit intosbt:1.12.xfrom
eed3si9n:bport/8656

Conversation

@eed3si9n
Copy link
Copy Markdown
Member

@eed3si9n eed3si9n commented Feb 3, 2026

This is a backport of #8656

Windows CMD interprets parentheses as special syntax for command grouping. When the project directory path contains parentheses (e.g., in username), the batch script fails with ') was unexpected at this time.' error.

This fix stores the current directory in a variable using delayed expansion (!CURRENT_DIR!) instead of using %CD% directly, which properly handles paths containing parentheses and other special characters.

Fixes #8644
Fixes #8658

)

Windows CMD interprets parentheses as special syntax for command grouping.
When the project directory path contains parentheses (e.g., in username),
the batch script fails with ') was unexpected at this time.' error.

This fix stores the current directory in a variable using delayed expansion
(!CURRENT_DIR!) instead of using %CD% directly, which properly handles
paths containing parentheses and other special characters.

Fixes sbt#8644
@eed3si9n eed3si9n merged commit d29e096 into sbt:1.12.x Feb 3, 2026
10 of 11 checks passed
@eed3si9n eed3si9n deleted the bport/8656 branch February 3, 2026 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants