JanDeDobbeleer / oh-my-posh

The most customisable and low-latency cross platform/shell prompt renderer
https://ohmyposh.dev
MIT License
17.42k stars 2.39k forks source link

Windows Terminal running v3 in a v2 cmdlet. #373

Closed awguitar86 closed 3 years ago

awguitar86 commented 3 years ago

Prerequisites

Description

I'm trying to get the v3 working on my Windows Terminal. I've walked through all the steps I could find to install it and upgrade it, but every time I start up my windows terminal it doesn't grab the theme I've set it to, and it says,

"It seems you're using an oh-my-posh V2 cmdlet while running V3. To migrate your current setup to V3, have a look the documentation."

I've gone over the documentation multiple times, but I'm not sure how to get v3 fully integrated, and to stop using a V2 cmdlet.

Environment

Steps to Reproduce

  1. Download Windows Terminal
  2. Download PowerShell 7
  3. Install posh-git
  4. Install oh-my-posh
  5. Upgrade oh-my-posh with "Update-Module -Name oh-my-posh -AllowPrerelease -Scope CurrentUser"
  6. Add these lines to the $PROFILE: "Import-Module posh-git" "Import-Module oh-my-posh" "Set-Theme Operator"
  7. Open Windows Terminal

Expected behavior: Expected to have Windows Terminal running oh-my-posh v3 and see the new themes, and new way of making updates and customizing the oh-my-posh.

Actual behavior: When terminal opens up the message in the terminal says, "It seems you're using an oh-my-posh V2 cmdlet while running V3. To migrate your current setup to V3, have a look the documentation." And the Theme is not being used.

JanDeDobbeleer commented 3 years ago

You're using V3, that's the good part. The only problem is that you got the cmdlet wrong, can you dump that part of your $PROFILE here?

From your comment it seems you're using Set-Theme which is renamed to Set-PoshPrompt in V3.

awguitar86 commented 3 years ago

This is all I have in my $PROFILE

Import-Module posh-git Import-Module oh-my-posh Set-Theme Operator

So instead of using Set-Theme in the profile, should I use Set-PoshPrompt? Because when I do Set-PoshPrompt in PowerShell it doesn't set anything in the profile.

JanDeDobbeleer commented 3 years ago

So instead of using Set-Theme in the profile, should I use Set-PoshPrompt?

@awguitar86 yes. Although operator isn't available in V3, but it should fallback to a prompt nonetheless.

awguitar86 commented 3 years ago

That worked! Thank you!

github-actions[bot] commented 6 months ago

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.