Compare commits

..

6 Commits

Author SHA1 Message Date
Johannes Altmanninger
233355bc9b __fish_apropos: assume only /usr/bin/apropos is broken
Also, remove a macOS version check that's doom to obsolescence,
and extract a function (WIP).
2025-11-15 14:33:55 +01:00
Tair Sabirgaliev
5c2073135e Fix syntax error in __fish_print_port_packages.fish
Fixes #12063 

NOTE: I'm not fish expert, please suggest a better way/place to fix this
2025-11-14 18:25:18 +01:00
Juho Kuisma
58cc0ad760 Update all translations 2025-11-14 23:30:12 +08:00
Juho Kuisma
41387a6a3a Fix funced error message when $VISUAL is set 2025-11-14 23:30:12 +08:00
Fabian Boehm
ee94272eaf fish_config: Remove superfluous grep
`grep -Fx` will match fixed strings over the entire line.

`status list-files foo` will match anything that starts with "foo".

Since we always pass a suffix here, that's the same thing.
If we really cared, we could do `string match "*.$suffix"` or similar.

Fixes #12060
2025-11-14 16:13:43 +01:00
Johannes Altmanninger
dd6000f1fd start new cycle
Created by ./build_tools/release.sh 4.2.1
2025-11-13 13:32:43 +01:00
18 changed files with 55 additions and 13 deletions

View File

@@ -1,3 +1,6 @@
fish ?.?.? (released ???)
=========================
fish 4.2.1 (released November 13, 2025)
=======================================

2
Cargo.lock generated
View File

