dotnet / dotnet/sdk

`dotnet` first-run text negatively impacts completion script generation

Open
#50,065 1 comment 3 reactions 1 assignee Assigned to @Copilot View on GitHub
Area-CLI
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

### Describe the bug

Users often put a comment to load up CLI completion scripts in their shell profiles, like so: `dotnet completions generate | eval` or similar.

This works great when the command only returns expected shell-script output on stdout.

However, any command will also trigger the CLI's first-run experiences, which emit to stdout. This results in user shell completions being corrupted and often reporting errors.

We should:
* make it so first-run text never fires for completions-related commands

An alternative fix is to:
* make all of the first-run related code emit to stderr instead of stdout so that users that use the completions commands in scripts do not get corrupted environments

This second change is breaking because on framework powershell, any command containing stderr is considered failed. If we do that, we should do it earlier in the cycle, along with other changes, and breaking change docs.

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.