Skip to content

Instantly share code, notes, and snippets.

@panicoenlaxbox
Last active August 15, 2026 14:20
Show Gist options
  • Select an option

  • Save panicoenlaxbox/250dd1d3bfced0445c31e72c95472377 to your computer and use it in GitHub Desktop.

Select an option

Save panicoenlaxbox/250dd1d3bfced0445c31e72c95472377 to your computer and use it in GitHub Desktop.
$PROFILE
# https://ohmyposh.dev/docs/themes#avit
# oh-my-posh init pwsh --config "avit" | Invoke-Expression
# Invoke-WebRequest `
# -Uri "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/avit.omp.json" `
# -OutFile "$env:USERPROFILE\Scripts\avit.omp.json"
oh-my-posh init pwsh --config "$env:USERPROFILE\Scripts\avit.omp.json" | Invoke-Expression
# "template": "{{ .HEAD }}{{ if .IsWorkTree }} <#FF8C00>\uec7e</>{{ end }} ",
# https://github.com/devblackops/terminal-icons
Import-Module -Name Terminal-Icons
. "$env:USERPROFILE\Scripts\Get-PortInfo.ps1"
# https://learn.microsoft.com/en-us/windows/terminal/tutorials/new-tab-same-directory
# Wraps the oh-my-posh prompt instead of replacing it, so the theme keeps working.
# Preferred over oh-my-posh's own "pwd": "osc99" (https://ohmyposh.dev/docs/configuration/general#settings)
# because that setting would live inside the theme config: it would be lost when
# switching themes, and again every time avit.omp.json is re-downloaded from upstream.
$global:__ompPrompt = $Function:prompt
function prompt {
$osc = ''
$loc = $ExecutionContext.SessionState.Path.CurrentLocation
if ($loc.Provider.Name -eq 'FileSystem') {
$osc = "$([char]27)]9;9;$($loc.ProviderPath)$([char]27)\"
}
"$(& $global:__ompPrompt)$osc"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment