From 12d321571a74b1880059d118ed68292892dde833 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Sun, 2 Feb 2020 21:18:19 +0000 Subject: [PATCH] fish: Slight improvement of prompt --- config/fish/functions/fish_right_prompt.fish | 15 +++++++-------- config/fish/functions/make.fish | 3 ++- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/config/fish/functions/fish_right_prompt.fish b/config/fish/functions/fish_right_prompt.fish index 62cc252..7c22f5e 100644 --- a/config/fish/functions/fish_right_prompt.fish +++ b/config/fish/functions/fish_right_prompt.fish @@ -1,16 +1,15 @@ function fish_right_prompt set -l code $status set -l jobs (jobs | wc -l) + set -l prompt - if test $jobs -gt 0 - set_color $fish_color_jobs - echo "$jobs " - end + test $jobs -gt 0 + and set -a prompt (set_color $fish_color_jobs)$jobs - if test $code -gt 0 - set_color $fish_color_error - echo "$code " - end + test $code -gt 0 + and set -a prompt (set_color $fish_color_error)$code + + echo $prompt set_color normal end diff --git a/config/fish/functions/make.fish b/config/fish/functions/make.fish index 1550731..2ea74aa 100644 --- a/config/fish/functions/make.fish +++ b/config/fish/functions/make.fish @@ -3,7 +3,8 @@ function make if which bmake >/dev/null ^&1 && \ string match -q -r '/pkgsrc$|/pkgsrc/' $PWD # pkgsrc does not like MAKEFLAGS including -j - env MAKEFLAGS= bmake $argv + set -lx MAKEFLAGS + command bmake $argv else command make $argv end