From 58df0bc05139909504f53eb1e00031b42e0893c4 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sun, 24 Jan 2021 14:25:34 +0100 Subject: [PATCH] __fish_print_pipestatus: remove fallback colors for missing arguments The arguments were not optional because we use "set -e argv[1 2 3 4 5]" --- share/functions/__fish_print_pipestatus.fish | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/share/functions/__fish_print_pipestatus.fish b/share/functions/__fish_print_pipestatus.fish index 1ec8a16ae..898f8e4a6 100644 --- a/share/functions/__fish_print_pipestatus.fish +++ b/share/functions/__fish_print_pipestatus.fish @@ -8,17 +8,17 @@ function __fish_print_pipestatus --description "Print pipestatus for prompt" set -l left_brace $argv[1] set -l right_brace $argv[2] set -l separator $argv[3] - - # Colors default to normal - set -q argv[4] - and set -l brace_sep_color $argv[4] - or set -l brace_sep_color normal - set -q argv[5] - and set -l status_color $argv[5] - or set -l status_color normal + set -l brace_sep_color $argv[4] + set -l status_color $argv[5] set -e argv[1 2 3 4 5] + if not set -q argv[1] + echo error: missing argument >&2 + status print-stacktrace >&2 + return 1 + end + # Only print status codes if the job failed. # SIGPIPE (141 = 128 + 13) is usually not a failure, see #6375. if not contains $last_status 0 141