dotnet / dotnet/sdk

dotnetup: Migrate mode selector to two sequential y/n prompts

Open
#53,838 0 comments 0 reactions 2 assignees Claimed by @nagilson View on GitHub
Area-dotnetup
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

## Summary

Replace the 3-option mode selector with two simpler yes/no questions, making the walkthrough less intimidating while preserving all configuration options.

## Current Behavior

The walkthrough presents a single 3-option interactive selector for `PathPreference`:
1. Shell Profile
2. Full Path Replacement
3. Isolated (dotnetup dotnet)

Users must understand all three modes upfront to make a choice.

## Proposed Behavior

### Prompt 1: Modify terminal profile (always shown)

```
Would you like to configure the current shell profile to use installs managed by dotnetup?
Only applications launched from the shell will leverage dotnetup installs.

> Yes (recommended)
No

Modify the current shell profile file to consume dotnetup on PATH environment variables. Recommended for users who want to develop
using dotnetup and launch their IDE through the terminal. Only PowerShell will work in this mode. CMD has no profile file. (only show on Windows)
```

No would show:
```
...
> No

Use 'dotnetup dotnet' to consume installs managed by dotnetup. New installs can be used alongside your existing installs.
Recommended for users without admin rights, or for users who want to keep their system managed installs (e.g. Program Files) as
the default.
```

- Accept hover selection (arrow keys) or typed `y`/`n`/`yes`/`no` (case-insensitive).
- Show the existing explanation text for the selected option.
- If **No** → set `PathPreference.DotnetupDotnet` (isolated mode). Done.

### Prompt 2: Replace system PATH (Windows only, shown only if Prompt 1 = Yes and a system .NET install exists)

```
Would you like to replace the system-level .NET PATH entry?
This removes existing installs from the system PATH and adds dotnetup's path instead.

> No (recommended)
Yes

Existing system installs will still be used outside your configured shell(s).
```

```
> Yes

Recommended for users who want all of their debuggers, applications, and IDEs to use dotnetup installs by default. Admin
privileges are required. Enables 'cmd' functionality by default. Other user accounts on this machine will be impacted and
applications may break.
```

- Same y/n input handling.
- If **Yes** → set `PathPreference.FullPathReplacement`.
- If **No** → set `PathPreference.ShellProfile`.

The `PathPreference` is not persisted until both questions are answered.

## Acceptance Criteria

- [ ] First prompt accepts y/n via keyboard selection or typed input (case-insensitive).
- [ ] Second prompt only appears on Windows when a system .NET install is detected and first answer was Yes.
- [ ] Existing explanation text is shown for the hovered/selected option.
- [ ] `PathPreference` is set correctly for all three paths (isolated, shell profile, full replacement).
- [ ] Config is not written until both applicable prompts are answered.
- [ ] Non-interactive mode defaults to `ShellProfile` without prompting.

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.