Compare commits

..

17 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
Johannes Altmanninger
3bc896bd89 Release 4.2.1
Created by ./build_tools/release.sh 4.2.1
2025-11-13 13:09:28 +01:00
Johannes Altmanninger
80b46fbc28 release.sh: create next minor version milestone
Also stop creating patch milestones automatically. The Web UI doesn't
allow deleting them, only the API does.
2025-11-13 13:06:23 +01:00
Johannes Altmanninger
b9af3eca9f Include prebuilt man pages again
Historically, Sphinx was required when building "standalone" builds,
else they would have no man pages.

This means that commit 0709e4be8b (Use standalone code paths by
default, 2025-10-26) broke man pages for users who build from a
tarball where non-standalone builds would use prebuilt docs.

Add a hack to use prebuilt docs again.

In future, we'll remove prebuilt docs, see #12052.
2025-11-13 12:58:29 +01:00
王宇逸
840efb76d0 zh_TW: fill tier1 translations
Co-authored-by: Lumynous <lumynou5.tw@gmail.com>

Closes #12043
2025-11-13 12:57:01 +01:00
王宇逸
8a845861f3 zh_CN: fill tier1 translations
Co-authored-by: Lumynous <lumynou5.tw@gmail.com>

Part of #12043
2025-11-13 12:57:01 +01:00
Johannes Altmanninger
39d6443b6b github sponsors link
In future we should make an opencollective or liberapay team.
2025-11-13 12:57:01 +01:00
Johannes Altmanninger
1c9d4e77df Fix webconfig import
Fixes 78f71971cb (fix: Python 3.5+ compatibility in webconfig.py
type hints, 2025-11-09).
Fixes #12053
2025-11-12 09:55:22 +01:00
Johannes Altmanninger
15f9d6d279 start new cycle
Created by ./build_tools/release.sh 4.2.0
2025-11-10 10:19:14 +01:00
Johannes Altmanninger
cf2f7eb785 CI: remove tmate used for debugging
Also remove dead code selecting pip version
2025-11-10 10:15:48 +01:00
Johannes Altmanninger
e7d740785d tests/help-completions: fix for macOS awk 2025-11-10 10:15:48 +01:00
Johannes Altmanninger
8cc25fe772 tests/man: work around man idiosyncracy on macOS/FreeBSD
This man implementation fails to remove control characters when stdout
is not a TTY. Upstream tracking issue:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282414
2025-11-10 10:15:48 +01:00
32 changed files with 151 additions and 68 deletions

2
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,2 @@
github:
- krobelus

View File

@@ -9,8 +9,7 @@ runs:
- shell: bash - shell: bash
run: | run: |
set -x set -x
pip=$(command -v pip pip3 | head -1) sudo pip install uv --break-system-packages
sudo "$pip" install uv --break-system-packages
# Check that pyproject.toml and the lock file are in sync. # Check that pyproject.toml and the lock file are in sync.
# TODO Use "uv" to install Python as well. # TODO Use "uv" to install Python as well.
: 'Note that --no-managed-python below would be implied but be explicit' : 'Note that --no-managed-python below would be implied but be explicit'

View File

@@ -148,9 +148,6 @@ jobs:
- name: make fish_run_tests - name: make fish_run_tests
run: | run: |
make -C build VERBOSE=1 fish_run_tests make -C build VERBOSE=1 fish_run_tests
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
windows: windows:
runs-on: windows-latest runs-on: windows-latest

View File

@@ -1,3 +1,15 @@
fish ?.?.? (released ???)
=========================
fish 4.2.1 (released November 13, 2025)
=======================================
This release fixes the following problems identified in 4.2.0:
- When building from a tarball without Sphinx (that is, with ``-DBUILD_DOCS=OFF`` or when ``sphinx-build`` is not found),
builtin man pages and help files were missing, which has been fixed (:issue:`12052`).
- ``fish_config``'s theme selector (the "colors" tab) was broken, which has been fixed (:issue:`12053`).
fish 4.2.0 (released November 10, 2025) fish 4.2.0 (released November 10, 2025)
======================================= =======================================

View File

