Installs Oh My Posh - a prompt theme engine for any shell with support for custom themes.
Add this feature to your .devcontainer/devcontainer.json:
Or with a theme:
{
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/iambipinpaul/devcontainer-features/oh-my-posh:1": {
"theme": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/jandedobbeleer.omp.json"
}
}
}| Option | Type | Default | Description |
|---|---|---|---|
version |
string | "latest" |
Version of Oh My Posh to install |
theme |
string | "" |
Theme URL or file path (empty = no theme) |
installForBash |
boolean | true |
Configure for bash shell |
installForZsh |
boolean | true |
Configure for zsh shell |
installForPwsh |
boolean | true |
Configure for PowerShell (auto-skips if not installed) |
The theme parameter accepts:
Direct URL to a theme configuration file from official themes:
"theme": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/atomic.omp.json"Browse themes: Visit https://ohmyposh.dev/docs/themes to see all available themes and copy their JSON URLs.
Path to a theme file in your repository:
"theme": "/workspaces/project/.devcontainer/custom-theme.omp.json"Use case: Project-specific custom themes
Leave empty to use Oh My Posh's default prompt:
"theme": ""{
"features": {
"ghcr.io/iambipinpaul/devcontainer-features/oh-my-posh:1": {}
}
}Installs Oh My Posh with default settings (both bash and zsh, no theme).
{
"features": {
"ghcr.io/iambipinpaul/devcontainer-features/oh-my-posh:1": {
"theme": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/jandedobbeleer.omp.json"
}
}
}{
"features": {
"ghcr.io/iambipinpaul/devcontainer-features/oh-my-posh:1": {
"theme": "/workspaces/project/.devcontainer/custom-theme.omp.json"
}
}
}{
"features": {
"ghcr.io/iambipinpaul/devcontainer-features/oh-my-posh:1": {
"theme": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/paradox.omp.json",
"installForZsh": false
}
}
}{
"features": {
"ghcr.io/devcontainers/features/powershell:1": {},
"ghcr.io/iambipinpaul/devcontainer-features/oh-my-posh:1": {
"theme": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/jandedobbeleer.omp.json",
"installForPwsh": true
}
}
}Note: PowerShell must be installed first (e.g., using the PowerShell feature).
- Oh My Posh Documentation - Official docs
- Browse All Themes - 200+ built-in themes
- Create Custom Themes - Theme customization guide
- Example Custom Theme - Sample theme file in this repo
Test locally by referencing the feature with a local path:
{
"features": {
"./src/oh-my-posh": {
"theme": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/jandedobbeleer.omp.json"
}
}
}See LICENSE for details.
{ "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "features": { "ghcr.io/iambipinpaul/devcontainer-features/oh-my-posh:1": {} } }