@@ -152,7 +152,7 @@ checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127"
[[package]]
name = "fish"
version = "4.2.1"
version = "4.2.1-snapshot"
dependencies = [
"bitflags",
"cc",

View File

@@ -70,7 +70,7 @@ debug = true
[package]
name = "fish"
version = "4.2.1"
version = "4.2.1-snapshot"
edition.workspace = true
rust-version.workspace = true
default-run = "fish"

View File

@@ -2328,6 +2328,9 @@ msgstr ""
msgid "funced: The value for $EDITOR '$editor' could not be used because the command '$editor[1]' could not be found"
msgstr ""
msgid "funced: The value for $VISUAL '$editor' could not be used because the command '$editor[1]' could not be found"
msgstr ""
msgid "help: %s is not a valid command: %s\\n"
msgstr ""

View File

@@ -2326,6 +2326,9 @@ msgstr ""
msgid "funced: The value for $EDITOR '$editor' could not be used because the command '$editor[1]' could not be found"
msgstr ""
msgid "funced: The value for $VISUAL '$editor' could not be used because the command '$editor[1]' could not be found"
msgstr ""
msgid "help: %s is not a valid command: %s\\n"
msgstr ""

View File

@@ -2457,6 +2457,9 @@ msgstr ""
msgid "funced: The value for $EDITOR '$editor' could not be used because the command '$editor[1]' could not be found"
msgstr ""
msgid "funced: The value for $VISUAL '$editor' could not be used because the command '$editor[1]' could not be found"
msgstr ""
msgid "help: %s is not a valid command: %s\\n"
msgstr ""

View File

@@ -2322,6 +2322,9 @@ msgstr ""
msgid "funced: The value for $EDITOR '$editor' could not be used because the command '$editor[1]' could not be found"
msgstr ""
msgid "funced: The value for $VISUAL '$editor' could not be used because the command '$editor[1]' could not be found"
msgstr ""
msgid "help: %s is not a valid command: %s\\n"
msgstr ""

View File

@@ -2327,6 +2327,9 @@ msgstr ""
msgid "funced: The value for $EDITOR '$editor' could not be used because the command '$editor[1]' could not be found"
msgstr ""
msgid "funced: The value for $VISUAL '$editor' could not be used because the command '$editor[1]' could not be found"
msgstr ""
msgid "help: %s is not a valid command: %s\\n"
msgstr ""

View File

@@ -2323,6 +2323,9 @@ msgstr ""
msgid "funced: The value for $EDITOR '$editor' could not be used because the command '$editor[1]' could not be found"
msgstr ""
msgid "funced: The value for $VISUAL '$editor' could not be used because the command '$editor[1]' could not be found"
msgstr ""
msgid "help: %s is not a valid command: %s\\n"
msgstr ""

View File

@@ -2355,6 +2355,9 @@ msgstr "foo=bar 变量覆盖"
msgid "funced: The value for $EDITOR '$editor' could not be used because the command '$editor[1]' could not be found"
msgstr "funced: 无法使用 $EDITOR '$editor' 的值,因为找不到命令 '$editor[1]'"
msgid "funced: The value for $VISUAL '$editor' could not be used because the command '$editor[1]' could not be found"
msgstr "funced: 无法使用 $VISUAL '$editor' 的值,因为找不到命令 '$editor[1]'"
msgid "help: %s is not a valid command: %s\\n"
msgstr "help: %s 不是有效的命令:%s\\n"

View File

@@ -2330,6 +2330,9 @@ msgstr "foo=bar 變數覆寫"
msgid "funced: The value for $EDITOR '$editor' could not be used because the command '$editor[1]' could not be found"
msgstr "funced$EDITOR 的值「$editor」無法使用找不到命令「$editor[1]」"
msgid "funced: The value for $VISUAL '$editor' could not be used because the command '$editor[1]' could not be found"
msgstr "funced$VISUAL 的值「$editor」無法使用找不到命令「$editor[1]」"
msgid "help: %s is not a valid command: %s\\n"
msgstr "help%s 不是有效的命令:%s\\n"

View File

@@ -38,7 +38,7 @@ complete -c man -n 'string match -q -- "*/*" (commandline -t | string collect)'
if command -q man
# We have a conditionally-defined man function,
# so we need to check for existence here.
if echo | MANPAGER=cat command man -l - &>/dev/null
if echo | __fish_without_manpager command man -l - &>/dev/null
complete -c man -s l -l local-file -d "Local file" -r
end
end

View File

@@ -5,9 +5,7 @@ if not type -q apropos
exit
end
# Check for macOS Catalina or above.
if test (__fish_uname) = Darwin
and test (string match -r "^\d+" "$(uname -r)") -ge 19
and test -x /usr/libexec/makewhatis
set -l dir
@@ -18,6 +16,11 @@ if test (__fish_uname) = Darwin
end
function __fish_apropos -V dir
if test "$(command -v apropos)" != /usr/bin/apropos
__fish_without_manpager apropos "$argv"
return
end
# macOS 10.15 "Catalina" has a read only filesystem where the whatis database should be.
# The whatis database is non-existent, so apropos tries (and fails) to create it every time,
# which can take seconds.
@@ -34,17 +37,19 @@ if test (__fish_uname) = Darwin
set age (path mtime -R -- $whatis)
end
MANPATH="$dir" MANPAGER=cat WHATISPAGER=cat apropos "$argv"
MANPATH="$dir" __fish_without_manpager apropos "$argv"
if test $age -ge $max_age
test -d "$dir" || mkdir -m 700 -p $dir
/bin/sh -c '( "$@" ) >/dev/null 2>&1 </dev/null &' -- /usr/libexec/makewhatis -o "$whatis" (/usr/bin/manpath | string split : | xargs realpath)
/bin/sh -c '( "$@" ) >/dev/null 2>&1 </dev/null &' -- \
/usr/libexec/makewhatis -o "$whatis" \
(/usr/bin/manpath | string split : | xargs realpath)
end
end
else
function __fish_apropos
# we only ever prefix match for completions. This also ensures results for bare apropos <TAB>
# (apropos '' gives no results, but apropos '^' lists all manpages)
MANPAGER=cat WHATISPAGER=cat apropos "$argv"
__fish_without_manpager apropos "$argv"
end
end

View File

@@ -10,7 +10,7 @@ function __fish_print_help --description "Print help for the specified fish func
end
set -l args -l (path filter -- $man1/$item.1 $man1/$item.1.gz)[1]
# Work around macOS/FreeBSD man not supporting -l yet (only mandoc really needs it).
if not MANPAGER=cat WHATISPAGER=cat command man -l $args[2] &>/dev/null
if not __fish_without_manpager command man -l $args[2] &>/dev/null
set -e args[1]
end
command man $args

View File

@@ -4,7 +4,6 @@ function __fish_print_port_packages
__fish_cached -t 250 -k port '
printf "all\ncurrent\nactive\ninactive\ninstalled\nuninstalled\noutdated\n"
port echo all | awk \'{$1=$1};1\'
'
port echo all | awk \'{$1=$1};1\''
return 0
end

View File

@@ -0,0 +1,7 @@
function __fish_without_manpager
MANPAGER=cat WHATISPAGER=cat if test "$argv[1]" = command
command $argv[2..]
else
$argv
end
end

View File

@@ -376,7 +376,7 @@ function __fish_config_matching
if not set -q argv[1]
set -a paths (status list-files $prefix)
else
set -a paths (status list-files $prefix | grep -Fx -e"$prefix/"$argv$suffix)
set -a paths (status list-files "$prefix/"$argv$suffix)
end
end
string join \n $paths

View File

@@ -39,7 +39,11 @@ function funced --description 'Edit function definition'
end
if not type -q -f "$editor[1]"
echo (_ "funced: The value for \$EDITOR '$editor' could not be used because the command '$editor[1]' could not be found") >&2
if set -q VISUAL
echo (_ "funced: The value for \$VISUAL '$editor' could not be used because the command '$editor[1]' could not be found") >&2
else
echo (_ "funced: The value for \$EDITOR '$editor' could not be used because the command '$editor[1]' could not be found") >&2
end
set editor fish
end