Display location depth in prompt #570
-
Prerequisites
DescriptionI have created my new theme but one thing that I can't figure out how to do, is that I would like to include the depth of my current location stack. For example in my existing (oh-my-posh v2) theme I used the following:
Is there a way to achieve something like that? I have already looked at |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You can make use of the environment segment and use function Set-EnvVar {
$env:STACK_COUNT = '$(''+'' * ((get-location -stack).count))'
}
New-Alias -Name 'Set-PoshContext' -Value 'Set-EnvVar' -Scope Global |
Beta Was this translation helpful? Give feedback.
-
Works perfectly, I wasn't aware of the fact that Thanks. |
Beta Was this translation helpful? Give feedback.
You can make use of the environment segment and use
Set-PoshContext
to add the stack count to an environment variable.