Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to change theme since v3.75.1 #355

Closed
2 tasks done
LarsBauer opened this issue Jan 18, 2021 · 19 comments
Closed
2 tasks done

Unable to change theme since v3.75.1 #355

LarsBauer opened this issue Jan 18, 2021 · 19 comments

Comments

@LarsBauer
Copy link
Contributor

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.

@JanDeDobbeleer
Copy link
Owner

It works for me without the -Theme switch, can you tab through it and validate the autocomplete and setting of the prompt?

@LarsBauer
Copy link
Contributor Author

LarsBauer commented Jan 18, 2021

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.

@JanDeDobbeleer
Copy link
Owner

JanDeDobbeleer commented Jan 18, 2021

@LarsBauer allow me to validate this in the evening. I did check that so maybe there's something else that influences this negatively. It sets a config, but as the text states, it can't open that location somehow.

@JanDeDobbeleer
Copy link
Owner

@LarsBauer confirmed to work on my machine, so some follow-up questions. Do you have a space in a folder somewhere? Or a mounted drive/Onedrive integration?

@LarsBauer
Copy link
Contributor Author

Yes, OneDrive integration is enabled so I guess there could be some spaces in the path. Can't check for sure because I am not on my work computer right now.

@JanDeDobbeleer
Copy link
Owner

That's probably it though, will try to reproduce 😅

JanDeDobbeleer added a commit that referenced this issue Jan 18, 2021
JanDeDobbeleer added a commit that referenced this issue Jan 18, 2021
@JanDeDobbeleer
Copy link
Owner

@LarsBauer found the issue. Fix incoming.

@LarsBauer
Copy link
Contributor Author

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

@danvim
Copy link

danvim commented Mar 29, 2021

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

@JanDeDobbeleer
Copy link
Owner

Can you show me your invocation?

@danvim
Copy link

danvim commented Mar 30, 2021

Can you show me your invocation?

Same as OP,

Import-Module oh-my-posh
Set-PoshPrompt -Theme agnoster
# or
Set-PoshPrompt agnoster

But I must say, the computer I'm using is pretty locked down for security reasons. I've tested the same in my own personal PC and it works fine with the same version. One of the reasons I wanted oh-my-posh was the git display. I'm currently settling with using posh-git directly.

@JanDeDobbeleer
Copy link
Owner

@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

@danvim
Copy link

danvim commented Apr 12, 2021

@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.

@JanDeDobbeleer
Copy link
Owner

@danvim That's a problem in Powershell yes

@rolflobker
Copy link

Installed in pwsh 7 (core) under Debian
Set-PoshTheme works fine

Set-PoshTheme ys
Export-PoshTheme -FilePath ~/.oh-my-posh.omp.json
Set-PoshPrompt -Theme ~/.oh-my-posh.omp.json

UNABLE TO OPEN CONFIG

Set-PoshTheme jandedobbeleer
Export-PoshTheme -FilePath ~/.oh-my-posh.omp.json
Set-PoshPrompt -Theme ~/.oh-my-posh.omp.json

Works just fine

Also works with theme Slim
Have not tested others

So at least with export of theme 'ys' we get a ' UNABLE TO OPEN CONFIG'

@JanDeDobbeleer
Copy link
Owner

Allow me to check that.

@rolflobker
Copy link

Allow me to check that.

I will allow that.

@JanDeDobbeleer
Copy link
Owner

@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 ;-)

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants