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"
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Crash on BatchApplyPropertiesFromSourceAssetDB when opening a specific project
- Scene view Camera cannot be moved with WASD/QE keys when the Right Mouse Button is held down and the Mouse is not moved
- Crash when calling default interface method from virtual method with same name
- [Android] Unity does not include the ".aab" extension for an AppBundle when it is built via script with the buildPlayerOptions.locationPathName = "AppName.apk" and EditorUserBuildSettings.buildAppBundle = true
- [Android] Duplicate fingers reported in InputSystem.EnhancedTouch.Touch.activeFingers array
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.