From 165e0d0ed55747587fbc0e7439db74df7ec44e63 Mon Sep 17 00:00:00 2001 From: traal <11281108+harkabeeparolus@users.noreply.github.com> Date: Thu, 16 Oct 2025 12:43:32 +0200 Subject: [PATCH] man.fish: fix for commands ! . : [ [ja: add test] Closes #11956 --- CHANGELOG.rst | 1 + share/functions/man.fish | 8 ++++---- tests/checks/man.fish | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 tests/checks/man.fish diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c475de7bf..da7d99247 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -27,6 +27,7 @@ fish 4.1.3 (released ???) This release fixes the following regressions identified in 4.1.0: - Crash on invalid :doc:`function ` command (:issue:`11912`). +- Fixed the fish ``man`` function for the commands ``!`` ``.`` ``:`` ``[`` (:issue:`11955`). as well as the following regressions identified in 4.0.0: diff --git a/share/functions/man.fish b/share/functions/man.fish index e38a480b5..6fa33a8f0 100644 --- a/share/functions/man.fish +++ b/share/functions/man.fish @@ -47,13 +47,13 @@ function man # So we override them with the good name. switch $argv case ! - set $argv not + set argv not case . - set $argv source + set argv source case : - set $argv true + set argv true case '[' - set $argv test + set argv test end end diff --git a/tests/checks/man.fish b/tests/checks/man.fish new file mode 100644 index 000000000..c1a67a0f6 --- /dev/null +++ b/tests/checks/man.fish @@ -0,0 +1,14 @@ +# RUN: %fish %s +# REQUIRES: command -v sphinx-build +# REQUIRES: command -v man +# REQUIRES: %fish -c 'status build-info' | grep '^Features:.*embed-data' + +set -lx MANWIDTH 80 +man abbr | head -n4 +# CHECK: ABBR(1) fish-shell ABBR(1) +# CHECK: NAME +# CHECK: abbr - manage fish abbreviations +man : | head -n4 +# CHECK: TRUE(1) fish-shell TRUE(1) +# CHECK: NAME +# CHECK: true - return a successful result