fix(config-help): quote +/pattern in MANPAGER to prevent word-splitting on spaces

This commit is contained in:
2026-06-08 23:18:31 -04:00
parent c5d6e35afc
commit cdf850f2e7
+3 -1
View File
@@ -224,7 +224,9 @@ function config-help --description 'Open the offline fish shell configuration ma
# then pass it as a less search pattern. MANPAGER is overridden
# here because the bat renderer does not support +/pattern jumps.
set -l pattern (string replace -ra '^#+ *' '' -- $found_text | string trim)
env MANPAGER="less +/$pattern" man -l "$man_file"
# Single-quote the +/pattern inside the MANPAGER string so the
# shell doesn't word-split headings that contain spaces.
env MANPAGER="less '+/$pattern'" man -l "$man_file"
else if test -n "$section_kw"
set_color yellow
echo "note: no section matching '$section_kw' — opening at top" >&2