From 6c88c7d2006330ed230c6d3aa8965a96fb3cd514 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sun, 20 Jun 2021 20:46:49 +0200 Subject: [PATCH] __fish_print_help: remove spurious bold/underline control characters Commit d15a51897 ("Rationalize $LESS uses") switched a "less" flag from -r (interpret all control characters) to -R (interpret only color codes) Somehow this changed the output of "fish -c 'command -h'" to include weird characters: DESCRIPTION^O command^O forces the shell to execute the program COMMANDNAME^O and ignore any functions or builtins with the same name. Probably this was the reason why I originally used -r over -R. Anyway, -R is safer and it looks like we can just remove the "ul" preprocessing since "less" will interpret bold/underline just fine. --- share/functions/__fish_print_help.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/functions/__fish_print_help.fish b/share/functions/__fish_print_help.fish index 0b9f2ab7e..ce7ebe887 100644 --- a/share/functions/__fish_print_help.fish +++ b/share/functions/__fish_print_help.fish @@ -111,7 +111,7 @@ function __fish_print_help --description "Print help message for the specified f end end end - end | string replace -ra '^ ' '' | ul | # post-process with `ul`, to interpret the old-style grotty escapes + end | string replace -ra '^ ' '' | begin set -l pager less set -q PAGER