Skip to content

[Bug] Unexpected token '}' in expression or statement. #3072

@PYCHBI

Description

@PYCHBI

Version Information

Cmder version: Version 1.3.25.328
Operating system: Win11 25H2 x64

Cmder Edition

N/A

Description of the issue

Whether using cmder or cmder_mini, after downloading and subtracted, without making any configuration changes, launching cmder with a built-in /task command such as D:\xxx\cmder\Cmder.exe /task "{XXXX}" works incorrectly for certain tasks.

For {cmd::Cmder as Admin} or {cmd::Cmder}, commands like D:\xxx\cmder\Cmder.exe /task "{cmd::Cmder}" or D:\xxx\cmder\Cmder.exe /task "{cmd::Cmder as Admin}" launch without issues.

However, when using PowerShell, an error occurs. The error message:

At line:1 char:108
+ ... esktop\Software\cmder_mini\vendor\conemu-maximus5\..\profile.ps1''' }
+                                                                        ~
Unexpected token '}' in expression or statement.
+ CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken

How to reproduce

Use the following command:
D:\xxxx\cmder\Cmder.exe /task "{PowerShell::PowerShell}"

Image

If one brace is manually removed from the command, like this:
D:\xxxx\cmder\Cmder.exe /task "{PowerShell::PowerShell"

Image

then cmder launches as expected.

Additional context

Since I didn't modify any configuration files after downloading and extracting, I believe the program likely has an extra closing curly brace in its code, which conflicts with the one inside the /task name.
This issue only occurs with "{PowerShell::PowerShell}" and "{PowerShell::PowerShell as Admin}" — cmd does not have this problem.

Checklist

  • I have read the documentation.
  • I have searched for similar issues and found none that describe my issue.
  • I have reproduced the issue on the latest version of Cmder.
  • I am certain my issues are not related to ConEmu, Clink, or other third-party tools that Cmder uses.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions