Compare commits

...

58 Commits
4.3.0 ... 4.1.2

Author SHA1 Message Date
Johannes Altmanninger
3fa252677a Release 4.1.2
Created by ./build_tools/release.sh 4.1.2
2025-10-07 22:56:06 +02:00
Johannes Altmanninger
e074b27abf release.sh: fix deployment approval logic 2025-10-07 22:55:04 +02:00
Johannes Altmanninger
a5727e59da tests/checks/fish_config: fix for non-embedded builds
(cherry picked from commit e3ebda3647)
2025-10-07 22:23:51 +02:00
Johannes Altmanninger
4e68f8a130 release.sh: check fish-site worktree staleness
(cherry picked from commit 092e7fa274)
2025-10-07 22:23:51 +02:00
Johannes Altmanninger
417755b6a7 tests/checks/config-paths-standalone.fish: fix bad assertion
Fixes #11906

(cherry picked from commit 724416125e)
2025-10-07 22:00:31 +02:00
Johannes Altmanninger
ef30feda12 Sanitize cursor position report on kitty click_events
This is easy to trigger by having a background process do "echo" to
move the terminal cursor to the next line, and then clicking anywhere.

Fixes #11905

(cherry picked from commit dd47c2baa2)
2025-10-07 21:54:40 +02:00
Johannes Altmanninger
20e3ed23b7 fish_config: fix regression "theme show" not showing custom themes
This regressed in 6f0532460a5~2..6f0532460a5 (fish_config: fix for
non-embedded builds, 2025-09-28).

Fixes #11903

(cherry picked from commit 15065255e9)
2025-10-07 21:54:40 +02:00
Johannes Altmanninger
7bfdb8460d Embedded builds to use $workspace_root/etc again if run from build dir
Commit f05ad46980 (config_paths: remove vestiges of installable
builds, 2025-09-06) removed a bunch of code paths for embed-data
builds, since those builds can do without most config paths.

However they still want the sysconfig path.  That commit made
embedded builds use "/etc/fish" unconditionally.  Previously they
used "$workspace_root/etc".  This is important when running tests,
which should not read /etc/fish.

tests/checks/invocation.fish tests this implicitly: if /etc/fish does
not exist, then

	fish --profile-startup /dev/stdout

will not contain "builtin source".

Let's restore historical behavior.  This might be annoying for users
who "install" with "ln -s target/debug/fish ~/bin/", but that hasn't
ever been recommended, and the historical behavior was in effect
until 4.1.0.

Fixes #11900

(cherry picked from commit 3fec9c8145)
2025-10-07 15:26:09 +02:00
Johannes Altmanninger
8d9d5816ed Extract constant for resolved build directory
Also use a different name than for the CMake variable, to reduce
confusion.

(cherry picked from commit a0b22077a5)
2025-10-07 15:26:09 +02:00
Johannes Altmanninger
97f6129dea Fix regression on paste in non-interactive read
As reported in
https://github.com/fish-shell/fish-shell/issues/11836#issuecomment-3369973613,
running "fish -c read" and pasting something would result this error
from __fish_paste:

	commandline: Can not set commandline in non-interactive mode

Bisects to 32c36aa5f8 (builtins commandline/complete: allow handling
commandline before reader initialization, 2025-06-13).  That commit
allowed "commandline" to work only in interactive sessions, i.e. if
stdin is a TTY or if overridden with -i.

But this is not the only case where fish might read from the TTY.
The notable other case is builtin read, which also works in
noninteractive shells.
Let's allow "commandline" at least after we have initialized the TTY
for the first reader, which restores the relevant historical behavior
(which is weird, e.g. « fish -c 'read; commandline foo' »).

(cherry picked from commit a958f23f63)
2025-10-06 15:12:13 +02:00
Xiretza
c19de5aeb9 Make command run by __fish_echo output to TTY for color detection
Without this, e.g. Alt-L shows the directory entries one per line and
without colors.

Closes #11888

(cherry picked from commit b7fabb11ac)
2025-10-06 15:12:13 +02:00
Johannes Altmanninger
874fba1108 Don't use kitty keyboard protocol support to decide timeout
As reported in
https://github.com/fish-shell/fish-shell/discussions/11868, some
terminals advertise support for the kitty keyboard protocol despite
it not necessarily being enabled.

We use this flag in 30ff3710a0 (Increase timeout when reading
escape sequences inside paste/kitty kbd, 2025-07-24), to support
the AutoHotKey scenario on terminals that support the kitty keyboard
protocols.

Let's move towards the more comprehensive fix mentioned in abd23d2a1b
(Increase escape sequence timeout while waiting for query response,
2025-09-30), i.e. only apply a low timeout when necessary to actually
distinguish legacy escape.

Let's pick 30ms for now (which has been used successfully for similar
things historically, see 30ff3710a0); a higher timeout let alone
a warning on incomplete sequence seems risky for a patch relase,
and it's also not 100% clear if this is actually a degraded state
because in theory the user might legitimately type "escape [ 1"
(while kitty keyboard protocol is turned off, e.g. before the shell
regains control).

This obsoletes and hence reverts commit 623c14aed0 (Kitty keyboard
protocol is non-functional on old versions of Zellij, 2025-10-04).

(cherry picked from commit 6accc475c9)
2025-10-06 15:12:12 +02:00
Johannes Altmanninger
695f225cb4 Kitty keyboard protocol is non-functional on old versions of Zellij
try_readb() uses a high timeout when the kitty keyboard protocol is
enabled, because in that case it should basically never be necessary
to interpret \e as escape key, see 30ff3710a0 (Increase timeout when
reading escape sequences inside paste/kitty kbd, 2025-07-24).

