oh-my-posh: Unable to change theme since v3.75.1

Prerequisites

  • I have read and understand the CONTRIBUTING guide
  • I looked for duplicate issues before submitting this one

Description

After upgrading to the latest version of the PowerShell module I noticed that the theme was reset to the default one. I tried to change it but the command Set-PoshPrompt -Theme sorin does not work. So I started downgrading and with v3.75.0 it started working again.

This is my PowerShell profile:

Import-Module oh-my-posh
Set-PoshPrompt -Theme sorin

Environment

  • Oh my Posh version: 3.75.1 / 3.75.2 (both broken)
  • Theme: sorin
  • Operating System: Windows 10 19042.746
  • Shell: PowerShell Core 7.1.1
  • Terminal: Windows Terminal Preview 1.5.3242.0

Steps to Reproduce

  1. Install v3.75.1
  2. Import module and try to change change theme

Expected behavior: The prompt should change to the selected theme.

Actual behavior: The prompt does not change.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (13 by maintainers)

Commits related to this issue

Most upvoted comments

@rolflobker someone added a \b in there which is a backspace character and fails to get parsed properly after export. I removed them we’ll see what breaks when an issue pops up 😉

Allow me to check that.

I will allow that.

@danvim I have no idea why it can’t open the file, in theory you should be able to get the agnoster config, store it somewhere your user has access to and point to that file when setting the prompt.

Import-Module oh-my-posh
Set-PoshPrompt -Theme ~/agnoster.omp.json

I am able to copy the file to C: and set the theme now. Thanks.

On the other note, ~/Documents, where Powershell’s modules get installed on this PC is on a network drive, with the path containing a $. I’m not sure if that’s a problem.

Thanks for the quick reply. I upgraded to the latest version and tried without the -Theme switch. Unfortunately this does not work either.

image

Edit: Autocomplete for the themes works fine.

Do you know what was causing the problem? I also find it weird it says UNABLE TO OPEN CONFIG. I’m getting this with version 3.129.0

Just upgraded and the issue is gone. 👍 Thank you a lot for the quick fix and your dedication to this awesome tool.