Search Issue Tracker
Fixed in 2020.3.48f1, 2021.3.23f1, 2022.2.16f1, 2023.1.0b13, 2023.2.0a9
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
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"
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- Vertex data is displaced when building with Addressables with Optimize Mesh Data enabled
- [macOS] “Input.GetMouseButtonDown” gets set to true when pressing and when releasing the mouse button in the Device Simulator view if "targetFrameRate" is set in the script
- UWP Capabilities are not changed when rebuilding the project
- [Oculus] Lights causing artifacts when Forward+ Rendering is selected
- Game Window Icons are white when in light mode
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.