Skip to content

Oh My Posh ​

Catalog v12.

Oh My Posh is a prompt for Bash and Zsh. The module starts it with its own settings on two lines: the user and host, the directory, Git state and the duration of a slow command above, the prompt symbol below. It draws in the colors of the guest's theme.

Select ​

toml
[shell]
prompt = "oh-my-posh"

Apply the change after editing limanix.toml. The next limanix shell starts with Oh My Posh, in Zsh or in Bash.

Versions ​

Oh My Posh comes from the catalog's base Nixpkgs revision. This module has no version lines. Inside the VM, oh-my-posh version shows the version.

Use ​

PartShows
First lineuser@host, the directory, the Git branch with * for uncommitted changes and arrows for commits to push or pull, and how long a command over five seconds ran
lmx wordsOutside tmux, the words of lmx status --short that need attention, such as restart; inside tmux, its status line shows them
Prompt symbol❯, red after a failed command

The managed settings use plain symbols, which every terminal font draws.

Colors ​

With the default system theme, Oh My Posh draws in the terminal's own colors. Another theme in [theme] of limanix.toml becomes the settings' palette, with one entry per role, and each part names its role, such as p:blue for the directory.

Configuration and integration ​

BoundaryContract
ShellsBash and Zsh
Standard settingsAn ordinary programs.bash.promptInit or programs.zsh.promptInit assignment replaces Oh My Posh in that shell
Personal statePOSH_THEME, set in the [env] table, names your own settings file; the managed palette does not apply to it
Services and capabilitiesReads the guest's theme

Corner cases ​

CaseBehavior or next step
A theme from the Oh My Posh gallerySave its file in your home and set POSH_THEME to it; most gallery themes need a Nerd Font
Colors look wrongA palette theme needs a terminal with 24-bit color; the system theme does not

Free and open source under the Apache License 2.0.