Skip to content

How can I enable ohmyposh only for the PowerShell in vsCode envirment without needing the PowerShell vsCode extension #4868

Answered by babakfp
babakfp asked this question in Troubleshoot
Discussion options

You must be logged in to vote

Ahhh, right, how couldn't I think about this!

Result Microsoft.PowerShell_profile.ps1:

if ($Env:TERM_PROGRAM -eq "vscode") {
    oh-my-posh init pwsh -c "C:\Users\Babak\Documents\OhMyPoshThemes\main.json" | Invoke-Expression
}

Thanks 🌸


Can I open a PR and add this to the docs (if it doesn't already exist 🤦‍♂️)?

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@babakfp
Comment options

@JanDeDobbeleer
Comment options

@babakfp
Comment options

Answer selected by babakfp
@JanDeDobbeleer
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants