2021-04-16 11:44:50 -04:00
|
|
|
$global:IsOutputANSICompatible = (
|
2021-04-25 13:03:16 -04:00
|
|
|
$PSVersionTable.Platform -eq "Unix"
|
|
|
|
) -or (
|
2021-04-16 11:44:50 -04:00
|
|
|
([int]((Get-CimInstance -ClassName Win32_OperatingSystem).Version -split '\.')[0]) -ge 10
|
|
|
|
) -or (
|
|
|
|
($env:ConEmuANSI -eq 'ON') -and ($Host.Name -eq 'ConsoleHost' )
|
|
|
|
)
|
2021-03-26 14:10:18 -04:00
|
|
|
Get-Command Set-PSReadLineKeyHandler -ErrorAction SilentlyContinue |
|
|
|
|
ForEach-Object { Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete }
|
2021-04-16 11:44:50 -04:00
|
|
|
if( (Get-Command Set-PoshPrompt -ErrorAction SilentlyContinue) -and $IsOutputANSICompatible ) {
|
2021-02-19 20:00:07 -05:00
|
|
|
$local:poshPrompt = Join-Path $HOME ".oh-my-posh.omp.json"
|
2021-02-22 14:58:49 -05:00
|
|
|
if( -not (Test-Path $poshPrompt) ) { $poshPrompt = "slim" }
|
2021-02-19 20:00:07 -05:00
|
|
|
Set-PoshPrompt -Theme $poshPrompt
|
2021-04-16 11:44:50 -04:00
|
|
|
} elseif( Get-Command Set-Theme -ErrorAction SilentlyContinue ) {
|
|
|
|
Set-Theme Paradox
|
|
|
|
} elseif( Get-Module -ListAvailable posh-git -ErrorAction SilentlyContinue ) {
|
|
|
|
Import-Module posh-git
|
|
|
|
|
|
|
|
$GitPromptSettings.AnsiConsole = $IsOutputANSICompatible
|
|
|
|
}
|