This is a custom theme for Oh My Posh, called deadlydog
.
This is an example what the command prompt looks like with this theme:
The top line's left block displays:
- The logged in user and the computer name.
- Handy if you run as different users or SSH into different servers.
- The full current directory path.
- Easy to select and copy the path, and can
Ctrl
+Click
it to open in File Explorer.
- Easy to select and copy the path, and can
- If in a Git repository, shows the current Git branch and status.
- If an error occurred on the previous command, a red
!
is shown (not shown in screenshot).- Allows you to easily see if the previous executable returned a non-zero exit code.
The top line's right block displays:
- How long the previous command took to run.
- Great for when you start a long-running operation and walk away from your PC.
- The current time that the information was displayed.
The next line will show different information depending on the context:
- If logged into Azure, shows the current Azure subscription.
- If logged into Kubernetes, shows the current k8s context and namespace.
Lastly, the prompt character is shown on the final line to accept user input.
I wasn't quite happy with the out-of-the-box themes, so I created this one.
To use this theme:
-
Install Oh My Posh if you haven't already.
-
Download and unzip the latest release of the
deadlydog.omp.json
theme file. -
Place the
deadlydog.omp.json
file somewhere where it can permanently live on your computer. A good place is the default Posh Themes Path, which you can find by running$env:POSH_THEMES_PATH
in PowerShell. e.g. C:\Program Files\WindowsPowerShell\Modules\oh-my-posh\themes -
- The command will vary depending on which shell you are in.
- You may need to change the file path to where you saved the
deadlydog.omp.json
file on your computer. - In PowerShell it would look something like:
oh-my-posh --init --shell pwsh --config $env:POSH_THEMES_PATH/deadlydog.omp.json | Invoke-Expression
Or if you have installed the oh-my-posh PowerShell module using
Install-Module oh-my-posh
, you can use the command:Set-PoshPrompt -Theme $env:POSH_THEMES_PATH/deadlydog.omp.json
If some characters do not show up properly, or you get errors like the following, it likely means that your terminal is not using a font that supports the unicode characters used in this theme:
invalid char escape
literal not terminated
invalid char literal
I recommend using the CaskaydiaCove Nerd Code
font, which can be downloaded from here.
Once you have downloaded and installed the font, you will need to update your terminal to use it.
See what's changed in the application over time by viewing the changelog.
Buy me a donut 🍩 for providing this theme open source and for free 🙂