Fix username and hostname order in powershell prompt
Daniel Ruiz de Alegría
2 years ago
13 | 13 | If ($NEWLINE_BEFORE_PROMPT -eq 'yes') { Write-Host } |
14 | 14 | If ($PROMPT_ALTERNATIVE -eq 'twoline') { |
15 | 15 | Write-Host "┌──(" -NoNewLine -ForegroundColor Blue |
16 | Write-Host "${bold}$(hostname)㉿$([environment]::username)${reset}" -NoNewLine -ForegroundColor Magenta | |
16 | Write-Host "${bold}$([environment]::username)㉿$(hostname)${reset}" -NoNewLine -ForegroundColor Magenta | |
17 | 17 | Write-Host ")-[" -NoNewLine -ForegroundColor Blue |
18 | 18 | Write-Host "${bold}$(Get-Location)${reset}" -NoNewLine -ForegroundColor White |
19 | 19 | Write-Host "]" -ForegroundColor Blue |
21 | 21 | Write-Host "${bold}PS>${reset}" -NoNewLine -ForegroundColor Blue |
22 | 22 | } Else { |
23 | 23 | Write-Host "${bold}PS " -NoNewLine -ForegroundColor Blue |
24 | Write-Host "$(hostname)㉿$([environment]::username) " -NoNewLine -ForegroundColor Magenta | |
24 | Write-Host "$([environment]::username)㉿$(hostname) " -NoNewLine -ForegroundColor Magenta | |
25 | 25 | Write-Host "$(Get-Location)>${reset}" -NoNewLine -ForegroundColor Blue |
26 | 26 | } |
27 | 27 | # Terminal title |
28 | Write-Host "${esc}]0;PS> $(hostname)@$([environment]::username): $(Get-Location)${bell}" -NoNewLine | |
28 | Write-Host "${esc}]0;PS> $([environment]::username)@$(hostname): $(Get-Location)${bell}" -NoNewLine | |
29 | 29 | return " " |
30 | 30 | } |