Saltar a contenido

Oh My Posh - Cross-Platform Prompt Engine

"Clase de la hoja"

########################################################################################################################################################################################################################################################## Copiar todos los comandos
########################################################################################################################################################################################################################################################## Generar PDF seleccionado/button

■/div titulada

Oh My Posh es un motor de impulso personalizado para cualquier shell que tenga la capacidad de ajustar la cadena de impulso con una función o variable. Está diseñado para ser rápido, extensible y multiplataforma, con una fuerza particular en Windows PowerShell y Windows Terminal. Oh My Posh ofrece temas hermosos, amplias opciones de personalización, y una integración perfecta en diferentes sistemas operativos y conchas.

Instalación

Instalación de Windows

PowerShell (Recomendado)

# Install via PowerShell Gallery
Install-Module oh-my-posh -Scope CurrentUser

# Install via Winget
winget install JanDeDobbeleer.OhMyPosh

# Install via Chocolatey
choco install oh-my-posh

# Install via Scoop
scoop install https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/oh-my-posh.json

Instalación manual

# Download and install manually
Invoke-WebRequest -Uri "https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-windows-amd64.exe" -OutFile "$env:USERPROFILE\oh-my-posh.exe"

# Add to PATH
$env:PATH += ";$env:USERPROFILE"

macOS Instalación

# Homebrew
brew install jandedobbeleer/oh-my-posh/oh-my-posh

# Manual installation
curl -s https://ohmyposh.dev/install.sh|bash -s

# Add to PATH
export PATH=$PATH:/usr/local/bin

Instalación de Linux

# Install script
curl -s https://ohmyposh.dev/install.sh|bash -s

# Manual download
wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O /usr/local/bin/oh-my-posh
chmod +x /usr/local/bin/oh-my-posh

# Package managers
# Arch Linux
yay -S oh-my-posh

# Ubuntu/Debian (via .deb package)
wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64.deb
sudo dpkg -i posh-linux-amd64.deb

Instalación de fuentes

# Install Nerd Fonts (required for icons)
oh-my-posh font install

# Install specific font
oh-my-posh font install meslo

# List available fonts
oh-my-posh font list

# Manual font installation
# Download from https://www.nerdfonts.com/
# Install CascadiaCode, FiraCode, or Meslo LG fonts

Configuración de Shell

PowerShell Setup

# Add to PowerShell profile
# Check profile location
$PROFILE

# Create profile if it doesn't exist
if (!(Test-Path -Path $PROFILE)) \\\\{
    New-Item -ItemType File -Path $PROFILE -Force
\\\\}

# Add Oh My Posh initialization
Add-Content -Path $PROFILE -Value 'oh-my-posh init pwsh|Invoke-Expression'

# With custom theme
Add-Content -Path $PROFILE -Value 'oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json"|Invoke-Expression'

# Reload profile
. $PROFILE

Bash Setup

# Add to ~/.bashrc
echo 'eval "$(oh-my-posh init bash)"' >> ~/.bashrc

# With custom theme
echo 'eval "$(oh-my-posh init bash --config ~/.poshthemes/jandedobbeleer.omp.json)"' >> ~/.bashrc

# Reload configuration
source ~/.bashrc

Zsh Setup

# Add to ~/.zshrc
echo 'eval "$(oh-my-posh init zsh)"' >> ~/.zshrc

# With custom theme
echo 'eval "$(oh-my-posh init zsh --config ~/.poshthemes/jandedobbeleer.omp.json)"' >> ~/.zshrc

# Reload configuration
source ~/.zshrc

Fish Setup

# Add to ~/.config/fish/config.fish
echo 'oh-my-posh init fish|source' >> ~/.config/fish/config.fish

# With custom theme
echo 'oh-my-posh init fish --config ~/.poshthemes/jandedobbeleer.omp.json|source' >> ~/.config/fish/config.fish

# Reload configuration
source ~/.config/fish/config.fish

Comando Prompt (CMD) Configuración

# Install Clink first
# Download from: https://chrisant996.github.io/clink/

# Create oh-my-posh.lua in Clink scripts directory
# %LOCALAPPDATA%\clink\oh-my-posh.lua
load(io.popen('oh-my-posh init cmd'):read("*a"))()

Gestión temática

