dotnet / dotnet/dotnet-api-docs
Unix-like platforms (Linux, macOS): `System.Diagnostics.ProcessStartInfo`: Clarify the helper-utility based behavior of `UseShellExecute = true`
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
As of this writing, https://learn.microsoft.com/en-US/dotnet/api/system.diagnostics.processstartinfo.useshellexecute is missing the following information:
* On Unix-like platforms, setting `UseShellExecute` to `true` requires _external helper utilities_ to function:
* On [Linux](https://github.com/dotnet/runtime/blob/9e31c21bcbb661fc4fa235839a66442a65ef447c/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Linux.cs#L110): any one of the following _three_ utilities must be locatable _via the `PATH` environment variable_: `xdg-open`, `gnome-open` or `kfmclient`
* A given Linux distro _may or may not_ come with any of these.
* On [macOS](https://github.com/dotnet/runtime/blob/9e31c21bcbb661fc4fa235839a66442a65ef447c/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.OSX.cs#L52), the built-in `open` utility is called via its _full path_, `/usr/bin/open`
Generally, setting `UseShellExecute` to `true` is a _GUI shell_ operation, and therefore makes no sense on terminal-only/headless systems.
Contributor guide
Assessment
This issue has not been assessed yet.