Customizing PowerShell with posh-git, oh-my-posh, and PSReadLine
Up until this point, our PowerShell prompt has been rather drab, showing only the current working directory. Let's look at the oh-my-posh project, a third-party module that provides a way to make our PowerShell prompt both more attractive and useful.
Oh-my-posh can take our default prompt, which looks like this:
And turn it into this:
This prompt, in addition to standing out from surrounding terminal output, has the following additional features, among many others:
- Supports a rich status display of Git repository state
- Supports many alternate themes
- Shortens longer paths, and supports displaying the home directory as a tilde (~)
- Detects whether the current directory is a Python virtualenv or Anaconda environment, and displays the name of that environment
- Keeps...