Temas incorporados

# List all available themes
oh-my-posh get themes

# Preview themes
oh-my-posh get themes --list

# Set theme
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\agnoster.omp.json"|Invoke-Expression

# Popular themes
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json"|Invoke-Expression
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\paradox.omp.json"|Invoke-Expression
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\powerlevel10k_rainbow.omp.json"|Invoke-Expression
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\atomic.omp.json"|Invoke-Expression
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\blue-owl.omp.json"|Invoke-Expression

Ubicaciónes temáticas

# Windows theme location
$env:POSH_THEMES_PATH

# macOS/Linux theme location
$(oh-my-posh get themes-path)

# List theme files
# Windows
Get-ChildItem -Path "$env:POSH_THEMES_PATH" -Filter "*.omp.json"

# macOS/Linux
ls $(oh-my-posh get themes-path)/*.omp.json

Creación de Temas Personalizados

\\\\{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "version": 2,
  "final_space": true,
  "console_title_template": "\\\\{\\\\{ .Shell \\\\}\\\\} in \\\\{\\\\{ .Folder \\\\}\\\\}",
  "blocks": [
    \\\\{
      "type": "prompt",
      "alignment": "left",
      "segments": [
        \\\\{
          "type": "path",
          "style": "powerline",
          "powerline_symbol": "\uE0B0",
          "foreground": "#ffffff",
          "background": "#61AFEF",
          "template": " \uF07C \\\\{\\\\{ .Path \\\\}\\\\} ",
          "properties": \\\\{
            "style": "folder"
          \\\\}
        \\\\},
        \\\\{
          "type": "git",
          "style": "powerline",
          "powerline_symbol": "\uE0B0",
          "foreground": "#193549",
          "background": "#95ffa4",
          "template": " \\\\{\\\\{ .HEAD \\\\}\\\\}\\\\{\\\\{if .BranchStatus \\\\}\\\\} \\\\{\\\\{ .BranchStatus \\\\}\\\\}\\\\{\\\\{ end \\\\}\\\\}\\\\{\\\\{ if .Working.Changed \\\\}\\\\} \uF044 \\\\{\\\\{ .Working.String \\\\}\\\\}\\\\{\\\\{ end \\\\}\\\\}\\\\{\\\\{ if and (.Staging.Changed) (.Working.Changed) \\\\}\\\\}|\\\\{\\\\{ end \\\\}\\\\}\\\\{\\\\{ if .Staging.Changed \\\\}\\\\} \uF046 \\\\{\\\\{ .Staging.String \\\\}\\\\}\\\\{\\\\{ end \\\\}\\\\} "
        \\\\}
      ]
    \\\\},
    \\\\{
      "type": "prompt",
      "alignment": "right",
      "segments": [
        \\\\{
          "type": "node",
          "style": "plain",
          "foreground": "#6CA35E",
          "template": "\uF898 \\\\{\\\\{ .Full \\\\}\\\\} "
        \\\\},
        \\\\{
          "type": "time",
          "style": "plain",
          "foreground": "#007ACC",
          "template": "\\\\{\\\\{ .CurrentDate|date .Format \\\\}\\\\} "
        \\\\}
      ]
    \\\\},
    \\\\{
      "type": "prompt",
      "alignment": "left",
      "newline": true,
      "segments": [
        \\\\{
          "type": "text",
          "style": "plain",
          "foreground": "#007ACC",
          "template": "❯ "
        \\\\}
      ]
    \\\\}
  ]
\\\\}

Estructura de configuración

Configuración básica

\\\\{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "version": 2,
  "final_space": true,
  "console_title_template": "\\\\{\\\\{ .Shell \\\\}\\\\} in \\\\{\\\\{ .Folder \\\\}\\\\}",
  "blocks": []
\\\\}

Configuración del bloque

\\\\{
  "type": "prompt",
  "alignment": "left",
  "newline": false,
  "segments": []
\\\\}

Configuración de segmentos

\\\\{
  "type": "path",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "foreground": "#ffffff",
  "background": "#61AFEF",
  "template": " \uF07C \\\\{\\\\{ .Path \\\\}\\\\} ",
  "properties": \\\\{\\\\}
\\\\}

Segmentos básicos

Path Segment

\\\\{
  "type": "path",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "foreground": "#ffffff",
  "background": "#61AFEF",
  "template": " \uF07C \\\\{\\\\{ .Path \\\\}\\\\} ",
  "properties": \\\\{
    "style": "folder",
    "max_depth": 3,
    "folder_separator_icon": " \uE0B1 ",
    "home_icon": "~",
    "folder_icon": "\uF07C",
    "windows_registry_icon": "\uE0B1",
    "mapped_locations": \\\\{
      "C:\\temp": "\uF0E7",
      "C:\\Users": "\uF007"
    \\\\}
  \\\\}
\\\\}

Git Segment

\\\\{
  "type": "git",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "foreground": "#193549",
  "background": "#95ffa4",
  "background_templates": [
    "\\\\{\\\\{ if or (.Working.Changed) (.Staging.Changed) \\\\}\\\\}#FF9248\\\\{\\\\{ end \\\\}\\\\}",
    "\\\\{\\\\{ if and (gt .Ahead 0) (gt .Behind 0) \\\\}\\\\}#ff4500\\\\{\\\\{ end \\\\}\\\\}",
    "\\\\{\\\\{ if gt .Ahead 0 \\\\}\\\\}#B388FF\\\\{\\\\{ end \\\\}\\\\}",
    "\\\\{\\\\{ if gt .Behind 0 \\\\}\\\\}#B388FF\\\\{\\\\{ end \\\\}\\\\}"
  ],
  "template": " \\\\{\\\\{ .UpstreamIcon \\\\}\\\\}\\\\{\\\\{ .HEAD \\\\}\\\\}\\\\{\\\\{if .BranchStatus \\\\}\\\\} \\\\{\\\\{ .BranchStatus \\\\}\\\\}\\\\{\\\\{ end \\\\}\\\\}\\\\{\\\\{ if .Working.Changed \\\\}\\\\} \uF044 \\\\{\\\\{ .Working.String \\\\}\\\\}\\\\{\\\\{ end \\\\}\\\\}\\\\{\\\\{ if and (.Staging.Changed) (.Working.Changed) \\\\}\\\\}|\\\\{\\\\{ end \\\\}\\\\}\\\\{\\\\{ if .Staging.Changed \\\\}\\\\} \uF046 \\\\{\\\\{ .Staging.String \\\\}\\\\}\\\\{\\\\{ end \\\\}\\\\}\\\\{\\\\{ if gt .StashCount 0 \\\\}\\\\} \uF692 \\\\{\\\\{ .StashCount \\\\}\\\\}\\\\{\\\\{ end \\\\}\\\\} ",
  "properties": \\\\{
    "branch_max_length": 25,
    "fetch_status": true,
    "fetch_upstream_icon": true
  \\\\}
\\\\}

Segmento de la situación

\\\\{
  "type": "status",
  "style": "diamond",
  "foreground": "#ffffff",
  "background": "#00897b",
  "background_templates": [
    "\\\\{\\\\{ if gt .Code 0 \\\\}\\\\}#e91e63\\\\{\\\\{ end \\\\}\\\\}"
  ],
  "leading_diamond": "<transparent,background>\uE0B0</>",
  "trailing_diamond": "\uE0B4",
  "template": " \\\\{\\\\{ if gt .Code 0 \\\\}\\\\}\uF00D\\\\{\\\\{ else \\\\}\\\\}\uF00C\\\\{\\\\{ end \\\\}\\\\} ",
  "properties": \\\\{
    "always_enabled": true
  \\\\}
\\\\}

Segmento de tiempo

\\\\{
  "type": "time",
  "style": "plain",
  "foreground": "#007ACC",
  "template": "\\\\{\\\\{ .CurrentDate|date .Format \\\\}\\\\}",
  "properties": \\\\{
    "time_format": "15:04:05"
  \\\\}
\\\\}

Segmentos de idiomas y tiempos de ejecución

Node.js Segment

\\\\{
  "type": "node",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "foreground": "#ffffff",
  "background": "#6CA35E",
  "template": " \uF898 \\\\{\\\\{ .Full \\\\}\\\\} ",
  "properties": \\\\{
    "fetch_version": true,
    "missing_command_text": "",
    "display_mode": "files",
    "version_url_template": "https://nodejs.org/en/download/releases/",
    "extensions": ["js", "ts"],
    "folders": ["node_modules", ".nvmrc"],
    "files": ["package.json", ".node-version", ".nvmrc"]
  \\\\}
\\\\}

Python Segment

\\\\{
  "type": "python",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "foreground": "#111111",
  "background": "#FFDE57",
  "template": " \uF81F \\\\{\\\\{ .Full \\\\}\\\\} ",
  "properties": \\\\{
    "display_mode": "files",
    "fetch_virtual_env": false
  \\\\}
\\\\}

Segmento

\\\\{
  "type": "go",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "foreground": "#111111",
  "background": "#8ED1F7",
  "template": " \uFCD1 \\\\{\\\\{ .Full \\\\}\\\\} ",
  "properties": \\\\{
    "fetch_version": true
  \\\\}
\\\\}

Rust Segment

\\\\{
  "type": "rust",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "foreground": "#193549",
  "background": "#99908a",
  "template": " \uE7a8 \\\\{\\\\{ .Full \\\\}\\\\} ",
  "properties": \\\\{
    "fetch_version": true
  \\\\}
\\\\}

Java Segment

\\\\{
  "type": "java",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "foreground": "#ffffff",
  "background": "#4063D8",
  "template": " \uF675 \\\\{\\\\{ .Full \\\\}\\\\} ",
  "properties": \\\\{
    "fetch_version": true
  \\\\}
\\\\}

Docker Segment

\\\\{
  "type": "docker",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "foreground": "#000000",
  "background": "#0B59E7",
  "template": " \uF308 \\\\{\\\\{ .Context \\\\}\\\\} ",
  "properties": \\\\{
    "display_mode": "files"
  \\\\}
\\\\}

Segmentos de información del sistema

OS Segment

\\\\{
  "type": "os",
  "style": "diamond",
  "foreground": "#26C6DA",
  "background": "#546E7A",
  "leading_diamond": "\uE0B6",
  "trailing_diamond": "<transparent,background>\uE0B0</>",
  "template": " \\\\{\\\\{ if .WSL \\\\}\\\\}WSL at \\\\{\\\\{ end \\\\}\\\\}\\\\{\\\\{.Icon\\\\}\\\\} ",
  "properties": \\\\{
    "macos": "\uF179",
    "ubuntu": "\uF31b",
    "windows": "\uF17a"
  \\\\}
\\\\}

Serie de sesiones

\\\\{
  "type": "session",
  "style": "diamond",
  "foreground": "#ffffff",
  "background": "#c386f1",
  "leading_diamond": "\uE0B6",
  "trailing_diamond": "\uE0B0",
  "template": " \\\\{\\\\{ .UserName \\\\}\\\\} ",
  "properties": \\\\{
    "display_host": false
  \\\\}
\\\\}

Segmento de batería

\\\\{
  "type": "battery",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "foreground": "#193549",
  "background": "#f36943",
  "background_templates": [
    "\\\\{\\\\{if eq \"Charging\" .State.String\\\\}\\\\}#40c4ff\\\\{\\\\{end\\\\}\\\\}",
    "\\\\{\\\\{if eq \"Discharging\" .State.String\\\\}\\\\}#ff5722\\\\{\\\\{end\\\\}\\\\}",
    "\\\\{\\\\{if eq \"Full\" .State.String\\\\}\\\\}#4caf50\\\\{\\\\{end\\\\}\\\\}"
  ],
  "template": " \\\\{\\\\{ if not .Error \\\\}\\\\}\\\\{\\\\{ .Icon \\\\}\\\\}\\\\{\\\\{ .Percentage \\\\}\\\\}\\\\{\\\\{ end \\\\}\\\\}\\\\{\\\\{ .Error \\\\}\\\\}\uF295 ",
  "properties": \\\\{
    "discharging_icon": "\uE231 ",
    "charging_icon": "\uE234 ",
    "charged_icon": "\uE22F "
  \\\\}
\\\\}

Segmento de memoria

\\\\{
  "type": "sysinfo",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "foreground": "#ffffff",
  "background": "#8f43f3",
  "template": " \uF85A \\\\{\\\\{ round .PhysicalPercentUsed .Precision \\\\}\\\\}% ",
  "properties": \\\\{
    "precision": 2
  \\\\}
\\\\}

Cloud and DevOps Segments

AWS Segment

\\\\{
  "type": "aws",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "foreground": "#ffffff",
  "background": "#FFA400",
  "template": " \uF270 \\\\{\\\\{.Profile\\\\}\\\\}\\\\{\\\\{if .Region\\\\}\\\\}@\\\\{\\\\{.Region\\\\}\\\\}\\\\{\\\\{end\\\\}\\\\} ",
  "properties": \\\\{
    "display_default": false
  \\\\}
\\\\}

Azure Segment

\\\\{
  "type": "az",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "foreground": "#000000",
  "background": "#9ec3f0",
  "template": " \uFD03 \\\\{\\\\{ .Name \\\\}\\\\} ",
  "properties": \\\\{
    "display_default": true
  \\\\}
\\\\}

Kubernetes Segment

\\\\{
  "type": "kubectl",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "foreground": "#000000",
  "background": "#ebcc34",
  "template": " \uFD31 \\\\{\\\\{.Context\\\\}\\\\}\\\\{\\\\{if .Namespace\\\\}\\\\} :: \\\\{\\\\{.Namespace\\\\}\\\\}\\\\{\\\\{end\\\\}\\\\} ",
  "properties": \\\\{
    "display_error": false
  \\\\}
\\\\}

Terraform Segment

\\\\{
  "type": "terraform",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "foreground": "#000000",
  "background": "#ebcc34",
  "template": " \uF1BB \\\\{\\\\{.WorkspaceName\\\\}\\\\} "
\\\\}

Características avanzadas

Plantillas condicionales

\\\\{
  "type": "git",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "foreground": "#193549",
  "background": "#95ffa4",
  "background_templates": [
    "\\\\{\\\\{ if or (.Working.Changed) (.Staging.Changed) \\\\}\\\\}#FF9248\\\\{\\\\{ end \\\\}\\\\}",
    "\\\\{\\\\{ if and (gt .Ahead 0) (gt .Behind 0) \\\\}\\\\}#ff4500\\\\{\\\\{ end \\\\}\\\\}",
    "\\\\{\\\\{ if gt .Ahead 0 \\\\}\\\\}#B388FF\\\\{\\\\{ end \\\\}\\\\}",
    "\\\\{\\\\{ if gt .Behind 0 \\\\}\\\\}#B388FF\\\\{\\\\{ end \\\\}\\\\}"
  ],
  "foreground_templates": [
    "\\\\{\\\\{ if or (.Working.Changed) (.Staging.Changed) \\\\}\\\\}#E3F2FD\\\\{\\\\{ end \\\\}\\\\}"
  ],
  "template": " \\\\{\\\\{ .UpstreamIcon \\\\}\\\\}\\\\{\\\\{ .HEAD \\\\}\\\\}\\\\{\\\\{if .BranchStatus \\\\}\\\\} \\\\{\\\\{ .BranchStatus \\\\}\\\\}\\\\{\\\\{ end \\\\}\\\\}\\\\{\\\\{ if .Working.Changed \\\\}\\\\} \uF044 \\\\{\\\\{ .Working.String \\\\}\\\\}\\\\{\\\\{ end \\\\}\\\\}\\\\{\\\\{ if and (.Staging.Changed) (.Working.Changed) \\\\}\\\\}|\\\\{\\\\{ end \\\\}\\\\}\\\\{\\\\{ if .Staging.Changed \\\\}\\\\} \uF046 \\\\{\\\\{ .Staging.String \\\\}\\\\}\\\\{\\\\{ end \\\\}\\\\}\\\\{\\\\{ if gt .StashCount 0 \\\\}\\\\} \uF692 \\\\{\\\\{ .StashCount \\\\}\\\\}\\\\{\\\\{ end \\\\}\\\\} "
\\\\}

Variables a medida

\\\\{
  "type": "text",
  "style": "plain",
  "foreground": "#E06C75",
  "template": "\\\\{\\\\{ .Env.CUSTOM_VAR \\\\}\\\\} "
\\\\}

Configuración transversal

\\\\{
  "type": "path",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "foreground": "#ffffff",
  "background": "#61AFEF",
  "template": " \\\\{\\\\{ if .WSL \\\\}\\\\}\uF17a \\\\{\\\\{ end \\\\}\\\\}\uF07C \\\\{\\\\{ .Path \\\\}\\\\} ",
  "properties": \\\\{
    "style": "folder",
    "mapped_locations": \\\\{
      "C:\\temp": "\uF0E7",
      "/tmp": "\uF0E7",
      "~": "\uF015"
    \\\\}
  \\\\}
\\\\}

Prompts multilínea

\\\\{
  "blocks": [
    \\\\{
      "type": "prompt",
      "alignment": "left",
      "segments": [
        \\\\{
          "type": "path",
          "style": "plain",
          "foreground": "#61AFEF",
          "template": "\uF07C \\\\{\\\\{ .Path \\\\}\\\\}"
        \\\\}
      ]
    \\\\},
    \\\\{
      "type": "prompt",
      "alignment": "right",
      "segments": [
        \\\\{
          "type": "time",
          "style": "plain",
          "foreground": "#007ACC",
          "template": "\\\\{\\\\{ .CurrentDate|date .Format \\\\}\\\\}"
        \\\\}
      ]
    \\\\},
    \\\\{
      "type": "prompt",
      "alignment": "left",
      "newline": true,
      "segments": [
        \\\\{
          "type": "text",
          "style": "plain",
          "foreground": "#007ACC",
          "template": "❯ "
        \\\\}
      ]
    \\\\}
  ]
\\\\}

Personalización y estilo

Esquemas de color

\\\\{
  "palette": \\\\{
    "os-color": "#ACB0BE",
    "closer-color": "#575656",
    "pink": "#F25D94",
    "lavender": "#LAVENDER",
    "blue": "#06BCE4"
  \\\\},
  "blocks": [
    \\\\{
      "type": "prompt",
      "alignment": "left",
      "segments": [
        \\\\{
          "type": "os",
          "style": "diamond",
          "foreground": "p:os-color",
          "background": "p:closer-color",
          "leading_diamond": "\uE0B6",
          "trailing_diamond": "\uE0B0",
          "template": " \\\\{\\\\{ .Icon \\\\}\\\\} "
        \\\\}
      ]
    \\\\}
  ]
\\\\}

Iconos y Símbolos

\\\\{
  "type": "git",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "template": " \\\\{\\\\{ .UpstreamIcon \\\\}\\\\}\\\\{\\\\{ .HEAD \\\\}\\\\}\\\\{\\\\{ if .Working.Changed \\\\}\\\\} \uF044 \\\\{\\\\{ .Working.String \\\\}\\\\}\\\\{\\\\{ end \\\\}\\\\} ",
  "properties": \\\\{
    "branch_icon": "\uF126 ",
    "commit_icon": "\uF417 ",
    "fetch_status": true,
    "fetch_upstream_icon": true,
    "untracked_modes": \\\\{
      "no": "\uF059",
      "normal": "\uF059",
      "all": "\uF059"
    \\\\},
    "status_formats": \\\\{
      "added": "\uF457",
      "copied": "\uF4A5",
      "deleted": "\uF458",
      "modified": "\uF459",
      "renamed": "\uF45A",
      "unmerged": "\uF426",
      "untracked": "\uF059"
    \\\\}
  \\\\}
\\\\}

Símbolos de Powerline

\\\\{
  "type": "path",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "inverse_powerline": false,
  "foreground": "#ffffff",
  "background": "#61AFEF",
  "template": " \uF07C \\\\{\\\\{ .Path \\\\}\\\\} "
\\\\}

Estilo de diamante

\\\\{
  "type": "os",
  "style": "diamond",
  "foreground": "#26C6DA",
  "background": "#546E7A",
  "leading_diamond": "\uE0B6",
  "trailing_diamond": "\uE0B4",
  "template": " \\\\{\\\\{ .Icon \\\\}\\\\} "
\\\\}

Rendimiento y optimización

Caching

\\\\{
  "type": "git",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "template": " \\\\{\\\\{ .HEAD \\\\}\\\\} ",
  "properties": \\\\{
    "fetch_status": false,
    "fetch_upstream_icon": false
  \\\\}
\\\\}
```_

### Pantalla condicional
```json
\\\\{
  "type": "node",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "template": " \uF898 \\\\{\\\\{ .Full \\\\}\\\\} ",
  "properties": \\\\{
    "display_mode": "files",
    "fetch_version": true
  \\\\}
\\\\}

Configuración de tiempo

\\\\{
  "type": "kubectl",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "template": " \uFD31 \\\\{\\\\{.Context\\\\}\\\\} ",
  "properties": \\\\{
    "parse_kubeconfig": false,
    "timeout": 2000
  \\\\}
\\\\}

Uso de la línea de comandos

Gestión temática

# Get current theme
oh-my-posh get theme

# Set theme
oh-my-posh init pwsh --config "~/.mytheme.omp.json"|Invoke-Expression

# Export current theme
oh-my-posh config export --output ~/.mytheme.omp.json

# Validate theme
oh-my-posh config validate --config ~/.mytheme.omp.json

# Migrate theme from v2 to v3
oh-my-posh config migrate --config ~/.mytheme.omp.json

Debugging

# Debug mode
oh-my-posh init pwsh --config ~/.mytheme.omp.json --debug|Invoke-Expression

# Print configuration
oh-my-posh config get --config ~/.mytheme.omp.json

# Test segment
oh-my-posh debug segment --config ~/.mytheme.omp.json --segment git

# Performance profiling
oh-my-posh init pwsh --config ~/.mytheme.omp.json --profile|Invoke-Expression

Cache Management

# Clear cache
oh-my-posh cache clear

# Cache path
oh-my-posh cache path

# Cache statistics
oh-my-posh cache get --key git
```_

## Ejemplos de integración

### Integración Terminal
```json
\\\\{
  "profiles": \\\\{
    "defaults": \\\\{
      "font": \\\\{
        "face": "CascadiaCode Nerd Font"
      \\\\}
    \\\\},
    "list": [
      \\\\{
        "name": "PowerShell",
        "source": "Windows.Terminal.PowershellCore",
        "startingDirectory": "%USERPROFILE%"
      \\\\}
    ]
  \\\\}
\\\\}

VS Code Integration

\\\\{
  "terminal.integrated.fontFamily": "CascadiaCode Nerd Font",
  "terminal.integrated.fontSize": 12,
  "terminal.integrated.profiles.windows": \\\\{
    "PowerShell": \\\\{
      "source": "PowerShell",
      "icon": "terminal-powershell"
    \\\\}
  \\\\}
\\\\}

Azure Cloud Shell

# Install in Azure Cloud Shell
curl -s https://ohmyposh.dev/install.sh|bash -s -- -d ~/bin
echo 'export PATH=$PATH:~/bin' >> ~/.bashrc
echo 'eval "$(oh-my-posh init bash)"' >> ~/.bashrc

Solución de problemas

Cuestiones comunes

# Font rendering issues
# Install Nerd Font and configure terminal

# PowerShell execution policy
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

# Module import issues
Import-Module oh-my-posh -Force

# Theme not loading
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json"|Invoke-Expression

# Performance issues
oh-my-posh init pwsh --config ~/.mytheme.omp.json --profile|Invoke-Expression

Debug Commands

# Check installation
oh-my-posh --version

# Validate configuration
oh-my-posh config validate --config ~/.mytheme.omp.json

# Test specific segment
oh-my-posh debug segment --config ~/.mytheme.omp.json --segment path

# Environment information
oh-my-posh debug environment

Validación de configuración

# Schema validation
oh-my-posh config validate --config ~/.mytheme.omp.json

# Export for sharing
oh-my-posh config export --output ~/.mytheme.omp.json

# Migrate old configuration
oh-my-posh config migrate --config ~/.old-theme.json

Oh My Posh proporciona una potente solución multiplataforma para la personalización rápida que se destaca particularmente en entornos Windows, manteniendo la compatibilidad completa con sistemas similares a Unix. Su sistema de configuración basado en JSON, amplia capacidad de identificación y fuerte integración de Windows Terminal hacen que sea una excelente opción para los desarrolladores que trabajan en múltiples plataformas. Ya sea que estés usando PowerShell en Windows, Bash en Linux, o cualquier shell en entre, Oh My Posh ofrece impulsos consistentes, hermosos e informativos que mejoran tu experiencia de línea de comandos.