I am using Windows Terminal(Preview) with shells like 1.PowerShell, 2.WSL
in my Windows 10 machine. I installed the latest version of oh-my-posh
and posh-git
to customize the terminal. My current theme is Agnoster
which gives a colorful custom prompt. But I want to get rid of the "username@host" from my prompt.
Eg:
Current => username@host D:\folder-name>
Needed => D:\folder-name>
I tried few things with $GitPromptSettings
variable and also in GitPrompt.ps1
file which is inside the posh-git folder but with no use.
Also, since i have oh-my-posh and posh-git, does both have prompt customization properties or it is only from posh-git?
Any help is appreciated.
remove the segment which type is session from ~\Documents\WindowsPowerShell\Modules\oh-my-posh\3.101.23\themes\<themename>.omp.json
You have to set $DefaultUser before importing modules.
Example:
$global:DefaultUser = [System.Environment]::UserName
Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Paradox
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With