đź”— Integration Guides
Table of Contents
- VS Code Integration
- Windows Terminal Integration
- Git Bash Integration
- WSL Integration
- iTerm2 Integration
- Other Terminal Emulators
- IDE Integration
- Remote/SSH Integration
VS Code Integration
Step 1: Configure Terminal Appearance
Open VS Code settings (Ctrl+,) and search for “terminal”:
{
// Color integration
"terminal.ansi16BitColors": true,
// Terminal behavior
"terminal.integrated.enableBell": false,
"terminal.integrated.enableMultiLinePasting": true,
// Terminal font configuration
"terminal.integrated.fontFamily": "\"FiraCode Nerd Font\", \"JetBrains Mono Nerd Font\", monospace",
"terminal.integrated.fontSize": 12,
"terminal.integrated.fontWeightBold": "600",
"terminal.integrated.inheritEnv": true,
"terminal.integrated.lineHeight": 1.3,
"terminal.integrated.smoothScrolling": true
}
Step 2: Configure Terminal Profiles
Add Oh My Posh initialization to terminal profiles:
PowerShell Profile
{
"terminal.integrated.defaultProfile.windows": "PowerShell",
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell",
"overrideName": true,
"args": [
"-NoExit",
"-Command",
"oh-my-posh init pwsh --config 'C:\\path\\to\\theme.json' | Invoke-Expression"
]
}
}
}
Bash Profile (Linux/macOS/WSL)
{
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.profiles.linux": {
"bash": {
"path": "bash",
"args": ["--init-file", "~/.bashrc"],
"overrideName": true
}
}
}
Step 3: Sync Color Theme (Optional)
VS Code can use a matching color theme:
- Install theme from VS Code Extensions:
- Search for “Dracula” or your preferred theme
- Install matching Oh My Posh theme version
- Configure in settings.json:
{ "workbench.colorTheme": "Dracula", "workbench.iconTheme": "material-icon-theme" }
Step 4: Test Configuration
- Open integrated terminal in VS Code (Ctrl+`)
- Verify prompt displays with colors
- Check icons rendering properly
- Test git branch display if in repo
Tips for VS Code Terminal
- Open multiple terminals: Click “+” button in terminal panel
- Split terminals: Click split icon
- Navigate terminals: Alt+Arrow keys
- Maximize terminal: Click maximize icon
- Kill terminal: Click trash icon
Common VS Code Issues
Problem: Terminal not using custom profile
Solution: Close terminal tab and reopen (Ctrl+`)
Problem: Colors look wrong
Solution:
- Check
workbench.colorThemesetting - Try disabling other color themes
- Verify Nerd Font is installed
Problem: Slow terminal startup
Solution:
- Reduce Oh My Posh complexity
- Profile with
$env:OHMYPOSH_DEBUG = $true - Move expensive initialization outside -Command
Windows Terminal Integration
Step 1: Install or Update Windows Terminal
# Install or update via WinGet
winget install Microsoft.WindowsTerminal
winget upgrade Microsoft.WindowsTerminal
Step 2: Access Settings
- Click dropdown menu (v) in Windows Terminal
- Select “Settings” or press Ctrl+,
- Opens settings.json
Step 3: Configure PowerShell Profile
Add or modify PowerShell profile in settings.json:
{
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"profiles": {
"defaults": {
"fontFace": "FiraCode Nerd Font",
"fontSize": 11,
"fontWeight": "normal",
"useAcrylic": true,
"acrylicOpacity": 0.85
},
"list": [
{
"name": "PowerShell",
"source": "Windows.Terminal.PowershellCore",
"hidden": false,
"startingDirectory": "%USERPROFILE%",
"commandline": "pwsh.exe",
"icon": "ms-appx:///ProfileIcons/PowerShell_{9ACB9455-CA41-5AF7-950F-6BACA7E80194}.png"
}
]
},
"schemes": [
{
"name": "Atomic Enhanced",
"background": "#1E1E1E",
"foreground": "#D4D4D4",
"cursorColor": "#00BCD4",
"selectionBackground": "#264F78",
"black": "#000000",
"blue": "#0080FF",
"brightBlack": "#808080",
"brightBlue": "#00B7FF",
"brightCyan": "#00F5FF",
"brightGreen": "#00FF00",
"brightMagenta": "#FF00FF",
"brightRed": "#FF3D3D",
"brightWhite": "#FFFFFF",
"brightYellow": "#FFD600",
"cyan": "#00D4FF",
"green": "#00C853",
"magenta": "#D946EF",
"red": "#FF0000",
"white": "#E0E0E0",
"yellow": "#FFD600"
}
]
}
Step 4: Customize Appearance
{
"appearance": {
"theme": "dark",
"acrylic": true,
"useAcrylicInTabRow": true,
"tabWidthMode": "equal"
},
"bellStyle": "none",
"colorScheme": "Atomic Enhanced",
"showTabsInTitleBar": true
}
Step 5: Add Keyboard Shortcuts (Optional)
{
"keybindings": [
{
"command": "sendInput",
"keys": ["ctrl+alt+n"],
"input": "New-Item -ItemType Directory -Name 'test'"
}
]
}
Windows Terminal Advanced Configuration
Multiple PowerShell Versions
{
"profiles": {
"list": [
{
"name": "PowerShell 7 (Current)",
"commandline": "pwsh.exe",
"source": "Windows.Terminal.PowershellCore"
},
{
"name": "Windows PowerShell 5.1",
"commandline": "powershell.exe",
"hidden": false
}
]
}
}
Startup Directory
{
"profiles": {
"defaults": {
"startingDirectory": "%USERPROFILE%\\Projects" // Start in Projects folder
}
}
}
Custom Icons
{
"profiles": {
"list": [
{
"name": "PowerShell",
"icon": "ms-appx:///ProfileIcons/PowerShell_{guid}.png"
// Or custom file path:
// "icon": "file:///C:\\path\\to\\icon.png"
}
]
}
}
Git Bash Integration
Step 1: Install Git for Windows
winget install Git.Git
# or
choco install git
Step 2: Verify Oh My Posh Installation
# Inside Git Bash
oh-my-posh --version
If not installed, install via WinGet first.
Step 3: Configure ~/.bashrc
# Open or create ~/.bashrc
nano ~/.bashrc
Add:
# ========== Oh My Posh Configuration ==========
# Initialize Oh My Posh
eval "$(oh-my-posh init bash --config ~/path/to/theme.json)"
# Optional aliases
alias ll='ls -la'
alias grep='grep --color=auto'
alias cat='cat'
# ========== End Configuration ==========
Step 4: Test in Git Bash
# Launch Git Bash
bash
# Verify prompt initialized
echo $PS1
Git Bash Limitations
⚠️ Note: Git Bash has limited ANSI support compared to modern terminals
| Feature | Status | Notes |
|---|---|---|
| Colors | ⚠️ Limited | Some color codes not rendered |
| Icons | âś… Works | Nerd Font icons display |
| Git status | âś… Full | Works well |
| Performance | âś… Good | Generally fast |
Recommendation
For best experience, use Windows Terminal with WSL instead of Git Bash.
WSL Integration
Step 1: Install WSL2 and Linux Distribution
# In PowerShell (Administrator)
wsl --install -d Ubuntu
wsl --set-default-version 2
Step 2: Install Oh My Posh in WSL
# Inside WSL terminal
curl -s https://ohmyposh.dev/install.sh | bash -s
Step 3: Configure ~/.bashrc or ~/.zshrc
# For Bash
nano ~/.bashrc
# For Zsh
nano ~/.zshrc
Add:
eval "$(oh-my-posh init bash --config ~/path/to/theme.json)"
Step 4: Configure Windows Terminal for WSL
Windows Terminal automatically detects WSL. To customize:
{
"profiles": {
"list": [
{
"name": "Ubuntu",
"commandline": "wsl.exe -d Ubuntu",
"startingDirectory": "//wsl$/Ubuntu/home/username",
"icon": "ms-appx:///ProfileIcons/Ubuntu_{guid}.png"
}
]
}
}
WSL Tips
- Directory shortcuts:
\\wsl$\Ubuntu\home\usernamein Windows Explorer - File sync:
/mnt/c/Users/usernameto access Windows files from WSL - Performance: WSL2 recommended over WSL1
- Font sharing: Windows Terminal font applies to WSL
iTerm2 Integration
Step 1: Install oh-my-posh via Homebrew
brew install oh-my-posh
Step 2: Configure ~/.zshrc
nano ~/.zshrc
Add:
eval "$(oh-my-posh init zsh --config ~/path/to/theme.json)"
Step 3: Configure iTerm2 Appearance
- iTerm2 > Preferences > Profiles > Text
- Font: Select “FiraCode Nerd Font” or similar
- Size: 12-14pt
- Antialias: âś“ checked
- Ligatures: âś“ checked
- iTerm2 > Preferences > Profiles > Colors
- Color presets: Import custom scheme
- Transparency: 10-20% optional
- iTerm2 > Preferences > Appearance
- Theme: Automatic or Dark
- Status bar location: Bottom (optional)
iTerm2 Advanced Configuration
Background Image (Optional)
Profiles > Window > Background image
- Select image file
- Set transparency/blending
Custom Color Scheme
Create theme file and import:
Profiles > Colors > Load Presets > Import
Other Terminal Emulators
Alacritty (Linux/macOS)
-
Install:
cargo install alacritty # or brew install alacritty -
Configure
~/.config/alacritty/alacritty.yml:font: family: FiraCode Nerd Font size: 12.0 colors: primary: background: "#1e1e1e" foreground: "#d4d4d4" -
Add to shell config:
eval "$(oh-my-posh init bash --config ~/theme.json)"
Kitty (Linux/macOS)
-
Install:
curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin -
Configure
~/.config/kitty/kitty.conf:font_family FiraCode Nerd Font font_size 12 -
Add to shell config:
eval "$(oh-my-posh init bash --config ~/theme.json)"
Terminator (Linux)
-
Install:
sudo apt-get install terminator -
Configure
~/.config/terminator/config:[profiles] [[default]] font = FiraCode Nerd Font 11
GNOME Terminal (Linux)
- Open Settings
- Profiles > Default > Text
- Choose “Noto Nerd Font” or similar
- Add to
~/.bashrc:eval "$(oh-my-posh init bash --config ~/theme.json)"
IDE Integration
JetBrains IDEs (IntelliJ, PyCharm, WebStorm)
- Settings > Tools > Terminal
- Font: FiraCode Nerd Font
- Shell path:
pwsh.exe(Windows) or/bin/bash(macOS/Linux)
- Run with shell config
- Shell integration automatically enabled
- Oh My Posh will initialize from
.bashrcor profile
- Verify
- Open terminal tab in IDE
- Check that prompt displays correctly
Visual Studio (C#)
- Tools > Options > Terminal
- Default terminal: Git Bash or Windows Terminal
- External terminal
- Use Windows Terminal with configured profiles
Remote/SSH Integration
Basic SSH Setup
# On remote server
ssh user@remote.host
# Install Oh My Posh
curl -s https://ohmyposh.dev/install.sh | bash -s
# Configure shell
eval "$(oh-my-posh init bash --config ~/theme.json)"
Persistent SSH Configuration
# Add to ~/.bashrc on remote
eval "$(oh-my-posh init bash --config ~/theme.json)"
# Or use environment variable
eval "$(oh-my-posh init bash --config $HOME/.config/ohmyposh/theme.json)"
SSH with Local Theme
Copy theme to remote:
# From local machine
scp ./OhMyPosh-Atomic-Custom.json user@remote.host:~/.config/ohmyposh/
# On remote, use it
eval "$(oh-my-posh init bash --config ~/.config/ohmyposh/OhMyPosh-Atomic-Custom.json)"
Terminal-Multiplexer Integration
tmux
Add to ~/.tmux.conf:
# Ensure colors pass through
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color:RGB"
# Run Oh My Posh in shell
set -g status off # Disable tmux status bar if using Oh My Posh
GNU Screen
Add to ~/.screenrc:
term screen-256color
Summary: Integration Checklist
For Each Environment
- Terminal emulator installed and latest version
- Nerd Font installed and configured
- Oh My Posh installed and in PATH
- Shell profile configured with Oh My Posh init
- Colors displaying correctly
- Icons rendering with no boxes/corruption
- Performance acceptable (< 300ms)
- Theme tested in that specific environment
Quick Tests
# Test in new terminal
oh-my-posh --version
# Should display version
# Test prompt rendering
echo "âś“ Ready"
# Should display check mark
# Check shell type
echo $SHELL
# Should show your shell path
Troubleshooting Integration Issues
Problem: Oh My Posh not initializing
Solution:
- Verify installation:
which oh-my-posh - Check shell config file loaded:
source ~/.bashrc - Verify init line in config:
grep oh-my-posh ~/.bashrc
Problem: Wrong colors in IDE terminal
Solution:
- Check IDE terminal settings
- Verify TERM variable:
echo $TERM(should bexterm-256color) - Test with basic prompt to isolate issue
Problem: Performance different across terminals
Solution:
- Profile with
$env:OHMYPOSH_DEBUG = $true - Check for different segment configurations per terminal
- Verify caching enabled in all environments