Skip to content

iAmBipinPaul/devcontainer-features

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Oh My Posh Dev Container Feature

Installs Oh My Posh - a prompt theme engine for any shell with support for custom themes.

Usage

Add this feature to your .devcontainer/devcontainer.json:

{
    "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
    "features": {
        "ghcr.io/iambipinpaul/devcontainer-features/oh-my-posh:1": {}
    }
}

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"
        }
    }
}

Options

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)

Theme Options

The theme parameter accepts:

1. Theme URL (Recommended)

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.

2. File Path

Path to a theme file in your repository:

"theme": "/workspaces/project/.devcontainer/custom-theme.omp.json"

Use case: Project-specific custom themes

3. No Theme (Default)

Leave empty to use Oh My Posh's default prompt:

"theme": ""

Examples

Minimal Installation

{
    "features": {
        "ghcr.io/iambipinpaul/devcontainer-features/oh-my-posh:1": {}
    }
}

Installs Oh My Posh with default settings (both bash and zsh, no theme).

With Theme URL

{
    "features": {
        "ghcr.io/iambipinpaul/devcontainer-features/oh-my-posh:1": {
            "theme": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/jandedobbeleer.omp.json"
        }
    }
}

With Custom Theme File

{
    "features": {
        "ghcr.io/iambipinpaul/devcontainer-features/oh-my-posh:1": {
            "theme": "/workspaces/project/.devcontainer/custom-theme.omp.json"
        }
    }
}

Bash Only

{
    "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
        }
    }
}

PowerShell Support

{
    "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).

More Information

Development

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"
        }
    }
}

License

See LICENSE for details.

About

Oh My Posh Dev Container Feature

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages