oh-my-posh: Extreme slowness in Powershell Core Win10 Pro 19042.685
Prerequisites
- I have read and understand the
CONTRIBUTINGguide - I looked for duplicate issues before submitting this one
Description
I loved oh-my-posh but slowness in GitRepos had me turn it off last year (v2). Its a new year so I decided to try v3 but it is extremely slow even with almost everything turned off. Its so slow that I think something must be wrong or setup wrong.
It takes 6231 ms for profile to load and takes 3 - 5 seconds to render a new line if I just press [ENTER].
What could be causing this and is there any way to debug?
Environment
- Oh my Posh version: 3.68.2
- Theme:
- Operating System: Win10 Pro 19042.685
- Shell: Powershell Core 7.1.0
- Terminal: Windows Terminal but I’ve also tried it on a straight Pwsh window.
Steps to Reproduce
- upgrade to omp v3
- install CaskaydiaCove NF font in Windows Terminal
- add omp v3 to pwsh profile
- open a terminal window
Expected behavior: [What you expected to happen] prompts render and normal speed
Actual behavior: [What actually happened] prompts render very slowly 3 to 5 seconds and profile takes over 6000 ms to load.
my schema omp json file
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh3/main/themes/schema.json",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"type": "path",
"style": "powerline",
"powerline_symbol": "\uE0B0",
"foreground": "#ffffff",
"background": "#61AFEF",
"properties": {
"prefix": " \uE5FF ",
"style": "folder"
}
},
{
"type": "time",
"style": "plain",
"foreground": "#007ACC",
"properties": {
"time_format": "15:04:05"
}
}
]
}
],
"final_space": true
}
this is my profile script: C:\Users\ME\OneDrive - LBA Ware\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
Invoke-Expression (oh-my-posh --init --shell pwsh --config ~/.poshthemes/jandedobbeleer-zack.omp.json);
function Get-PublicIp4 {
Write-Host (invoke-webrequest "https://api.ipify.org?format=json").Content;
}
function Get-PublicIp6 {
Write-Host (invoke-webrequest "https://api6.ipify.org?format=json").Content;
}
function ll {
Get-ChildItem -Force $args;
}
#Clear-Host;
screenshot. this is me loading new shell and just pressing enter a few times while waiting for profile to load. you can see how long it takes to render each line after profile loads.

About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 42 (16 by maintainers)
Commits related to this issue
- fix(git): use exact executable name can conflict with git.cmd relates to #315 — committed to JanDeDobbeleer/oh-my-posh by JanDeDobbeleer 3 years ago
- fix(git): use exact executable name can conflict with git.cmd relates to #315 — committed to JanDeDobbeleer/oh-my-posh by JanDeDobbeleer 3 years ago
fhdjkslkasdfh wtf 😈😁😂, what is doing this peace of xyz here 😎,
git.cmdomg, I can’t find out how did you discover this 😲Now it looks amazing
115ms, I’m happy going to useoh-my-posh v3, thank you for your time ⌚🙏 @JanDeDobbeleer@silverqx actually I think you helped identify an issue more users are experiencing (we were also never able to reproduce this). If you happen to have a
git.cmdin your PATH that takes precedence overgit.exe, you’re in for a ride.@silverqx I found the issue. You have a
git.cmdfile inside thebinfolder. That one’s interpreted as an executable which is why the output doesn’t work anymore. When running git directly it works, but from go we’re stuck at that would-be executable. You can validate this by renaming that file.I’m sure that
3.106.4is loaded, I checked it byGet-Command -CommandType Function -Module oh-my-poshcommand, which also displays version numbers, just for the record. 🙂@silverqx chances are my latest release resolves this. We now no longer update the index which could’ve been the issue due to it being locked. That also explains why it happens for some people but not all.
thank you for the clarification, I’m going to try to clone the problematic repo, …
Ok I have tried clone my repo and I can not reproduce the problem on a freshly cloned repo 🤔, so I compressed it and attached it here: dotfiles.zip
I absolutely don’t know what can cause this issue, I also tried to call
git gcit didn’t help. @JanDeDobbeleer@silverqx unfortunately, that’s more related to git than oh-my-posh. There is some offset between running directly in the shell vs running it from go, but not seconds. We could omit status as that one’s taking up the time, but then again, you don’t want that everywhere. If someone can point me to an OSS git repo that has this issue, I’ll gladly see if we can speed things up a bit, but we already did a lot of work in that regard. Also, on Windows everything is noticeably slower compared to mac and linux. Not necessarily related to go either (we went fully crazy trying to validate the root cause end of last year).
I’ll check this again today
Get Outlook for iOShttps://aka.ms/o0ukef
From: stale[bot] notifications@github.com Sent: Saturday, January 16, 2021 3:46:46 PM To: JanDeDobbeleer/oh-my-posh3 oh-my-posh3@noreply.github.com Cc: Zack Moore zack@zackmoore.xyz; Mention mention@noreply.github.com Subject: Re: [JanDeDobbeleer/oh-my-posh3] Extreme slowness in Powershell Core Win10 Pro 19042.685 (#315)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/JanDeDobbeleer/oh-my-posh3/issues/315#issuecomment-761643421, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AANGWJG546SXH64C37673DLS2H3LNANCNFSM4VTI3XXA.