Zellij before commit 0075548a (fix(terminal): support kitty keyboard
protocol setting with "=" (#3942), 2025-01-17) fails to enable kitty
keyboard protocol, so it sends the raw escape bytes, causing us to
wait 300ms.

Closes #11868

(cherry picked from commit 623c14aed0)
2025-10-04 07:23:59 +02:00
Johannes Altmanninger
9f36adb731 Refresh TTY timestamps after firing focus events
Using a multi-line prompt with focus events on:

	tmux new-session fish -C '
		tmux set -g focus-events on
		set -g fish_key_bindings fish_vi_key_bindings
		function fish_prompt
		    echo (prompt_pwd)
		    echo -n "> "
		end
		tmux split
	'

switching to the fish pane and typing any key sometimes leads to our
two-line-prompt being redawn one line below it's actual place.

Reportedly, it bisects to d27f5a5 which changed when we print things.
I did not verify root cause, but
1. symptoms are very similar to other
   problems with TTY timestamps, see eaa837effa (Refresh TTY
   timestamps again in most cases, 2025-07-24).
2. this seems fixed if we refresh timestamps after
   running the focus events, which print some cursor shaping commands
   to stdout. So bravely do that.

Closes #11870

(cherry picked from commit 7d83dc4758)
2025-10-03 22:41:20 +02:00
Johannes Altmanninger
3ff699d7ea Update changelog for patch release
(cherry picked from commit 493d0bca95)
2025-10-03 22:41:10 +02:00
Étienne Deparis
4b6ad751e8 web_config: Support long options separated with = from their value
Closes #11861

(cherry picked from commit 8adc598e90)
2025-10-03 22:38:25 +02:00
Étienne Deparis
8dd90085b6 web_config: Use None as default for underline style
Underline is no more a boolean and should be one of the accepted style,
or None. By keeping False as default value, web_config was generating
wrong --underline=False settings

Part of #11861

(cherry picked from commit c884c08257)
2025-10-03 22:38:25 +02:00
Johannes Altmanninger
47396e78ce Stop requesting modifyOtherKeys on old Midnight Commander again
This upstream issue was fixed in 0ea77d2ec (Ticket #4597: fix CSI
parser, 2024-10-09); for old mc's we had worked around this but the
workaround was accidentally removed. Add it back for all the versions
that don't have that fix.

Fixes f0e007c439 (Relocate tty metadata and protocols and clean
it up, 2025-06-19) Turns out this was why the "Capability" enum was
added in 2d234bb676 (Only request keyboard protocols once we know
if kitty kbd is supported, 2025-01-26).

Fixes #11869

(cherry picked from commit fcd246064b)
2025-10-03 22:38:25 +02:00
Johannes Altmanninger
77a038541a Harmonize temporary Midnight Commander workarounds a bit
(cherry picked from commit 86a0a348ee)
2025-10-03 22:38:25 +02:00
Johannes Altmanninger
84dbdf4e2a Unbreak hack to strip " (deleted)" suffix from executable path
Commit 49b88868df (Fix stripping of " (deleted)" from non-UTF8 paths
to fish, 2024-10-12) was wrong because Path::ends_with() considers
entire path components. Fix that.

Refs:
- https://matrix.to/#/!YLTeaulxSDauOOxBoR:matrix.org/$k2IQazfmztFUXrairmIQvx_seS1ZJ7HlFWhmNy479Dg
- https://matrix.to/#/!YLTeaulxSDauOOxBoR:matrix.org/$4pugfHejL9J9L89zuFU6Bfg41UMjA0y79orc3EaBego

(cherry picked from commit 7b59ae0d82)
2025-10-03 22:38:25 +02:00
Johannes Altmanninger
0a50ba9ef5 release.sh: add next patch milestone
This is still the common case.

(cherry picked from commit ed36e852d2)
2025-10-03 22:38:25 +02:00
Johannes Altmanninger
8b317a192b release.sh: close milestone when done
Don't fail early if this doesn't exist, because it's not needed for
testing this on fish-shell forks that live on GitHub.

(cherry picked from commit da5d93c1e2)
2025-10-03 22:38:25 +02:00
Fabian Boehm
42decbf1da Fix scp completions
Introduced when __fish_mktemp_relative was.

Fixes #11860

(cherry picked from commit 97acc12d62)
2025-10-02 18:40:57 +02:00
Johannes Altmanninger
79b0d24701 release.sh: sunset release announcement email
I'm not sure if our peer projects do this or if it's useful to have
on top of github releases (especially as most releases are patch
releases mainly).

We could certainly use "sphinx-build -b text" in
build_tools/release-notes.sh to extract a nice plaintext changelog
and send that, but that doesn't support links.  Not sure about HTML
email either.

(cherry picked from commit 62543b36a4)
2025-10-01 08:10:20 +02:00
Johannes Altmanninger
1f6cd5fc2d Release 4.1.1
Created by ./build_tools/release.sh 4.1.1
2025-09-30 19:27:13 +02:00
Johannes Altmanninger
635525be96 Changelog update for 4.1.1
(cherry picked from commit 412149a5de)
2025-09-30 19:26:51 +02:00
Johannes Altmanninger
280791c0f5 Increase escape sequence timeout while waiting for query response
Running "fish -d reader" inside SSH inside Windows terminal sometimes
results in hangs on startup (or whenever we run "scrollback-push"),
because not all of the Primary DA response is available for reading
at once:

	reader: Incomplete escape sequence: \e\[?61\;4\;6\;7\;14\;21\;22\;23\;24\;28\;32

Work around this by increasing the read timeout while we're waiting
for query responses.

We should try to find a better (more comprehensive?) fix in future,
but for the patch release, this small change will do.

Fixes #11841

(cherry picked from commit abd23d2a1b)
2025-09-30 19:05:04 +02:00
Johannes Altmanninger
91faa1be49 Changelog for translation fixes from #11833
(cherry picked from commit b774c54a6f)
2025-09-30 19:05:04 +02:00
王宇逸
24e529ea07 zh_CN: fix tier 1 translations
Closes #11833

(cherry picked from commit e4b797405b)
2025-09-30 19:05:04 +02:00
Johannes Altmanninger
595bfda331 release-notes.sh: fix sphinx warning for patch release notes
Integration_4.1.1 fails to generate release notes with

	CHANGELOG.rst:9: WARNING: Bullet list ends without a blank
	line; unexpected unindent. [docutils].

(cherry picked from commit 81a89a5dec)
2025-09-30 19:05:04 +02:00
Johannes Altmanninger
0f358756a2 Primary Device Attribute is a proper noun
We don't care about any specific attributes but we do very much care
about the specific query and response format associated with VT100's
primary device attribute query. Use a proper noun to emphasize that
we want that one and no other.

Ref: https://github.com/fish-shell/fish-shell/pull/11833#discussion_r2385659040
(cherry picked from commit 0da12a6b55)
2025-09-30 12:08:37 +02:00
Johannes Altmanninger
0ace46d127 build.rs: fix MSRV (1.70) clippy
(cherry picked from commit 86ec8994e6)
2025-09-30 12:08:37 +02:00
Johannes Altmanninger
a143a67318 po/de.po: copy-edit German translations
Go through all existing translations except for tier3.

(cherry picked from commit caf426ddb2)
2025-09-30 11:52:43 +02:00
Johannes Altmanninger
047b9d96a0 builtin commandline: fix completion description
(cherry picked from commit 508ae410a6)
2025-09-30 11:52:43 +02:00
Johannes Altmanninger
c942b034ba builtin function: remove dead code
(cherry picked from commit 993b977c9b)
2025-09-30 11:52:42 +02:00
Johannes Altmanninger
0f1caacae4 builtin function: fix a misleading error message
Issue introduced in 7914c92824 (replaced the functions '--rename'
option with '--copy'., 2010-09-09).

(cherry picked from commit a7f0138fc7)
2025-09-30 11:52:42 +02:00
Johannes Altmanninger
f332cdc757 builtin set: fix regression in error message description
(cherry picked from commit ab3c932903)
2025-09-30 11:52:42 +02:00
Johannes Altmanninger
c6912c6721 Remove translations for some error messages that basically never happen
Executable path is empty only in contrived circumstances.

The regex error happens only when the user explicitly turns off a
feature flag.

The orphaned process error seems very unlikely, not worth translating.

(cherry picked from commit ae0fdadcff)
2025-09-30 11:52:42 +02:00
Johannes Altmanninger
678edbd223 Fix short description for builtin wait
(cherry picked from commit e3974989d8)
2025-09-30 11:52:42 +02:00
Johannes Altmanninger
1a78407efe Translation update implied by parent commit
Part of #11833

(cherry picked from commit 080b1e0e4f)
2025-09-30 11:52:41 +02:00
Johannes Altmanninger
3ecf1bc46d po: add section markers to indicate translation priority
Part of #11833

(cherry picked from commit a5db91dd85)
2025-09-30 11:52:41 +02:00
Johannes Altmanninger
4d99e51e62 Translation update implied by parent commit
Part of #11833

(cherry picked from commit b62f54631b)
2025-09-30 11:52:41 +02:00
Johannes Altmanninger
a9576d44e3 Prepare to not localize private function descriptions
The overwhelming majority of localizable messages comes from
completions:

	$ ls share/completions/ | wc -l
	$ 1048

OTOH functions also contribute a small amount, mostly via their
descriptions (so usually just one per file).

	$ ls share/functions/ | wc -l
	$ 237

Most of these are private and almost never shown to the user, so it's
not worth bothering translators with them. So:

- Skip private (see the parent commit) and deprecated functions.
- Skip wrapper functions like grep (where the translation seems to
  be provided by apropos), and even the English description is not
  helpful.
  - Assume that most real systems have "seq", "realpath" etc.,
    so it's no use providing our own translations for our fallbacks.
- Mark fish's own functions as tier1, and some barely-used functiosn
  and completions as tier3, so we can order them that way in
  po/*.po. Most translators should only look at tier1 and tier2.
  In future we could disable localization for tier3.

See the explanation at the bottom of
tests/checks/message-localization-tier-is-declared.fish

Part of #11833

(cherry picked from commit d835c5252a)
2025-09-30 11:52:41 +02:00
Johannes Altmanninger
2c0e912fe1 Mark private functions that don't need localization
See the next commit.

Part of #11833

(cherry picked from commit a53db72564)
2025-09-30 11:52:41 +02:00
Johannes Altmanninger
1f96e58852 functions/realpath: remove weird wrapping
Wrapping the same thing is redundant and wrapping grealpath is kinda
pointless since we only provide completions for realpath.

(cherry picked from commit 61b0368dac)
2025-09-30 11:52:41 +02:00
Integral
03f4bf262a completions/help: correct the spelling of "redirection"
Closes #11839

(cherry picked from commit 568b4a22f9)
2025-09-30 11:52:41 +02:00
Jiangqiu Shen
bb61c948af Re-add translations for share/completions/cjpm.fish
As removed in the parent commit.
Cherry-picked from e4c55131c7 (Update translation, 2025-07-04)

(cherry picked from commit 8abba8a089)
2025-09-30 11:52:41 +02:00
王宇逸
fa59a736bf zh_CN: bad translations are worse than none
Part of #11833

(cherry picked from commit b3b789cd68)
2025-09-30 11:52:40 +02:00
Johannes Altmanninger
97dc8f69d9 functions/seq: use early return
(cherry picked from commit 425a166111)
2025-09-30 11:52:40 +02:00
Johannes Altmanninger
57753474e4 tests/checks/check-all-fish-files.fish: follow naming convention
(cherry picked from commit 1dcc290e29)
2025-09-30 11:52:40 +02:00
Johannes Altmanninger
d5f4cedeb5 build.rs: remove dead code
(cherry picked from commit 863204dbfa)
2025-09-30 11:52:40 +02:00
Sebastian Fleer
ec4700308e webconfig: Replace str.stripprefix with str.removeprefix
str.stripprefix doesn't exist in Python:
https://docs.python.org/3/library/stdtypes.html#str.removeprefix

Closes #11840

(cherry picked from commit 4b21e7c9c7)
2025-09-30 11:52:40 +02:00
Johannes Altmanninger
1d5ae08696 Reliably disable modifyOtherKeys on WezTerm
WezTerm allows applications to enable modifyOtherKeys by default.
Its implementation has issues on non-English or non-QWERTY layouts,
see https://github.com/wezterm/wezterm/issues/6087 and #11204.

fish 4.0.1 disabled modifyOtherKeys on WezTerm specifically
(7ee6d91ba0 (Work around keyboard-layout related bugs in WezTerm's
modifyOtherKeys, 2025-03-03)), fish 4.1.0 didn't, because at that
time, WezTerm would advertise support for the kitty keyboard protocol
(even if applications are not allowed to enable it) which would make
fish skip requesting the legacy modifyOtherKeys.

WezTerm no longer advertises that if config.enable_kitty_keyboard
is false.  Let's work around it in another way.

(cherry picked from commit df5230ff4a)
2025-09-30 11:52:40 +02:00
Johannes Altmanninger
bb5b583d63 Tighten some screws for TTY-specific workarounds
(cherry picked from commit 7cd0943056)
2025-09-30 11:52:40 +02:00
Johannes Altmanninger
7d80a599f2 fish_config: fix for non-embedded builds
I only tested with embedded-builds; CMake tests were failing because
they use different code paths here.

fish_config could use some love.  Start by extracting common
functionality between "{theme,prompt} show", fixing the behavior.

Fixes 29a35a7951 (fish_config: fix "prompt/theme show" in embed-data
builds, 2025-09-28).

(cherry picked from commit 6f0532460a)
2025-09-28 12:31:00 +02:00
Johannes Altmanninger
284d8fa3d1 fish_config: fix "prompt/theme show" in embed-data builds
Fixes #11832

(cherry picked from commit 29a35a7951)
2025-09-28 11:08:14 +02:00
Johannes Altmanninger
a03f52add0 release workflow: install msgfmt for staticbuilds
This makes us actually embed localized messages.

Part of #11828

(cherry picked from commit 0ff0de7efe)
2025-09-28 11:06:21 +02:00
Johannes Altmanninger
89fa81123b build_tools/release.sh: actually add new docs
Not quite sure for which step this is actually needed.  While at it,
fix the errexit issue that caused this blunder.

(cherry picked from commit 97ae05b69d)
2025-09-28 11:06:21 +02:00
261 changed files with 35885 additions and 38056 deletions

View File

@@ -80,7 +80,7 @@ jobs:
with:
targets: x86_64-unknown-linux-musl,aarch64-unknown-linux-musl
- name: Install dependencies
run: sudo apt install crossbuild-essential-arm64 musl-tools python3-sphinx
run: sudo apt install crossbuild-essential-arm64 gettext musl-tools python3-sphinx
- name: Build statically-linked executables
run: |
set -x

View File

@@ -1,3 +1,37 @@
fish 4.1.2 (released October 07, 2025)
======================================
This release fixes the following regressions identified in 4.1.0:
- Fixed spurious error output when completing remote file paths for ``scp`` (:issue:`11860`).
- Fixed the :kbd:`alt-l` binding not formatting ``ls`` output correctly (one entry per line, no colors) (:issue:`11888`).
- Fixed an issue where focus events (currently only enabled in ``tmux``) would cause multiline prompts to be redrawn in the wrong line (:issue:`11870`).
- Stopped printing output that would cause a glitch on old versions of Midnight Commander (:issue:`11869`).
- Added a fix for some configurations of Zellij where :kbd:`escape` key processing was delayed (:issue:`11868`).
- Fixed a case where the :doc:`web-based configuration tool <cmds/fish_config>` would generate invalid configuration (:issue:`11861`).
- Fixed a case where pasting into ``fish -c read`` would fail with a noisy error (:issue:`11836`).
- Fixed a case where upgrading fish would break old versions of fish that were still running.
In general, fish still needs to be restarted after it is upgraded,
except for `standalone builds <https://github.com/fish-shell/fish-shell/?tab=readme-ov-file#building-fish-with-embedded-data-experimental>`__.
fish 4.1.1 (released September 30, 2025)
========================================
This release fixes the following regressions identified in 4.1.0:
- Many of our new Chinese translations were more confusing than helpful; they have been fixed or removed (:issue:`11833`).
Note that you can work around this type of issue by configuring fish's :doc:`message localization <cmds/_>`:
if your environment contains something like ``LANG=zh_CN.UTF-8``,
you can use ``set -g LC_MESSAGES en`` to use English messages inside fish.
This will not affect fish's child processes unless ``LC_MESSAGES`` was already exported.
- Some :doc:`fish_config <cmds/fish_config>` subcommands for showing prompts and themes had been broken in standalone Linux builds (those using the ``embed-data`` cargo feature), which has been fixed (:issue:`11832`).
- On Windows Terminal, we observed an issue where fish would fail to read the terminal's response to our new startup queries, causing noticeable lags and a misleading error message. A workaround has been added (:issue:`11841`).
- A WezTerm `issue breaking shifted key input <https://github.com/wezterm/wezterm/issues/6087>`__ has resurfaced on some versions of WezTerm; our workaround has been extended to cover all versions for now (:issue:`11204`).
- Fixed a crash in :doc:`the web-based configuration tool <cmds/fish_config>` when using the new underline styles (:issue:`11840`).
fish 4.1.0 (released September 27, 2025)
========================================
@@ -30,7 +64,7 @@ Deprecations and removed features
- The ``--install`` option when fish is built as self-installing is removed, see :ref:`below <changelog-4.1-embedded>`.
- ``set_color ff0000`` now outputs 24-bit RGB true-color even if :envvar:`COLORTERM` is unset.
One can override this by setting :envvar:`fish_term24bit` to 0 (:issue:`11372`).
- fish now requires the terminal to respond to queries for the :ref:`primary device attribute <term-compat-primary-da>`.
- fish now requires the terminal to respond to queries for the :ref:`Primary Device Attribute <term-compat-primary-da>`.
For now, this can be reversed via a :ref:`feature flag <featureflags>`,
by running (once) ``set -Ua fish_features no-query-term`` and restarting fish.
- Users of GNU screen may experience :ref:`minor glitches <term-compat-dcs-gnu-screen>` when starting fish.
@@ -83,9 +117,6 @@ Improved terminal support
- Support for double, curly, dotted and dashed underlines, for use in ``fish_color_*`` variables and the :doc:`set_color builtin <cmds/set_color>` (:issue:`10957`).
- Underlines can now be colored independent of text (:issue:`7619`).
- New documentation page :doc:`Terminal Compatibility <terminal-compatibility>` (also accessible via ``man fish-terminal-compatibility``) lists the terminal control sequences used by fish.
- fish now requires the terminal to respond to queries for the :ref:`primary device attribute <term-compat-primary-da>`.
For now, this can be reversed via a :ref:`feature flag <featureflags>`,
by running (once) ``set -Ua fish_features no-query-term``.
Other improvements
------------------

2
Cargo.lock generated
View File

@@ -105,7 +105,7 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
[[package]]
name = "fish"
version = "4.1.0"
version = "4.1.2"
dependencies = [
"bitflags",
"cc",

View File

@@ -64,7 +64,7 @@ debug = true
[package]
name = "fish"
version = "4.1.0"
version = "4.1.2"
edition.workspace = true
rust-version.workspace = true
default-run = "fish"

View File

@@ -180,7 +180,7 @@ To install fish with embedded files, just use ``cargo``, like::
cargo install --git https://github.com/fish-shell/fish-shell --tag "$(curl -s https://api.github.com/repos/fish-shell/fish-shell/releases/latest | jq -r .tag_name)" # to build the latest release
cargo install --git https://github.com/fish-shell/fish-shell # to build the latest development snapshot
This will place the binaries in ``~/.cargo/bin/``, but you can place them wherever you want.
This will place the standalone binaries in ``~/.cargo/bin/``, but you can place them wherever you want.
This build won't have the HTML docs (``help`` will open the online version).
It will try to build the man pages with sphinx-build. If that is not available and you would like to include man pages, you need to install it and retrigger the build script, e.g. by setting FISH_BUILD_DOCS=1::

View File

@@ -3,7 +3,6 @@
use fish_build_helper::{fish_build_dir, workspace_root};
use rsconf::Target;
use std::env;
use std::error::Error;
use std::path::{Path, PathBuf};
fn canonicalize<P: AsRef<Path>>(path: P) -> PathBuf {
@@ -17,7 +16,7 @@ fn main() {
// language server.
rsconf::set_env_value(
"FISH_BUILD_DIR",
"FISH_RESOLVED_BUILD_DIR",
// If set by CMake, this might include symlinks. Since we want to compare this to the
// dir fish is executed in we need to canonicalize it.
canonicalize(fish_build_dir()).to_str().unwrap(),
@@ -81,53 +80,44 @@ fn detect_cfgs(target: &mut Target) {
for (name, handler) in [
// Ignore the first entry, it just sets up the type inference. Model new entries after the
// second line.
(
"",
&(|_: &Target| Ok(false)) as &dyn Fn(&Target) -> Result<bool, Box<dyn Error>>,
),
("", &(|_: &Target| false) as &dyn Fn(&Target) -> bool),
("apple", &detect_apple),
("bsd", &detect_bsd),
("cygwin", &detect_cygwin),
("small_main_stack", &has_small_stack),
// See if libc supports the thread-safe localeconv_l(3) alternative to localeconv(3).
("localeconv_l", &|target| {
Ok(target.has_symbol("localeconv_l"))
target.has_symbol("localeconv_l")
}),
("FISH_USE_POSIX_SPAWN", &|target| {
Ok(target.has_header("spawn.h"))
target.has_header("spawn.h")
}),
("HAVE_PIPE2", &|target| {
Ok(target.has_symbol("pipe2"))
target.has_symbol("pipe2")
}),
("HAVE_EVENTFD", &|target| {
// FIXME: NetBSD 10 has eventfd, but the libc crate does not expose it.
if cfg!(target_os = "netbsd") {
Ok(false)
false
} else {
Ok(target.has_header("sys/eventfd.h"))
target.has_header("sys/eventfd.h")
}
}),
("HAVE_WAITSTATUS_SIGNAL_RET", &|target| {
Ok(target.r#if("WEXITSTATUS(0x007f) == 0x7f", &["sys/wait.h"]))
target.r#if("WEXITSTATUS(0x007f) == 0x7f", &["sys/wait.h"])
}),
] {
match handler(target) {
Err(e) => {
rsconf::warn!("{}: {}", name, e);
rsconf::declare_cfg(name, false);
},
Ok(enabled) => rsconf::declare_cfg(name, enabled),
}
rsconf::declare_cfg(name, handler(target))
}
}
fn detect_apple(_: &Target) -> Result<bool, Box<dyn Error>> {
Ok(cfg!(any(target_os = "ios", target_os = "macos")))
fn detect_apple(_: &Target) -> bool {
cfg!(any(target_os = "ios", target_os = "macos"))
}
fn detect_cygwin(_: &Target) -> Result<bool, Box<dyn Error>> {
fn detect_cygwin(_: &Target) -> bool {
// Cygwin target is usually cross-compiled.
Ok(std::env::var("CARGO_CFG_TARGET_OS").unwrap() == "cygwin")
std::env::var("CARGO_CFG_TARGET_OS").unwrap() == "cygwin"
}
/// Detect if we're being compiled for a BSD-derived OS, allowing targeting code conditionally with
@@ -136,13 +126,14 @@ fn detect_cygwin(_: &Target) -> Result<bool, Box<dyn Error>> {
/// Rust offers fine-grained conditional compilation per-os for the popular operating systems, but
/// doesn't necessarily include less-popular forks nor does it group them into families more
/// specific than "windows" vs "unix" so we can conditionally compile code for BSD systems.
fn detect_bsd(_: &Target) -> Result<bool, Box<dyn Error>> {
fn detect_bsd(_: &Target) -> bool {
// Instead of using `uname`, we can inspect the TARGET env variable set by Cargo. This lets us
// support cross-compilation scenarios.
let mut target = std::env::var("TARGET").unwrap();
if !target.chars().all(|c| c.is_ascii_lowercase()) {
target = target.to_ascii_lowercase();
}
#[allow(clippy::let_and_return)] // for old clippy
let is_bsd = target.ends_with("bsd") || target.ends_with("dragonfly");
#[cfg(any(
target_os = "dragonfly",
@@ -151,7 +142,7 @@ fn detect_bsd(_: &Target) -> Result<bool, Box<dyn Error>> {
target_os = "openbsd",
))]
assert!(is_bsd, "Target incorrectly detected as not BSD!");
Ok(is_bsd)
is_bsd
}
/// Rust sets the stack size of newly created threads to a sane value, but is at at the mercy of the
@@ -160,13 +151,13 @@ fn detect_bsd(_: &Target) -> Result<bool, Box<dyn Error>> {
///
/// 0.5 MiB is small enough that we'd have to drastically reduce MAX_STACK_DEPTH to less than 10, so
/// we instead use a workaround to increase the main thread size.
fn has_small_stack(_: &Target) -> Result<bool, Box<dyn Error>> {
fn has_small_stack(_: &Target) -> bool {
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "netbsd")))]
return Ok(false);
return false;
// NetBSD 10 also needs this but can't find pthread_get_stacksize_np.
#[cfg(target_os = "netbsd")]
return Ok(true);
return true;
#[cfg(any(target_os = "ios", target_os = "macos"))]
{
@@ -182,8 +173,8 @@ fn has_small_stack(_: &Target) -> Result<bool, Box<dyn Error>> {
let stack_size = unsafe { pthread_get_stacksize_np(pthread_self()) };
const TWO_MIB: usize = 2 * 1024 * 1024 - 1;
match stack_size {
0..=TWO_MIB => Ok(true),
_ => Ok(false),
0..=TWO_MIB => true,
_ => false,
}
}
}

View File

@@ -19,7 +19,7 @@ begin
echo ""
end
set -g workspace_root (status dirname)/..
set -g workspace_root (path resolve (status dirname)/..)
set -l rust_extraction_file
if set -l --query _flag_use_existing_template
@@ -31,6 +31,7 @@ begin
or exit 1
end
echo '# fish-section-tier1-from-rust'
# Get rid of duplicates and sort.
msguniq --no-wrap --strict --sort-output $rust_extraction_file
or exit 1
@@ -39,8 +40,9 @@ begin
rm $rust_extraction_file
end
function extract_fish_script_messages --argument-names regex
function extract_fish_script_messages_impl
set -l regex $argv[1]
set -e argv[1]
# Using xgettext causes more trouble than it helps.
# This is due to handling of escaping in fish differing from formats xgettext understands
# (e.g. POSIX shell strings).
@@ -59,24 +61,74 @@ begin
# 5. Double quotes are escaped, such that they are not interpreted as the start or end of
# a msgid.
# 6. We transform the string into the format expected in a PO file.
cat $share_dir/config.fish $share_dir/completions/*.fish $share_dir/functions/*.fish |
cat $argv |
string replace --filter --regex $regex '$1' |
string unescape |
sort -u |
sed -E -e 's_\\\\_\\\\\\\\_g' -e 's_"_\\\\"_g' -e 's_^(.*)$_msgid "\1"\nmsgstr ""\n_'
end
function extract_fish_script_messages
set -l tier $argv[1]
set -e argv[1]
if not set -q argv[1]
return
end
# This regex handles explicit requests to translate a message. These are more important to translate
# than messages which should be implicitly translated.
set -l explicit_regex '.*\( *_ (([\'"]).+?(?<!\\\\)\\2) *\).*'
echo "# fish-section-$tier-from-script-explicitly-added"
extract_fish_script_messages_impl $explicit_regex $argv
# This regex handles descriptions for `complete` and `function` statements. These messages are not
# particularly important to translate. Hence the "implicit" label.
set -l implicit_regex '^(?:\s|and |or )*(?:complete|function).*? (?:-d|--description) (([\'"]).+?(?<!\\\\)\\2).*'
echo "# fish-section-$tier-from-script-implicitly-added"
extract_fish_script_messages_impl $implicit_regex $argv
end
set -g share_dir $workspace_root/share
# This regex handles explicit requests to translate a message. These are more important to translate
# than messages which should be implicitly translated.
set -l explicit_regex '.*\( *_ (([\'"]).+?(?<!\\\\)\\2) *\).*'
extract_fish_script_messages $explicit_regex
set -l tier1 $share_dir/config.fish
set -l tier2
set -l tier3
# This regex handles descriptions for `complete` and `function` statements. These messages are not
# particularly important to translate. Hence the "implicit" label.
set -l implicit_regex '^(?:\s|and |or )*(?:complete|function).*? (?:-d|--description) (([\'"]).+?(?<!\\\\)\\2).*'
extract_fish_script_messages $implicit_regex
for file in $share_dir/completions/*.fish $share_dir/functions/*.fish
# set -l tier (string match -r '^# localization: .*' <$file)
set -l tier (string replace -rf -m1 \
'^# localization: (.*)$' '$1' <$file)
if set -q tier[1]
switch "$tier"
case tier1 tier2 tier3
set -a $tier $file
case 'skip*'
case '*'
echo >&2 "$file:1 unexpected localization tier: $tier"
exit 1
end
continue
end
set -l dirname (path basename (path dirname $file))
set -l command_name (path basename --no-extension $file)
if test $dirname = functions &&
string match -q -- 'fish_*' $command_name
set -a tier1 $file
continue
end
if test $dirname != completions
echo >&2 "$file:1 missing localization tier for function file"
exit 1
end
if test -e $workspace_root/doc_src/cmds/$command_name.rst
set -a tier1 $file
else
set -a tier3 $file
end
end
extract_fish_script_messages tier1 $tier1
extract_fish_script_messages tier2 $tier2
extract_fish_script_messages tier3 $tier3
end |
# At this point, all extracted strings have been written to stdout,
# starting with the ones taken from the Rust sources,

View File

@@ -53,14 +53,14 @@ previous_minor_version=${previous_version%.*}
)
fi
printf %s "$(awk <"$workspace_root/CHANGELOG.rst" '
printf '%s\n' "$(awk <"$workspace_root/CHANGELOG.rst" '
NR <= 2 || /^\.\. ignore / { next }
/^===/ { exit }
{ print }
' | sed '$d')" |
sed -e '$s/^----*$//' # Remove spurious transitions at the end of the document.
if [ "$minor_version" != "$previous_minor_version" ]; then
if [ "$minor_version" != "$previous_minor_version" ]; then {
JoinEscaped() {
sed 's/\S/\\&/g' |
awk '
@@ -79,7 +79,7 @@ previous_minor_version=${previous_version%.*}
echo
printf "Welcome back our returning committers: "
JoinEscaped <"$relnotes_tmp/committers-returning"
fi
} fi
echo
echo "---"
echo

View File

@@ -32,6 +32,7 @@ done
repo_root="$(dirname "$0")/.."
fish_site=$repo_root/../fish-site
fish_site_repo=git@github.com:$repository_owner/fish-site
for path in . "$fish_site"
do
@@ -42,6 +43,13 @@ do
fi
done
(
cd "$fish_site"
[ "$(git rev-parse HEAD)" = \
"$(git ls-remote "$fish_site_repo" refs/heads/master |
awk '{print $1}')" ]
)
if git tag | grep -qxF "$version"; then
echo >&2 "$0: tag $version already exists"
exit 1
@@ -136,7 +144,10 @@ rm -rf "$tmpdir"
cd "$fish_site"
make
git add -u
! git ls-files --others --exclude-standard | grep .
git add docs
if git ls-files --others --exclude-standard | grep .; then
exit 1
fi
git commit --message="$(printf %s "\
| Release $version (docs)
|
@@ -144,15 +155,21 @@ rm -rf "$tmpdir"
" | sed 's,^\s*| \?,,')"
)
# Approve macos-codesign
# TODO what if current user can't approve?
gh_pending_deployments() {
gh_api_repo() {
path=$1
shift
command gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"/repos/$repository_owner/fish-shell/actions/runs/$run_id/pending_deployments" \
"/repos/$repository_owner/fish-shell/$path" \
"$@"
}
# Approve macos-codesign
# TODO what if current user can't approve?
gh_pending_deployments() {
gh_api_repo "actions/runs/$run_id/pending_deployments" "$@"
}
while {
environment_id=$(gh_pending_deployments | jq .[].environment.id)
[ -z "$environment_id" ]
@@ -167,7 +184,7 @@ echo '
"comment": "Approved via ./build_tools/release.sh"
}
' |
gh_pending_deployments -XPOST --input=-
gh_pending_deployments --method POST --input=-
# Await completion.
gh run watch "$run_id"
@@ -184,7 +201,10 @@ done
cd "$fish_site"
make new-release
git add -u
! git ls-files --others --exclude-standard | grep .
git add docs
if git ls-files --others --exclude-standard | grep .; then
exit 1
fi
git commit --message="$(printf %s "\
| Release $version (release list update)
|
@@ -192,12 +212,12 @@ done
" | sed 's,^\s*| \?,,')"
# This takes care to support remote names that are different from
# fish-shell remote name. Also, support detached HEAD state.
git push git@github.com:$repository_owner/fish-site HEAD:master
git push "$fish_site_repo" HEAD:master
)
if [ -n "$integration_branch" ]; then
if [ -n "$integration_branch" ]; then {
git push $remote "$version^{commit}":refs/heads/$integration_branch
else
} else {
changelog=$(cat - CHANGELOG.rst <<EOF
fish ?.?.? (released ???)
=========================
@@ -207,23 +227,27 @@ EOF
printf %s\\n "$changelog" >CHANGELOG.rst
CommitVersion ${version}-snapshot "start new cycle"
git push $remote HEAD:master
fi
# TODO This can currently require a TTY for editing and password
# prompts.
if [ "$repository_owner" = fish-shell ]; then {
mail=$(mktemp)
cat >$mail <<EOF
From: $(git var GIT_AUTHOR_IDENT | sed 's/ [0-9]* +[0-9]*$//')
Subject: fish $version released
See https://github.com/fish-shell/fish-shell/releases/tag/$version
EOF
git send-email --suppress-cc=all --confirm=always $mail \
--to="fish-users Mailing List <fish-users@lists.sourceforge.net>"
rm $mail
} fi
milestone_number=$(
gh_api_repo milestones?state=open |
jq '.[] | select(.title == "fish '"$version"'") | .number'
)
gh_api_repo --method PATCH milestones/$milestone_number \
--raw-field state=closed
next_patch_version=$(
echo "$version" | awk -F. '
NF == 3 && $3 ~ /[0-9]+/ {
printf "%s.%s.%s", $1, $2, $3+1
}
'
)
if [ -n "$next_patch_version" ]; then
gh_api_repo --method POST milestones \
--raw-field title="fish $next_patch_version"
fi
exit
}

View File

@@ -99,15 +99,55 @@ if set -l --query _flag_dry_run
cp -r $po_dir/* $tmpdir
end
function merge_po_files --argument-names template_file po_file
msgmerge --no-wrap --update --no-fuzzy-matching --backup=none --quiet \
$po_file $template_file
or cleanup_exit
set -l new_po_file (mktemp) # TODO Remove on failure.
and msgattrib --no-wrap --no-obsolete -o $new_po_file $po_file
or cleanup_exit
begin
echo "# fish-note-sections: Translations are divided into sections, each starting with a fish-section-* comment."
echo "# fish-note-sections: The first few sections are more important."
echo "# fish-note-sections: Ignore the tier3 sections unless you have a lot of time."
sed -i '
/^# fish-note-sections:/d;
/^# fish-section-/d;
' $new_po_file
set -l next_line 1
set -l section
awk <$template_file '
/^# fish-section-\S*$/ {
section = $0
}
section != "" && /^msgid ".+"$/ {
print section
print $0
section = ""
}
' |
while read -l section
read -l msgid_line
set -l line_number (grep -m1 -Fxn $msgid_line $new_po_file | string split :)[1]
sed -n "$next_line,$(math $line_number - 1)"p $new_po_file
echo $section
set next_line $line_number
# set section
end
sed -n "$next_line,\$"p $new_po_file
end >$po_file
rm $new_po_file
end
for po_file in $po_files
if set --query tmpdir[1]
set po_file $tmpdir/(basename $po_file)
end
if set -l --query po
if test -e $po_file
msgmerge --no-wrap --update --no-fuzzy-matching --backup=none --quiet $po_file $template_file
and msgattrib --no-wrap --no-obsolete -o $po_file $po_file
or cleanup_exit
merge_po_files $template_file $po_file
else
cp $template_file $po_file
end

View File

@@ -12,7 +12,7 @@ fn cargo_target_dir() -> Cow<'static, Path> {
}
pub fn fish_build_dir() -> Cow<'static, Path> {
// FISH_BUILD_DIR is set by CMake, if we are using it.
// This is set if using CMake.
option_env!("FISH_BUILD_DIR")
.map(|d| Cow::Borrowed(Path::new(d)))
.unwrap_or(cargo_target_dir())

View File

@@ -72,7 +72,7 @@ Required Commands
``\e[0c``
-
- Request primary device attribute.
- Request Primary Device Attribute.
The terminal must respond with a CSI command that starts with the ``?`` parameter byte (so a sequence starting with ``\e[?``) and has ``c`` as final byte.
Failure to implement this will cause a brief pause at startup followed by a warning.

3948
po/de.po

File diff suppressed because it is too large Load Diff

3830
po/en.po

File diff suppressed because it is too large Load Diff

3830
po/fr.po

File diff suppressed because it is too large Load Diff

3830
po/pl.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

3828
po/sv.po

File diff suppressed because it is too large Load Diff

49670
po/zh_CN.po

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1,2 @@
# localization: tier1
complete ! --wraps not

View File

@@ -1 +1,2 @@
# localization: tier1
complete [ --wraps test

View File

@@ -11,7 +11,7 @@ complete -c commandline -s t -l current-token -d "Select token under cursor"
complete -c commandline -s b -l current-buffer -d "Select entire command line (default)"
complete -c commandline -s c -l cut-at-cursor -d "Only return that part of the command line before the cursor"
complete -c commandline -s f -l function -d "Inject readline functions to reader"
complete -c commandline -s f -l function -d "execute readline function"
complete -c commandline -s x -l tokens-expanded -d "Print a list of expanded tokens"
complete -c commandline -s I -l input -d "Specify command to operate on"

View File

@@ -1,3 +1,5 @@
# localization: skip(barely-used)
set --local CONDITION '! __fish_seen_argument --short r --long required-val --short o --long optional-val'
complete --command fish_opt --no-files

View File

@@ -122,7 +122,7 @@ complete -c help -x -a exporting-variables -d "What set -x does"
complete -c help -x -a functions -d "How to define functions"
complete -c help -x -a home-directory-expansion -d "~ expansion"
complete -c help -x -a index-range-expansion -d "var[x..y] slices"
complete -c help -x -a input-output-redirection -d "< and > redirectoins"
complete -c help -x -a input-output-redirection -d "< and > redirections"
complete -c help -x -a lists -d "Variables with multiple elements"
complete -c help -x -a loops-and-blocks -d "while, for and begin"
complete -c help -x -a more-on-universal-variables

View File

@@ -47,7 +47,7 @@ complete -c scp -d "Local Path" -n "not string match @ -- (commandline -ct)"
complete -c scp -d "Remote Path" -f -n "commandline -ct | string match -e ':'" -a '
(__scp_remote_target):(
if not set -q __fish_scp_sftp
set -l tmp (__fish_mktemp fish-scp)
set -l tmp (__fish_mktemp_relative fish-scp)
if scp -P(__scp2ssh_port_number) -o "BatchMode yes" -q -O $tmp (__scp_remote_target):/dev/null
set -g __fish_scp_sftp true
else

View File

@@ -1,3 +1,4 @@
function N_ --description No-op
# localization: skip(deprecated)
function N_
printf "%s" $argv
end

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
# returns 0 only if any argument is on of the supplied arguments
function __fish_any_arg_in
set -l haystack $argv

View File

@@ -1,4 +1,5 @@
function __fish_anyeditor --description "Print a editor to use, or an error message"
# localization: tier1
function __fish_anyeditor
set -l editor
if set -q VISUAL
echo $VISUAL | read -at editor

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_anypager --description "Print a pager to use"
set -l pager
# We prefer $PAGER if we have it

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_anypython
# Try python3 first, because that's usually faster and generally nicer.
# Do not consider the stub /usr/bin/python3 that comes installed on Darwin to be Python

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_append -d "Internal completion function for appending string to the commandline" --argument-names sep
set -e argv[1]
set -l str (commandline -tc | string replace -rf "(.*$sep)[^$sep]*" '$1' | string replace -r -- '--.*=' '')

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
if not type -q apropos
function __fish_apropos
end

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_argcomplete_complete
set -lx _ARGCOMPLETE 1
set -lx _ARGCOMPLETE_IFS \n

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_cache_put
set -l cache_file $argv[1]
touch $cache_file

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_cache_sourced_completions
# Allow a `--name=foo` option which ends up in the filename.
argparse -s name= -- $argv

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_cached --description "Cache the command output for a given amount of time"
argparse --min-args 1 --max-args 1 --stop-nonopt 't/max-age=!_validate_int --min 0' 'k/cache-key=' -- $argv

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
# This is meant to be bound to something like ctrl-c
function __fish_cancel_commandline
commandline -f cancel-commandline

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_change_key_bindings --argument-names bindings
set -g __fish_active_key_bindings $bindings
# Allow the user to set the variable universally

View File

@@ -1,4 +1,5 @@
function __fish_cmd__complete_args -d 'Function to generate args'
# localization: tier3
function __fish_cmd__complete_args
set -l current_token (commandline -tc)
switch $current_token

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
# TODO: This function is deprecated. It was used in fish_clipboard_paste
# which some users copied, so maybe leave it around for a few years.
function __fish_commandline_is_singlequoted --description "Return 0 if the current token has an open single-quote"

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_complete_atool_archive_contents --description 'List archive contents'
set -l cmd (commandline -cxp)
set -e cmd[1]

View File

@@ -1,5 +1,6 @@
# localization: tier3
#
# Bittorrent commands
function __fish_complete_bittorrent
complete -c $argv -l max_uploads -x --description "Maximum uploads at once"
complete -c $argv -l keepalive_interval -x --description "Number of seconds between keepalives"

View File

@@ -1,3 +1,5 @@
# localization: skip(private)
#
# Helper function for completions that need to enumerate block devices.
function __fish_complete_blockdevice
set -l cmd (commandline -ct)

View File

@@ -1,3 +1,5 @@
# localization: skip(private)
#
# This function only emits completions that might result from matches against $CDPATH. We rely on
# the core file name completion logic to include all other possible matches.
function __fish_complete_cd -d "Completions for the cd command"

View File

@@ -1,3 +1,5 @@
# localization: skip(private)
#
# This function is compatible with clang, clang++, and variations thereof, and is shared
# by clang.fish and clang++.fish.
# We dynamically query the head at `(commandline -x)[1]` to get the correct completions.

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_complete_command --description 'Complete using all available commands'
set -l ctoken "$(commandline -ct)"
switch $ctoken

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_complete_convert_options --description 'Complete Convert options' --argument-names what
switch $what
case format Format

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
#
# Find directories that complete $argv[1], output them as completions
# with description $argv[2] if defined, otherwise use 'Directory'.

View File

@@ -1,4 +1,5 @@
function __fish_complete_docutils -d "Completions for Docutils common options" -a cmd
# localization: tier3
function __fish_complete_docutils -a cmd
complete -x -c $cmd -k -a "(__fish_complete_suffix .rst .txt)"
# General Docutils Options

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_complete_freedesktop_icons -d 'List installed icon names according to `https://specifications.freedesktop.org/icon-theme-spec/0.13/`'
# The latest `icon-theme-spec` as of 2024-08-10 is 0.13
# https://specifications.freedesktop.org/icon-theme-spec/latest/

View File

@@ -1,4 +1,5 @@
function __fish_complete_ftp -d 'Complete ftp, pftp' --argument-names ftp
# localization: tier3
function __fish_complete_ftp --argument-names ftp
# Common across all ftp implementations
complete -c $ftp -xa "(__fish_print_hostnames)" -d Hostname
complete -c $ftp -s 4 -d 'Use IPv4 only'

View File

@@ -1,3 +1,4 @@
# localization: tier3
#
# Completions for the gpg program.
#
@@ -15,7 +16,7 @@
# removed. The remaining list of completions is still quite
# impressive.
function __fish_complete_gpg -d "Internal function for gpg completion code deduplication" -a __fish_complete_gpg_command
function __fish_complete_gpg -a __fish_complete_gpg_command
if string match -q 'gpg (GnuPG) 1.*' ($__fish_complete_gpg_command --version 2>/dev/null)
complete -c $__fish_complete_gpg_command -l simple-sk-checksum -d 'Integrity protect secret keys by using a SHA-1 checksum'
complete -c $__fish_complete_gpg_command -l no-sig-create-check -d "Do not verify each signature right after creation"

View File

@@ -1,5 +1,6 @@
# Helper function for contextual autocompletion of GPG key ids
# localization: skip(private)
# Helper function for contextual autocompletion of GPG key ids
function __fish_complete_gpg_key_id -d 'Complete using gpg key ids' -a __fish_complete_gpg_command list_arg
# Use user id as description
set -l keyid

View File

@@ -1,5 +1,6 @@
# Helper function for contextual autocompletion of gpg user ids
# localization: skip(private)
# Helper function for contextual autocompletion of gpg user ids
function __fish_complete_gpg_user_id -d "Complete using gpg user ids" -a __fish_complete_gpg_command list_arg
# gpg doesn't seem to like it when you use the whole key name as a
# completion, so we skip the <EMAIL> part and use it as a description.

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_complete_group_ids --description "Complete group IDs with group name as description"
if command -sq getent
getent group | string replace -f -r '^([[:alpha:]_][^:]*):[^:]*:(\d+).*' '$2\t$1'

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_complete_groups --description "Print a list of local groups, with group members as the description"
if command -sq getent
getent group | while read -l line

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_complete_job_pids --description "Print a list of job PIDs and their commands"
if set -l jobpids (jobs -p)
# when run at the commandline, the first line of output is a header, but

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_complete_list --argument-names div cmd prefix iprefix
if not set -q cmd[1]
echo "Usage:

View File

@@ -1,3 +1,4 @@
# localization: tier3
function __fish_complete_lpr -d 'Complete lpr common options' --argument-names cmd
complete -c $cmd -s E -d 'Forces encryption when connecting to the server'
complete -c $cmd -s U -d 'Specifies an alternate username' -xa '(__fish_complete_users)'

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_complete_lpr_option --description 'Complete lpr option'
set -l optstr "$(commandline -t)"
switch $optstr

View File

@@ -1,3 +1,4 @@
# localization: tier3
function __fish_complete_magick
complete -c $argv -o adjoin -d 'Join images into a single multi-image file'
complete -c $argv -o affine -d 'Affine transform matrix [matrix]'

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_complete_man
# Try to guess what section to search in. If we don't know, we
# use [^)]*, which should match any section.

View File

@@ -1,3 +1,4 @@
# localization: tier3
function __fish_print_user_ids
if command -sq getent
for line in (getent passwd)

View File

@@ -1,3 +1,4 @@
# localization: tier3
function __fish_mysql_query -a query
argparse -u 'u/user=' 'P/port=' 'h/host=' 'p/password=?' 'S/socket=' -- (commandline -px)
set -l mysql_cmd mysql

View File

@@ -1,3 +1,4 @@
# localization: tier3
function __fish_complete_netcat
set -l nc $argv[1]
set -l flavor $argv[-1]

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_complete_path --description "Complete using path"
set -l target
set -l description

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_complete_pg_database
psql -AtqwlXF \t 2>/dev/null | awk 'NF > 1 { print $1 }'
end

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_complete_pg_user
psql -AtqwXc 'select usename from pg_user' template1 2>/dev/null
end

View File

@@ -1,3 +1,4 @@
# localization: tier3
function __fish_complete_pgrep -d 'Complete pgrep/pkill' --argument-names cmd
complete -c $cmd -xa '(__fish_complete_proc)'
complete -c $cmd -s f -d 'Match pattern against full command line'

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_complete_pids -d "Print a list of process identifiers along with brief descriptions"
# This may be a bit slower, but it's nice - having the tty displayed is really handy
# 'tail -n +2' deletes the first line, which contains the headers

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_complete_ppp_peer --description 'Complete isp name for pon/poff'
find /etc/ppp/peers/ -type f -printf '%f\n'

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_complete_proc
# "comm=" means "print comm field with an empty name", which causes the header to be removed.
# On many systems, comm is truncated (e.g. on Linux it's 15 chars),

View File

@@ -1,3 +1,4 @@
# localization: tier3
function __fish_complete_ssh -d "common completions for ssh commands" --argument-names command
complete -c $command -s 4 -d "IPv4 only"
complete -c $command -s 6 -d "IPv6 only"

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_complete_subcommand -d "Complete subcommand" --no-scope-shadowing
# How many non-option tokens we skip in the input commandline before completing the subcommand
# Usually 1; use "--fcs-skip=2" to make it 2 (see e.g. tmux and ssh completions)

View File

@@ -1,3 +1,5 @@
# localization: skip(private)
#
# Find files ending in any of the non-switch arguments and output them as completions.
# * --description provides the description that should be part of each generated completion,
# * --prefix=DIR makes __fish_complete_suffix behave as if it were called in DIR rather than $PWD

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_complete_user_at_hosts -d "Print list host-names with user@"
for user_at in (commandline -ct | string match -r '.*@'; or echo "")(__fish_print_hostnames)
echo $user_at

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_complete_user_ids --description "Complete user IDs with user name as description"
if command -sq getent
getent passwd | string replace -f -r '^([[:alpha:]_][^:]*):[^:]*:(\d+).*' '$2\t$1'

View File

@@ -1,3 +1,5 @@
# localization: skip(private)
#
# This should be used where you want user names with a description. Such as in an argument
# completion. If you just want a list of user names use __fish_print_users.
# The string replace command takes into account GECOS-formatted description fields, by retaining

View File

@@ -1,3 +1,5 @@
# localization: tier3
#
# Helper functions for wireshark/tshark/dumpcap completion
function __fish_wireshark_choices

View File

@@ -1,4 +1,5 @@
function __fish_complete_zfs_mountpoint_properties -d "Completes with ZFS mountpoint properties"
# localization: tier3
function __fish_complete_zfs_mountpoint_properties
set -l OS ""
switch (uname)
case Linux

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_complete_zfs_pools -d "Completes with available ZFS pools"
zpool list -o name,comment -H | string replace -a \t'-' ''
end

View File

@@ -1,4 +1,5 @@
function __fish_complete_zfs_ro_properties -d "Completes with ZFS read-only properties"
# localization: tier3
function __fish_complete_zfs_ro_properties
echo -e "available\tAvailable space"
echo -e "avail\tAvailable space"
echo -e "compressratio\tAchieved compression ratio"

View File

@@ -1,4 +1,5 @@
function __fish_complete_zfs_rw_properties -d "Completes with ZFS read-write properties"
# localization: tier3
function __fish_complete_zfs_rw_properties
set -l OS ""
switch (uname)
case Linux

View File

@@ -1,4 +1,5 @@
function __fish_complete_zfs_write_once_properties -d "Completes with ZFS properties which can only be written at filesystem creation, and only be read thereafter"
# localization: tier3
function __fish_complete_zfs_write_once_properties
set -l OS ""
switch (uname)
case Linux

View File

@@ -1,3 +1,5 @@
# localization: skip(private)
#
# This function is intended to be used to generate completions in `-a "(...)"` calls for arguments that take 1..n values
# separated by commas and we dynamically or statically generated a list of n values that must be combined and permuted
# in order to appease both the `complete` machinery and the target application.

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
#
# Initializations that should only be performed when entering interactive mode.
#

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_contains_opt -d "Checks if a specific option has been given in the current commandline"
set -l next_short
set -l short_opt

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
# a function to obtain a list of installed packages with CRUX pkgutils
function __fish_crux_packages -d 'Obtain a list of installed packages'
pkginfo -i | string split -f1 ' '

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_cursor_konsole -d 'Set cursor (konsole)'
set -l shape $argv[1]
switch "$shape"

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_cursor_xterm -d 'Set cursor (xterm)'
set -l shape $argv[1]

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
#
# This function is used internally by the fish command completion code
#

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
set -l erase_line "$(
if status test-feature ignore-terminfo
echo \e\[K
@@ -9,7 +10,8 @@ set -l erase_line "$(
function __fish_echo --inherit-variable erase_line --description 'run the given command after the current commandline and redraw the prompt'
set -l line (commandline --line)
string >&2 repeat -N \n --count=(math (commandline | count) - $line + 1)
printf %s\n $erase_line($argv) >&2
printf %s $erase_line >&2
$argv >&2
string >&2 repeat -N \n --count=(math (count (fish_prompt)) - 1)
string >&2 repeat -N \n --count=(math $line - 1)
commandline -f repaint

View File

@@ -1,3 +1,4 @@
# localization: tier1
function __fish_edit_command_if_at_cursor --description 'If cursor is at the command token, edit the command source file'
set -l tokens (commandline -xpc)
set -l command

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
# Retrieves the first non-switch argument from the command line buffer
function __fish_first_token
set -l tokens (commandline -cx)

View File

@@ -1,3 +1,4 @@
# localization: skip(deprecated)
function __fish_git_prompt
# TODO: This name is deprecated, figure out a way to tell users.
fish_git_prompt $argv

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_gnu_complete -d "Wrapper for the complete built-in. Skips the long completions on non-GNU systems"
set -l is_gnu 0

View File

@@ -1,3 +1,4 @@
# localization: skip(deprecated)
function __fish_hg_prompt
fish_hg_prompt
end

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
set -l dir "$(path dirname -- (status fish-path 2>/dev/null))"
if command -v $dir/fish_indent >/dev/null

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
# determine if this is the very first argument (regardless if switch or not)
function __fish_is_first_arg
set -l tokens (commandline -pxc)

View File

@@ -1,3 +1,4 @@
# localization: skip(private)
function __fish_is_first_token -d 'Test if no non-switch argument has been specified yet'
__fish_is_nth_token 1
end

Some files were not shown because too many files have changed in this diff Show More