mottosso / bleeding-rez

Rez - Reproducible software environments for Windows, Linux and MacOS
GNU Lesser General Public License v3.0
72 stars 10 forks source link

Detect parent shell #60

Open mottosso opened 5 years ago

mottosso commented 5 years ago

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 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