Get-PoshStackCount occasionally fails to be loaded when reloading profile #4653
Unanswered
DEberhardt
asked this question in
Troubleshoot
Replies: 2 comments 3 replies
|
@DEberhardt I don't think we can solve that. This is a global function and probably that's not yet loaded due to they way you reload the profile. You're also the first with this issue it seems. |
3 replies
|
Interesting. Could I load the PowerShell Module oh-my-posh-core upfront, to properly initialize it and pot. alleviate the issue? |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Code of Conduct
What happened?
This happens sometimes in VsCode, though I have also seen it in Terminal (PS7)
When Reloading my profile, it sometimes stumbles over itself. Re-doing that will usually fix, so don't know whether this may lead to chasing ghosts... apologies.
Profile hasn't changed in ages, though I now have a function to reload the profile instead of always starting a new session.
Exception
Checkpoint-Profile
if it helps, I am reloading my profile with a little function:
Function call in the profile
Theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [{
"alignment": "left",
"segments": [{
"Enabled": false,
"foreground": "#1BD760",
"properties": {
"paused_icon": "\uf8e3 ",
"playing_icon": "\ue602 ",
"stopped_icon": "\uf04d ",
"track_separator": " - "
},
"style": "plain",
"template": "{{ .Icon }}{{ if ne .Status "stopped" }}{{ .Artist }} - {{ .Track }}{{ end }} ",
"type": "spotify"
}],
"type": "prompt"
},
{
"alignment": "right",
"segments": [{
"foreground": "#91ddff",
"style": "plain",
"template": " \uf85a {{ round .PhysicalPercentUsed .Precision }}% ",
"type": "sysinfo"
},
{
"foreground_templates": [
"{{if eq "Charging" .State.String}}#40c4ff{{end}}",
"{{if eq "Discharging" .State.String}}#ff5722{{end}}",
"{{if eq "Full" .State.String}}#4caf50{{end}}"
],
"foreground": "#f36943",
"properties": {
"charged_icon": "\uf583 ",
"charging_icon": "\uf588 ",
"discharging_icon": "\uf57d "
},
"style": "plain",
"template": " {{ if not .Error }}{{ .Icon }}{{ .Percentage }}{{ end }}{{ .Error }}% ",
"type": "battery"
},
{
"type": "owm",
"style": "plain",
"foreground": "#91ddff",
"template": "{{.Weather}} {{ .Temperature }}{{.UnitIcon }} ",
"properties": {
"apikey": "3d07cc3aeda66d90243a06c9f4deac5f",
"location": "BRISTOL,GB",
"units": "metric",
"http_timeout": 100,
"cache_timeout": 10
}
},
{
"foreground": "#ffffff",
"properties": {
"time_format": "_2 Jan"
},
"style": "plain",
"template": " {{ .CurrentDate | date .Format }}",
"type": "time"
},
{
"foreground": "#91ddff",
"properties": {
"datetime_format": "2022-01-02 15:04:05",
"time_format": "15:04:05"
},
"style": "plain",
"template": " {{ .CurrentDate | date .Format }}",
"type": "time"
}
],
"type": "prompt"
},
{
"alignment": "left",
"newline": true,
"segments": [{
"Enabled": false,
"background": "#ff8800",
"foreground": "#100e23",
"powerline_symbol": "\ue0c0",
"properties": {
"root_icon": ""
},
"style": "powerline",
"template": " \uf0e7 ",
"type": "root"
},
{
"Enabled": false,
"background": "#8800dd",
"foreground": "#ffffff",
"powerline_symbol": "\ue0b0",
"properties": {
"style": "amarillo",
"threshold": 500
},
"style": "powerline",
"template": " {{ .FormattedMs }} ",
"type": "executiontime"
},
{
"background": "#ffffff",
"foreground": "#100e23",
"powerline_symbol": "\ue0b0",
"style": "powerline",
"template": " {{ .Name }} ",
"type": "shell"
},
{
"Enabled": false,
"background": "#91ddff",
"foreground": "#100e23",
"powerline_symbol": "\ue0b0",
"properties": {
"folder_icon": "\uf115",
"folder_separator_icon": " \ue0b1 ",
"style": "full"
},
"style": "powerline",
"template": " {{ .Path }} ",
"type": "path"
},
{
"background": "#95ffa4",
"background_templates": [
"{{ if or (.Working.Changed) (.Staging.Changed) }}#FF9248{{ end }}",
"{{ if and (gt .Ahead 0) (gt .Behind 0) }}#ff4500{{ end }}",
"{{ if gt .Ahead 0 }}#B388FF{{ end }}",
"{{ if gt .Behind 0 }}#B388FF{{ end }}"
],
"foreground": "#193549",
"leading_diamond": "\ue0b6",
"powerline_symbol": "\ue0b0",
"properties": {
"branch_max_length": 25,
"fetch_stash_count": true,
"fetch_status": true,
"fetch_upstream_icon": true
},
"style": "powerline",
"template": " {{ .UpstreamIcon }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \uf692 {{ .StashCount }}{{ end }} ",
"trailing_diamond": "\ue0b4",
"type": "git"
},
{
"Enabled": false,
"background": "#906cff",
"foreground": "#100e23",
"powerline_symbol": "\ue0b0",
"style": "powerline",
"template": " \ue235 {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}{{ .Full }}{{ end }} ",
"type": "python"
},
{
"Enabled": false,
"background": "#ff8080",
"foreground": "#ffffff",
"powerline_symbol": "\ue0b0",
"style": "powerline",
"template": " {{ if gt .Code 0 }}\uf00d {{ .Meaning }}{{ else }}\uf42e{{ end }} ",
"type": "exit"
}
],
"type": "prompt"
},
{
"alignment": "left",
"newline": true,
"segments": [{
"Enabled": false,
"foreground": "#007ACC",
"style": "plain",
"template": "\u276f ",
"type": "text"
}],
"type": "prompt"
}
],
"transient_prompt": {
"background": "transparent",
"foreground": "#666666",
"template": "[{{ .Segments.Time.CurrentDate | date "2006-01-02 15:04:05" }}]{{ if .Segments.Executiontime.Ms }}{{ if eq "False" (title (default "False" .Env.DISABLE_SEGMENT_TRANSIENT_EXEC_TIME)) }}[{{ .Segments.Executiontime.FormattedMs }}]{{ end }}{{ end }}\u276f "
},
"version": 2
}
What OS are you seeing the problem on?
Windows
Which shell are you using?
powershell
Log output
All reactions