dotnet / dotnet/sdk

dotnetup: Improve shell detection

Open
#52,939 1 comment 0 reactions 0 assignees View on GitHub
Area-dotnetup
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

Currently we use the SHELL environment variable to detect the current shell. On Windows this isn't set and we assume if we need to check the shell on Windows that it's PowerShell. We check the shell to generate the environment setup scripts, and expect to also use it to modify the shell initialization / profile scripts to source this logic.

The SHELL environment variable represents the default login shell. So if you start a different shell the variable won't change and you might get results for the wrong shell. However, when you start a different shell its initialization scripts aren't run (AFAIK).

So we might want to update the logic here. If we're just generating the setup script to source, it might be better to look up the process tree to determine the shell to generate the scripts for. However, for actually modifying the initialization scripts, we may want to continue to use SHELL, as that's more likely to have the right effect.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.