The default shell is hard-coded into the Rez executable; which means that if you call rez env from cmd.exe, you'll drop into another cmd.exe. But if you call it from PowerShell, you'll also drop into cmd.exe.
Implementation
Detect parent process, and figure out it's name, e.g. cmd.exe or powershell.exe on Windows, and bash on Unix.
Relevant
/proc/self/exe is a simlink to the currently running executable on Unix
Goal
Be smart about which subshell to use.
Motivation
The default shell is hard-coded into the Rez executable; which means that if you call
rez env
fromcmd.exe
, you'll drop into anothercmd.exe
. But if you call it fromPowerShell
, you'll also drop intocmd.exe
.Implementation
Detect parent process, and figure out it's name, e.g.
cmd.exe
orpowershell.exe
on Windows, andbash
on Unix.Relevant
/proc/self/exe
is a simlink to the currently running executable on Unix