@@ -44,6 +44,7 @@ set(VARS_FOR_CARGO
"${FISH_PCRE2_BUILDFLAG}" "${FISH_PCRE2_BUILDFLAG}"
"RUSTFLAGS=$ENV{RUSTFLAGS} ${rust_debugflags}" "RUSTFLAGS=$ENV{RUSTFLAGS} ${rust_debugflags}"
"FISH_SPHINX=${SPHINX_EXECUTABLE}" "FISH_SPHINX=${SPHINX_EXECUTABLE}"
"FISH_USE_PREBUILT_DOCS=${USE_PREBUILT_DOCS}"
) )
# Let fish pick up when we're running out of the build directory without installing # Let fish pick up when we're running out of the build directory without installing

2
Cargo.lock generated
View File

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

View File

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

View File

@@ -82,6 +82,7 @@ fn detect_cfgs(target: &mut Target) {
("apple", &detect_apple), ("apple", &detect_apple),
("bsd", &detect_bsd), ("bsd", &detect_bsd),
("using_cmake", &|_| option_env!("FISH_CMAKE_BINARY_DIR").is_some()), ("using_cmake", &|_| option_env!("FISH_CMAKE_BINARY_DIR").is_some()),
("use_prebuilt_docs", &|_| env_var("FISH_USE_PREBUILT_DOCS").is_some_and(|v| v == "TRUE") ),
("cygwin", &detect_cygwin), ("cygwin", &detect_cygwin),
("small_main_stack", &has_small_stack), ("small_main_stack", &has_small_stack),
// See if libc supports the thread-safe localeconv_l(3) alternative to localeconv(3). // See if libc supports the thread-safe localeconv_l(3) alternative to localeconv(3).

View File

@@ -66,13 +66,15 @@ PREFIX_TMPDIR=$(mktemp -d)
cd "$PREFIX_TMPDIR" cd "$PREFIX_TMPDIR"
echo "$VERSION" > version echo "$VERSION" > version
cmake -G "$BUILD_GENERATOR" -DCMAKE_BUILD_TYPE=Debug "$wd" cmake -G "$BUILD_GENERATOR" -DCMAKE_BUILD_TYPE=Debug "$wd"
mkdir $PWD/user_doc/src
FISH_SPHINX_BUILD_DATE=$tag_creation_date \ FISH_SPHINX_BUILD_DATE=$tag_creation_date \
FISH_SPHINX_HELP_SECTIONS_OUTPUT=$PWD/user_doc/src/help_sections.rs \
$BUILD_TOOL doc $BUILD_TOOL doc
TAR_APPEND="$TAR --append --file=$path --mtime=now --owner=0 --group=0 \ TAR_APPEND="$TAR --append --file=$path --mtime=now --owner=0 --group=0 \
--mode=g+w,a+rX --transform s/^/$prefix\//" --mode=g+w,a+rX --transform s/^/$prefix\//"
$TAR_APPEND --no-recursion user_doc $TAR_APPEND --no-recursion user_doc
$TAR_APPEND user_doc/html user_doc/man $TAR_APPEND user_doc/html user_doc/man user_doc/src/help_sections.rs
$TAR_APPEND version $TAR_APPEND version
cd - cd -

View File

@@ -255,23 +255,27 @@ EOF
git push $remote HEAD:master git push $remote HEAD:master
} fi } fi
milestone_version="$(
if echo "$version" | grep -q '\.0$'; then
echo "$minor_version"
else
echo "$version"
fi
)"
milestone_number=$( milestone_number=$(
gh_api_repo milestones?state=open | gh_api_repo milestones?state=open |
jq '.[] | select(.title == "fish '"$version"'") | .number' jq --arg name "fish $1" '
.[] | select(.title == $name) | .number
'
) )
gh_api_repo milestones/$milestone_number --method PATCH \ gh_api_repo milestones/"$milestone_number" --method PATCH \
--raw-field state=closed --raw-field state=closed
next_patch_version=$( next_minor_version=$(echo "$minor_version" |
echo "$version" | awk -F. ' awk -F. '{ printf "%s.%s", $1, $2+1 }')
NF == 3 && $3 ~ /[0-9]+/ { if [ -z "$(milestone_number "$next_minor_version")" ]; then
printf "%s.%s.%s", $1, $2, $3+1
}
'
)
if [ -n "$next_patch_version" ]; then
gh_api_repo milestones --method POST \ gh_api_repo milestones --method POST \
--raw-field title="fish $next_patch_version" --raw-field title="fish $next_minor_version"
fi fi
exit exit

View File

@@ -66,6 +66,7 @@ endif()
add_feature_info(Documentation INSTALL_DOCS "user manual and documentation") add_feature_info(Documentation INSTALL_DOCS "user manual and documentation")
set(USE_PREBUILT_DOCS FALSE)
if(BUILD_DOCS) if(BUILD_DOCS)
configure_file("${SPHINX_SRC_DIR}/conf.py" "${SPHINX_BUILD_DIR}/conf.py" @ONLY) configure_file("${SPHINX_SRC_DIR}/conf.py" "${SPHINX_BUILD_DIR}/conf.py" @ONLY)
add_custom_target(doc ALL add_custom_target(doc ALL
@@ -76,6 +77,7 @@ if(BUILD_DOCS)
PROPERTY FOLDER cmake/DocTargets) PROPERTY FOLDER cmake/DocTargets)
elseif(HAVE_PREBUILT_DOCS) elseif(HAVE_PREBUILT_DOCS)
set(USE_PREBUILT_DOCS TRUE)
if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
# Out of tree build - link the prebuilt documentation to the build tree # Out of tree build - link the prebuilt documentation to the build tree
add_custom_target(link_doc ALL) add_custom_target(link_doc ALL)

View File

@@ -1,4 +1,4 @@
use fish_build_helper::env_var; use fish_build_helper::{env_var, workspace_root};
use std::path::Path; use std::path::Path;
fn main() { fn main() {
@@ -9,6 +9,16 @@ fn main() {
let _ = std::fs::create_dir_all(&sec1_dir); let _ = std::fs::create_dir_all(&sec1_dir);
let help_sections_path = Path::new(&env_var("OUT_DIR").unwrap()).join("help_sections.rs"); let help_sections_path = Path::new(&env_var("OUT_DIR").unwrap()).join("help_sections.rs");
if env_var("FISH_USE_PREBUILT_DOCS").is_some_and(|v| v == "TRUE") {
std::fs::copy(
workspace_root().join("user_doc/src/help_sections.rs"),
help_sections_path,
)
.unwrap();
return;
}
std::fs::write( std::fs::write(
help_sections_path.clone(), help_sections_path.clone(),
r#"pub static HELP_SECTIONS: &str = "";"#, r#"pub static HELP_SECTIONS: &str = "";"#,
@@ -26,8 +36,6 @@ fn build_man(man_dir: &Path, sec1_dir: &Path, help_sections_path: &Path) {
process::{Command, Stdio}, process::{Command, Stdio},
}; };
use fish_build_helper::workspace_root;
let workspace_root = workspace_root(); let workspace_root = workspace_root();
let doc_src_dir = workspace_root.join("doc_src"); let doc_src_dir = workspace_root.join("doc_src");

View File

@@ -97,7 +97,12 @@ def setup(app):
app.add_directive("synopsis", FishSynopsisDirective) app.add_directive("synopsis", FishSynopsisDirective)
app.add_config_value("issue_url", default=None, rebuild="html") app.add_config_value("issue_url", default=None, rebuild="html")
app.add_config_value("fish_help_sections_output", "", "man", str) app.add_config_value(
"fish_help_sections_output",
default=os.environ.get("FISH_SPHINX_HELP_SECTIONS_OUTPUT", ""),
rebuild="man",
types=str,
)
app.add_role("issue", issue_role) app.add_role("issue", issue_role)
app.connect("builder-inited", remove_fish_indent_lexer) app.connect("builder-inited", remove_fish_indent_lexer)

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" msgid "funced: The value for $EDITOR '$editor' could not be used because the command '$editor[1]' could not be found"
msgstr "" 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" msgid "help: %s is not a valid command: %s\\n"
msgstr "" 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" msgid "funced: The value for $EDITOR '$editor' could not be used because the command '$editor[1]' could not be found"
msgstr "" 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" msgid "help: %s is not a valid command: %s\\n"
msgstr "" 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" msgid "funced: The value for $EDITOR '$editor' could not be used because the command '$editor[1]' could not be found"
msgstr "" 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" msgid "help: %s is not a valid command: %s\\n"
msgstr "" 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" msgid "funced: The value for $EDITOR '$editor' could not be used because the command '$editor[1]' could not be found"
msgstr "" 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" msgid "help: %s is not a valid command: %s\\n"
msgstr "" 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" msgid "funced: The value for $EDITOR '$editor' could not be used because the command '$editor[1]' could not be found"
msgstr "" 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" msgid "help: %s is not a valid command: %s\\n"
msgstr "" 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" msgid "funced: The value for $EDITOR '$editor' could not be used because the command '$editor[1]' could not be found"
msgstr "" 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" msgid "help: %s is not a valid command: %s\\n"
msgstr "" msgstr ""

View File

@@ -109,7 +109,7 @@ msgstr "%s"
#, c-format #, c-format
msgid "%s %s: Abbreviation %s already exists for commands %s, cannot rename %s\n" msgid "%s %s: Abbreviation %s already exists for commands %s, cannot rename %s\n"
msgstr "" msgstr "%s %s: 名为 %s 且适用于命令 %s 的缩写已存在,无法重命名 %s\n"
#, c-format #, c-format
msgid "%s %s: Abbreviation %s already exists, cannot rename %s\n" msgid "%s %s: Abbreviation %s already exists, cannot rename %s\n"
@@ -123,9 +123,9 @@ msgstr "%s %s: 缩写词 '%s' 不能包含空格\n"
msgid "%s %s: Name cannot be empty\n" msgid "%s %s: Name cannot be empty\n"
msgstr "%s %s: 名称不能为空\n" msgstr "%s %s: 名称不能为空\n"
#, fuzzy, c-format #, c-format
msgid "%s %s: No abbreviation named %s with the specified command restrictions\n" msgid "%s %s: No abbreviation named %s with the specified command restrictions\n"
msgstr "%s %s: 没有命名为 %s 的缩写\n" msgstr "%s %s: 没有命名为 %s 且符合指定命令限制的缩写\n"
#, c-format #, c-format
msgid "%s %s: Requires at least two arguments\n" msgid "%s %s: Requires at least two arguments\n"
@@ -343,11 +343,11 @@ msgstr "%s: 无法将作业 %s'%s' 放到后台,因为它不受作业控制
msgid "%s: Cannot combine options %s\n" msgid "%s: Cannot combine options %s\n"
msgstr "%s: 无法合并选项 %s\n" msgstr "%s: 无法合并选项 %s\n"
#, fuzzy, c-format #, c-format
msgid "%s: Cannot specify multiple positions\n" msgid "%s: Cannot specify multiple positions\n"
msgstr "%s: 无法指定多个位置\n" msgstr "%s: 无法指定多个位置\n"
#, fuzzy, c-format #, c-format
msgid "%s: Cannot specify multiple regex patterns\n" msgid "%s: Cannot specify multiple regex patterns\n"
msgstr "%s: 无法指定多种正则匹配规则\n" msgstr "%s: 无法指定多种正则匹配规则\n"
@@ -367,11 +367,11 @@ msgstr "%s: 命令在交互提示符下无效\n"
msgid "%s: Could not find '%s'\n" msgid "%s: Could not find '%s'\n"
msgstr "%s: 找不到 '%s'\n" msgstr "%s: 找不到 '%s'\n"
#, fuzzy, c-format #, c-format
msgid "%s: Could not find a job with process ID '%d'\n" msgid "%s: Could not find a job with process ID '%d'\n"
msgstr "%s: 无法找到进程 ID 为 '%d' 的作业\n" msgstr "%s: 无法找到进程 ID 为 '%d' 的作业\n"
#, fuzzy, c-format #, c-format
msgid "%s: Could not find child processes with the name '%s'\n" msgid "%s: Could not find child processes with the name '%s'\n"
msgstr "%s: 无法找到名为 '%s' 的子进程\n" msgstr "%s: 无法找到名为 '%s' 的子进程\n"
@@ -431,7 +431,7 @@ msgstr "%s: 非法函数名 '%s'\n"
msgid "%s: Implicit int flag '%c' already defined\n" msgid "%s: Implicit int flag '%c' already defined\n"
msgstr "%s: 隐式整形标识 '%c' 已被定义\n" msgstr "%s: 隐式整形标识 '%c' 已被定义\n"
#, fuzzy, c-format #, c-format
msgid "%s: Implicit int short flag '%c' does not allow modifiers like '%c'\n" msgid "%s: Implicit int short flag '%c' does not allow modifiers like '%c'\n"
msgstr "%s: 隐式整形短标识 '%c' 不能带有形如 '%c' 的修饰符\n" msgstr "%s: 隐式整形短标识 '%c' 不能带有形如 '%c' 的修饰符\n"
@@ -447,7 +447,7 @@ msgstr "%s: 无效的 --min-args 值 '%s'\n"
msgid "%s: Invalid --unknown-arguments value '%s'\n" msgid "%s: Invalid --unknown-arguments value '%s'\n"
msgstr "%s: 无效的 --unknown-arguments 值 '%s'\n" msgstr "%s: 无效的 --unknown-arguments 值 '%s'\n"
#, fuzzy, c-format #, c-format
msgid "%s: Invalid count value '%s'\n" msgid "%s: Invalid count value '%s'\n"
msgstr "%s: 无效的计数值 '%s'\n" msgstr "%s: 无效的计数值 '%s'\n"
@@ -459,11 +459,11 @@ msgstr "%s: 无效的终止值 '%s'\n"
msgid "%s: Invalid escape style '%s'\n" msgid "%s: Invalid escape style '%s'\n"
msgstr "%s: 无效的转义格式 '%s'\n" msgstr "%s: 无效的转义格式 '%s'\n"
#, fuzzy, c-format #, c-format
msgid "%s: Invalid fields value '%s'\n" msgid "%s: Invalid fields value '%s'\n"
msgstr "%s: 无效的字段值 '%s'\n" msgstr "%s: 无效的字段值 '%s'\n"
#, fuzzy, c-format #, c-format
msgid "%s: Invalid function name: %s\n" msgid "%s: Invalid function name: %s\n"
msgstr "%s: 无效的函数名:%s\n" msgstr "%s: 无效的函数名:%s\n"
@@ -475,11 +475,11 @@ msgstr "%s: 无效的起始索引值 '%s'\n"
msgid "%s: Invalid job control mode '%s'\n" msgid "%s: Invalid job control mode '%s'\n"
msgstr "%s: 无效的作业控制模式 '%s'\n" msgstr "%s: 无效的作业控制模式 '%s'\n"
#, fuzzy, c-format #, c-format
msgid "%s: Invalid length value '%s'\n" msgid "%s: Invalid length value '%s'\n"
msgstr "%s: 无效的长度值 '%s'\n" msgstr "%s: 无效的长度值 '%s'\n"
#, fuzzy, c-format #, c-format
msgid "%s: Invalid level value '%s'\n" msgid "%s: Invalid level value '%s'\n"
msgstr "%s: 无效的级别值 '%s'\n" msgstr "%s: 无效的级别值 '%s'\n"
@@ -491,11 +491,11 @@ msgstr "%s: 无效的限制 '%s'\n"
msgid "%s: Invalid max matches value '%s'\n" msgid "%s: Invalid max matches value '%s'\n"
msgstr "%s: 无效的最大匹配值 '%s'\n" msgstr "%s: 无效的最大匹配值 '%s'\n"
#, fuzzy, c-format #, c-format
msgid "%s: Invalid max value '%s'\n" msgid "%s: Invalid max value '%s'\n"
msgstr "%s: 无效的最大值 '%s'\n" msgstr "%s: 无效的最大值 '%s'\n"
#, fuzzy, c-format #, c-format
msgid "%s: Invalid option spec '%s' at char '%c'\n" msgid "%s: Invalid option spec '%s' at char '%c'\n"
msgstr "%s: 无效的选项规范 '%s' 于字符 '%c'\n" msgstr "%s: 无效的选项规范 '%s' 于字符 '%c'\n"
@@ -519,7 +519,7 @@ msgstr "%s: 字段 '%s' 的范围值无效\n"
msgid "%s: Invalid sort key '%s'\n" msgid "%s: Invalid sort key '%s'\n"
msgstr "%s: 无效的排序键 '%s'\n" msgstr "%s: 无效的排序键 '%s'\n"
#, fuzzy, c-format #, c-format
msgid "%s: Invalid start value '%s'\n" msgid "%s: Invalid start value '%s'\n"
msgstr "%s: 无效的起始值 '%s'\n" msgstr "%s: 无效的起始值 '%s'\n"
@@ -611,7 +611,7 @@ msgstr "%s: 该操作系统不支持资源限制\n"
msgid "%s: STEP must be a positive integer\n" msgid "%s: STEP must be a positive integer\n"
msgstr "%s: STEP 必须是正整数\n" msgstr "%s: STEP 必须是正整数\n"
#, fuzzy, c-format #, c-format
msgid "%s: Short flag '%c' already defined\n" msgid "%s: Short flag '%c' already defined\n"
msgstr "%s: 已经定义了短标识 '%c'\n" msgstr "%s: 已经定义了短标识 '%c'\n"
@@ -1357,7 +1357,7 @@ msgstr "多次执行一条命令"
msgid "Perform a set of commands multiple times" msgid "Perform a set of commands multiple times"
msgstr "多次执行一组指令" msgstr "多次执行一组指令"
#, fuzzy, c-format #, c-format
msgid "Please set $%s to a directory where you have write access." msgid "Please set $%s to a directory where you have write access."
msgstr "请将 $%s 设置为您有写入权限的目录。" msgstr "请将 $%s 设置为您有写入权限的目录。"
@@ -1468,7 +1468,7 @@ msgstr "搜索/使用路径"
msgid "Send job %d (%s) to foreground\n" msgid "Send job %d (%s) to foreground\n"
msgstr "将作业 %d (%s) 发送到前台\n" msgstr "将作业 %d (%s) 发送到前台\n"
#, fuzzy, c-format #, c-format
msgid "Send job %s '%s' to background\n" msgid "Send job %s '%s' to background\n"
msgstr "将作业 %s '%s' 发送到后台\n" msgstr "将作业 %s '%s' 发送到后台\n"
@@ -1624,7 +1624,7 @@ msgstr "无法求值字符串替换"
msgid "Unable to expand variable name '%s'" msgid "Unable to expand variable name '%s'"
msgstr "无法展开变量名称 '%s'" msgstr "无法展开变量名称 '%s'"
#, fuzzy, c-format #, c-format
msgid "Unable to locate %s directory derived from $%s: '%s'." msgid "Unable to locate %s directory derived from $%s: '%s'."
msgstr "无法定位目录 %s 导出自 $%s'%s'。" msgstr "无法定位目录 %s 导出自 $%s'%s'。"
@@ -1871,7 +1871,7 @@ msgstr "仅支持 f1 至 f%d不支持 'f%s'"
msgid "or press ctrl-%c or ctrl-%c twice in a row." msgid "or press ctrl-%c or ctrl-%c twice in a row."
msgstr "或按下 ctrl-%c 键,或连续按两次 ctrl-%c 键。" msgstr "或按下 ctrl-%c 键,或连续按两次 ctrl-%c 键。"
#, fuzzy, c-format #, c-format
msgid "rows %u to %u of %u" msgid "rows %u to %u of %u"
msgstr "第 %u 行至第 %u 行,共 %u 行" msgstr "第 %u 行至第 %u 行,共 %u 行"
@@ -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" 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]'" 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" msgid "help: %s is not a valid command: %s\\n"
msgstr "help: %s 不是有效的命令:%s\\n" msgstr "help: %s 不是有效的命令:%s\\n"
@@ -2827,7 +2830,7 @@ msgid "List embedded files contained in the fish binary"
msgstr "列出 fish 二进制文件包含的嵌入文件" msgstr "列出 fish 二进制文件包含的嵌入文件"
msgid "List section arguments for the 'help' command" msgid "List section arguments for the 'help' command"
msgstr "" msgstr "列出传给 'help' 命令的段落名称参数"
msgid "List the names of the functions, but not their definition" msgid "List the names of the functions, but not their definition"
msgstr "列出函数的名称,但不列出其定义" msgstr "列出函数的名称,但不列出其定义"

View File

@@ -82,7 +82,7 @@ msgstr "%s"
#, c-format #, c-format
msgid "%s %s: Abbreviation %s already exists for commands %s, cannot rename %s\n" msgid "%s %s: Abbreviation %s already exists for commands %s, cannot rename %s\n"
msgstr "" msgstr "%s %s名為 %s 且適用於命令 %s 的縮寫已存在,無法重新命名 %s\n"
#, c-format #, c-format
msgid "%s %s: Abbreviation %s already exists, cannot rename %s\n" msgid "%s %s: Abbreviation %s already exists, cannot rename %s\n"
@@ -96,9 +96,9 @@ msgstr "%s %s縮寫「%s」中不能包含空格\n"
msgid "%s %s: Name cannot be empty\n" msgid "%s %s: Name cannot be empty\n"
msgstr "%s %s名稱不能空白\n" msgstr "%s %s名稱不能空白\n"
#, fuzzy, c-format #, c-format
msgid "%s %s: No abbreviation named %s with the specified command restrictions\n" msgid "%s %s: No abbreviation named %s with the specified command restrictions\n"
msgstr "%s %s沒有縮寫名為 %s\n" msgstr "%s %s沒有縮寫名為 %s 且符合指定命令限制\n"
#, c-format #, c-format
msgid "%s %s: Requires at least two arguments\n" msgid "%s %s: Requires at least two arguments\n"
@@ -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" 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]」" 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" msgid "help: %s is not a valid command: %s\\n"
msgstr "help%s 不是有效的命令:%s\\n" msgstr "help%s 不是有效的命令:%s\\n"
@@ -2802,7 +2805,7 @@ msgid "List embedded files contained in the fish binary"
msgstr "列出 fish 二進位檔中嵌入的檔案" msgstr "列出 fish 二進位檔中嵌入的檔案"
msgid "List section arguments for the 'help' command" msgid "List section arguments for the 'help' command"
msgstr "" msgstr "列出傳給「help」命令的段落名稱引數"
msgid "List the names of the functions, but not their definition" msgid "List the names of the functions, but not their definition"
msgstr "列出函式名稱,不包括其定義" msgstr "列出函式名稱,不包括其定義"

View File

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

View File

@@ -5,9 +5,7 @@ if not type -q apropos
exit exit
end end
# Check for macOS Catalina or above.
if test (__fish_uname) = Darwin if test (__fish_uname) = Darwin
and test (string match -r "^\d+" "$(uname -r)") -ge 19
and test -x /usr/libexec/makewhatis and test -x /usr/libexec/makewhatis
set -l dir set -l dir
@@ -18,6 +16,11 @@ if test (__fish_uname) = Darwin
end end
function __fish_apropos -V dir 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. # 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, # The whatis database is non-existent, so apropos tries (and fails) to create it every time,
# which can take seconds. # which can take seconds.
@@ -34,17 +37,19 @@ if test (__fish_uname) = Darwin
set age (path mtime -R -- $whatis) set age (path mtime -R -- $whatis)
end end
MANPATH="$dir" MANPAGER=cat WHATISPAGER=cat apropos "$argv" MANPATH="$dir" __fish_without_manpager apropos "$argv"
if test $age -ge $max_age if test $age -ge $max_age
test -d "$dir" || mkdir -m 700 -p $dir 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
end end
else else
function __fish_apropos function __fish_apropos
# we only ever prefix match for completions. This also ensures results for bare apropos <TAB> # we only ever prefix match for completions. This also ensures results for bare apropos <TAB>
# (apropos '' gives no results, but apropos '^' lists all manpages) # (apropos '' gives no results, but apropos '^' lists all manpages)
MANPAGER=cat WHATISPAGER=cat apropos "$argv" __fish_without_manpager apropos "$argv"
end end
end end

View File

@@ -10,7 +10,7 @@ function __fish_print_help --description "Print help for the specified fish func
end end
set -l args -l (path filter -- $man1/$item.1 $man1/$item.1.gz)[1] 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). # 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] set -e args[1]
end end
command man $args command man $args

View File

@@ -4,7 +4,6 @@ function __fish_print_port_packages
__fish_cached -t 250 -k port ' __fish_cached -t 250 -k port '
printf "all\ncurrent\nactive\ninactive\ninstalled\nuninstalled\noutdated\n" 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 return 0
end 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] if not set -q argv[1]
set -a paths (status list-files $prefix) set -a paths (status list-files $prefix)
else 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
end end
string join \n $paths string join \n $paths

View File

@@ -39,7 +39,11 @@ function funced --description 'Edit function definition'
end end
if not type -q -f "$editor[1]" 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 set editor fish
end end

View File

@@ -19,7 +19,7 @@ import subprocess
import sys import sys
import tempfile import tempfile
import threading import threading
import typing from typing import Optional
from itertools import chain from itertools import chain
COMMON_WSL_CMD_PATHS = ( COMMON_WSL_CMD_PATHS = (

View File

@@ -334,10 +334,19 @@ fn parse_cmd_opts(
use rust_embed::RustEmbed; use rust_embed::RustEmbed;
#[cfg(feature = "embed-data")] #[cfg(feature = "embed-data")]
#[derive(RustEmbed)] cfg_if!(
#[folder = "$FISH_RESOLVED_BUILD_DIR/fish-man/man1"] if #[cfg(use_prebuilt_docs)] {
#[prefix = "man/man1/"] #[derive(RustEmbed)]
struct Docs; #[folder = "user_doc/man/man1"]
#[prefix = "man/man1/"]
struct Docs;
} else {
#[derive(RustEmbed)]
#[folder = "$FISH_RESOLVED_BUILD_DIR/fish-man/man1"]
#[prefix = "man/man1/"]
struct Docs;
}
);
#[cfg(all(using_cmake, feature = "embed-data"))] #[cfg(all(using_cmake, feature = "embed-data"))]
#[derive(RustEmbed)] #[derive(RustEmbed)]

View File

@@ -6,7 +6,7 @@ status help-sections | grep -v ^cmds/ >expected
__fish_data_with_file completions/help.fish cat | __fish_data_with_file completions/help.fish cat |
awk ' awk '
/(\s)case(\s)/ && $2 != "'\''cmds/*'\''" { / case / && $2 != "'\''cmds/*'\''" {
sub(/^introduction/, "index", $2); sub(/^introduction/, "index", $2);
print $2 print $2
} }

View File

@@ -8,12 +8,14 @@ __fish_data_with_file functions/__fish_print_help.fish source
# REQUIRES: test "$FISH_BUILD_DOCS" != "0" # REQUIRES: test "$FISH_BUILD_DOCS" != "0"
# REQUIRES: %fish -c 'status build-info' | grep '^Features:.*embed-data' # REQUIRES: %fish -c 'status build-info' | grep '^Features:.*embed-data'
set -l deroff col -b -p -x
set -lx MANWIDTH 80 set -lx MANWIDTH 80
man abbr | head -n4 man abbr | $deroff | head -n4
# CHECK: ABBR(1) {{ *}} fish-shell {{ *}} ABBR(1) # CHECK: ABBR(1) {{ *}} fish-shell {{ *}} ABBR(1)
# CHECK: NAME # CHECK: NAME
# CHECK: abbr - manage fish abbreviations # CHECK: abbr - manage fish abbreviations
man : | head -n4 man : | $deroff | head -n4
# CHECK: TRUE(1) {{ *}} fish-shell {{ *}} TRUE(1) # CHECK: TRUE(1) {{ *}} fish-shell {{ *}} TRUE(1)
# CHECK: NAME # CHECK: NAME
# CHECK: true - return a successful result # CHECK: true - return a successful result