Background job information #1495
HasEveryUsernameBeenTaken
started this conversation in
Ideas
Replies: 2 comments 7 replies
-
You can add this by leveraging the text segment. You can create a function to store the value in an environment variable: function Set-EnvVar {
$env:BG_JOBS = (Get-Job -State Running).Count
}
New-Alias -Name 'Set-PoshContext' -Value 'Set-EnvVar' -Scope Global -Force then add the following to your config: {
"type": "text",
"style": "powerline",
"powerline_symbol": "\uE0B0",
"foreground": "#ffffff",
"background": "#0077c2",
"properties": {
"template": "{{if ne .Env.BG_JOBS \"0\" }}{{ .Env.BG_JOBS }}{{ end }}"
}
} |
Beta Was this translation helpful? Give feedback.
6 replies
-
A note about zsh (as I just fought to have it working)
Here is how to do it in zsh, you can't use |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Would it be possible to display the number of active background jobs in a segment or include this in an existing segment?
I think I first saw this kind of thing in Liquid Prompt on GNU/Linux. In PowerShell, I previously included the following in a custom prompt function, and I miss it in Oh My Posh.
Beta Was this translation helpful? Give feedback.
All reactions