mxc
mxc copied to clipboard
[IsolationSession] A `process.env` entry without `=` is set as an empty variable
Relevant area(s)
Windows
Brief description of your issue
The IsolationSession backend passes a process.env entry that has no =, such as FOO, as the variable FOO with an empty value (src/mxc-sdk/src/backends/isolation_session/common/process_options.rs :: build_process_options). Bubblewrap, ProcessContainer, Seatbelt and WSLc drop such an entry because it names no variable, as the shared src/mxc-sdk/src/core/mxc_common/default_env.rs :: env_pairs does.
Steps to reproduce
Read from the code at d22e3515; not run.
build_process_optionssplits each entry at its first=and gives an entry without one an empty value, soFOOandFOO=both become("FOO", "").- The backend accepts
process.envonly withprocess.inheritDefaultEnv: true, which layers the entries over the default environment. build_pty_process_optionsstarts frombuild_process_options, so PTY runs do the same.
Expected behavior
A bare entry leaves the process's environment unchanged, as on Bubblewrap, ProcessContainer, Seatbelt and WSLc.
Actual behavior
The process gets the variable with an empty value, so a bare entry that names a default variable, such as TEMP, empties it.