Closed mwasowski closed 2 years ago
Did I miss another configuration change in one of the updates? :)
@mwasowski what does your profile look like?
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
$env:POSH_SESSION_DEFAULT_USER = [System.Environment]::UserName
# Import-Module posh-git
Import-Module oh-my-posh
Import-Module PSReadLine
function upmod { Get-InstalledModule | Update-Module }
Set-PoshPrompt -Theme ~\.oh-my-posh\.powerlevel10k_rainbow.omp.json
Enable-PoshTransientPrompt
Clear-Host
# Shows navigable menu of all options when hitting Tab
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
# Autocompletion for arrow keys
Set-PSReadLineOption -HistorySearchCursorMovesToEnd
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
@mwasowski what happens when you change
Set-PoshPrompt -Theme ~\.oh-my-posh\.powerlevel10k_rainbow.omp.json
for
oh-my-posh --init --shell pwsh --config ~\.oh-my-posh\.powerlevel10k_rainbow.omp.json | Invoke-Expression
Interesting..that actually works. Just it feels like it's taking longer? 🤔
Also with my initial config, if I do
. $profile
It loads the theme correctly. It's like it's unable to do it on the initial open.
@mwasowski can't take longer to load as the first cmdlet is a wrapper around that one :-)
That's why I wrote that it feels like it takes longer ;)
Interesting. When I did this in my config:
Set-PoshPrompt -Theme ~\.oh-my-posh\.powerlevel10k_rainbow.omp.json
Set-PoshPrompt -Theme ~\.oh-my-posh\.powerlevel10k_rainbow.omp.json
It also works ;)
@mwasowski zero sense was made but I'll try to see what's going on 😀
@JanDeDobbeleer Yeah, I know! It's like it is not initializing correctly? I think this is not that urgent and now I bite myself I bothered you by opening this before Christmas 😦
@mwasowski I tried to reproduce this but I can't... It always loads first try. I would resort to only using the invoke syntax:
oh-my-posh --init --shell pwsh --config ~\.oh-my-posh\.powerlevel10k_rainbow.omp.json | Invoke-Expression
The Set-PoshPrompt
command is silently deprecated.
Looks like I have the same issue (or at least a side effect) on a fresh install of Windows 10
Does not work anymore:
oh-my-posh --init --shell pwsh --config ~\.oh-my-posh\.unicorn.omp.json | Invoke-Expression
Works great:
Set-PoshPrompt Unicorn
Env:
It looks like oh-my-posh --init --shell pwsh --config ~\AppData\Local\Programs\oh-my-posh\themes\unicorn.omp.json | Invoke-Expression
is working for me (now).
Does not work anymore:
oh-my-posh --init --shell pwsh --config ~\.oh-my-posh\.unicorn.omp.json | Invoke-Expression
@BenjaminAbt but is that theme located there?
Hi I was also facing this. Today only I setup the oh-my-posh.
When I was trying to change the them by below command nothing was happening. Btw this command is working for the first time. Also one behavior I found , It doesn't matter which theme you are selecting it will by default applying jandedobbeleer.omp.json
theme for me.
oh-my-posh --init --shell pwsh --config ~\.oh-my-posh\.unicorn.omp.json | Invoke-Expression
As soon I tried the following command it worked for me
oh-my-posh --init --shell pwsh --config ~\AppData\Local\Programs\oh-my-posh\themes\unicorn.omp.json | Invoke-Expression
@JanDeDobbeleer @BenjaminAbt
@BenjaminAbt but is that theme located there?
Sorry! Obviously lost in the wave of notifications. Yes, the file was there.
In the meantime I moved the file to a new location. It can be loaded again.
oh-my-posh --init --shell pwsh --config $Env:OneDriveConsumer\Apps\OhMyPosh\abt.omp.json | Invoke-Expression
Hi. I have the same issue.
I keep my config in home directory which is C:\Users\Łukasz
. It contains letter from polish alphabet.
Reloading profile or executing init
once more loads theme correctly.
I moved my theme to different location (without polish letter) and it works now.
I am having the same issue and I think this may be a problem with the codepage. I got this problem whenever the path to my theme contains some non-ASCII character. With out setting any module my console is in codepage 936, by setting my theme with a non-ASCII path the it automatically uses the default theme and the codepage changes to 65001. Setting the theme the again under codepage 65001 works. (This may explain why setting it twice works)
Alternatively, doing
chcp 65001
Set-PoshPrompt path_to_theme
in the $Profile
works for me.
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.
Code of Conduct
What happened?
I am having issue when I open Windows Terminal with either Powershell Core or Windows Powershell. The theme is not loading nad I am presented with the default one: I have both configured in
$profile
and it was working before the update I did today. What is strange when I launch. $profile
it correctly sets my theme.Theme
powerlevel10k_rainbow with minor modifications
What OS are you seeing the problem on?
Windows
Which shell are you using?
powershell
Log output