Closed Aankhen closed 3 years ago
something like this?
But the behaviour is different between powershell and unix shells:
Yes, like that! (Just with the count hidden if there’s nothing pushed.) May I ask how you have that? I went through segment_path.go
twice before creating this issue, but I must have missed something, unless it’s a customization of your own.
Thank you for listing the behaviour of the different shells—I only have experience with Bash myself, and all I could find in my brief searches was what I read about zsh. I guess fish would be one of the shells that couldn’t show the stack. As far as zsh goes, I’d defer to actual users on whether it would be useful to show it. They could always hide it if not.
I’ll push the branch later today
Thanks, guys! I wish every feature request went so smoothly! 😬
Do I need to do anything other than update to 3.137 and set stack_count_enabled
?
Should be enough. And reopen or reload your shell.
I must be doing something wrong. This is my configuration for the block:
{
"type": "path",
"style": "diamond",
"powerline_symbol": "\uE0B0",
"foreground": "#ffffff",
"background": "#004e9d",
"leading_diamond": "\uE0B6",
"trailing_diamond": "\uE0B0",
"properties": {
"prefix": " \uE5FF ",
"style": "mixed",
"stack_count_enabled": true
}
}
And this is what I see:
It's enough on my side. Don't forget to reload your shell. Tested on windows and macos:
Yes, it’s a new shell, but it doesn’t seem to be working:
the config I use:
{
"background": "#ff479c",
"foreground": "#ffffff",
"powerline_symbol": "",
"properties": {
"folder_separator_icon": " ",
"home_icon": "~",
"prefix": " ",
"style": "folder",
"stack_count_enabled": true
},
"style": "powerline",
"type": "path"
},
I also tried your config:
Odd… are you using your fork or are you using the just-released version?
I found an issue with set-poshprompt, let me fix this.
It works when invoke directly in the profile like this Invoke-Expression (&"/usr/local/bin/oh-my-posh" --init --shell=pwsh --config=/Volumes/data/tools/ohmyposh/jandedobbeleer_custom3.omp.json) but not with set-poshprompt(which does the same) I'm checking why.
So it's basically the same issue as described here:https://github.com/JanDeDobbeleer/oh-my-posh2/blob/c4919171881e8384a0af4aa5dec26d3ad0ea5f88/README.md#adding-stack-count-to-a-custom-theme https://github.com/JanDeDobbeleer/oh-my-posh2/issues/113
A workaround for the time being is to not use Set-PoshPrompt but this in your Powershell profile:
Invoke-Expression (oh-my-posh --init --shell pwsh --config "$(scoop prefix oh-my-posh)/themes/jandedobbeleer.omp.json")
Explained in the documentation here:https://ohmyposh.dev/docs/installation#3-replace-your-existing-prompt
I'll try to see what can be done to make it work with Set-PoshPrompt
@Aankhen Can you try the latest version and tell us if it's ok?
The latest version works! Thanks for chasing this down. That was a pretty confusing bug and I really appreciate all the work you put into fixing it. 😊
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.
Prerequisites
CONTRIBUTING
guideDescription
It would be very useful to have the path block show the size of the location stack if it’s available in the shell and contains more than one entry. In case it helps, the commands I know of to get the size are:
(Get-Location -Stack).Count
in PowerShelldirs -p | wc - l
in Bash & zshEnvironment
Steps to Reproduce
pushd C:\dir1
pushd C:\dir2
pushd C:\dir3
Expected behavior: The path block shows something like:
Actual behavior: The path block shows only the folder (different one, sorry):