Search Issue Tracker

Fixed

Fixed in 2020.3.48f1, 2021.3.23f1, 2022.2.16f1, 2023.1.0b13, 2023.2.0a9

Votes

0

Found in

2020.3.42f1

2021.3.15f1

2022.2.0f1

2023.1.0a22

2023.2.0a1

Issue ID

UUM-21600

Regression

No

Commandline receives different commands when passing through System.Environment.Commandline method

--

-

How to reproduce:
1. Open the attached “repro-project.zip”
2. Click “Tools → Automated Command Line Tests”
3. Wait for the process to finish and observe the console

Expected results: The output should be the same as the input.
Actual result: The output differs from the input, replacing come characters and adding quotes.

Reproducible with: 2020.3.42f1, 2021.3.15f1, 2022.2.0f1, 2023.1.0a22

Reproducible on: Windows 10

Example output:
Input: -developer -screen-width 1920 -screen-height 1080 -force-d3d11 -annoy-me -developer --twset "DevEnvironments.InitialEnvironment"=04 --twset "Quality Settings.SRP Batcher"=off -force-gfx-direct -force-d3d12-debug
Output: -developer -screen-width 1920 -screen-height 1080 -force-d3d11 -annoy-me -developer --twset "DevEnvironments.InitialEnvironment\"=04 --twset \"Quality Settings.SRP Batcher\"=off -force-gfx-direct -force-d3d12-debu"

  1. Resolution Note (fix version 2023.2.0a9):

    Arguments are now correctly split when quoting sequence starts mid-way. Furthermore, support for escaped double quotes is added.
    It is worth noting that passed arguments will only sometimes match the exact format from System.Environment.CommandLine. This is because arguments containing spaces will always be quoted, quotes from quoted sequences will be removed, escaped characters will become not escaped, etc.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.