Oh My Posh + eza Windows terminal beautification
IntroductionPermalink
Perfect display effect
HighlightPermalink
- Perfect compatibility, no bugs
- Lighten the display color of system information (memory).
- Fun and concise, displaying only useful information.
ThemePermalink
Windows TerminalPermalink
- Virtual environment not activated, non-root permissions
- Virtual environment activated, non-root permissions
- Virtual environment not activated, root permissions (The two arrows represent root permissions)
- Virtual environment activated, root permissions (The Python icon turns dark purple)
VS CodePermalink
Perfectly adapted to the VS Code terminal.
installationPermalink
Tools used:
Font:
-
Windows Terminal installationPermalink
The Windows 10 system does not come with a built-in Terminal, but you can install Windows Terminal from the Microsoft Store.
-
Font installationPermalink
Download and install MesloLGM Nerd Font and CaskaydiaCove Nerd Font Font Download.
-
OhMyPosh installationPermalink
Open Git Bash or PowerShell in Windows Terminal and execute the following command:
winget install JanDeDobbeleer.OhMyPosh
For Git Bash:
Add the following commands to the .bash_profile (~/wow.omp.json is the path of your theme file)
eval "$(oh-my-posh --init --shell bash --config ~/wow.omp.json)"
For PowerShell:
Execute the following command in PowerShell to open or create a configuration file
notepad $PROFILE
Add the following command to the your configuration file (~/wow.omp.json is the path of your theme file)
oh-my-posh init pwsh --config "$env:C:\Users\yt\wow.omp.json" | Invoke-Expression
-
eza installationPermalink
For windows, run the command:
winget install eza-community.eza
See installation instructions for other OS.
Replace the original ls command (Git Bash) Add the following command to the .bash_profile
alias ls='eza --icons -a'
export EZA_CONFIG_DIR="C:/Users/yt/.config/eza"
Replace the original ls command (PowerShell)
Run the command:
notepad $PROFILE
Add the following command to the your configuration file (~/wow.omp.json is the path of your theme file)
if (Test-Path Alias:ls) {
Remove-Item -Path Alias:ls -Force
}
function Invoke-Eza {
eza.exe --icons -a @args
}
Set-Alias -Name ls -Value Invoke-Eza
$env:EZA_CONFIG_DIR = "$env:USERPROFILE\.config\eza"```
-
VS Code SettingPermalink
For the VS Code terminal, please use the CaskaydiaCove Nerd Font instead of other Nerd Fonts. In my tests, using other Nerd Fonts may cause issues with missing icons or layout misalignment in the VS Code terminal, possibly due to VS Code’s renderer.
Common bug fixesPermalink
Font garbling or missing iconsPermalink
Please install and set up Nerd Fonts. For VS Code terminal, please use CaskaydiaCove Nerd Font.
The custom theme displays correctly in Windows Terminal, but the layout is misaligned in the VS Code terminal.Permalink
Disable automatic activation of Conda virtual environments. Add the following command to the .condarc file:
auto_activate_base: false
Git Bash experiences screen flickering when pressing backspace in Windows Terminal.Permalink
Add the line set bell-style none to ~/.inputrc (create the file if it doesn’t exist).
Font background turns black after deleting text in PowerShellPermalink
Use this command to update PSReadline to solve the problem.
Update-Module PSReadline