Zum Hauptinhalt springen

Oh-My-Posh

Oh My Posh ist ein Framework für die Powershell-Shell, das es ermöglicht, die Erscheinungsbilder der Powershell-Prompt zu personalisieren und anzupassen. Es bietet eine umfassende Sammlung von Themes, Symbolen, Farben und Schriftarten, mit denen Benutzer ihre Powershell-Prompt auf einzigartige und ansprechende Weise gestalten können.

Das Framework bietet auch eine Reihe von Funktionen und Optionen, die die Benutzerfreundlichkeit verbessern, wie z.B. die Anzeige von Git-Branch-Informationen und der aktuellen Arbeitsverzeichnis-Informationen, sowie eine Vielzahl von vordefinierten Prompts, die für verschiedene Anwendungsfälle und Bedürfnisse geeignet sind.

Oh My Posh ist Open-Source-Software und wird von einer aktiven Community von Entwicklern und Benutzern unterstützt. Es ist kompatibel mit verschiedenen Betriebssystemen wie Windows, MacOS und Linux und kann in Kombination mit anderen Tools und Plugins wie dem Package-Manager Chocolatey und dem Terminal-Emulator Windows Terminal verwendet werden.

Install oh-my-posh and fonts

# Install oh-my-posh and posh-git
winget install JanDeDobbeleer.OhMyPosh -s winget
# and the config to profile to load on powershell startup
# load oh-my-posh
New-Item -Path $PROFILE -Type File -Force
Add-Content -Path $PROFILE -Value 'oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/powerlevel10k_rainbow.omp.json" | Invoke-Expression'
# fist activation, if you don't want to restart powershell
. $PROFILE

manuelly install fonts

# install font
Invoke-WebRequest -Uri 'https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Meslo.zip' -OutFile .\Meslo.zip
Expand-Archive -Path .\Meslo.zip
$fonts = (New-Object -ComObject Shell.Application).Namespace(0x14)
Get-ChildItem -Path .\Meslo\*.ttf | ForEach-Object { $fonts.CopyHere($_.FullName) }
Remove-Item -Path .\Meslo -Recurse
Remove-Item -Path .\Meslo.zip

VS Code settings

IMPORTANT: Restart VS Code after installing the fonts

Add this line to VSCode config

"terminal.integrated.fontFamily": "MesloLGS NF"

Kommentare