prefix-dev / pixi

Package management made easy
https://pixi.sh
BSD 3-Clause "New" or "Revised" License
2.88k stars 156 forks source link

Don't show prompt (PS1) by default when you detect Starship is being used #1556

Open corneliusroemer opened 2 months ago

corneliusroemer commented 2 months ago

Problem description

I'm the fourth user to "complain" about the PS1 prompt being set by default by pixi.

It might be nice to disable the prompt whenever you notice someone uses starship. This is easy: just check for the STARSHIP env variable:

$ env
STARSHIP_SHELL=zsh
STARSHIP_SESSION_KEY=xxxxxxxxxxxxxx

See: https://github.com/prefix-dev/pixi/issues/523, https://github.com/prefix-dev/pixi/issues/1275, https://github.com/prefix-dev/pixi/issues/1533, #1555

ruben-arts commented 1 month ago

What happens for you? As on my bash shell it just gets ignored and I only see the starship generated prompt.

corneliusroemer commented 1 month ago

@ruben-arts are you sure you have made sure that you have not set your config to change-ps1 = false?

Maybe I didn't express myself clearly enough:

Proposal: Default to change-ps1 = false when you detect the user using starship (unless you want to generally set ps1=false, which might go too far, but I wouldn't mind)

Yura52 commented 1 month ago

A quick thought: a user can have a custom starship configuration that does not show the environment-related prompt. Then, removing the pixi prompt for starship users by default will mean showing no environment prompt at all.

corneliusroemer commented 1 month ago

Hmm, if someone has customized starship to not show conda environments then presumably they don't want the environment to show. If they miss it they can add it. After all they know how to customize, as the environment shows by default IIRC.

Why does one need to show the prompt? It's so intrusive. It should be opt in. I thought pixi wants to be like npm for python. npm doesn't show a prompt either.