From 763e9454b22fc9cc15aad361f325a2b89c1df692 Mon Sep 17 00:00:00 2001 From: Florian Meinicke Date: Fri, 11 Oct 2019 16:56:47 +0200 Subject: [PATCH] Don't pay extra forking cost when config is disabled --- fish_prompt.fish | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fish_prompt.fish b/fish_prompt.fish index f10f00f..29f8753 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -421,9 +421,14 @@ function __bobthefish_prompt_status -S -a last_status -d 'Display flags for a no and set superuser 1 # Jobs display - set num_bg_jobs (jobs -p | wc -l) - [ $num_bg_jobs -gt 0 ] - and set bg_jobs 1 + if [ "$theme_display_jobs_verbose" = 'yes' ] + set bg_jobs (jobs -p | wc -l) + [ "$bg_jobs" -eq 0 ] + and set bg_jobs # clear it out so it doesn't show when `0` + else + jobs -p >/dev/null + and set bg_jobs 1 + end if [ "$nonzero" -o "$superuser" -o "$bg_jobs" ] __bobthefish_start_segment $color_initial_segment_exit