__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.
This commit is contained in:
Johannes Altmanninger 2021-06-20 20:46:49 +02:00
parent 73b13315de
commit 6c88c7d200

View file

@ -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