automotiveMastermind / prompt

A spectacular prompt for *nix distributions.
MIT License
9 stars 6 forks source link

replace set-prompt with starship-based prompt #76

Closed dmccaffery closed 3 years ago

dmccaffery commented 3 years ago

Starship is a fantastic and highly customisable prompt that can (and likely should) replace the script-based prompt we include. Most of the functionality of prompt remains; this would only impact the look and feel.

image

dmccaffery commented 3 years ago

@sjk07 / @patrickserrano : submitted draft PR #77 that adds this functionality -- if you guys think the above looks good, I'll submit the PR formally.

patrickserrano commented 3 years ago

@dmccaffery I was using starship before prompt, so I support this change. That said can you just walk through the components of the first line of the prompt?

It looks like

<cwd> on <branch> <git activity> on <machine> on <other machine?> 

Also does this change include displaying the pyenv/direnv in the prompt still or will that need to be added in a separate PR?

dmccaffery commented 3 years ago

It does include python env, GoLang, nvm, kubernetes context, etc. The two things on the end in my case are the cloud regions (aws is the orange, gcp is the blue) based on my configuration.

Starship is highly adaptive to context, but the default configuration will be included in the user profile in the PR if you want to take a look. I only change a few things; mainly adding counts to git status as well as using real logos as symbols from fira code nerd font.

dmccaffery commented 3 years ago

Here is the config:

https://github.com/automotiveMastermind/prompt/blob/656d329c3c4e90df94444b33439ba2adf389548d/src/user/starship.toml

Note that GitHub doesn't render the utf symbols correctly -- but these are the logos for the various languages / frameworks out of nerd fonts.

sjk07 commented 3 years ago

I have had some issues with starship in powershell... instantly hangs when I go into a git repo for ages. Ill check to see how it works on wsl2 since we don't support powershell anyway

sjk07 commented 3 years ago

This might be just a windows thing. current prompt in wsl is slow in git repos as well (not as slow)

dmccaffery commented 3 years ago

git is slow in general in WSL -- starship is faster than the script based prompt on windows / linux, which makes sense as its not forking child processes to parse the porcelain output.

dmccaffery commented 3 years ago

:tada: This issue has been resolved in version 8.3.0-next.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: