Closed cardin closed 4 years ago
I have a new engine that removes that dependency, but it's not ready for prime time just yet.
Yes, it's way too slow for daily use, at least for me :(
In addition, it's very slow for huge git codebase to show Git status indications. So for me, I have to abandon the Git status indications unwillingly. 😢
I've tried https://github.com/cmarcusreid/git-status-cache-posh-client and it could help to mitigate the problem.
I've just installed the latest versions for the first time and unfortunately it's massively slow. Are there any tweaks I can use to make my prompt appear in a usable time please??
I've just installed the latest versions for the first time and unfortunately it's massively slow. Are there any tweaks I can use to make my prompt appear in a usable time please??
Never mind. I've worked out that all I needed to do was install the modules for allusers in an elevated prompt and remove them from the profile. I've left commands commented out in my profile, viz.:
# run these from an elevated prompt and make sure that they are commented out here..
#Install-Module posh-git -scope AllUsers
#Install-Module oh-my-posh -scope AllUsers
Set-Theme agnoster
Installing as admin didn't change my startup speed @PreetSangha
Installing as admin didn't change my startup speed @PreetSangha
so you installed the modules for all users? Did you remember to take the install-module commands out of your profile now? Note that I have them commented out in the above? I've edited the comment to make it clearer.
Preet
Yes. I don't have install-modules in my profile. I did remove the comment marks
PS> get-module oh-my-posh,posh-git -ListAvailable
Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 2.0.443 oh-my-posh {Write-ColorPreview, Show-Colors, Show-ThemeColors, Show-T...
Script 0.7.3 posh-git {Invoke-NullCoalescing, Add-PoshGitToProfile, Get-PromptPa...
What else do you have in your profile? Perhaps it's that that's taking the time?
Hey @cardin. I just published my new engine. That one has no trouble with startup/rendering times.
You can install and use it as follows
Install-Module -Name go-my-posh -Repository PSGallery
Import-Module go-my-posh
Set-PoshPrompt paradox
if you want, you can also list all available themes
Get-PoshThemes
Feel free to create an issue there as well to follow up in case you find problems.
I will keep an eye on oh-my-posh
, but I'll favor go-my-posh
going forward.
So no solutions? I still took 800ms.
@GF-Huang Set-Theme
is V2, not V3.
See https://ohmyposh.dev
@GF-Huang
Set-Theme
is V2, not V3. See https://ohmyposh.dev
This?
[ScriptBlock]$Prompt = { $realLASTEXITCODE = $global:LASTEXITCODE & "C:\tools\oh-my-posh.exe" -config "~/downloadedtheme.json" -error $realLASTEXITCODE -pwd $PWD $global:LASTEXITCODE = $realLASTEXITCODE Remove-Variable realLASTEXITCODE -Confirm:$false } Set-Item -Path Function:prompt -Value $Prompt -Force
You can easily update to the beta of oh-my-posh. https://ohmyposh.dev/docs/upgrading
800ms is pretty fast? less than a second startup time seems reasonable.
Problem Installing oh-my-posh and post-git has increased the average Powershell startup time from negligible to 500-2000 ms. Powershell even mentions it: "Loading personal and system profiles took 1084ms."
Tried on an empty Powershell 7 profile and an empty Powershell 5 profile, with
Set-Theme Paradox
, on Windows 10 1909.Desired Outcome oh-my-posh's impact on Powershell startup time should be reduced.
One possible way could be to reduce the dependency on posh-git - there might be several posh-git functions in there that are unused.