mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-19 14:51:13 -03:00
Compare commits
182 Commits
test-drive
...
4.0.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1456f9707 | ||
|
|
c88e6827b7 | ||
|
|
bc3e3ae029 | ||
|
|
3191ac13e5 | ||
|
|
4f810809c8 | ||
|
|
d622949d26 | ||
|
|
d95b662542 | ||
|
|
d88d3122c8 | ||
|
|
a7f717c59c | ||
|
|
ba49981f17 | ||
|
|
05ae55b172 | ||
|
|
b5877ebe44 | ||
|
|
f9a03215b8 | ||
|
|
ff0980c4c1 | ||
|
|
1a58d3f08b | ||
|
|
b71027f622 | ||
|
|
84c03c6f26 | ||
|
|
bf455bc316 | ||
|
|
6af0378916 | ||
|
|
de154065fe | ||
|
|
459e9b7847 | ||
|
|
f127323c33 | ||
|
|
3fc245d829 | ||
|
|
542793a534 | ||
|
|
18c231de29 | ||
|
|
8e78857836 | ||
|
|
c7efbf590e | ||
|
|
5771085280 | ||
|
|
76d2419228 | ||
|
|
ffbf957fa3 | ||
|
|
ae3532e9ec | ||
|
|
5cd2ef903a | ||
|
|
67b6afffd4 | ||
|
|
6df88e1a9f | ||
|
|
61884bda36 | ||
|
|
66584dadcc | ||
|
|
5944518e6e | ||
|
|
19502ff9e7 | ||
|
|
e37e1b8f78 | ||
|
|
5d31be1c3e | ||
|
|
7a959723ef | ||
|
|
ad7631093d | ||
|
|
bd8d268255 | ||
|
|
83f29ed09c | ||
|
|
aca6836103 | ||
|
|
c9f1979b05 | ||
|
|
4a35c48ce5 | ||
|
|
f336cf5624 | ||
|
|
1504731d53 | ||
|
|
9dce68fab4 | ||
|
|
815bc054e7 | ||
|
|
b8af4b20c2 | ||
|
|
c06830ccf2 | ||
|
|
f96b9c53ce | ||
|
|
12527d1522 | ||
|
|
46422b6a16 | ||
|
|
97f0809b62 | ||
|
|
d30a2c5240 | ||
|
|
7ee6d91ba0 | ||
|
|
a94c4e96ab | ||
|
|
e767bb623f | ||
|
|
e925eccad2 | ||
|
|
200eeffeee | ||
|
|
0d453039ac | ||
|
|
044afefc5c | ||
|
|
5cce0918a9 | ||
|
|
3a673aff63 | ||
|
|
880aa479bf | ||
|
|
303af078f3 | ||
|
|
1e069b0fff | ||
|
|
eb336889b7 | ||
|
|
1c57144f8b | ||
|
|
6d30751f1c | ||
|
|
d33b967196 | ||
|
|
ea115f8595 | ||
|
|
def40ff34d | ||
|
|
bfa1e0dafb | ||
|
|
b52173c854 | ||
|
|
b5736c5535 | ||
|
|
e2a0b0e2b8 | ||
|
|
ebc460b9f9 | ||
|
|
df56f7155e | ||
|
|
40b63c35ab | ||
|
|
b72dc096f9 | ||
|
|
c571b65221 | ||
|
|
fab273cf4d | ||
|
|
0f346991e4 | ||
|
|
9c2bfec150 | ||
|
|
9c40f72643 | ||
|
|
774ad16404 | ||
|
|
6d7a7c2254 | ||
|
|
e1349b9c4a | ||
|
|
0677c03689 | ||
|
|
1b6e107131 | ||
|
|
7ea368b6d3 | ||
|
|
00b2009851 | ||
|
|
47d3189614 | ||
|
|
65ac71edcc | ||
|
|
a11b9e5af7 | ||
|
|
db244e0492 | ||
|
|
3469fd25ec | ||
|
|
378f452eaa | ||
|
|
04151d758b | ||
|
|
bf91da5979 | ||
|
|
2f2ea729a7 | ||
|
|
db48cd547b | ||
|
|
acadf00718 | ||
|
|
93ac5d0eb3 | ||
|
|
5aec9e3b47 | ||
|
|
d7fb0308a7 | ||
|
|
fa5de3ece8 | ||
|
|
29e69bd113 | ||
|
|
4d6544591e | ||
|
|
bfbee7a7ff | ||
|
|
3400844f9a | ||
|
|
f1bb4e02fe | ||
|
|
9385a25c22 | ||
|
|
323bddcce6 | ||
|
|
d29d63d930 | ||
|
|
a62bae9e8f | ||
|
|
28d4fc33d8 | ||
|
|
7dc046b959 | ||
|
|
9882849fda | ||
|
|
92582d5b1f | ||
|
|
8eb5e36aa6 | ||
|
|
fd3ed7cfa5 | ||
|
|
4c9dfcc5d7 | ||
|
|
4024d82412 | ||
|
|
1c11055241 | ||
|
|
28fb5b5207 | ||
|
|
45439f07d7 | ||
|
|
452aa6c614 | ||
|
|
8c92ea1642 | ||
|
|
d2bfb51611 | ||
|
|
806734cc56 | ||
|
|
8e141070b2 | ||
|
|
b009c0d480 | ||
|
|
b3aa79e9aa | ||
|
|
fbf9ac8046 | ||
|
|
fb6d3c3669 | ||
|
|
d6dccc3c88 | ||
|
|
f36a7262db | ||
|
|
8a5b1ccc17 | ||
|
|
52a2bed38c | ||
|
|
cbfbac2198 | ||
|
|
a9b7dd1a9b | ||
|
|
4decacb933 | ||
|
|
620eed466b | ||
|
|
33fe575112 | ||
|
|
13f7e6d0a5 | ||
|
|
44a8344da1 | ||
|
|
92919effc5 | ||
|
|
046cadb53a | ||
|
|
a5f99afa47 | ||
|
|
24397c71cd | ||
|
|
566ff38fee | ||
|
|
7ea2ab4ebb | ||
|
|
e6e647092d | ||
|
|
5845a3f7ad | ||
|
|
ff8a879e80 | ||
|
|
6749a44d0f | ||
|
|
550a076fa3 | ||
|
|
c28659a045 | ||
|
|
d2608588fc | ||
|
|
dd333cdc82 | ||
|
|
57a7920e15 | ||
|
|
2f99a82700 | ||
|
|
5f76fc3e41 | ||
|
|
c0a2b55efd | ||
|
|
f75912d205 | ||
|
|
701853fdd3 | ||
|
|
ea2c53ca85 | ||
|
|
06105e9207 | ||
|
|
e858322749 | ||
|
|
bd2ddda9a4 | ||
|
|
6db110916b | ||
|
|
d707a516d2 | ||
|
|
aed52049ab | ||
|
|
5fed900b94 | ||
|
|
70ba81e5b3 | ||
|
|
f237fb7b9f | ||
|
|
7069f3fe40 |
30
.github/workflows/main.yml
vendored
30
.github/workflows/main.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: make test
|
||||
name: make fish_run_tests
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
@@ -28,10 +28,10 @@ jobs:
|
||||
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
- name: make
|
||||
run: |
|
||||
make VERBOSE=1
|
||||
- name: make test
|
||||
make -C build VERBOSE=1
|
||||
- name: make fish_run_tests
|
||||
run: |
|
||||
make VERBOSE=1 test
|
||||
make -C build VERBOSE=1 fish_run_tests
|
||||
|
||||
ubuntu-32bit-static-pcre2:
|
||||
|
||||
@@ -54,10 +54,10 @@ jobs:
|
||||
cmake -DFISH_USE_SYSTEM_PCRE2=OFF -DRust_CARGO_TARGET=i586-unknown-linux-gnu ..
|
||||
- name: make
|
||||
run: |
|
||||
make VERBOSE=1
|
||||
- name: make test
|
||||
make -C build VERBOSE=1
|
||||
- name: make fish_run_tests
|
||||
run: |
|
||||
make VERBOSE=1 test
|
||||
make -C build VERBOSE=1 fish_run_tests
|
||||
|
||||
ubuntu-asan:
|
||||
|
||||
@@ -92,8 +92,8 @@ jobs:
|
||||
cmake .. -DASAN=1 -DRust_CARGO_TARGET=x86_64-unknown-linux-gnu -DCMAKE_BUILD_TYPE=Debug
|
||||
- name: make
|
||||
run: |
|
||||
make VERBOSE=1
|
||||
- name: make test
|
||||
make -C build VERBOSE=1
|
||||
- name: make fish_run_tests
|
||||
env:
|
||||
FISH_CI_SAN: 1
|
||||
ASAN_OPTIONS: check_initialization_order=1:detect_stack_use_after_return=1:detect_leaks=1:fast_unwind_on_malloc=0
|
||||
@@ -107,7 +107,7 @@ jobs:
|
||||
llvm_version=$(clang --version | awk 'NR==1 { split($NF, version, "."); print version[1] }')
|
||||
export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-$llvm_version
|
||||
export LSAN_OPTIONS="$LSAN_OPTIONS:suppressions=$PWD/build_tools/lsan_suppressions.txt"
|
||||
make VERBOSE=1 test
|
||||
make -C build VERBOSE=1 fish_run_tests
|
||||
|
||||
# Our clang++ tsan builds are not recognizing safe rust patterns (such as the fact that Drop
|
||||
# cannot be called while a thread is using the object in question). Rust has its own way of
|
||||
@@ -133,9 +133,9 @@ jobs:
|
||||
# - name: make
|
||||
# run: |
|
||||
# make
|
||||
# - name: make test
|
||||
# - name: make fish_run_tests
|
||||
# run: |
|
||||
# make test
|
||||
# make -C build fish_run_tests
|
||||
|
||||
macos:
|
||||
|
||||
@@ -160,7 +160,7 @@ jobs:
|
||||
cmake -DWITH_GETTEXT=NO -DCMAKE_BUILD_TYPE=Debug ..
|
||||
- name: make
|
||||
run: |
|
||||
make VERBOSE=1
|
||||
- name: make test
|
||||
make -C build VERBOSE=1
|
||||
- name: make fish_run_tests
|
||||
run: |
|
||||
make VERBOSE=1 test
|
||||
make -C build VERBOSE=1 fish_run_tests
|
||||
|
||||
@@ -31,7 +31,7 @@ PREFIX?=/usr/local
|
||||
build/fish: build/$(BUILDFILE)
|
||||
$(CMAKE) --build build
|
||||
|
||||
# Don't split the mkdir into its own rule because that would cause CMake to regenerate the build
|
||||
# Don't split the mkdir into its own rule because that would cause CMake to regenerate the build
|
||||
# files after each build (because it adds the mdate of the build directory into the out-of-date
|
||||
# calculation tree). GNUmake supports order-only dependencies, BSDmake does not seem to.
|
||||
build/$(BUILDFILE):
|
||||
@@ -48,7 +48,11 @@ clean:
|
||||
|
||||
.PHONY: test
|
||||
test: build/fish
|
||||
$(CMAKE) --build build --target test
|
||||
$(CMAKE) --build build --target fish_run_tests
|
||||
|
||||
.PHONY: fish_run_tests
|
||||
fish_run_tests: build/fish
|
||||
$(CMAKE) --build build --target fish_run_tests
|
||||
|
||||
.PHONY: run
|
||||
run: build/fish
|
||||
|
||||
137
CHANGELOG.rst
137
CHANGELOG.rst
@@ -1,17 +1,56 @@
|
||||
fish 4.0b1 (released December 17, 2024)
|
||||
fish 4.0.2 (released April 20, 2025)
|
||||
====================================
|
||||
|
||||
This release of fish fixes a number of issues identified in fish 4.0.1:
|
||||
|
||||
- Completions are quoted, rather than backslash-escaped, only if the completion is unambiguous. Continuing to edit the token is therefore easier (:issue:`11271`). This changes the behavior introduced in 4.0.0 where all completions were quoted.
|
||||
- The warning when the terminfo database can't be found has been downgraded to a log message. fish will act as if the terminal behaves like xterm-256color, which is correct for the vast majority of cases (:issue:`11277`, :issue:`11290`).
|
||||
- Key combinations using the super (Windows/command) key can now (actually) be bound using the :kbd:`super-` prefix (:issue:`11217`). This was listed in the release notes for 4.0.1 but did not work correctly.
|
||||
- :doc:`function <cmds/function>` is stricter about argument parsing, rather than allowing additional parameters to be silently ignored (:issue:`11295`).
|
||||
- Using parentheses in the :doc:`test <cmds/test>` builtin works correctly, following a regression in 4.0.0 where they were not recognized (:issue:`11387`).
|
||||
- :kbd:`delete` in Vi mode when Num Lock is active will work correctly (:issue:`11303`).
|
||||
- Abbreviations cannot alter the command-line contents, preventing a crash (:issue:`11324`).
|
||||
- Improvements to various completions, including new completions for ``wl-randr`` (:issue:`11301`), performance improvements for ``cargo`` completions by avoiding network requests (:issue:`11347`), and other improvements for ``btrfs`` (:issue:`11320`), ``cryptsetup`` (:issue:`11315`), ``git`` (:issue:`11319`, :issue:`11322`, :issue:`11323`), ``jj`` (:issue:`11046`), and ``systemd-analyze`` (:issue:`11314`).
|
||||
- The Mercurial (``hg``) prompt can handle working directories that contain an embedded newline, rather than producing errors (:issue:`11348`).
|
||||
- A number of crashes have been fixed. Triggers include prompts containing backspace characters (:issue:`11280`), history pager search (:issue:`11355`), invalid UTF-8 in :doc:`read <cmds/read>` (:issue:`11383`), and the ``kill-selection`` binding (:issue:`11367`).
|
||||
- A race condition in the test suite has been fixed (:issue:`11254`), and a test for fish versioning relaxed to support downstream distributors' modifications (:issue:`11173`).
|
||||
- Small improvements to the documentation (:issue:`11264`, :issue:`11329`, :issue:`11361`).
|
||||
|
||||
--------------
|
||||
|
||||
fish 4.0.1 (released March 12, 2025)
|
||||
====================================
|
||||
|
||||
This release of fish includes the following improvements compared to fish 4.0.0:
|
||||
|
||||
- Key combinations using the super (Windows/command) key can be bound using the :kbd:`super-` prefix (:issue:`11217`).
|
||||
- Konsole's menu shows the "Open folder with" option again (:issue:`11198`).
|
||||
- ``$fish_color_search_match`` will now only be applied to the foreground color if it has an explicit foreground. For example, this allows setting::
|
||||
set -g fish_color_search_match --reverse
|
||||
- Cursor shape commands (``\e[2 q``) are no longer sent in non-interactive shells or in redirections (:issue:`11255`).
|
||||
- :doc:`status <cmds/status>` gained a ``is-interactive-read`` subcommand, to check whether the script is being called from an interactive :doc:`read <cmds/read>` invocation.
|
||||
- fish's background tasks are now started in a way that avoids an error on macOS Terminal.app (:issue:`11181`).
|
||||
- Using key combinations within qemu should work correctly.
|
||||
- Prompts containing control characters no longer cause incorrect display of command lines (:issue:`11252`).
|
||||
- Cancelling the command-line in Vi mode displays correctly again (:issue:`11261`).
|
||||
- The acidhub prompt properly displays the git branch again (:issue:`11179`).
|
||||
- Completions for ``wine`` correctly include files again (:issue:`11202`).
|
||||
- On macOS, paths from ``/etc/paths`` and ``/etc/manpaths`` containing colons are handled correctly (:issue:`10684`). This functionality was included in the 4.0.0 release notes but was missing from the source code.
|
||||
- The XTerm ``modifyOtherKeys`` keyboard encoding is no longer used under WezTerm, as it does not work correctly in all layouts (:issue:`11204`).
|
||||
- kbd:`option-left` and other similar keys should now work in iTerm versions before 3.5.12; the kitty keyboard protocol is now disabled on these versions (:issue:`11192`).
|
||||
- The kitty keyboard protocol is no longer used under Midnight Commander, as it does not work correctly (:issue:`10640`).
|
||||
- fish now sends the commandline along with the OSC 133 semantic prompt command start sequence. This fixes a test in the kitty terminal (:issue:`11203`).
|
||||
- Git completions for third-party commands like "git-absorb" are completed correctly again (:issue:`11205`).
|
||||
- Completions for ``diskutil`` no longer produce an error (:issue:`11201`).
|
||||
- The output of certain error messages no longer prints newlines to standard output (:issue:`11248`).
|
||||
- A number of crashes have been fixed, including file names longer than 255 bytes (:issue:`11221`), using fish on a btrfs filesystem (:issue:`11219`), history files that do not have the expected format (:issue:`11236`), and pasting into an empty command line (:issue:`11256`).
|
||||
|
||||
--------------
|
||||
|
||||
fish 4.0.0 (released February 27, 2025)
|
||||
=======================================
|
||||
|
||||
Changes since 4.0b1
|
||||
-------------------
|
||||
- :kbd:`ctrl-c` cancels builtin ``read`` again, fixing a regression in the beta.
|
||||
|
||||
These are the draft release notes for fish 4.0.0. Like this release of fish itself, they are in beta and are not complete. Please report any issues you find.
|
||||
|
||||
.. ignore: 751 2037 2037 3017 3018 3162 3299 4770 4865 5284 5991 6981 6996 7172 9332 9439 9440 9442 9452 9469 9480 9482 9520 9536 9541 9542 9544 9554 9556 9559 9561 9563 9566 9567 9568 9573 9575 9576 9579 9585 9586 9588 9589 9591 9592 9593 9594 9599 9600 9603 9607 9608 9612 9613 9615 9616 9619 9621 9625 9626 9630 9636 9637 9638 9641 9642 9643 9653 9654 9658 9661 9666 9671 9673 9688 9725 9726 9729 9735 9739 9745 9746 9751 9754 9765 9767 9768 9771 9777 9778 9786 9816 9818 9821 9839 9845 9856 9859 9861 9863 9864 9867 9869 9873 9874 9879 9881 9893 9894 9896 9902 9916 9923 9925 9927 9928 9930 9947 9948 9950 9952 9962 9963 9966 9968 9980 9981 9984 9990 9991 10040 10061 10090 10101 10102 10108 10114 10115 10121 10128 10129 10143 10145 10146 10161 10173 10174 10175 10179 10180 10181 10182 10184 10185 10186 10188 10195 10198 10200 10201 10204 10210 10214 10219 10220 10222 10223 10227 10228 10232 10235 10237 10241 10243 10244 10245 10246 10251 10254 10260 10263 10267 10268 10270 10272 10276 10277 10278 10279 10281 10288 10290 10291 10293 10305 10306 10307 10308 10309 10316 10317 10321 10327 10328 10329 10330 10336 10338 10340 10342 10345 10346 10347 10348 10349 10353 10354 10355 10356 10357 10358 10360 10366 10368 10370 10371 10372 10373 10377 10379 10381 10388 10389 10390 10395 10398 10400 10403 10404 10407 10408 10409 10411 10412 10415 10417 10418 10427 10429 10434 10438 10439 10440 10441 10442 10443 10445 10446 10448 10450 10451 10452 10456 10457 10462 10463 10464 10466 10467 10471 10473 10474 10479 10481 10485 10486 10487 10490 10491 10492 10494 10499 10500 10503 10505 10507 10508 10509 10510 10511 10512 10513 10518 10519 10520 10524 10528 10529 10530 10538 10541 10542 10547 10548 10549 10555 10560 10562 10564 10565 10568 10569 10572 10573 10574 10575 10578 10580 10582 10583 10588 10591 10594 10595 10596 10609 10622 10623 10627 10628 10634 10635 10636 10637 10640 10646 10647 10649 10650 10652 10653 10654 10655 10657 10659 10662 10664 10667 10669 10670 10674 10679 10681 10685 10686 10687 10688 10689 10697 10698 10702 10707 10708 10712 10713 10716 10718 10719 10721 10726 10727 10728 10731 10760 10762 10763 10767 10770 10775 10776 10778 10779 10782 10784 10789 10792 10795 10796 10801 10812 10817 10825 10836 10839 10844 10845 10847 10851 10858 10863 10864 10873 10874 10880 10885 10891 10894 10907
|
||||
|
||||
fish's core code has been ported from C++ to Rust (:issue:`9512`).
|
||||
This means a large change in dependencies and how to build fish.
|
||||
Packagers should see the :ref:`For Distributors <rust-packaging>` section at the end.
|
||||
fish's core code has been ported from C++ to Rust (:issue:`9512`). This means a large change in dependencies and how to build fish. However, there should be no direct impact on users. Packagers should see the :ref:`For Distributors <rust-packaging>` section at the end.
|
||||
|
||||
Notable backwards-incompatible changes
|
||||
--------------------------------------
|
||||
@@ -19,10 +58,7 @@ Notable backwards-incompatible changes
|
||||
- As part of a larger binding rework, ``bind`` gained a new key notation.
|
||||
In most cases the old notation should keep working, but in rare cases you may have to change a ``bind`` invocation to use the new notation.
|
||||
See :ref:`below <changelog-new-bindings>` for details.
|
||||
- Terminals that fail to ignore unrecognized OSC or CSI sequences may display garbage. We know cool-retro-term and emacs' ansi-term are affected,
|
||||
most mainstream terminals are not.
|
||||
- :kbd:`alt-left` and :kbd:`alt-right` will now move by one argument (which may contain quoted spaces), not just one word like :kbd:`ctrl-left` and :kbd:`ctrl-right` do.
|
||||
- :kbd:`alt-backspace` will delete an entire argument, not just one word (which is :kbd:`ctrl-backspace` now).
|
||||
- :kbd:`ctrl-c` now calls a new bind function called ``clear-commandline``. The old behavior, which leaves a "^C" marker, is available as ``cancel-commandline`` (:issue:`10935`)
|
||||
- ``random`` will produce different values from previous versions of fish when used with the same seed, and will work more sensibly with small seed numbers.
|
||||
The seed was never guaranteed to give the same result across systems,
|
||||
so we do not expect this to have a large impact (:issue:`9593`).
|
||||
@@ -37,8 +73,9 @@ Notable backwards-incompatible changes
|
||||
set -Ua fish_features no-qmark-noglob
|
||||
|
||||
The flag will eventually be made read-only, making it impossible to turn off.
|
||||
- Terminals that fail to ignore unrecognized OSC or CSI sequences may display garbage. We know cool-retro-term and emacs' ansi-term are affected, but most mainstream terminals are not.
|
||||
- fish no longer searches directories from the Windows system/user ``$PATH`` environment variable for Linux executables. To execute Linux binaries by name (i.e. not with a relative or absolute path) from a Windows folder, make sure the ``/mnt/c/...`` path is explicitly added to ``$fish_user_paths`` and not just automatically appended to ``$PATH`` by ``wsl.exe`` (:issue:`10506`).
|
||||
- Under Microsoft Windows Subsystem for Linux 1 (not WSL 2) , backgrounded jobs that have not been disowned and do not terminate on their own after a ``SIGHUP`` + ``SIGCONT`` sequence will be explicitly killed by fish on exit (after the usual prompt to close or disown them) to work around a WSL 1 deficiency that sees backgrounded processes that run into ``SIGTTOU`` remain in a suspended state indefinitely (:issue:`5263`). The workaround is to explicitly ``disown`` processes you wish to outlive the shell session.
|
||||
- Under Microsoft Windows Subsystem for Linux 1 (not WSL 2), backgrounded jobs that have not been disowned and do not terminate on their own after a ``SIGHUP`` + ``SIGCONT`` sequence will be explicitly killed by fish on exit (after the usual prompt to close or disown them) to work around a WSL 1 deficiency that sees backgrounded processes that run into ``SIGTTOU`` remain in a suspended state indefinitely (:issue:`5263`). The workaround is to explicitly ``disown`` processes you wish to outlive the shell session.
|
||||
|
||||
Notable improvements and fixes
|
||||
------------------------------
|
||||
@@ -55,23 +92,30 @@ Notable improvements and fixes
|
||||
- ``bind ctrl-x,alt-c 'do something'`` binds a sequence of two keys.
|
||||
|
||||
Any key argument that starts with an ASCII control character (like ``\e`` or ``\cX``) or is up to 3 characters long, not a named key, and does not contain ``,`` or ``-`` will be interpreted in the old syntax to keep compatibility for the majority of bindings.
|
||||
|
||||
Keyboard protocols can be turned off by disabling the "keyboard-protocols" feature flag::
|
||||
|
||||
set -Ua fish_features no-keyboard-protocols
|
||||
|
||||
This is a temporary measure to work around buggy terminals (:issue:`11056`), which appear to be relatively rare.
|
||||
Use this if something like "=0" or "=5u" appears in your commandline mysteriously.
|
||||
|
||||
- fish can now be built as a self-installing binary (:issue:`10367`). That means it can be easily built on one system and copied to another, where it can extract supporting files.
|
||||
To do this, run::
|
||||
|
||||
cargo install --path . # in a clone of the fish repository
|
||||
# or `cargo build --release` and copy target/release/fish{,_indent,_key_reader} wherever you want
|
||||
|
||||
The first time it runs interactively, it will extract all the data files to ``~/.local/share/fish/install/``. To uninstall, remove the fish binaries and that directory.
|
||||
The first time it runs interactively, it will extract all the data files to ``~/.local/share/fish/install/``. A specific path can be used for the data files with ``fish --install=PATH`` To uninstall, remove the fish binaries and that directory.
|
||||
|
||||
This build system is experimental; the main build system, using ``cmake``, remains the recommended approach for packaging and installation to a prefix.
|
||||
- A new function ``fish_should_add_to_history`` can be overridden to decide whether a command should be added to the history (:issue:`10302`).
|
||||
- :kbd:`ctrl-c` during command input no longer prints ``^C`` and a new prompt, but merely clears the command line. This restores the behavior from version 2.2. To revert to the old behavior, use ``bind ctrl-c __fish_cancel_commandline`` (:issue:`10213`).
|
||||
- Bindings can now mix special input functions and shell commands, so ``bind ctrl-g expand-abbr "commandline -i \n"`` works as expected (:issue:`8186`).
|
||||
- Special input functions run from bindings via ``commandline -f`` are now applied immediately, instead of after the currently executing binding (:issue:`3031`).
|
||||
- Special input functions run from bindings via ``commandline -f`` are now applied immediately, instead of after the currently executing binding (:issue:`3031`, :issue:`10126`).
|
||||
For example, ``commandline -i foo; commandline | grep foo`` succeeds now.
|
||||
- Undo history is no longer truncated after every command, but kept for the lifetime of the shell process.
|
||||
- The :kbd:`ctrl-r` history search now uses glob syntax (:issue:`10131`).
|
||||
- The :kbd:`ctrl-r` history search now operates only on the line or command substitution at cursor, making it easier to combine commands from history.
|
||||
- The :kbd:`ctrl-r` history search now operates only on the line or command substitution at cursor, making it easier to combine commands from history (:issue:`9751`).
|
||||
- Abbreviations can now be restricted to specific commands. For instance::
|
||||
|
||||
abbr --add --command git back 'reset --hard HEAD^'
|
||||
@@ -101,6 +145,7 @@ Deprecations and removed features
|
||||
If this happens, you can use the ``reset`` command from ``ncurses`` to restore the terminal state.
|
||||
- ``fish_key_reader --verbose`` no longer shows timing information.
|
||||
- Terminal information is no longer read from hashed terminfo databases, or termcap databases (:issue:`10269`). The vast majority of systems use a non-hashed terminfo database, which is still supported.
|
||||
- ``source`` returns an error if used without a filename or pipe/redirection (:issue:`10774`).
|
||||
|
||||
Scripting improvements
|
||||
----------------------
|
||||
@@ -127,6 +172,8 @@ Scripting improvements
|
||||
- A new ``path basename -E`` option that causes it to return the basename ("filename" with the directory prefix removed) with the final extension (if any) also removed. This is a shorter version of ``path change-extension "" (path basename $foo)`` (:issue:`10521`).
|
||||
- A new ``math --scale-mode`` option to select ``truncate``, ``round``, ``floor``, ``ceiling`` as you wish; the default value is ``truncate``. (:issue:`9117`).
|
||||
- ``random`` is now less strict about its arguments, allowing a start larger or equal to the end. (:issue:`10879`)
|
||||
- ``function --argument-names`` now produces an error if a read-only variable name is used, rather than simply ignoring it (:issue:`10842`).
|
||||
- Tilde expansion in braces (that is, ``{~,}``) works correctly (:issue:`10610`).
|
||||
|
||||
Interactive improvements
|
||||
------------------------
|
||||
@@ -146,11 +193,20 @@ Interactive improvements
|
||||
- Measuring a command with ``time`` now considers the time taken for command substitution (:issue:`9100`).
|
||||
- ``fish_add_path`` now automatically enables verbose mode when used interactively (in the command line), in an effort to be clearer about what it does (:issue:`10532`).
|
||||
- fish no longer adopts TTY modes of failed commands (:issue:`10603`).
|
||||
- `complete -e cmd` now prevents autoloading completions for `cmd` (:issue:`6716`).
|
||||
- ``complete -e cmd`` now prevents autoloading completions for ``cmd`` (:issue:`6716`).
|
||||
- fish's default color scheme no longer uses the color "blue", as it has bad contrast against the background in a few terminal's default palettes (:issue:`10758`, :issue:`10786`)
|
||||
The color scheme will not be upgraded for existing installs. If you want, you should select it again via ``fish_config``.
|
||||
- Command lines which are larger than the terminal are now displayed correctly, instead of multiple blank lines being displayed (:issue:`7296`).
|
||||
- Prompts that use external commands will no longer produce an infinite loop if the command crashes (:issue:`9796`).
|
||||
- Undo (:kbd:`ctrl-z`) restores the cursor position too (:issue:`10838`).
|
||||
- The output of ``jobs`` shows "-" for jobs that have the same process group ID as the fish process, rather than "-2" (:issue:`10833`).
|
||||
- Job expansion (``%1`` syntax) works properly for jobs that are a mixture of external commands and functions (:issue:`10832`).
|
||||
- Command lines which have more lines than the terminal can be displayed and edited correctly (:issue:`10827`).
|
||||
- Functions that have been erased are no longer highlighted as valid commands (:issue:`10866`).
|
||||
- ``not``, ``time``, and variable assignments (that is ``not time a=b env``) is correctly recognized as valid syntax (:issue:`10890`).
|
||||
- The Web-based configuration removes old right-hand-side prompts again, fixing a regression in fish 3.4.0 (:issue:`10675`).
|
||||
- Further protection against programs which crash and leave the terminal in an inconsistent state (:issue:`10834`, :issue:`11038`).
|
||||
- A workaround for git being very slow on macOS has been applied, improving performance after a fresh boot (:issue:`10535`).
|
||||
|
||||
New or improved bindings
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -158,7 +214,6 @@ New or improved bindings
|
||||
- During up-arrow history search, :kbd:`shift-delete` will delete the current search item and move to the next older item. Previously this was only supported in the history pager.
|
||||
- :kbd:`shift-delete` will also remove the currently-displayed autosuggestion from history, and remove it as a suggestion.
|
||||
- :kbd:`ctrl-Z` (also known as :kbd:`ctrl-shift-z`) is now bound to redo.
|
||||
- :kbd:`alt-delete` now deletes the argument (which may contain quoted spaces) right of the cursor.
|
||||
- Some improvements to the :kbd:`alt-e` binding which edits the command line in an external editor:
|
||||
- The editor's cursor position is copied back to fish. This is currently supported for Vim and Kakoune.
|
||||
- Cursor position synchronization is only supported for a set of known editors, which are now also detected in aliases which use ``complete --wraps``. For example, use ``complete --wraps my-vim vim`` to synchronize cursors when ``EDITOR=my-vim``.
|
||||
@@ -173,18 +228,22 @@ New or improved bindings
|
||||
- :kbd:`ctrl-delete` deletes the next word (same as :kbd:`alt-d`).
|
||||
- New special input functions:
|
||||
- ``forward-char-passive`` and ``backward-char-passive`` are like their non-passive variants but do not accept autosuggestions or move focus in the completion pager (:issue:`10398`).
|
||||
- ``forward-token``, ``backward-token``, ``kill-token``, and ``backward-kill-token`` are similar to the ``*-bigword`` variants but for the whole argument token which includes escaped spaces (:issue:`2014`).
|
||||
- ``forward-token``, ``backward-token``, ``kill-token``, and ``backward-kill-token`` are similar to the ``*-bigword`` variants but for the whole argument token (which includes escaped spaces) (:issue:`2014`).
|
||||
- ``clear-commandline``, which merely clears the command line, as an alternative to ``cancel-commandline`` which prints ``^C`` and a new prompt (:issue:`10213`).
|
||||
- The ``accept-autosuggestion`` special input function now returns false when there was nothing to accept (:issue:`10608`).
|
||||
- Vi mode has seen some improvements but continues to suffer from the lack of people working on it.
|
||||
- New default cursor shapes for insert and replace mode.
|
||||
- Insert-mode :kbd:`ctrl-n` accepts autosuggestions (:issue:`10339`).
|
||||
- :kbd:`ctrl-n` in insert mode accepts autosuggestions (:issue:`10339`).
|
||||
- Outside insert mode, the cursor will no longer be placed beyond the last character on the commandline.
|
||||
- When the cursor is at the end of the commandline, a single :kbd:`l` will accept an autosuggestion (:issue:`10286`).
|
||||
- The cursor position after pasting (:kbd:`p`) has been corrected.
|
||||
- Added an additional binding, :kbd:`_`, for moving to the beginning of the line (:issue:`10720`).
|
||||
- When the cursor is at the start of a line, escaping from insert mode no longer moves the cursor to the previous line.
|
||||
- Added bindings for clipboard interaction, like :kbd:`",+,p` and :kbd:`",+,y,y`.
|
||||
- Deleting in visual mode now moves the cursor back, matching vi (:issue:`10394`).
|
||||
- The :kbd:`;`, :kbd:`,`, :kbd:`v`, :kbd:`V`, :kbd:`I`, and :kbd:`gU` bindings work in visual mode (:issue:`10601`, :issue:`10648`).
|
||||
- Support :kbd:`%` motion (:issue:`10593`).
|
||||
- :kbd:`ctrl-k` to remove the contents of the line beyond the cursor in all modes (:issue:`10648`).
|
||||
- Support `ab` and `ib` vi text objects. New input functions are introduced ``jump-{to,till}-matching-bracket`` (:issue:`1842`).
|
||||
- The :kbd:`E` binding now correctly handles the last character of the word, by jumping to the next word (:issue:`9700`).
|
||||
|
||||
@@ -194,13 +253,16 @@ Completions
|
||||
- Option completion now uses fuzzy subsequence filtering, just like non-option completion (:issue:`830`).
|
||||
This means that ``--fb`` may be completed to ``--foobar`` if there is no better match.
|
||||
- Completions that insert an entire token now use quotes instead of backslashes to escape special characters (:issue:`5433`).
|
||||
- Historically, file name completions are provided after the last ``:`` or ``=`` within a token.
|
||||
- Normally, file name completions start after the last ``:`` or ``=`` in a token.
|
||||
This helps commands like ``rsync --files-from=``.
|
||||
If the ``=`` or ``:`` is actually part of the filename, it will be escaped as ``\:`` and ``\=``,
|
||||
and no longer get this special treatment.
|
||||
This special meaning can now disabled by escaping these separators as ``\:`` and ``\=``.
|
||||
This matches Bash's behavior.
|
||||
Note that this escaping is usually not necessary since the completion engine already tries
|
||||
to guess whether the separator is actually part of a file name.
|
||||
- Various new completion scripts and numerous updates to existing ones.
|
||||
- Completions could hang if the ``PAGER`` environment variable was sent to certain editors on macOS, FreeBSD and some other platforms. This has been fixed (:issue:`10820`).
|
||||
- Generated completions are now stored in ``$XDG_CACHE_HOME/fish`` or ``~/.cache/fish`` by default (:issue:`10369`)
|
||||
- A regression in fish 3.1, where completing a command line could change it completely, has been fixed (:issue:`10904`).
|
||||
|
||||
Improved terminal support
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -216,10 +278,14 @@ Improved terminal support
|
||||
|
||||
Other improvements
|
||||
------------------
|
||||
- ``status`` gained a ``buildinfo`` subcommand, to print information on how fish was built, to help with debugging (:issue:`10896`).
|
||||
- ``fish_indent`` will now collapse multiple empty lines into one (:issue:`10325`).
|
||||
- ``fish_indent`` now preserves the modification time of files if there were no changes (:issue:`10624`).
|
||||
- Performance in launching external processes has been improved for many cases (:issue:`10869`).
|
||||
- Performance and interactivity under Windows Subsystem for Linux has been improved, with a workaround for Windows-specific locations being appended to ``$PATH`` by default (:issue:`10506`).
|
||||
- On macOS, paths from ``/etc/paths`` and ``/etc/manpaths`` containing colons are handled correctly (:issue:`10684`).
|
||||
- Additional filesystems such as AFS are properly detected as remote, which avoids certain hangs due to expensive filesystem locks (:issue:`10818`).
|
||||
- A spurious error when launching multiple instances of fish for the first time has been removed (:issue:`10813`).
|
||||
|
||||
.. _rust-packaging:
|
||||
|
||||
@@ -228,10 +294,23 @@ For distributors
|
||||
|
||||
fish has been ported to Rust. This means a significant change in dependencies, which are listed in the README. In short, Rust 1.70 or greater is required, and a C++ compiler is no longer needed (although a C compiler is still required, for some C glue code and the tests).
|
||||
|
||||
CMake remains the recommended build system, because of cargo's limited support for installing support files. Version 3.5 remains the minimum supported version. The Xcode generator for CMake is not supported any longer (:issue:`9924`)
|
||||
CMake remains the recommended build system, because of cargo's limited support for installing support files. Version 3.5 remains the minimum supported version. The Xcode generator for CMake is not supported any longer (:issue:`9924`). CMake builds default to optimized release builds (:issue:`10799`).
|
||||
|
||||
fish no longer depends on the ncurses library, but still uses a terminfo database. When packaging fish, please add a dependency on the package containing your terminfo database instead of curses.
|
||||
|
||||
The ``test`` target was removed as it can no longer be defined in new CMake versions. Use ``make fish_run_tests``. Any existing test target will not print output if it fails (:issue:`11116`).
|
||||
|
||||
The Web-based configuration has been rewritten to use Alpine.js (:issue:`9554`).
|
||||
|
||||
--------------
|
||||
|
||||
fish 4.0b1 (released December 17, 2024)
|
||||
=======================================
|
||||
|
||||
A number of improvements were included in fish 4.0.0 following the beta release of 4.0b1. These include fixes for regressions, improvements to completions and documentation, and the removal of a small number of problematic changes.
|
||||
|
||||
The full list of fixed issues can be found on the `GitHub milestone page for 4.0-final <https://github.com/fish-shell/fish-shell/milestone/43>`_.
|
||||
|
||||
--------------
|
||||
|
||||
fish 3.7.1 (released March 19, 2024)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
|
||||
|
||||
@@ -56,7 +56,7 @@ function(CREATE_TARGET target)
|
||||
${Rust_CARGO}
|
||||
build --bin ${target}
|
||||
$<$<CONFIG:Release>:--release>
|
||||
$<$<CONFIG:RelWithDebInfo>:--release>
|
||||
$<$<CONFIG:RelWithDebInfo>:--profile=release-with-debug>
|
||||
--target ${Rust_CARGO_TARGET}
|
||||
--no-default-features
|
||||
${CARGO_FLAGS}
|
||||
|
||||
@@ -43,7 +43,7 @@ Guidelines
|
||||
In short:
|
||||
|
||||
- Be conservative in what you need (keep to the agreed minimum supported Rust version, limit new dependencies)
|
||||
- Use automated tools to help you (including ``make test`` and ``build_tools/style.fish``)
|
||||
- Use automated tools to help you (including ``make fish_run_tests`` and ``build_tools/style.fish``)
|
||||
|
||||
Contributing completions
|
||||
========================
|
||||
@@ -207,7 +207,7 @@ The tests can be run on your local computer on all operating systems.
|
||||
::
|
||||
|
||||
cmake path/to/fish-shell
|
||||
make test
|
||||
make fish_run_tests
|
||||
|
||||
Git hooks
|
||||
---------
|
||||
@@ -235,7 +235,7 @@ One possibility is a pre-push hook script like this one:
|
||||
done
|
||||
if [ "x$isprotected" = x1 ]; then
|
||||
echo "Running tests before push to master"
|
||||
make test
|
||||
make fish_run_tests
|
||||
RESULT=$?
|
||||
if [ $RESULT -ne 0 ]; then
|
||||
echo "Tests failed for a push to master, we can't let you do that" >&2
|
||||
@@ -245,7 +245,7 @@ One possibility is a pre-push hook script like this one:
|
||||
exit 0
|
||||
|
||||
This will check if the push is to the master branch and, if it is, only
|
||||
allow the push if running ``make test`` succeeds. In some circumstances
|
||||
allow the push if running ``make fish_run_tests`` succeeds. In some circumstances
|
||||
it may be advisable to circumvent this check with
|
||||
``git push --no-verify``, but usually that isn’t necessary.
|
||||
|
||||
|
||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -112,7 +112,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "fish"
|
||||
version = "4.0.0-beta.1"
|
||||
version = "4.0.2"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cc",
|
||||
|
||||
@@ -10,9 +10,13 @@ edition = "2021"
|
||||
overflow-checks = true
|
||||
lto = true
|
||||
|
||||
[profile.release-with-debug]
|
||||
inherits = "release"
|
||||
debug = true
|
||||
|
||||
[package]
|
||||
name = "fish"
|
||||
version = "4.0.0-beta.1"
|
||||
version = "4.0.2"
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
default-run = "fish"
|
||||
|
||||
@@ -55,7 +55,11 @@ clean:
|
||||
|
||||
.PHONY: test
|
||||
test: build/fish
|
||||
$(CMAKE) --build build --target test
|
||||
$(CMAKE) --build build --target fish_run_tests
|
||||
|
||||
.PHONY: fish_run_tests
|
||||
fish_run_tests: build/fish
|
||||
$(CMAKE) --build build --target fish_run_tests
|
||||
|
||||
.PHONY: install
|
||||
install: build/fish
|
||||
|
||||
@@ -123,7 +123,7 @@ Dependencies
|
||||
Compiling fish requires:
|
||||
|
||||
- Rust (version 1.70 or later)
|
||||
- CMake (version 3.5 or later)
|
||||
- CMake (version 3.15 or later)
|
||||
- a C compiler (for system feature detection and the test helper binary)
|
||||
- PCRE2 (headers and libraries) - optional, this will be downloaded if missing
|
||||
- gettext (headers and libraries) - optional, for translation support
|
||||
|
||||
5
build.rs
5
build.rs
@@ -29,6 +29,11 @@ fn main() {
|
||||
.unwrap(),
|
||||
);
|
||||
|
||||
// Some build info
|
||||
rsconf::set_env_value("BUILD_TARGET_TRIPLE", &env::var("TARGET").unwrap());
|
||||
rsconf::set_env_value("BUILD_HOST_TRIPLE", &env::var("HOST").unwrap());
|
||||
rsconf::set_env_value("BUILD_PROFILE", &env::var("PROFILE").unwrap());
|
||||
|
||||
let version = &get_version(&env::current_dir().unwrap());
|
||||
// Per https://doc.rust-lang.org/cargo/reference/build-scripts.html#inputs-to-the-build-script,
|
||||
// the source directory is the current working directory of the build script
|
||||
|
||||
@@ -306,18 +306,23 @@ if (Rust_RESOLVE_RUSTUP_TOOLCHAINS)
|
||||
set(_DISCOVERED_TOOLCHAINS_VERSION "")
|
||||
|
||||
foreach(_TOOLCHAIN_RAW ${_TOOLCHAINS_RAW})
|
||||
if (_TOOLCHAIN_RAW MATCHES "([a-zA-Z0-9\\._\\-]+)[ \t\r\n]?(\\(default\\) \\(override\\)|\\(default\\)|\\(override\\))?[ \t\r\n]+(.+)")
|
||||
# We're going to try to parse the output of `rustup toolchain list --verbose`.
|
||||
# We expect output like this:
|
||||
# stable-random-toolchain-junk (parenthesized-random-stuff-like-active-or-default) /path/to/toolchain/blah/more-blah
|
||||
# In the following regex, we capture the toolchain name, any parenthesized stuff, and then the path.
|
||||
message(STATUS "Parsing toolchain: ${_TOOLCHAIN_RAW}")
|
||||
if (_TOOLCHAIN_RAW MATCHES "([^\t ]+)[\t ]*(\\(.*\\))?[\t ]*(.+)")
|
||||
set(_TOOLCHAIN "${CMAKE_MATCH_1}")
|
||||
set(_TOOLCHAIN_TYPE "${CMAKE_MATCH_2}")
|
||||
|
||||
set(_TOOLCHAIN_PATH "${CMAKE_MATCH_3}")
|
||||
set(_TOOLCHAIN_${_TOOLCHAIN}_PATH "${CMAKE_MATCH_3}")
|
||||
|
||||
if (_TOOLCHAIN_TYPE MATCHES ".*\\(default\\).*")
|
||||
if (_TOOLCHAIN_TYPE MATCHES "default")
|
||||
set(_TOOLCHAIN_DEFAULT "${_TOOLCHAIN}")
|
||||
endif()
|
||||
|
||||
if (_TOOLCHAIN_TYPE MATCHES ".*\\(override\\).*")
|
||||
if (_TOOLCHAIN_TYPE MATCHES "override")
|
||||
set(_TOOLCHAIN_OVERRIDE "${_TOOLCHAIN}")
|
||||
endif()
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ else()
|
||||
set(rust_target_dir "${FISH_RUST_BUILD_DIR}/${Rust_CARGO_HOST_TARGET}")
|
||||
endif()
|
||||
|
||||
set(rust_profile $<IF:$<CONFIG:Debug>,debug,release>)
|
||||
set(rust_profile $<IF:$<CONFIG:Debug>,debug,$<IF:$<CONFIG:RelWithDebInfo>,release-with-debug,release>>)
|
||||
set(rust_debugflags "$<$<CONFIG:Debug>:-g>$<$<CONFIG:RelWithDebInfo>:-g>")
|
||||
|
||||
|
||||
@@ -49,6 +49,8 @@ set(VARS_FOR_CARGO
|
||||
"PREFIX=${CMAKE_INSTALL_PREFIX}"
|
||||
# Temporary hack to propogate CMake flags/options to build.rs.
|
||||
"CMAKE_WITH_GETTEXT=${CMAKE_WITH_GETTEXT}"
|
||||
# Cheesy so we can tell cmake was used to build
|
||||
"CMAKE=1"
|
||||
"DOCDIR=${CMAKE_INSTALL_FULL_DOCDIR}"
|
||||
"DATADIR=${CMAKE_INSTALL_FULL_DATADIR}"
|
||||
"SYSCONFDIR=${CMAKE_INSTALL_FULL_SYSCONFDIR}"
|
||||
|
||||
@@ -8,13 +8,11 @@ set(CMAKE_FOLDER tests)
|
||||
# pass but it should not be considered a failed test run, either.
|
||||
set(SKIP_RETURN_CODE 125)
|
||||
|
||||
# Even though we are using CMake's ctest for testing, we still define our own `make test` target
|
||||
# Even though we are using CMake's ctest for testing, we still define our own `make fish_run_tests` target
|
||||
# rather than use its default for many reasons:
|
||||
# * CMake doesn't run tests in-proc or even add each tests as an individual node in the ninja
|
||||
# dependency tree, instead it just bundles all tests into a target called `test` that always just
|
||||
# shells out to `ctest`, so there are no build-related benefits to not doing that ourselves.
|
||||
# * CMake devs insist that it is appropriate for `make test` to never depend on `make all`, i.e.
|
||||
# running `make test` does not require any of the binaries to be built before testing.
|
||||
# * The only way to have a test depend on a binary is to add a fake test with a name like
|
||||
# "build_fish" that executes CMake recursively to build the `fish` target.
|
||||
# * Circling back to the point about individual tests not being actual Makefile targets, CMake does
|
||||
@@ -32,15 +30,6 @@ add_custom_target(fish_run_tests
|
||||
USES_TERMINAL
|
||||
)
|
||||
|
||||
# If CMP0037 is available, also make an alias "test" target.
|
||||
# Note that this policy may not be available, in which case definining such a target silently fails.
|
||||
cmake_policy(PUSH)
|
||||
if(POLICY CMP0037)
|
||||
cmake_policy(SET CMP0037 OLD)
|
||||
add_custom_target(test DEPENDS fish_run_tests)
|
||||
endif()
|
||||
cmake_policy(POP)
|
||||
|
||||
# The "test" directory.
|
||||
set(TEST_DIR ${CMAKE_CURRENT_BINARY_DIR}/test)
|
||||
|
||||
@@ -81,7 +70,7 @@ configure_file(build_tools/pexpect_helper.py pexpect_helper.py COPYONLY)
|
||||
set(CMAKE_XCODE_GENERATE_SCHEME 0)
|
||||
|
||||
# CMake being CMake, you can't just add a DEPENDS argument to add_test to make it depend on any of
|
||||
# your binaries actually being built before `make test` is executed (requiring `make all` first),
|
||||
# your binaries actually being built before `make fish_run_tests` is executed (requiring `make all` first),
|
||||
# and the only dependency a test can have is on another test. So we make building fish
|
||||
# prerequisites to our entire top-level `test` target.
|
||||
function(add_test_target NAME)
|
||||
|
||||
25
debian/control
vendored
25
debian/control
vendored
@@ -3,10 +3,16 @@ Section: shells
|
||||
Priority: optional
|
||||
Maintainer: ridiculous_fish <corydoras@ridiculousfish.com>
|
||||
Uploaders: David Adam <zanchey@ucc.gu.uwa.edu.au>
|
||||
Build-Depends: debhelper (>= 12), cmake (>= 3.19.0) | cmake-mozilla (>= 3.19.0), gettext,
|
||||
rustc (>= 1.70), cargo (>= 0.66) | cargo-mozilla (>= 0.66), libpcre2-dev,
|
||||
Build-Depends: debhelper (>= 12),
|
||||
cargo (>= 0.66) | cargo-mozilla (>= 0.66),
|
||||
cmake (>= 3.15.0) | cmake-mozilla (>= 3.15.0),
|
||||
gettext,
|
||||
libpcre2-dev,
|
||||
rustc (>= 1.70),
|
||||
# Test dependencies
|
||||
locales-all, ncurses-base, python3
|
||||
locales-all,
|
||||
ncurses-base,
|
||||
python3
|
||||
Standards-Version: 4.1.5
|
||||
Homepage: https://fishshell.com/
|
||||
Vcs-Git: https://github.com/fish-shell/fish-shell.git
|
||||
@@ -14,8 +20,17 @@ Vcs-Browser: https://github.com/fish-shell/fish-shell
|
||||
|
||||
Package: fish
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, file, gettext-base, man-db, ncurses-base, procps,
|
||||
python3 (>=3.5)
|
||||
Depends: bsdextrautils,
|
||||
Depends: bsdextrautils | bsdmainutils,
|
||||
file,
|
||||
gettext-base,
|
||||
groff-base,
|
||||
man-db,
|
||||
ncurses-base,
|
||||
procps,
|
||||
python3 (>=3.5),
|
||||
${misc:Depends},
|
||||
${shlibs:Depends}
|
||||
Conflicts: fish-common
|
||||
Recommends: xsel (>=1.2.0)
|
||||
Suggests: xdg-utils
|
||||
|
||||
@@ -53,7 +53,7 @@ Combining these features, it is possible to create custom syntaxes, where a regu
|
||||
|
||||
> abbr > ~/.config/fish/conf.d/myabbrs.fish
|
||||
|
||||
This will save all your abbrevations in "myabbrs.fish", overwriting the whole file so it doesn't leave any duplicates,
|
||||
This will save all your abbreviations in "myabbrs.fish", overwriting the whole file so it doesn't leave any duplicates,
|
||||
or restore abbreviations you had erased.
|
||||
Of course any functions will have to be saved separately, see :doc:`funcsave <funcsave>`.
|
||||
|
||||
@@ -125,6 +125,7 @@ This first creates a function ``vim_edit`` which prepends ``vim`` before its arg
|
||||
This creates an abbreviation "4DIRS" which expands to a multi-line loop "template." The template enters each directory and then leaves it. The cursor is positioned ready to enter the command to run in each directory, at the location of the ``!``, which is itself erased.
|
||||
|
||||
::
|
||||
|
||||
abbr --command git co checkout
|
||||
|
||||
Turns "co" as an argument to "git" into "checkout". Multiple commands are possible, ``--command={git,hg}`` would expand "co" to "checkout" for both git and hg.
|
||||
|
||||
@@ -23,7 +23,7 @@ If both ``KEYS`` and ``COMMAND`` are given, ``bind`` adds (or replaces) a bindin
|
||||
If only ``KEYS`` is given, any existing binding in the given ``MODE`` will be printed.
|
||||
|
||||
``KEYS`` is a comma-separated list of key names.
|
||||
Modifier keys can be specified by prefixing a key name with a combination of ``ctrl-``, ``alt-`` and ``shift-``.
|
||||
Modifier keys can be specified by prefixing a key name with a combination of ``ctrl-``, ``alt-``, ``shift-`` and ``super-`` (i.e. the "windows" or "command" key).
|
||||
For example, pressing :kbd:`w` while holding the Alt modifier is written as ``alt-w``.
|
||||
Key names are case-sensitive; for example ``alt-W`` is the same as ``alt-shift-w``.
|
||||
``ctrl-x,ctrl-e`` would mean pressing :kbd:`ctrl-x` followed by :kbd:`ctrl-e`.
|
||||
@@ -99,6 +99,12 @@ The following options are available:
|
||||
**-s** or **--silent**
|
||||
Silences some of the error messages, including for unknown key names and unbound sequences.
|
||||
|
||||
**-k KEY_NAME** or **--key KEY_NAME**
|
||||
This looks up KEY_NAME in terminfo and binds that sequence instead of a key that fish would decode.
|
||||
To view a list of the terminfo keys fish knows about, use ``bind --key-names`` or ``bind -K``.
|
||||
This is deprecated and provided for compatibility with older fish versions. You should bind the keys directly.
|
||||
Instead of ``bind -k sright`` use ``bind shift-right``, instead of ``bind -k nul`` use ``bind ctrl-space`` and so on.
|
||||
|
||||
**-h** or **--help**
|
||||
Displays help about using this command.
|
||||
|
||||
@@ -162,7 +168,7 @@ The following special input functions are available:
|
||||
start selecting text
|
||||
|
||||
``cancel``
|
||||
cancel the current commandline and replace it with a new empty one
|
||||
close the pager if it is open, or undo the most recent completion if one was just inserted, or otherwise cancel the current commandline and replace it with a new empty one
|
||||
|
||||
``cancel-commandline``
|
||||
cancel the current commandline and replace it with a new empty one, leaving the old one in place with a marker to show that it was cancelled
|
||||
@@ -170,6 +176,9 @@ The following special input functions are available:
|
||||
``capitalize-word``
|
||||
make the current word begin with a capital letter
|
||||
|
||||
``clear-commandline``
|
||||
empty the entire commandline
|
||||
|
||||
``clear-screen``
|
||||
clears the screen and redraws the prompt. if the terminal doesn't support clearing the screen it is the same as ``repaint``.
|
||||
|
||||
@@ -259,7 +268,7 @@ The following special input functions are available:
|
||||
search the history for the next matching argument
|
||||
|
||||
``forward-jump`` and ``backward-jump``
|
||||
read another character and jump to its next occurence after/before the cursor
|
||||
read another character and jump to its next occurrence after/before the cursor
|
||||
|
||||
``forward-jump-till`` and ``backward-jump-till``
|
||||
jump to right *before* the next occurrence
|
||||
@@ -269,7 +278,7 @@ The following special input functions are available:
|
||||
|
||||
``jump-to-matching-bracket``
|
||||
jump to matching bracket if the character under the cursor is bracket;
|
||||
otherwise, jump to the next occurence of *any right* bracket after the cursor.
|
||||
otherwise, jump to the next occurrence of *any right* bracket after the cursor.
|
||||
The following brackets are considered: ``([{}])``
|
||||
|
||||
``jump-till-matching-bracket``
|
||||
@@ -292,7 +301,7 @@ The following special input functions are available:
|
||||
move the selected text to the killring
|
||||
|
||||
``kill-whole-line``
|
||||
move the line (including the following newline) to the killring. If the line is the last line, its preceeding newline is also removed
|
||||
move the line (including the following newline) to the killring. If the line is the last line, its preceding newline is also removed
|
||||
|
||||
``kill-inner-line``
|
||||
move the line (without the following newline) to the killring
|
||||
|
||||
@@ -71,7 +71,7 @@ The following options change what part of the commandline is printed or updated:
|
||||
Selects the current token
|
||||
|
||||
**--search-field**
|
||||
Use the pager search field instead of the command line. Returns false is the search field is not shown.
|
||||
Use the pager search field instead of the command line. Returns false if the search field is not shown.
|
||||
|
||||
The following options change the way ``commandline`` prints the current commandline buffer:
|
||||
|
||||
@@ -116,7 +116,7 @@ The following options output metadata about the commandline state:
|
||||
**--is-valid**
|
||||
Returns true when the commandline is syntactically valid and complete.
|
||||
If it is, it would be executed when the ``execute`` bind function is called.
|
||||
If the commandline is incomplete, return 2, if erroneus, return 1.
|
||||
If the commandline is incomplete, return 2, if erroneous, return 1.
|
||||
|
||||
**--showing-suggestion**
|
||||
Evaluates to true (i.e. returns 0) when the shell is currently showing an automatic history completion/suggestion, available to be consumed via one of the `forward-` bindings.
|
||||
|
||||
@@ -34,15 +34,17 @@ The following options are available:
|
||||
See :ref:`Debugging <debugging-fish>` below for details.
|
||||
|
||||
**-o** or **--debug-output=DEBUG_FILE**
|
||||
Specifies a file path to receive the debug output, including categories and :envvar:`fish_trace`.
|
||||
The default is stderr.
|
||||
Specifies a file path to receive the debug output, including categories and :envvar:`fish_trace`.
|
||||
The default is standard error.
|
||||
|
||||
**-i** or **--interactive**
|
||||
The shell is interactive.
|
||||
|
||||
**--install**
|
||||
When built as self-installable (via cargo), this will unpack fish's datafiles and place them in ~/.local/share/fish/install/.
|
||||
Fish will also ask to do this automatically when run interactively.
|
||||
**--install[=PATH]**
|
||||
When built as self-installable (via cargo), this will unpack fish's data files and place them in ``~/.local/share/fish/install/``.
|
||||
fish will also ask to do this automatically when run interactively.
|
||||
If PATH is given, fish will install itself into a relocatable directory tree rooted at that path.
|
||||
That means it will install the data files to PATH/share/fish and copy itself to PATH/bin/fish.
|
||||
|
||||
**-l** or **--login**
|
||||
Act as if invoked as a login shell.
|
||||
|
||||
@@ -26,15 +26,12 @@ The first argument to fish_title contains the most recently executed foreground
|
||||
|
||||
This requires that your terminal supports programmable titles and the feature is turned on.
|
||||
|
||||
To disable setting the title, use an empty function (see below).
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
A simple title:
|
||||
|
||||
|
||||
|
||||
::
|
||||
A simple title::
|
||||
|
||||
function fish_title
|
||||
set -q argv[1]; or set argv fish
|
||||
@@ -43,3 +40,7 @@ A simple title:
|
||||
echo (fish_prompt_pwd_dir_length=1 prompt_pwd): $argv;
|
||||
end
|
||||
|
||||
Do not change the title::
|
||||
|
||||
function fish_title
|
||||
end
|
||||
|
||||
@@ -20,7 +20,7 @@ Description
|
||||
|
||||
fish will search the working directory to resolve relative paths but will not search :envvar:`PATH` .
|
||||
|
||||
If no file is specified and stdin is not the terminal, or if the file name ``-`` is used, stdin will be read.
|
||||
If no file is specified and a file or pipeline is connected to standard input, or if the file name ``-`` is used, ``source`` will read from standard input. If no file is specified and there is no redirected file or pipeline on standard input, an error will be printed.
|
||||
|
||||
The exit status of ``source`` is the exit status of the last job to execute. If something goes wrong while opening or reading the file, ``source`` exits with a non-zero status.
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ Synopsis
|
||||
status
|
||||
status is-login
|
||||
status is-interactive
|
||||
status is-interactive-read
|
||||
status is-block
|
||||
status is-breakpoint
|
||||
status is-command-substitution
|
||||
@@ -29,6 +30,7 @@ Synopsis
|
||||
status job-control CONTROL_TYPE
|
||||
status features
|
||||
status test-feature FEATURE
|
||||
status buildinfo
|
||||
|
||||
Description
|
||||
-----------
|
||||
@@ -49,6 +51,9 @@ The following operations (subcommands) are available:
|
||||
**is-interactive**, **-i** or **--is-interactive**
|
||||
Returns 0 if fish is interactive - that is, connected to a keyboard.
|
||||
|
||||
**is-interactive-read** or **--is-interactive-read**
|
||||
Returns 0 if fish is running an interactive :doc:`read <read>` builtin which is connected to a keyboard.
|
||||
|
||||
**is-login**, **-l** or **--is-login**
|
||||
Returns 0 if fish is a login shell - that is, if fish should perform login tasks such as setting up :envvar:`PATH`.
|
||||
|
||||
@@ -97,6 +102,10 @@ The following operations (subcommands) are available:
|
||||
**test-feature** *FEATURE*
|
||||
Returns 0 when FEATURE is enabled, 1 if it is disabled, and 2 if it is not recognized.
|
||||
|
||||
**buildinfo**
|
||||
This prints information on how fish was build - which architecture, which build system or profile was used, etc.
|
||||
This is mainly useful for debugging.
|
||||
|
||||
Notes
|
||||
-----
|
||||
|
||||
|
||||
@@ -18,7 +18,9 @@ Description
|
||||
|
||||
.. BEGIN DESCRIPTION
|
||||
|
||||
``string escape`` escapes each *STRING* in one of three ways. The first is **--style=script**. This is the default. It alters the string such that it can be passed back to ``eval`` to produce the original argument again. By default, all special characters are escaped, and quotes are used to simplify the output when possible. If **-n** or **--no-quoted** is given, the simplifying quoted format is not used. Exit status: 0 if at least one string was escaped, or 1 otherwise.
|
||||
``string escape`` escapes each *STRING* in one of several ways.
|
||||
|
||||
**--style=script** (default) alters the string such that it can be passed back to ``eval`` to produce the original argument again. By default, all special characters are escaped, and quotes are used to simplify the output when possible. If **-n** or **--no-quoted** is given, the simplifying quoted format is not used. Exit status: 0 if at least one string was escaped, or 1 otherwise.
|
||||
|
||||
**--style=var** ensures the string can be used as a variable name by hex encoding any non-alphanumeric characters. The string is first converted to UTF-8 before being encoded.
|
||||
|
||||
|
||||
@@ -52,13 +52,13 @@ Match Glob Examples
|
||||
|
||||
::
|
||||
|
||||
>_ string match '?' a
|
||||
>_ string match 'a' a
|
||||
a
|
||||
|
||||
>_ string match 'a*b' axxb
|
||||
axxb
|
||||
|
||||
>_ string match -i 'a??B' Axxb
|
||||
>_ string match -i 'a*B' Axxb
|
||||
Axxb
|
||||
|
||||
>_ string match -- '-*' -h foo --version bar
|
||||
@@ -67,7 +67,7 @@ Match Glob Examples
|
||||
-h
|
||||
--version
|
||||
|
||||
>_ echo 'ok?' | string match '*\?'
|
||||
>_ echo 'ok?' | string match '*?'
|
||||
ok?
|
||||
|
||||
# Note that only the second STRING will match here.
|
||||
@@ -79,7 +79,7 @@ Match Glob Examples
|
||||
foo
|
||||
foo2
|
||||
|
||||
>_ string match 'foo?' 'foo1' 'foo' 'foo2'
|
||||
>_ string match 'foo*' 'foo1' 'foo' 'foo2'
|
||||
foo1
|
||||
foo2
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ Description
|
||||
|
||||
.. BEGIN DESCRIPTION
|
||||
|
||||
``string repeat`` repeats the *STRING* **-n** or **--count** times. The **-m** or **--max** option will limit the number of outputted characters (excluding the newline). This option can be used by itself or in conjunction with **--count**. If both **--count** and **--max** are present, max char will be outputed unless the final repeated string size is less than max, in that case, the string will repeat until count has been reached. Both **--count** and **--max** will accept a number greater than or equal to zero, in the case of zero, nothing will be outputed. The first argument is interpreted as *COUNT* if **--count** or **--max** are not explicilty specified. If **-N** or **--no-newline** is given, the output won't contain a newline character at the end. Exit status: 0 if yielded string is not empty, 1 otherwise.
|
||||
``string repeat`` repeats the *STRING* **-n** or **--count** times. The **-m** or **--max** option will limit the number of outputted characters (excluding the newline). This option can be used by itself or in conjunction with **--count**. If both **--count** and **--max** are present, max char will be outputted unless the final repeated string size is less than max, in that case, the string will repeat until count has been reached. Both **--count** and **--max** will accept a number greater than or equal to zero, in the case of zero, nothing will be outputted. The first argument is interpreted as *COUNT* if **--count** or **--max** are not explicitly specified. If **-N** or **--no-newline** is given, the output won't contain a newline character at the end. Exit status: 0 if yielded string is not empty, 1 otherwise.
|
||||
|
||||
.. END DESCRIPTION
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ If **-q** or **--quiet** is given, ``string shorten`` only runs for the return v
|
||||
|
||||
The default ellipsis is ``…``. If fish thinks your system is incapable because of your locale, it will use ``...`` instead.
|
||||
|
||||
The return value is 0 if any shortening occured, 1 otherwise.
|
||||
The return value is 0 if any shortening occurred, 1 otherwise.
|
||||
|
||||
.. END DESCRIPTION
|
||||
|
||||
|
||||
@@ -303,7 +303,7 @@ Some bindings are common across Emacs and vi mode, because they aren't text edit
|
||||
|
||||
- :kbd:`alt-enter` inserts a newline at the cursor position. This is useful to add a line to a commandline that's already complete.
|
||||
|
||||
- :kbd:`alt-left` (``←``) and :kbd:`alt-right` (``→``) move the cursor one argument left or right, or moves forward/backward in the directory history if the command line is empty. If the cursor is already at the end of the line, and an autosuggestion is available, :kbd:`alt-right` (``→``) (or :kbd:`alt-f`) accepts the first argument in the suggestion.
|
||||
- :kbd:`alt-left` (``←``) and :kbd:`alt-right` (``→``) move the cursor one word left or right (to the next space or punctuation mark), or moves forward/backward in the directory history if the command line is empty. If the cursor is already at the end of the line, and an autosuggestion is available, :kbd:`alt-right` (``→``) (or :kbd:`alt-f`) accepts the first word in the suggestion.
|
||||
|
||||
- :kbd:`ctrl-left` (``←``) and :kbd:`ctrl-right` (``→``) move the cursor one word left or right. These accept one word of the autosuggestion - the part they'd move over.
|
||||
|
||||
@@ -327,8 +327,12 @@ Some bindings are common across Emacs and vi mode, because they aren't text edit
|
||||
|
||||
- :kbd:`alt-d` or :kbd:`ctrl-delete` moves the next word to the :ref:`killring`.
|
||||
|
||||
- :kbd:`alt-d` lists the directory history if the command line is empty.
|
||||
|
||||
- :kbd:`alt-delete` moves the next argument to the :ref:`killring`.
|
||||
|
||||
- :kbd:`shift-delete` removes the current history item or autosuggestion from the command history.
|
||||
|
||||
- :kbd:`alt-h` (or :kbd:`f1`) shows the manual page for the current command, if one exists.
|
||||
|
||||
- :kbd:`alt-l` lists the contents of the current directory, unless the cursor is over a directory argument, in which case the contents of that directory will be listed.
|
||||
@@ -360,11 +364,13 @@ To enable emacs mode, use :doc:`fish_default_key_bindings <cmds/fish_default_key
|
||||
|
||||
- :kbd:`ctrl-b`, :kbd:`ctrl-f` move the cursor one character left or right or accept the autosuggestion just like the :kbd:`left` (``←``) and :kbd:`right` (``→``) shared bindings (which are available as well).
|
||||
|
||||
- :kbd:`alt-b`, :kbd:`alt-f` move the cursor one word left or right, or accept one word of the autosuggestion. If the command line is empty, moves forward/backward in the directory history instead.
|
||||
|
||||
- :kbd:`ctrl-n`, :kbd:`ctrl-p` move the cursor up/down or through history, like the up and down arrow shared bindings.
|
||||
|
||||
- :kbd:`delete` or :kbd:`backspace` or :kbd:`ctrl-h` removes one character forwards or backwards respectively.
|
||||
|
||||
- :kbd:`ctrl-backspace` removes one word backwards and :kbd:`alt-backspace` removes one argument backwards.
|
||||
- :kbd:`alt-backspace` removes one word backwards. If supported by the terminal, :kbd:`ctrl-backspace` does the same.
|
||||
|
||||
- :kbd:`alt-<` moves to the beginning of the commandline, :kbd:`alt->` moves to the end.
|
||||
|
||||
@@ -382,7 +388,7 @@ To enable emacs mode, use :doc:`fish_default_key_bindings <cmds/fish_default_key
|
||||
|
||||
- :kbd:`ctrl-z`, :kbd:`ctrl-_` (:kbd:`ctrl-/` on some terminals) undo the most recent edit of the line.
|
||||
|
||||
- :kbd:`alt-/` reverts the most recent undo.
|
||||
- :kbd:`alt-/` or :kbd:`ctrl-shift-z` reverts the most recent undo.
|
||||
|
||||
- :kbd:`ctrl-r` opens the history in a pager. This will show history entries matching the search, a few at a time. Pressing :kbd:`ctrl-r` again will search older entries, pressing :kbd:`ctrl-s` (that otherwise toggles pager search) will go to newer entries. The search bar will always be selected.
|
||||
|
||||
@@ -476,6 +482,7 @@ Command mode is also known as normal mode.
|
||||
- :kbd:`p` pastes text from the :ref:`killring`.
|
||||
|
||||
- :kbd:`u` undoes the most recent edit of the command line.
|
||||
|
||||
- :kbd:`ctrl-r` redoes the most recent edit.
|
||||
|
||||
- :kbd:`[` and :kbd:`]` search the command history for the previous/next token containing the token under the cursor before the search was started. See the :ref:`history <history-search>` section for more information on history searching.
|
||||
@@ -497,6 +504,8 @@ Insert mode
|
||||
|
||||
- :kbd:`backspace` removes one character to the left.
|
||||
|
||||
- :kbd:`ctrl-n` accepts the autosuggestion.
|
||||
|
||||
.. _vi-mode-visual:
|
||||
|
||||
Visual mode
|
||||
|
||||
@@ -870,7 +870,7 @@ but if you need multiple or the command doesn't read from standard input, "proce
|
||||
|
||||
This creates a temporary file, stores the output of the command in that file and prints the filename, so it is given to the outer command.
|
||||
|
||||
Fish has a default limit of 100 MiB on the data it will read in a command sustitution. If that limit is reached the command (all of it, not just the command substitution - the outer command won't be executed at all) fails and ``$status`` is set to 122. This is so command substitutions can't cause the system to go out of memory, because typically your operating system has a much lower limit, so reading more than that would be useless and harmful. This limit can be adjusted with the ``fish_read_limit`` variable (`0` meaning no limit). This limit also affects the :doc:`read <cmds/read>` command.
|
||||
Fish has a default limit of 100 MiB on the data it will read in a command substitution. If that limit is reached the command (all of it, not just the command substitution - the outer command won't be executed at all) fails and ``$status`` is set to 122. This is so command substitutions can't cause the system to go out of memory, because typically your operating system has a much lower limit, so reading more than that would be useless and harmful. This limit can be adjusted with the ``fish_read_limit`` variable (`0` meaning no limit). This limit also affects the :doc:`read <cmds/read>` command.
|
||||
|
||||
.. [#] One exception: Setting ``$IFS`` to empty will disable line splitting. This is deprecated, use :doc:`string split <cmds/string-split>` instead.
|
||||
|
||||
@@ -1845,7 +1845,7 @@ The "locale" of a program is its set of language and regional settings that depe
|
||||
|
||||
.. envvar:: LC_MONETARY
|
||||
|
||||
Determines currency, how it is formated, and the symbols used.
|
||||
Determines currency, how it is formatted, and the symbols used.
|
||||
|
||||
.. envvar:: LC_NUMERIC
|
||||
|
||||
@@ -2022,17 +2022,21 @@ You can see the current list of features via ``status features``::
|
||||
qmark-noglob on 3.0 ? no longer globs
|
||||
regex-easyesc on 3.1 string replace -r needs fewer \\'s
|
||||
ampersand-nobg-in-token on 3.4 & only backgrounds if followed by a separating character
|
||||
remove-percent-self off 3.8 %self is no longer expanded (use $fish_pid)
|
||||
test-require-arg off 3.8 builtin test requires an argument
|
||||
remove-percent-self off 4.0 %self is no longer expanded (use $fish_pid)
|
||||
test-require-arg off 4.0 builtin test requires an argument
|
||||
keyboard-protocols on 4.0 Use keyboard protocols (kitty, xterm's modifyotherkeys
|
||||
|
||||
Here is what they mean:
|
||||
|
||||
- ``stderr-nocaret`` was introduced in fish 3.0 (and made the default in 3.3). It makes ``^`` an ordinary character instead of denoting an stderr redirection, to make dealing with quoting and such easier. Use ``2>`` instead. This can no longer be turned off since fish 3.5. The flag can still be tested for compatibility, but a ``no-stderr-nocaret`` value will simply be ignored.
|
||||
- ``qmark-noglob`` was also introduced in fish 3.0 (and made the default in 3.8). It makes ``?`` an ordinary character instead of a single-character glob. Use a ``*`` instead (which will match multiple characters) or find other ways to match files like ``find``.
|
||||
- ``regex-easyesc`` was introduced in 3.1. It makes it so the replacement expression in ``string replace -r`` does one fewer round of escaping. Before, to escape a backslash you would have to use ``string replace -ra '([ab])' '\\\\\\\\$1'``. After, just ``'\\\\$1'`` is enough. Check your ``string replace`` calls if you use this anywhere.
|
||||
- ``ampersand-nobg-in-token`` was introduced in fish 3.4. It makes it so a ``&`` i no longer interpreted as the backgrounding operator in the middle of a token, so dealing with URLs becomes easier. Either put spaces or a semicolon after the ``&``. This is recommended formatting anyway, and ``fish_indent`` will have done it for you already.
|
||||
- ``remove-percent-self`` turns off the special ``%self`` expansion. It was introduced in 3.8. To get fish's pid, you can use the :envvar:`fish_pid` variable.
|
||||
- ``test-require-arg`` removes :doc:`builtin test <cmds/test>`'s one-argument form (``test "string"``. It was introduced in 3.8. To test if a string is non-empty, use ``test -n "string"``. If disabled, any call to ``test`` that would change sends a :ref:`debug message <debugging-fish>` of category "deprecated-test", so starting fish with ``fish --debug=deprecated-test`` can be used to find offending calls.
|
||||
- ``stderr-nocaret`` was introduced in fish 3.0 and cannot be turned off since fish 3.5. It can still be tested for compatibility, but a ``no-stderr-nocaret`` value will simply be ignored. The flag made ``^`` an ordinary character instead of denoting an stderr redirection. Use ``2>`` instead.
|
||||
- ``qmark-noglob`` was also introduced in fish 3.0 (and made the default in 4.0). It makes ``?`` an ordinary character instead of a single-character glob. Use a ``*`` instead (which will match multiple characters) or find other ways to match files like ``find``.
|
||||
- ``regex-easyesc`` was introduced in 3.1 (and made the default in 3.5). It makes it so the replacement expression in ``string replace -r`` does one fewer round of escaping. Before, to escape a backslash you would have to use ``string replace -ra '([ab])' '\\\\\\\\$1'``. After, just ``'\\\\$1'`` is enough. Check your ``string replace`` calls if you use this anywhere.
|
||||
- ``ampersand-nobg-in-token`` was introduced in fish 3.4 (and made the default in 3.5). It makes it so a ``&`` i no longer interpreted as the backgrounding operator in the middle of a token, so dealing with URLs becomes easier. Either put spaces or a semicolon after the ``&``. This is recommended formatting anyway, and ``fish_indent`` will have done it for you already.
|
||||
- ``remove-percent-self`` turns off the special ``%self`` expansion. It was introduced in 4.0. To get fish's pid, you can use the :envvar:`fish_pid` variable.
|
||||
- ``test-require-arg`` removes :doc:`builtin test <cmds/test>`'s one-argument form (``test "string"``. It was introduced in 4.0. To test if a string is non-empty, use ``test -n "string"``. If disabled, any call to ``test`` that would change sends a :ref:`debug message <debugging-fish>` of category "deprecated-test", so starting fish with ``fish --debug=deprecated-test`` can be used to find offending calls.
|
||||
- ``keyboard-protocols`` lets fish turn on various keyboard protocols including the kitty keyboard protocol.
|
||||
It was introduced in 4.0 and is on by default.
|
||||
Disable it with ``no-keyboard-protocols`` to work around bugs in your terminal.
|
||||
|
||||
|
||||
These changes are introduced off by default. They can be enabled on a per session basis::
|
||||
@@ -2053,12 +2057,6 @@ Prefixing a feature with ``no-`` turns it off instead. E.g. to reenable the ``?`
|
||||
|
||||
set -Ua fish_features no-qmark-noglob
|
||||
|
||||
Currently, the following features are enabled by default:
|
||||
|
||||
- stderr-nocaret - ``^`` no longer redirects stderr, use ``2>``. Enabled by default in fish 3.3.0. No longer changeable since fish 3.5.0.
|
||||
- regex-easyesc - ``string replace -r`` requires fewer backslashes in the replacement part. Enabled by default in fish 3.5.0.
|
||||
- ampersand-nobg-in-token - ``&`` in the middle of a word is a normal character instead of backgrounding. Enabled by default in fish 3.5.0.
|
||||
|
||||
.. _event:
|
||||
|
||||
Event handlers
|
||||
|
||||
@@ -53,7 +53,6 @@ body {
|
||||
div.related ul {
|
||||
margin: 0;
|
||||
padding: 0 0 0 10px;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
div.related {
|
||||
@@ -71,12 +70,10 @@ div.related h3 {
|
||||
}
|
||||
|
||||
div.related li.right {
|
||||
float: right;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
div.sphinxsidebar {
|
||||
width: 230px;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
@@ -113,7 +110,6 @@ div.sphinxsidebar ul {
|
||||
margin: 10px;
|
||||
padding: 0;
|
||||
color: var(--secondary-link-color);
|
||||
margin: 10px;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
@@ -548,10 +544,6 @@ div.sphinxsidebar ul {
|
||||
}
|
||||
|
||||
|
||||
div.bodywrapper {
|
||||
margin-left: 230px;
|
||||
}
|
||||
|
||||
aside.footnote > .label {
|
||||
display: inline;
|
||||
}
|
||||
@@ -565,19 +557,36 @@ div.documentwrapper {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
div.document {
|
||||
display: grid;
|
||||
grid-template: 1fr min-content / 12rem minmax(0,1fr);
|
||||
}
|
||||
|
||||
/* On screens that are less than 700px wide remove anything non-essential
|
||||
- the sidebar, the gradient background, ... */
|
||||
@media screen and (max-width: 700px) {
|
||||
div.document {
|
||||
display: grid;
|
||||
grid-template: 30vh min-content / 100%;
|
||||
}
|
||||
div.sphinxsidebar {
|
||||
font-size: 16px;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
position: relative;
|
||||
/* To separate the "side"bar from the content below */
|
||||
border-bottom: 1px solid;
|
||||
border-color: var(--sidebar-border-color);
|
||||
}
|
||||
div.bodywrapper {
|
||||
|
||||
/* Reduce margins to save space */
|
||||
div.sphinxsidebar ul ul, div.bodywrapper, div.content {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
div.sphinxsidebar h3, div.sphinxsidebar h4 {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
div.sphinxsidebar ul {
|
||||
flex-basis: content;
|
||||
@@ -585,14 +594,15 @@ div.documentwrapper {
|
||||
}
|
||||
div.sphinxsidebarwrapper {
|
||||
display: flex;
|
||||
gap: 1em;
|
||||
justify-content: space-between;
|
||||
}
|
||||
div.sphinxsidebarwrapper > h3:nth-child(5) {
|
||||
display: none;
|
||||
}
|
||||
div#searchbox {
|
||||
#searchbox {
|
||||
display: none !important;
|
||||
}
|
||||
div.content {margin-left: 0;}
|
||||
div.body {
|
||||
padding: 1rem;
|
||||
}
|
||||
@@ -613,6 +623,9 @@ div.documentwrapper {
|
||||
|
||||
/* On print media remove anything non-essential. */
|
||||
@media print {
|
||||
div.document {
|
||||
display: block;
|
||||
}
|
||||
.inline-search {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ BuildRequires: cargo gettext gcc xz pcre2-devel
|
||||
BuildRequires: rust >= 1.70
|
||||
# Packaging guidelines say to use a BuildRequires: rust-packaging, but it adds no value for our package
|
||||
|
||||
BuildRequires: cmake >= 3.19
|
||||
BuildRequires: cmake >= 3.15
|
||||
|
||||
%if 0%{?suse_version}
|
||||
BuildRequires: update-desktop-files
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
complete -c VBoxSDL -l startvm -x -d "Set virtual machine to start" -a "(__fish_print_VBox_vms)"
|
||||
|
||||
complete -c VBoxSDL -l seperate -d "Run separate VM process or attach to a running VM"
|
||||
complete -c VBoxSDL -l separate -d "Run separate VM process or attach to a running VM"
|
||||
complete -c VBoxSDL -l hda -f -d "Set temporary first hard disk"
|
||||
complete -c VBoxSDL -l fda -f -d "Set temporary first floppy disk"
|
||||
complete -c VBoxSDL -l cdrom -r -d "Set temporary CDROM/DVD" -a "none\tunmount"
|
||||
|
||||
@@ -14,7 +14,7 @@ complete -c acpi -s A -l without-ac-adapter -d 'Suppress ac-adapter information'
|
||||
complete -c acpi -s V -l everything -d 'Show every device, overrides above options'
|
||||
complete -c acpi -s s -l show-empty -d 'Show non-operational devices'
|
||||
complete -c acpi -s S -l hide-empty -d 'Hide non-operational devices'
|
||||
complete -c acpi -s c -l celcius -d 'Use celsius as the temperature unit'
|
||||
complete -c acpi -s c -l cooling -d 'Show cooling device information'
|
||||
complete -c acpi -s f -l fahrenheit -d 'Use fahrenheit as the temperature unit'
|
||||
complete -c acpi -s k -l kelvin -d 'Use kelvin as the temperature unit'
|
||||
complete -c acpi -s d -l directory -d '<dir> path to ACPI info (/proc/acpi)'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
complete -c apt-build -l help -d "Display help and exit"
|
||||
complete -f -c apt-build -a update -d "Update list of packages"
|
||||
complete -f -c apt-build -a upgrade -d "Upgrade packages"
|
||||
complete -f -c apt-bulid -a world -d "Rebuild your system"
|
||||
complete -f -c apt-build -a world -d "Rebuild your system"
|
||||
complete -x -c apt-build -a install -d "Build and install a new package"
|
||||
complete -x -c apt-build -a source -d "Download and extract a source"
|
||||
complete -x -c apt-build -a info -d "Info on a package"
|
||||
|
||||
12
share/completions/batsh.fish
Normal file
12
share/completions/batsh.fish
Normal file
@@ -0,0 +1,12 @@
|
||||
set -l command batsh
|
||||
|
||||
complete -c $command -f
|
||||
|
||||
complete -c $command -s h -l help \
|
||||
-a 'pager\tdefault plain groff' \
|
||||
-d 'Show help'
|
||||
|
||||
complete -c $command -s v -l version -d 'Show version'
|
||||
|
||||
complete -c $command \
|
||||
-a 'bash\t"Compile to Bash" batsh\t"Format file" winbat\t"Compile to Batch"'
|
||||
@@ -1,4 +1,13 @@
|
||||
set -l commands status install update remove is-installed random-seed systemd-efi-options reboot-to-firmware list set-default set-oneshot
|
||||
set -l commands status install update remove is-installed random-seed systemd-efi-options reboot-to-firmware list set-default set-oneshot set-timeout set-timeout-oneshot
|
||||
|
||||
# Execute `bootctl list` and return entries
|
||||
function __bootctl_entries
|
||||
if not type -q jq
|
||||
return 1
|
||||
end
|
||||
|
||||
bootctl list --json short | jq '.[] | "\(.id)\t\(.showTitle)"' --raw-output
|
||||
end
|
||||
|
||||
complete -c bootctl -f
|
||||
complete -c bootctl -n "not __fish_seen_subcommand_from $commands" -a status -d 'Show status of EFI variables'
|
||||
@@ -13,6 +22,9 @@ complete -c bootctl -n "__fish_seen_subcommand_from reboot-to-firmware" -a 'true
|
||||
complete -c bootctl -n "not __fish_seen_subcommand_from $commands" -a list -d 'List boot loader entries'
|
||||
complete -c bootctl -n "not __fish_seen_subcommand_from $commands" -a set-default -d 'Set default boot loader entry'
|
||||
complete -c bootctl -n "not __fish_seen_subcommand_from $commands" -a set-oneshot -d 'Set default boot loader entry (Once)'
|
||||
complete -c bootctl -n "__fish_seen_subcommand_from set-default set-oneshot" -x -a '(__bootctl_entries)'
|
||||
complete -c bootctl -n "not __fish_seen_subcommand_from $commands" -a set-timeout -d 'Set default boot loader timeout'
|
||||
complete -c bootctl -n "not __fish_seen_subcommand_from $commands" -a set-timeout-oneshot -d 'Set default boot loader timeout (Once)'
|
||||
|
||||
complete -c bootctl -s h -l help -d 'Show this help'
|
||||
complete -c bootctl -l version -d 'Print version'
|
||||
|
||||
62
share/completions/btrbk.fish
Normal file
62
share/completions/btrbk.fish
Normal file
@@ -0,0 +1,62 @@
|
||||
# Filter Completion
|
||||
function __fish_btrbk_complete_filter
|
||||
btrbk list config --format col:h:snapshot_name,source_subvolume,target_url | string replace -r '([^ ]+)\s+([^ ]+)\s+([^ ]*)' '$1\t$2 -> $3'
|
||||
end
|
||||
|
||||
# options with arguments
|
||||
complete -c btrbk -l format -x -d 'Change output format' -a "table long raw"
|
||||
complete -c btrbk -l loglevel -s l -x -d 'Set logging level' -a "error warn info debug trace"
|
||||
complete -c btrbk -l exclude -x -d 'Exclude configured sections' -a "(__fish_btrbk_complete_filter)"
|
||||
complete -c btrbk -l override -x -d 'Globally override a configuration option'
|
||||
|
||||
# options with file completion
|
||||
complete -c btrbk -l config -r -s c -d 'Specify configuration file'
|
||||
complete -c btrbk -l lockfile -r -d 'Create and check lockfile'
|
||||
|
||||
# options without arguments
|
||||
complete -c btrbk -l help -s h -d 'Display this help message'
|
||||
complete -c btrbk -l version -d 'Display version information'
|
||||
complete -c btrbk -l dry-run -s n -d 'Perform a trial run with no changes made'
|
||||
complete -c btrbk -l preserve -s p -d 'Preserve all (do not delete anything)'
|
||||
complete -c btrbk -l preserve-snapshots -d 'Preserve snapshots (do not delete snapshots)'
|
||||
complete -c btrbk -l preserve-backups -d 'Preserve backups (do not delete backups)'
|
||||
complete -c btrbk -l wipe -d 'Delete all but latest snapshots'
|
||||
complete -c btrbk -l verbose -s v -d 'Be more verbose (increase logging level)'
|
||||
complete -c btrbk -l quiet -s q -d 'Be quiet (do not print backup summary)'
|
||||
complete -c btrbk -l table -s t -d 'Change output to table format'
|
||||
complete -c btrbk -l long -s L -d 'Change output to long format'
|
||||
complete -c btrbk -l print-schedule -s S -d 'Print scheduler details (for the "run" command)'
|
||||
complete -c btrbk -l progress -d 'Show progress bar on send-receive operation'
|
||||
|
||||
# uncommon options from manpage
|
||||
complete -c btrbk -l single-column -s 1 -d 'Print output as a single column'
|
||||
complete -c btrbk -l pretty -d 'Print pretty table output with lowercase and underlined column headings'
|
||||
complete -c btrbk -l raw -d 'Create raw targets for archive command'
|
||||
|
||||
# subcommands
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a run -d 'Run snapshot and backup operations'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a dryrun -d 'Show what would be executed without running btrfs commands'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a snapshot -d 'Run snapshot operations only'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a resume -d 'Run backup operations and delete snapshots'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a prune -d 'Only delete snapshots and backups'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a archive -d 'Recursively copy all subvolumes (src -> dst)'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a clean -d 'Delete incomplete (garbled) backups'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a stats -d 'Print snapshot/backup statistics'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a usage -d 'Print filesystem usage'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a ls -d 'List all btrfs subvolumes below a given path'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a origin -d 'Print origin information for a subvolume'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a diff -d 'List file changes between related subvolumes'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a extents -d 'Calculate accurate disk space usage for a path'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a list -d 'List snapshots and backups'
|
||||
|
||||
# subsubcommands for "list"
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a all -d 'List all snapshots and backups'
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a snapshots -d 'List snapshots only'
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a backups -d 'List backups and correlated snapshots'
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a latest -d 'List most recent snapshots and backups'
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a config -d 'List configured source/snapshot/target relations'
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a source -d 'List configured source/snapshot relations'
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a volume -d 'List configured volume sections'
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a target -d 'List configured targets'
|
||||
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from run dryrun snapshot resume prune clean' -x -a '(__fish_btrbk_complete_filter)'
|
||||
@@ -102,33 +102,36 @@ complete -f -c btrfs -n $restore -s S -l symlink -d 'Restore symbolic links'
|
||||
complete -f -c btrfs -n $restore -s v -l verbose -d Verbose
|
||||
complete -f -c btrfs -n $restore -s i -l ignore-errors -d 'Ignore errors'
|
||||
complete -f -c btrfs -n $restore -s o -l overwrite -d Overwrite
|
||||
complete -f -c btrfs -n $restore -s t -d 'Tree location'
|
||||
complete -f -c btrfs -n $restore -s f -d 'Filesystem location'
|
||||
complete -f -c btrfs -n $restore -s u -l super -d 'Super mirror'
|
||||
complete -f -c btrfs -n $restore -s r -l root -d 'Root objectid'
|
||||
complete -f -c btrfs -n $restore -s t -r -d 'Tree location'
|
||||
complete -f -c btrfs -n $restore -s f -r -d 'Filesystem location'
|
||||
complete -f -c btrfs -n $restore -s u -l super -r -d 'Super mirror'
|
||||
complete -f -c btrfs -n $restore -s r -l root -r -d 'Root objectid'
|
||||
complete -f -c btrfs -n $restore -s d -d 'Find dir'
|
||||
complete -f -c btrfs -n $restore -s l -l list-roots -d 'List tree roots'
|
||||
complete -f -c btrfs -n $restore -s D -l dry-run -d 'Only list files that would be recovered'
|
||||
complete -f -c btrfs -n $restore -l path-regex -d 'Restore only filenames matching regex'
|
||||
complete -f -c btrfs -n $restore -l path-regex -r -d 'Restore only filenames matching regex'
|
||||
complete -f -c btrfs -n $restore -s c -d 'Ignore case (--path-regex only)'
|
||||
|
||||
# btrfs send
|
||||
complete -f -c btrfs -n $send -s e -d ''
|
||||
complete -f -c btrfs -n $send -s p -d 'Send an incremental stream from <parent> to <subvol>'
|
||||
complete -f -c btrfs -n $send -s c -d 'Use this snapshot as a clone source for an incremental send'
|
||||
complete -f -c btrfs -n $send -s f -d 'Output is normally written to stdout'
|
||||
complete -f -c btrfs -n $send -s p -r -d 'Send an incremental stream from <parent> to <subvol>'
|
||||
complete -f -c btrfs -n $send -s c -r -d 'Use this snapshot as a clone source for an incremental send'
|
||||
complete -f -c btrfs -n $send -s f -r -d 'Output is normally written to stdout'
|
||||
complete -f -c btrfs -n $send -l no-data -d 'send in NO_FILE_DATA mode'
|
||||
complete -f -c btrfs -n $send -s v -l verbose -d 'Enable verbose output to stderr'
|
||||
complete -f -c btrfs -n $send -s q -l quiet -d 'Suppress all messages, except errors'
|
||||
complete -f -c btrfs -n $send -l proto -a '0 1 2' -r -d 'Use send protocol version'
|
||||
complete -f -c btrfs -n $send -l proto -l compressed-data -d 'Send compressed data directly'
|
||||
|
||||
# btrfs receive
|
||||
complete -f -c btrfs -n $receive -s v -d 'Increase verbosity about performed actions'
|
||||
complete -f -c btrfs -n $receive -s q -l quiet -d 'Suppress all messages, except errors'
|
||||
complete -f -c btrfs -n $receive -s f -d 'Read the stream from FILE instead of stdin'
|
||||
complete -f -c btrfs -n $receive -s f -r -d 'Read the stream from FILE instead of stdin'
|
||||
complete -f -c btrfs -n $receive -s e -d 'Terminate after receiving an <end cmd> marker in the stream'
|
||||
complete -f -c btrfs -n $receive -s C -l chroot -d 'Confine the process to <mount> using chroot'
|
||||
complete -f -c btrfs -n $receive -s E -l max-errors -d 'Terminate when NUMBER errors occur'
|
||||
complete -f -c btrfs -n $receive -s m -d 'The root mount point of the destination filesystem'
|
||||
complete -f -c btrfs -n $receive -s E -l max-errors -r -d 'Terminate when NUMBER errors occur'
|
||||
complete -f -c btrfs -n $receive -s m -r -d 'The root mount point of the destination filesystem'
|
||||
complete -f -c btrfs -n $receive -l force-decompress -r -d 'Always decompress data'
|
||||
complete -f -c btrfs -n $receive -l dump -d 'Dump stream metadata'
|
||||
|
||||
# btrfs help
|
||||
@@ -147,9 +150,11 @@ complete -f -c btrfs -n $subvolume -a show -d 'Show more information about the s
|
||||
complete -f -c btrfs -n $subvolume -a sync -d 'Wait until given subvolume(s) are completely removed from the filesystem.'
|
||||
# btrfs subvolume create
|
||||
complete -f -c btrfs -n '__btrfs_command_groups subvolume create' -s i -d 'Add subvolume to a qgroup (can be given multiple times)'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups subvolume create' -s p -d 'Create any missing parent directories'
|
||||
# btrfs subvolume delete
|
||||
complete -f -c btrfs -n '__btrfs_command_groups subvolume delete' -s c -l commit-after -d 'Wait for transaction commit at the end of the operation'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups subvolume delete' -s C -l commit-each -d 'Wait for transaction commit after deleting each subvolume'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups subvolume delete' -s R -l recursive -d 'Delete subvolumes beneath each subvolume recursively'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups subvolume delete' -s v -l verbose -d 'Verbose output of operations'
|
||||
# btrfs subvolume list
|
||||
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s o -d 'Print only subvolumes below specified path'
|
||||
@@ -164,8 +169,8 @@ complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s s -d 'List on
|
||||
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s r -d 'List readonly subvolumes (including snapshots)'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s d -d 'List deleted subvolumes that are not yet cleaned'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s t -d 'Print the result as a table'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s G -d 'Filter the subvolumes by generation'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s C -d 'Filter the subvolumes by ogeneration'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s G -r -d 'Filter the subvolumes by generation'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s C -r -d 'Filter the subvolumes by ogeneration'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -l sort -d 'List the subvolume in order' -a '{gen,ogen,rootid,path}'
|
||||
# btrfs subvolume snapshot
|
||||
complete -f -c btrfs -n '__btrfs_command_groups subvolume snapshot' -s r -d 'Create a readonly snapshot'
|
||||
@@ -194,6 +199,7 @@ complete -f -c btrfs -n $filesystem -a defragment -d 'Defragment a file or a dir
|
||||
complete -f -c btrfs -n $filesystem -a resize -d 'Resize a filesystem'
|
||||
complete -f -c btrfs -n $filesystem -a label -d 'Get or change the label of a filesystem'
|
||||
complete -f -c btrfs -n $filesystem -a usage -d 'Show detailed information about internal filesystem usage.'
|
||||
complete -f -c btrfs -n $filesystem -a mkswapfile -d 'Create a new swapfile'
|
||||
# btrfs filesystem df
|
||||
complete -f -c btrfs -n '__btrfs_command_groups filesystem df' -s b -l raw -d 'Show raw numbers in bytes'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups filesystem df' -s h -l human-readable -d 'Show human friendly numbers, base 1024'
|
||||
@@ -230,9 +236,12 @@ complete -f -c btrfs -n '__btrfs_command_groups filesystem defragment' -s v -d '
|
||||
complete -f -c btrfs -n '__btrfs_command_groups filesystem defragment' -s r -d 'Defragment files recursively'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups filesystem defragment' -s c -d 'Compress the file while defragmenting' -ra '{zlib,lzo,zstd}'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups filesystem defragment' -s f -d 'Flush data to disk immediately after defragmenting'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups filesystem defragment' -s s -d 'Defragment only from NUMBER byte onward'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups filesystem defragment' -s l -d 'Defragment only up to LEN bytes'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups filesystem defragment' -s t -d 'Target extent SIZE hint'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups filesystem defragment' -s s -r -d 'Defragment only from NUMBER byte onward'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups filesystem defragment' -s l -r -d 'Defragment only up to LEN bytes'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups filesystem defragment' -s t -r -d 'Target extent SIZE hint'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups filesystem defragment' -l step -r -d 'Defragment in steps of SIZE'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups filesystem defragment' -s L -l level -r -d 'Specify compression levels'
|
||||
|
||||
# btrfs filesystem usage
|
||||
complete -f -c btrfs -n '__btrfs_command_groups filesystem usage' -s b -l raw -d 'Show raw numbers in bytes'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups filesystem usage' -s h -l human-readable -d 'Show human friendly numbers, base 1024'
|
||||
@@ -244,6 +253,11 @@ complete -f -c btrfs -n '__btrfs_command_groups filesystem usage' -s m -l mbytes
|
||||
complete -f -c btrfs -n '__btrfs_command_groups filesystem usage' -s g -l gbytes -d 'Show sizes in GiB, or GB with --si'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups filesystem usage' -s t -l tbytes -d 'Show sizes in TiB, or TB with --si'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups filesystem usage' -s T -d 'Show data in tabular format'
|
||||
# btrfs filesystem mkswapfile
|
||||
complete -f -c btrfs -n '__btrfs_command_groups filesystem mkswapfile' -s s -l size -r -d 'Swapfile size'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups filesystem mkswapfile' -s U -l uuid -r -d 'UUID for the swapfile'
|
||||
# btrfs filesystem resize
|
||||
complete -f -c btrfs -n '__btrfs_command_groups filesystem resize' -l enqueue -d 'Wait for other exclusive operations'
|
||||
|
||||
# btrfs balance
|
||||
complete -f -c btrfs -n $balance -a start -d 'Balance chunks across the devices'
|
||||
@@ -252,13 +266,23 @@ complete -f -c btrfs -n $balance -a cancel -d 'Cancel running or paused balance'
|
||||
complete -f -c btrfs -n $balance -a resume -d 'Resume interrupted balance'
|
||||
complete -f -c btrfs -n $balance -a status -d 'Show status of running or paused balance'
|
||||
# btrfs balance start
|
||||
complete -f -c btrfs -n '__btrfs_command_groups balance start' -s d -d 'Act on data chunks with FILTERS'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups balance start' -s m -d 'Act on metadata chunks with FILTERS'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups balance start' -s s -d 'Act on system chunks with FILTERS (only under -f)'
|
||||
function __btrfs_balance_filters
|
||||
set -l profiles raid{0,1{,c3,c4},10,5,6} dup single
|
||||
set -l btrfs_balance_filters \
|
||||
profiles=$profiles\t"Balances only block groups with the given profiles" \
|
||||
convert=$profiles\t"Convert selected block groups to given profile" \
|
||||
usage= devid= vrange= limit= strips= soft
|
||||
set -l prefix (commandline -tc | string replace -r '^-d' -- '' | string match -rg '^(.*?)?[^,]*$' -- $token)
|
||||
printf "%s\n" "$prefix"$btrfs_balance_filters
|
||||
end
|
||||
complete -f -c btrfs -n '__btrfs_command_groups balance start' -s d -ra '(__btrfs_balance_filters)' -d 'Act on data chunks with FILTERS'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups balance start' -s m -ra '(__btrfs_balance_filters)' -d 'Act on metadata chunks with FILTERS'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups balance start' -s s -ra '(__btrfs_balance_filters)' -d 'Act on system chunks with FILTERS (only under -f)'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups balance start' -s v -d 'Be verbose'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups balance start' -s f -d 'Force a reduction of metadata integrity'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups balance start' -l full-balance -d 'Do not print warning and do not delay start'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups balance start' -l background -l bg -d 'Run the balance as a background process'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups balance start' -l enqueue -d 'Wait for other exclusive operations'
|
||||
# btrfs balance status
|
||||
complete -f -c btrfs -n '__btrfs_command_groups balance status' -s v -d 'Be verbose'
|
||||
|
||||
@@ -279,6 +303,10 @@ complete -f -c btrfs -n '__btrfs_command_groups device scan' -s u -l forget -d '
|
||||
# btrfs device stats
|
||||
complete -f -c btrfs -n '__btrfs_command_groups device stats' -s c -l check -d 'Return non-zero if any stat counter is not zero'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups device stats' -s z -l reset -d 'Show current stats and reset values to zero'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups device stats' -s T -d "Print stats in a tabular form"
|
||||
# btrfs device remove
|
||||
complete -f -c btrfs -n '__btrfs_command_groups device remove' -l enqueue -d 'Wait for other exclusive operations'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups device remove' -l force -d 'Skip the safety timeout for removing multiple devices'
|
||||
# btrfs device usage
|
||||
complete -f -c btrfs -n '__btrfs_command_groups device usage' -s b -l raw -d 'Show raw numbers in bytes'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups device usage' -s h -l human-readable -d 'Show human friendly numbers, base 1024'
|
||||
@@ -295,12 +323,18 @@ complete -f -c btrfs -n $scrub -a start -d 'Start a new scrub. If a scrub is alr
|
||||
complete -f -c btrfs -n $scrub -a cancel -d 'Cancel a running scrub'
|
||||
complete -f -c btrfs -n $scrub -a resume -d 'Resume previously canceled or interrupted scrub'
|
||||
complete -f -c btrfs -n $scrub -a status -d 'Show status of running or finished scrub'
|
||||
complete -f -c btrfs -n $scrub -a limit -d 'Show or set scrub limits on devices of the given filesystem'
|
||||
# btrfs scrub limit
|
||||
complete -f -c btrfs -n '__btrfs_command_groups scrub limit' -s d -l devid -d 'Select the device by DEVID to apply the limit'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups scrub limit' -s l -l limit -d 'Set the limit of the device'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups scrub limit' -s a -l all -d 'Apply the limit to all devices'
|
||||
# btrfs scrub start
|
||||
complete -f -c btrfs -n '__btrfs_command_groups scrub start' -s B -d 'Do not background'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups scrub start' -s d -d 'Stats per device (-B only)'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups scrub start' -s q -d 'Be quiet'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups scrub start' -s r -d 'Read only mode'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups scrub start' -s R -d 'Raw print mode, print full data instead of summary'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups scrub start' -l limit -d 'Set the scrub throughput limit'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups scrub start' -s c -d 'Set ioprio class (see ionice(1) manpage)'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups scrub start' -s n -d 'Set ioprio classdata (see ionice(1) manpage)'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups scrub start' -s f -d 'Force starting new scrub'
|
||||
@@ -321,6 +355,9 @@ complete -f -c btrfs -n $rescue -a chunk-recover -d 'Recover the chunk tree by s
|
||||
complete -f -c btrfs -n $rescue -a super-recover -d 'Recover bad superblocks from good copies'
|
||||
complete -f -c btrfs -n $rescue -a zero-log -d 'Clear the tree log. Usable if it\'s corrupted and prevents mount.'
|
||||
complete -f -c btrfs -n $rescue -a fix-device-size -d 'Re-align device and super block sizes'
|
||||
complete -f -c btrfs -n $rescue -a clear-ino-cache -d 'Remove leftover items pertaining to the deprecated inode cache feature'
|
||||
complete -f -c btrfs -n $rescue -a clear-space-cache -d 'Completely remove the on-disk data of free space cache of given version'
|
||||
complete -f -c btrfs -n $rescue -a clear-uuid-tree -d 'Clear the UUID tree'
|
||||
# btrfs rescue chunk-recover
|
||||
complete -f -c btrfs -n '__btrfs_command_groups rescue chunk-recover' -s y -d 'Assume an answer of YES to all questions'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups rescue chunk-recover' -s v -d 'Verbose mode'
|
||||
@@ -337,6 +374,8 @@ complete -f -c btrfs -n $inspect_internal -a min-dev-size -d 'Get the minimum si
|
||||
complete -f -c btrfs -n $inspect_internal -a dump-tree -d 'Dump tree structures from a given device'
|
||||
complete -f -c btrfs -n $inspect_internal -a dump-super -d 'Dump superblock from a device in a textual form'
|
||||
complete -f -c btrfs -n $inspect_internal -a tree-stats -d 'Print various stats for trees'
|
||||
complete -f -c btrfs -n $inspect_internal -a list-chunks -d 'Enumerate chunks on all devices'
|
||||
complete -f -c btrfs -n $inspect_internal -a map-swapfile -d 'Find device-specific physical offset of file that can be used for hibernation'
|
||||
# btrfs inspect-internal inode-resolve
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal inode-resolve' -s v -d 'Verbose mode'
|
||||
# btrfs inspect-internal logical-resolve
|
||||
@@ -351,20 +390,50 @@ complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -s d
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -s r -l roots -d 'Print only short root node info'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -s R -l backups -d 'Print short root node info and backup root info'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -s u -l uuid -d 'Print only the uuid tree'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -s b -l block -d 'Print info from the specified BLOCK only'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -s t -l tree -d 'Print only tree with the given ID'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -s b -l block -r -d 'Print info from the specified BLOCK only'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -s t -l tree -r -d 'Print only tree with the given ID'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -l follow -d 'Use with -b, to show all children tree blocks of <block_num>'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -l noscan -d 'Do not scan the devices from the filesystem'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -l bfs -d 'Breadth-first traversal of the trees, print nodes, then leaves'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -l dfs -d 'Depth-first traversal of the trees'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -l hide-names -d 'Print placeholder instead of names'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -l csum-headers -d 'Print b-tree node checksums in headers'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -l csum-items -d 'Print checksums stored in checksum items'
|
||||
|
||||
# btrfs inspect-internal dump-super
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-super' -s f -l full -d 'Print full superblock information, backup roots etc.'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-super' -s a -l all -d 'Print information about all superblocks'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-super' -s s -l super -d 'Specify which SUPER-BLOCK copy to print out' -ra '{0,1,2}'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-super' -s F -l force -d 'Attempt to dump superblocks with bad magic'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-super' -l bytenr -d 'Specify alternate superblock OFFSET'
|
||||
# btrfs inspect-internal logical-resolve
|
||||
complete -f -c btrfs -n '__btrfs_command_groups logical-resolve' -s P -d 'Print inodes instead of resolving paths'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups logical-resolve' -s o -d 'Ignore offsets, find all references to an extent'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups logical-resolve' -s s -r -d 'Set internal buffer size for storing file names'
|
||||
# btrfs inspect-internal tree-stats
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal tree-stats' -s b -d 'Show raw numbers in bytes'
|
||||
# btrfs inspect-internal list-chunks
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal list-chunks' -l sort -ra 'devid pstart lstart usage length' -d 'Sort by a column (ascending)'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal list-chunks' -l raw -d 'Show raw numbers in bytes'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal list-chunks' -l human-readable -d 'Show human friendly numbers, base 1024'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal list-chunks' -l iec -d 'Use 1024 as a base (KiB, MiB, GiB, TiB)'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal list-chunks' -l si -d 'Use 1000 as a base (kB, MB, GB, TB)'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal list-chunks' -l kbytes -d 'Show sizes in KiB, or kB with --si'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal list-chunks' -l mbytes -d 'Show sizes in MiB, or MB with --si'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal list-chunks' -l gbytes -d 'Show sizes in GiB, or GB with --si'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal list-chunks' -l tbytes -d 'Show sizes in TiB, or TB with --si'
|
||||
# btrfs inspect-internal map-swapfile
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal map-swapfile' -l resume-offset -s r -d 'Print the value suitable as resume offset for /sys/power/resume_offset.'
|
||||
# btrfs inspect-internal tree-stats
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal tree-stats' -s t -r -d 'Print stats only for the given treeid'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal tree-stats' -l raw -s b -d 'Show raw numbers in bytes'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal tree-stats' -l human-readable -d 'Show human friendly numbers, base 1024'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal tree-stats' -l iec -d 'Use 1024 as a base (KiB, MiB, GiB, TiB)'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal tree-stats' -l si -d 'Use 1000 as a base (kB, MB, GB, TB)'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal tree-stats' -l kbytes -d 'Show sizes in KiB, or kB with --si'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal tree-stats' -l mbytes -d 'Show sizes in MiB, or MB with --si'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal tree-stats' -l gbytes -d 'Show sizes in GiB, or GB with --si'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal tree-stats' -l tbytes -d 'Show sizes in TiB, or TB with --si'
|
||||
|
||||
# btrfs property
|
||||
complete -f -c btrfs -n $property -a get -d 'Get a property value of a btrfs object'
|
||||
@@ -381,9 +450,12 @@ complete -f -c btrfs -n '__btrfs_command_groups property list' -s t -d 'List pro
|
||||
complete -f -c btrfs -n $quota -a enable -d 'Enable subvolume quota support for a filesystem.'
|
||||
complete -f -c btrfs -n $quota -a disable -d 'Disable subvolume quota support for a filesystem.'
|
||||
complete -f -c btrfs -n $quota -a rescan -d 'Trash all qgroup numbers and scan the metadata again with the current config.'
|
||||
# btrfs quota enable
|
||||
complete -f -c btrfs -n '__btrfs_command_groups quota enable' -s s -l simple -d 'Use simple quotas'
|
||||
# btrfs quota rescan
|
||||
complete -f -c btrfs -n '__btrfs_command_groups quota rescan' -s s -d 'Show status of a running rescan operation'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups quota rescan' -s w -d 'Wait for rescan operation to finish'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups quota rescan' -s s -l status -d 'Show status of a running rescan operation'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups quota rescan' -s w -l wait -d 'Wait for rescan operation to finish'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups quota rescan' -s W -l wait-norescan -d 'Wait for rescan to finish without starting it'
|
||||
|
||||
# btrfs qgroup
|
||||
complete -f -c btrfs -n $qgroup -a assign -d 'Assign SRC as the child qgroup of DST'
|
||||
@@ -391,6 +463,7 @@ complete -f -c btrfs -n $qgroup -a remove -d 'Remove a child qgroup SRC from DST
|
||||
complete -f -c btrfs -n $qgroup -a create -d 'Create a subvolume quota group.'
|
||||
complete -f -c btrfs -n $qgroup -a destroy -d 'Destroy a quota group.'
|
||||
complete -f -c btrfs -n $qgroup -a show -d 'Show subvolume quota groups.'
|
||||
complete -f -c btrfs -n $qgroup -a clear-stale -d 'Clear all stale qgroups whose subvolume does not exist'
|
||||
complete -f -c btrfs -n $qgroup -a limit -d 'Set the limits a subvolume quota group.'
|
||||
# btrfs qgroup assign
|
||||
complete -f -c btrfs -n '__btrfs_command_groups qgroup assign' -l rescan -d 'Schedule qutoa rescan if needed'
|
||||
@@ -424,5 +497,7 @@ complete -f -c btrfs -n $replace -a cancel -d 'Cancel a running device replace o
|
||||
complete -f -c btrfs -n '__btrfs_command_groups replace start' -s r -d 'Only read from <srcdev> if no other zero-defect mirror exists'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups replace start' -s f -d 'Force using and overwriting <targetdev>'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups replace start' -s B -d 'Do not background'
|
||||
complete -f -c btrfs -n '__btrfs_command_groups replace start' -l enqueue -d "Wait if there's another exclusive operation running"
|
||||
complete -f -c btrfs -n '__btrfs_command_groups replace start' -s K -l nodiscard -d 'Do not perform TRIM on DEVICES'
|
||||
# btrfs replace status
|
||||
complete -f -c btrfs -n '__btrfs_command_groups replace status' -s 1 -d 'Only print once until the replace operation finishes'
|
||||
|
||||
@@ -61,7 +61,7 @@ complete -f -c bzr -n '__fish_seen_subcommand_from merge' -l pull -d 'If destina
|
||||
complete -f -c bzr -n '__fish_seen_subcommand_from merge' -l remember -d 'Remember the specified location as a default'
|
||||
complete -f -c bzr -n '__fish_seen_subcommand_from merge' -l force -d 'Merge even if the destination tree has uncommitted changes'
|
||||
complete -f -c bzr -n '__fish_seen_subcommand_from merge' -l reprocess -d 'Reprocess to reduce spurious conflicts'
|
||||
complete -f -c bzr -n '__fish_seen_subcommand_from merge' -l uncommited -d 'Apply uncommitted changes from a working copy, instead of branch changes'
|
||||
complete -f -c bzr -n '__fish_seen_subcommand_from merge' -l uncommitted -d 'Apply uncommitted changes from a working copy, instead of branch changes'
|
||||
complete -f -c bzr -n '__fish_seen_subcommand_from merge' -l show-base -d 'Show base revision text in conflicts'
|
||||
complete -f -c bzr -n '__fish_seen_subcommand_from merge' -l preview -d 'Instead of merging, show a diff of the merge'
|
||||
complete -f -c bzr -n '__fish_seen_subcommand_from merge' -l interactive -s i -d 'Select changes interactively'
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
## --- WRITTEN MANUALLY ---
|
||||
set -l __fish_cargo_subcommands (cargo --list 2>&1 | string replace -rf '^\s+([^\s]+)\s*(.*)' '$1\t$2' | string escape)
|
||||
|
||||
# Append user-installed extensions (e.g. cargo-foo, invokable as `cargo foo`) to the list of subcommands (à la git)
|
||||
set -la __fish_cargo_subcommands (complete -C'cargo-' | string replace -rf '^cargo-(\w+).*' '$1')
|
||||
|
||||
complete -c cargo -f -c cargo -n __fish_use_subcommand -a "$__fish_cargo_subcommands"
|
||||
complete -c cargo -x -c cargo -n '__fish_seen_subcommand_from help' -a "$__fish_cargo_subcommands"
|
||||
|
||||
@@ -53,27 +50,6 @@ end
|
||||
complete -c cargo -n '__fish_seen_subcommand_from run test build debug check' -l package \
|
||||
-xa "(__fish_cargo_packages)"
|
||||
|
||||
# Look up crates.io crates matching the single argument provided to this function
|
||||
function __fish_cargo_search
|
||||
if test (string length -- "$argv[1]") -le 2
|
||||
# Don't waste time searching for strings with too many results to realistically
|
||||
# provide a meaningful completion within our results limit.
|
||||
return
|
||||
end
|
||||
|
||||
# This doesn't do a prefix search, so bump up the limit a tiny bit to try and
|
||||
# get enough results to show something.
|
||||
cargo search --color never --quiet --limit 20 -- $argv[1] 2>/dev/null |
|
||||
# Filter out placeholders and "... and xxx more crates"
|
||||
string match -rvi '^\.\.\.|= "0.0.0"|# .*(reserved|yanked)' |
|
||||
# Remove the version number and map the description
|
||||
string replace -rf '^([^ ]+).*# (.*)' '$1\t$2'
|
||||
end
|
||||
|
||||
# Complete possible crate names by search the crates.io index
|
||||
complete -c cargo -n '__fish_seen_subcommand_from add install' -n '__fish_is_nth_token 2' \
|
||||
-a "(__fish_cargo_search (commandline -ct))"
|
||||
|
||||
## --- AUTO-GENERATED WITH `cargo complete fish` ---
|
||||
# Manually massaged to improve some descriptions
|
||||
complete -c cargo -n __fish_use_subcommand -l explain -d 'Run `rustc --explain CODE`'
|
||||
|
||||
@@ -16,14 +16,12 @@ complete -c code -l user-data-dir -ra "(__fish_complete_directories)" -d 'Specif
|
||||
complete -c code -l profile -d 'Opens the provided folder or workspace with the given profile'
|
||||
complete -c code -s v -l version -d 'Print version'
|
||||
complete -c code -s h -l help -d 'Print usage'
|
||||
complete -c code -l folder-uri -d 'Opens a window with given folder uri(s)'
|
||||
complete -c code -l file-uri -d 'Opens a window with given file uri(s)'
|
||||
|
||||
# Extensions management
|
||||
complete -c code -l extensions-dir -d 'Set the root path for extensions'
|
||||
complete -c code -l extensions-dir -r -d 'Set the root path for extensions'
|
||||
complete -c code -l list-extensions -d 'List the installed extensions'
|
||||
complete -c code -l show-versions -d 'Show versions of installed extensions' -n '__fish_seen_argument -l list-extensions'
|
||||
complete -c code -l category -d 'Filters installed extensions by provided category' -n '__fish_seen_argument -l list-extensions'
|
||||
complete -c code -l category -x -d 'Filters installed extensions by provided category' -n '__fish_seen_argument -l list-extensions'
|
||||
complete -c code -l install-extension -ra "(__fish_complete_vscode_extensions)" -d 'Installs or updates the extension'
|
||||
complete -c code -l force -n '__fish_seen_argument -l install-extension' -d 'Updates to the latest version'
|
||||
complete -c code -l pre-release -n '__fish_seen_argument -l install-extension' -d 'Installs the pre-release version'
|
||||
@@ -35,12 +33,13 @@ complete -c code -l disable-extensions -d 'Disable all installed extensions'
|
||||
|
||||
# Troubleshooting
|
||||
complete -c code -l verbose -d 'Print verbose output (implies --wait)'
|
||||
complete -c code -l log -a 'critical error warn info debug trace off' -d 'Log level to use (default: info)'
|
||||
complete -c code -l log -xa 'critical error warn info debug trace off' -d 'Log level to use (default: info)'
|
||||
complete -c code -s s -l status -d 'Print process usage and diagnostics information'
|
||||
complete -c code -l prof-startup -d 'Run CPU profiler during startup'
|
||||
complete -c code -l sync -d 'Turn sync on or off'
|
||||
complete -c code -l inspect-extensions -d 'Allow debugging and profiling of extensions'
|
||||
complete -c code -l sync -xa 'on off' -d 'Turn sync on or off'
|
||||
complete -c code -l inspect-extensions -x -d 'Allow debugging and profiling of extensions'
|
||||
complete -c code -l inspect-brk-extensions -x -d 'Allow debugging and profiling of extensions'
|
||||
complete -c code -l disable-lcd-text -d 'Disable LCD font rendering'
|
||||
complete -c code -l disable-gpu -d 'Disable GPU hardware acceleration'
|
||||
complete -c code -l disable-chromium-sandbox -d 'Disable the Chromium sandbox environment'
|
||||
complete -c code -l telemetry -d 'Shows all telemetry events which VS code collects'
|
||||
|
||||
@@ -5,7 +5,7 @@ complete -c create_ap -l version -d 'Print version number'
|
||||
complete -c create_ap -s c -x -d 'Channel number'
|
||||
complete -c create_ap -s w -x -a '1 2 1+2' -d 'WPA version to use'
|
||||
complete -c create_ap -s n -d 'Disable Internet sharing'
|
||||
complete -c create_ap -s m -x -a 'nat brigde none' -d 'Method for Internet sharing'
|
||||
complete -c create_ap -s m -x -a 'nat bridge none' -d 'Method for Internet sharing'
|
||||
complete -c create_ap -l psk -d 'Use 64 hex digits pre-shared-key'
|
||||
complete -c create_ap -l hidden -d 'Make the Access Point hidden'
|
||||
complete -c create_ap -l mac-filter -d 'Enable MAC address filtering'
|
||||
|
||||
@@ -94,3 +94,6 @@ complete -c cryptsetup -l veracrypt-query-pim -d "Query Personal Iteration Multi
|
||||
complete -c cryptsetup -l verbose -s v -d "Shows more detailed error messages"
|
||||
complete -c cryptsetup -l verify-passphrase -s y -d "Verifies the passphrase by asking for it twice"
|
||||
complete -c cryptsetup -l version -s V -d "Print package version"
|
||||
|
||||
# subcommands
|
||||
complete -c cryptsetup -n "__fish_seen_subcommand_from close status resize" -f -r -a "(path basename /dev/mapper/* | string match -v control)"
|
||||
|
||||
@@ -6,6 +6,6 @@ complete -c csvlens -l filter -r -d "Use this regex to filter rows to display by
|
||||
complete -c csvlens -l find -r -d "Use this regex to find and highlight matches by default"
|
||||
complete -c csvlens -s i -l ignore-case -d "Searches ignore case. Ignored if any uppercase letters are present in the search string"
|
||||
complete -c csvlens -l echo-column -r -d "Print the value of this column to stdout for the selected row"
|
||||
complete -c csvlens -l debug "Show stats for debugging"
|
||||
complete -c csvlens -l debug -d "Show stats for debugging"
|
||||
complete -c csvlens -s h -l help -f -d "Print help"
|
||||
complete -c csvlens -s V -l version -f -d "Print version"
|
||||
|
||||
@@ -53,7 +53,7 @@ complete -f -c diskutil -n '__fish_diskutil_using_not_subcommand umountDisk' -a
|
||||
|
||||
# eject
|
||||
complete -f -c diskutil -n __fish_use_subcommand -a eject -d 'Eject a volume or disk'
|
||||
complete -f -c diskutil -n '__fish_diskutil_using_not_subcommand eject' -a '(__fish_diskutil_volumes ; __fish_diskutil_devices)'
|
||||
complete -f -c diskutil -n '__fish_diskutil_using_not_subcommand eject' -a '(__fish_diskutil_mounted_volumes ; __fish_diskutil_devices)'
|
||||
|
||||
# mount
|
||||
complete -f -c diskutil -n __fish_use_subcommand -a mount -d 'Mount a single volume'
|
||||
|
||||
@@ -2,8 +2,12 @@
|
||||
# Completions for the dnf command
|
||||
#
|
||||
|
||||
function __dnf_is_dnf5
|
||||
path resolve -- $PATH/dnf | path filter | string match -q -- '*/dnf5'
|
||||
end
|
||||
|
||||
function __dnf_list_installed_packages
|
||||
dnf repoquery --cacheonly "$cur*" --qf "%{name}" --installed </dev/null
|
||||
dnf repoquery --cacheonly "$cur*" --qf "%{name}\n" --installed </dev/null
|
||||
end
|
||||
|
||||
function __dnf_list_available_packages
|
||||
@@ -15,9 +19,14 @@ function __dnf_list_available_packages
|
||||
return
|
||||
end
|
||||
set -l results
|
||||
# dnf --cacheonly list --available gives a list of non-installed packages dnf is aware of,
|
||||
# but it is slow as molasses. Unfortunately, sqlite3 is not available oob (Fedora Server 32).
|
||||
if type -q sqlite3
|
||||
if __dnf_is_dnf5
|
||||
# dnf5 provides faster completions than repoquery, but does not maintain the
|
||||
# same sqlite db as dnf4
|
||||
set results (dnf --complete=2 dnf install "$tok*")
|
||||
else if type -q sqlite3
|
||||
# dnf --cacheonly list --available gives a list of non-installed packages dnf is aware of,
|
||||
# but it is slow as molasses. Unfortunately, sqlite3 is not available oob (Fedora Server 32).
|
||||
|
||||
# This schema is bad, there is only a "pkg" field with the full
|
||||
# packagename-version-release.fedorarelease.architecture
|
||||
# tuple. We are only interested in the packagename.
|
||||
@@ -26,7 +35,7 @@ function __dnf_list_available_packages
|
||||
else
|
||||
# In some cases dnf will ask for input (e.g. to accept gpg keys).
|
||||
# Connect it to /dev/null to try to stop it.
|
||||
set results (dnf repoquery --cacheonly "$tok*" --qf "%{name}" --available </dev/null 2>/dev/null)
|
||||
set results (dnf repoquery --cacheonly "$tok*" --qf "%{name}\n" --available </dev/null 2>/dev/null)
|
||||
end
|
||||
if set -q results[1]
|
||||
set results (string match -r -- '.*\\.rpm$' $files) $results
|
||||
@@ -37,7 +46,7 @@ function __dnf_list_available_packages
|
||||
end
|
||||
|
||||
function __dnf_list_transactions
|
||||
if type -q sqlite3
|
||||
if not __dnf_is_dnf5 && type -q sqlite3
|
||||
sqlite3 /var/lib/dnf/history.sqlite "SELECT id, cmdline FROM trans" 2>/dev/null | string replace "|" \t
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
function __fish_doas_print_remaining_args
|
||||
set -l tokens (commandline -xpc) (commandline -ct)
|
||||
set -l tokens (commandline -xpc | string escape) (commandline -ct)
|
||||
set -e tokens[1]
|
||||
# These are all the options mentioned in the man page for openbsd's "doas" (in that order).
|
||||
set -l opts a= C= L n s u=
|
||||
|
||||
24
share/completions/elm.fish
Normal file
24
share/completions/elm.fish
Normal file
@@ -0,0 +1,24 @@
|
||||
set -l commands repl init reactor make install bump diff publish
|
||||
|
||||
complete -c elm -f
|
||||
# repl completions
|
||||
complete -c elm -n "not __fish_seen_subcommand_from $commands" -a repl -d 'Open up an interactive programming session'
|
||||
complete -c elm -n "__fish_seen_subcommand_from repl" -l no-colors -d 'Turn off the colors in REPL'
|
||||
complete -c elm -n "__fish_seen_subcommand_from repl" -l interpreter -d 'Path to an alternative JS interpreter'
|
||||
# reactor completions
|
||||
complete -c elm -n "not __fish_seen_subcommand_from $commands" -a reactor -d 'Compile code with a click'
|
||||
complete -c elm -n "__fish_seen_subcommand_from reactor" -l port -d 'Compile code with a click'
|
||||
# make completions
|
||||
complete -c elm -n "not __fish_seen_subcommand_from $commands" -a make -d 'Compiles Elm code in JS or HTML'
|
||||
complete -c elm -n "__fish_seen_subcommand_from make" -l output -F -r -d 'Specify the name of resulting JS file'
|
||||
complete -c elm -n "__fish_seen_subcommand_from make" -l debug -d 'Turn on the time-travelling debugger'
|
||||
complete -c elm -n "__fish_seen_subcommand_from make" -l optimize -d 'Turn on optimizations to make code smaller and faster'
|
||||
complete -c elm -n "__fish_seen_subcommand_from make" -l docs -d 'Generate a JSON file of documentation for a package'
|
||||
#other commands completions
|
||||
complete -c elm -n "not __fish_seen_subcommand_from $commands" -a init -d 'Start an Elm project'
|
||||
complete -c elm -n "not __fish_seen_subcommand_from $commands" -a install -d 'Fetches packages from Elm repository'
|
||||
complete -c elm -n "not __fish_seen_subcommand_from $commands" -a bump -d 'Figures out the next version number based on API changes'
|
||||
complete -c elm -n "not __fish_seen_subcommand_from $commands" -a diff -d 'See what changed in a package between different versions'
|
||||
complete -c elm -n "not __fish_seen_subcommand_from $commands" -a publish -d 'Publishes your package on package.elm-lang.org so anyone in the community can use it'
|
||||
|
||||
complete -c elm -l help -d "Show a more detailed description"
|
||||
@@ -62,7 +62,7 @@ end
|
||||
|
||||
# Get the text after all env arguments and variables, so we can complete it as a regular command
|
||||
function __fish_env_remaining_args -V is_gnu
|
||||
set -l argv (commandline -xpc) (commandline -ct)
|
||||
set -l argv (commandline -xpc | string escape) (commandline -ct)
|
||||
if set -q is_gnu[1]
|
||||
argparse -s i/ignore-environment u/unset= help version -- $argv 2>/dev/null
|
||||
or return 0
|
||||
|
||||
@@ -1,26 +1 @@
|
||||
function __fish_exercism_no_subcommand -d 'Test if exercism has yet to be given the subcommand'
|
||||
for i in (commandline -xpc)
|
||||
if contains -- $i demo debug configure fetch restore submit unsubmit tracks download help
|
||||
return 1
|
||||
end
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
complete -c exercism -s c -l config -d 'path to config file [$EXERCISM_CONFIG_FILE, $XDG_CONFIG_HOME]'
|
||||
complete -c exercism -s v -l verbose -d "turn on verbose logging"
|
||||
complete -c exercism -s h -l help -d "show help"
|
||||
complete -c exercism -s v -l version -d "print the version"
|
||||
complete -f -n __fish_exercism_no_subcommand -c exercism -a configure -d "Writes config values to a JSON file"
|
||||
complete -f -n __fish_exercism_no_subcommand -c exercism -a debug -d "Outputs useful debug information"
|
||||
complete -f -n __fish_exercism_no_subcommand -c exercism -a download -d "Downloads a solution given the ID of the latest iteration"
|
||||
complete -f -n __fish_exercism_no_subcommand -c exercism -a fetch -d "Fetches the next unsubmitted problem in each track"
|
||||
complete -f -n __fish_exercism_no_subcommand -c exercism -a list -d "Lists the available problems for a language track, given its ID"
|
||||
complete -f -n __fish_exercism_no_subcommand -c exercism -a open -d "Opens exercism.io on given problem"
|
||||
complete -f -n __fish_exercism_no_subcommand -c exercism -a restore -d "Downloads the most recent iteration for each of your solutions on exercism.io"
|
||||
complete -f -n __fish_exercism_no_subcommand -c exercism -a skip -d "Skips a problem given a track ID and problem slug"
|
||||
complete -f -n __fish_exercism_no_subcommand -c exercism -a status -d "Fetches information about your progress with a given language track"
|
||||
complete -f -n __fish_exercism_no_subcommand -c exercism -a submit -d "Submits a new iteration to a problem on exercism.io"
|
||||
complete -f -n __fish_exercism_no_subcommand -c exercism -a tracks -d "Lists the available language tracks"
|
||||
complete -f -n __fish_exercism_no_subcommand -c exercism -a upgrade -d "Upgrades the CLI to the latest released version"
|
||||
complete -f -n __fish_exercism_no_subcommand -c exercism -a help -d "show help"
|
||||
exercism completion fish | source
|
||||
|
||||
2
share/completions/fish-lsp.fish
Normal file
2
share/completions/fish-lsp.fish
Normal file
@@ -0,0 +1,2 @@
|
||||
__fish_cache_sourced_completions fish-lsp complete
|
||||
or fish-lsp complete | source
|
||||
1
share/completions/folderify.fish
Normal file
1
share/completions/folderify.fish
Normal file
@@ -0,0 +1 @@
|
||||
folderify --completions fish | source
|
||||
1
share/completions/gcloud.fish
Normal file
1
share/completions/gcloud.fish
Normal file
@@ -0,0 +1 @@
|
||||
complete -c gcloud -f -a '(__fish_argcomplete_complete gcloud)'
|
||||
@@ -16,6 +16,7 @@ complete -c gem -n __fish_use_subcommand -xa cleanup -d "Cleanup old versions of
|
||||
complete -c gem -n __fish_use_subcommand -xa contents -d "Display the contents of the installed gems"
|
||||
complete -c gem -n __fish_use_subcommand -xa dependency -d "Show the dependencies of an installed gem"
|
||||
complete -c gem -n __fish_use_subcommand -xa environment -d "Display RubyGems environmental information"
|
||||
complete -c gem -n __fish_use_subcommand -xa fetch -d "Download a gem into current directory"
|
||||
complete -c gem -n __fish_use_subcommand -xa help -d "Provide help on the 'gem' command"
|
||||
complete -c gem -n __fish_use_subcommand -xa install -d "Install a gem into the local repository"
|
||||
complete -c gem -n __fish_use_subcommand -xa list -d "Display all gems whose name starts with STRING"
|
||||
@@ -86,6 +87,9 @@ complete $dep_opt -s p -l pipe -d "Pipe Format (name --version ver)"
|
||||
set -l env_opt -c gem -n 'contains environment (commandline -pxc)'
|
||||
complete $env_opt -xa "packageversion\t'display the package version' gemdir\t'display the path where gems are installed' gempath\t'display path used to search for gems' version\t'display the gem format version' remotesources\t'display the remote gem servers'"
|
||||
|
||||
set -l fetch_opt -c gem -n 'contains fetch (commandline -pxc)'
|
||||
complete $fetch_opt -s v -l version -d "Specify version of gem to download" -x
|
||||
|
||||
##
|
||||
# help
|
||||
set -l help_opt -c gem -n 'contains help (commandline -pxc)'
|
||||
|
||||
27
share/completions/git-subtree.fish
Normal file
27
share/completions/git-subtree.fish
Normal file
@@ -0,0 +1,27 @@
|
||||
complete -f -c git -a subtree -d 'Manage git subtrees'
|
||||
# Git subtree common completions
|
||||
complete -f -c git -n '__fish_git_using_command subtree' -s q -l quiet -d 'Suppress output'
|
||||
complete -f -c git -n '__fish_git_using_command subtree' -s d -l debug -d 'Debug output'
|
||||
complete -f -c git -n '__fish_git_using_command subtree' -s P -l path -d 'Path to the subtree'
|
||||
|
||||
# Git subtree subcommands
|
||||
complete -f -c git -n '__fish_git_using_command subtree' -a add -d "Add a new subtree to the repository"
|
||||
complete -f -c git -n '__fish_git_using_command subtree' -a merge -d "Merge changes from a subtree into the repository"
|
||||
complete -f -c git -n '__fish_git_using_command subtree' -a split -d "Extract a subtree from the repository"
|
||||
complete -f -c git -n '__fish_git_using_command subtree' -a pull -d "Fetch and integrate changes from a remote subtree"
|
||||
complete -f -c git -n '__fish_git_using_command subtree' -a push -d "Push changes to a remote subtree"
|
||||
|
||||
# Completions for push and split subcommands
|
||||
complete -f -c git -n '__fish_git_using_command subtree; and __fish_seen_subcommand_from push split' -l annotate -d 'Annotate the commit'
|
||||
complete -f -c git -n '__fish_git_using_command subtree; and __fish_seen_subcommand_from push split' -s b -l branch -d 'Branch to split'
|
||||
complete -f -c git -n '__fish_git_using_command subtree; and __fish_seen_subcommand_from push split' -l ignore-joins -d 'Ignore joins during history reconstruction'
|
||||
complete -f -c git -n '__fish_git_using_command subtree; and __fish_seen_subcommand_from push split' -l onto -d 'Specify the commit ID to start history reconstruction'
|
||||
complete -f -c git -n '__fish_git_using_command subtree; and __fish_seen_subcommand_from push split' -l rejoin -d 'Merge the synthetic history back into the main project'
|
||||
complete -f -c git -n '__fish_git_using_command subtree; and __fish_seen_subcommand_from push split; and __fish_contains_opt rejoin' -l squash -d 'Merge subtree changes as a single commit'
|
||||
complete -f -c git -n '__fish_git_using_command subtree; and __fish_seen_subcommand_from push split; and __fish_contains_opt rejoin' -l no-squash -d 'Do not merge subtree changes as a single commit'
|
||||
complete -f -c git -n '__fish_git_using_command subtree; and __fish_seen_subcommand_from push split; and __fish_contains_opt rejoin' -s m -l message -d 'Use the given message as the commit message for the merge commit'
|
||||
|
||||
# Completion for add and merge subcommands
|
||||
complete -f -c git -n '__fish_git_using_command subtree; and __fish_seen_subcommand_from add merge' -l squash -d 'Merge subtree changes as a single commit'
|
||||
complete -f -c git -n '__fish_git_using_command subtree; and __fish_seen_subcommand_from add merge' -l no-squash -d 'Do not merge subtree changes as a single commit'
|
||||
complete -f -c git -n '__fish_git_using_command subtree; and __fish_seen_subcommand_from add merge' -s m -l message -d 'Use the given message as the commit message for the merge commit'
|
||||
@@ -882,9 +882,16 @@ short\t<sha1> / <author> / <title line>
|
||||
medium\t<sha1> / <author> / <author date> / <title> / <commit msg>
|
||||
full\t<sha1> / <author> / <committer> / <title> / <commit msg>
|
||||
fuller\t<sha1> / <author> / <author date> / <committer> / <committer date> / <title> / <commit msg>
|
||||
reference\t<abbrev-hash> (<title-line>, <short-author-date>)
|
||||
email\t<sha1> <date> / <author> / <author date> / <title> / <commit msg>
|
||||
mboxrd\tLike email, but lines in the commit message starting with \"From \" are quoted with \">\"
|
||||
raw\tShow the entire commit exactly as stored in the commit object
|
||||
format:\tSpecify which information to show"
|
||||
format:\tSpecify which information to show
|
||||
"
|
||||
__fish_git config -z --get-regexp '^pretty\.' 2>/dev/null | while read -lz key value
|
||||
set -l name (string replace -r '^.*?\.' '' -- $key)
|
||||
printf "%s\t%s\n" $name $value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -892,6 +899,15 @@ function __fish_git_is_rebasing
|
||||
test -e (__fish_git rev-parse --absolute-git-dir)/rebase-merge
|
||||
end
|
||||
|
||||
function __fish_git_filters
|
||||
printf "%s\n" \
|
||||
blob:none\t"omits all blobs" \
|
||||
blob:limit=\t"omits blobs by size" \
|
||||
object:type={tag,commit,tree,blob}\t"omit object which are not of the requested type" \
|
||||
sparse:oid=\t"omit blobs not required for a sparse checkout" \
|
||||
tree:\t"omits all blobs and trees"
|
||||
end
|
||||
|
||||
# general options
|
||||
complete git -f -l help -s h -d 'Display manual of a Git command'
|
||||
complete git -f -n __fish_git_needs_command -l version -s v -d 'display git version'
|
||||
@@ -1026,6 +1042,7 @@ complete -f -c git -n '__fish_git_using_command fetch' -l unshallow -d 'Convert
|
||||
complete -f -c git -n '__fish_git_using_command fetch' -l refetch -d 'Re-fetch without negotiating common commits'
|
||||
complete -f -c git -n '__fish_git_using_command fetch' -l negotiation-tip -d 'Only report commits reachable from these tips' -kxa '(__fish_git_commits; __fish_git_branches)'
|
||||
complete -f -c git -n '__fish_git_using_command fetch' -l negotiate-only -d "Don't fetch, only show commits in common with the server"
|
||||
complete -f -c git -n '__fish_git_using_command fetch' -l filter -ra '(__fish_git_filters)' -d 'Request a subset of objects from server'
|
||||
|
||||
# TODO other options
|
||||
|
||||
@@ -1340,6 +1357,7 @@ complete -f -c git -n '__fish_git_using_command clone' -s o -l origin -d 'Use a
|
||||
complete -f -c git -n '__fish_git_using_command clone' -s b -l branch -d 'Use a specific branch instead of the one used by the cloned repository'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l depth -d 'Truncate the history to a specified number of revisions'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l recursive -d 'Initialize all submodules within the cloned repository'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l filter -ra '(__fish_git_filters)' -d 'Partial clone by requesting a subset of objects from server'
|
||||
|
||||
### commit
|
||||
complete -c git -n __fish_git_needs_command -a commit -d 'Record changes to the repository'
|
||||
@@ -1588,6 +1606,7 @@ complete -c git -n '__fish_git_using_command log rev-list' -l bisect
|
||||
complete -c git -n '__fish_git_using_command log rev-list' -l stdin -d 'Read commits from stdin'
|
||||
complete -c git -n '__fish_git_using_command log rev-list' -l cherry-mark -d 'Mark equivalent commits with = and inequivalent with +'
|
||||
complete -c git -n '__fish_git_using_command log rev-list' -l cherry-pick -d 'Omit equivalent commits'
|
||||
complete -f -c git -n '__fish_git_using_command rev-list' -l filter -ra '(__fish_git_filters)' -d 'Omits objects from the list of printed objects'
|
||||
complete -c git -n '__fish_git_using_command log' -l left-only
|
||||
complete -c git -n '__fish_git_using_command log' -l right-only
|
||||
complete -c git -n '__fish_git_using_command log' -l cherry
|
||||
@@ -1791,6 +1810,8 @@ complete -f -c git -n '__fish_git_using_command merge' -l rerere-autoupdate -d '
|
||||
complete -f -c git -n '__fish_git_using_command merge' -l no-rerere-autoupdate -d 'Do not use previous conflict resolutions'
|
||||
complete -f -c git -n '__fish_git_using_command merge' -l abort -d 'Abort the current conflict resolution process'
|
||||
complete -f -c git -n '__fish_git_using_command merge' -l continue -d 'Conclude current conflict resolution process'
|
||||
complete -f -c git -n '__fish_git_using_command merge' -l autostash -d 'Before starting merge, stash local changes, and apply stash when done'
|
||||
complete -f -c git -n '__fish_git_using_command merge' -l no-autostash -d 'Do not stash local changes before starting merge'
|
||||
|
||||
### merge-base
|
||||
complete -f -c git -n __fish_git_needs_command -a merge-base -d 'Find a common ancestor for a merge'
|
||||
@@ -2271,6 +2292,7 @@ complete -f -c git -n '__fish_git_using_command submodule' -n '__fish_seen_subco
|
||||
complete -f -c git -n '__fish_git_using_command submodule' -n '__fish_seen_subcommand_from update' -s N -l no-fetch -d "Don't fetch new objects from the remote"
|
||||
complete -f -c git -n '__fish_git_using_command submodule' -n '__fish_seen_subcommand_from update' -l remote -d "Instead of using superproject's SHA-1, use the state of the submodule's remote-tracking branch"
|
||||
complete -f -c git -n '__fish_git_using_command submodule' -n '__fish_seen_subcommand_from update' -l force -d "Discard local changes when switching to a different commit & always run checkout"
|
||||
complete -f -c git -n '__fish_git_using_command submodule' -n '__fish_seen_subcommand_from update' -l filter -ra '(__fish_git_filters)' -d 'Request a subset of objects from server'
|
||||
complete -f -c git -n '__fish_git_using_command submodule' -n '__fish_seen_subcommand_from add' -l force -d "Also add ignored submodule path"
|
||||
complete -f -c git -n '__fish_git_using_command submodule' -n '__fish_seen_subcommand_from deinit' -l force -d "Remove even with local changes"
|
||||
complete -f -c git -n '__fish_git_using_command submodule' -n '__fish_seen_subcommand_from deinit' -l all -d "Remove all submodules"
|
||||
@@ -2562,11 +2584,11 @@ complete -c git -n __fish_git_needs_command -a '(__fish_git_custom_commands)' -d
|
||||
function __fish_git_complete_custom_command -a subcommand
|
||||
set -l cmd (commandline -xpc)
|
||||
set -e cmd[1] # Drop "git".
|
||||
set -lx subcommand_args
|
||||
set -l subcommand_args
|
||||
if argparse -s (__fish_git_global_optspecs) -- $cmd
|
||||
set subcommand_args $argv[2..] # Drop the subcommand.
|
||||
set subcommand_args (string escape -- $argv[2..]) # Drop the subcommand.
|
||||
end
|
||||
complete -C "git-$subcommand \$subcommand_args "(commandline -ct)
|
||||
complete -C "git-$subcommand $subcommand_args "(commandline -ct)
|
||||
end
|
||||
|
||||
# source git-* commands' autocompletion file if exists
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
complete -c gprof -s A -l annoted-source -d "Print annotated source"
|
||||
complete -c gprof -s A -l annotated-source -d "Print annotated source"
|
||||
complete -c gprof -s b -l brief -d "Do not print explanations"
|
||||
complete -c gprof -s C -l exec-counts -d "Print tally"
|
||||
complete -c gprof -s i -l file-info -d "Display summary"
|
||||
|
||||
1
share/completions/gsutil.fish
Normal file
1
share/completions/gsutil.fish
Normal file
@@ -0,0 +1 @@
|
||||
complete -c gsutil -f -a '(__fish_argcomplete_complete gsutil)'
|
||||
@@ -15,7 +15,7 @@ complete -c htop -l readonly -d 'Disable all system and process changing feature
|
||||
complete -c htop -l version -s V -d 'Show version and exit'
|
||||
complete -c htop -l tree -s t -d 'Show processes in tree view'
|
||||
complete -c htop -l highlight-changes -s H -d 'Highlight new and old processes' -x
|
||||
complete -c htop -l drop-capabilites -d 'Drop unneeded Linux capabilites (Requires libpcap support)' -xka "
|
||||
complete -c htop -l drop-capabilities -d 'Drop unneeded Linux capabilities (Requires libpcap support)' -xka "
|
||||
off
|
||||
basic
|
||||
strict
|
||||
|
||||
@@ -14,7 +14,7 @@ set -l ip_all_commands $ip_commands $ip_addr $ip_link $ip_neigh $ip_route $ip_ru
|
||||
|
||||
function __fish_ip_commandwords
|
||||
set -l skip 0
|
||||
set -l cmd (commandline -xpc)
|
||||
set -l cmd (commandline -xpc | string escape)
|
||||
# Remove the first word because it's "ip" or an alias for it
|
||||
set -e cmd[1]
|
||||
set -l have_command 0
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
jj util completion fish | source
|
||||
# The reason for `__this-command-does-not-exist` is that, if dynamic completion
|
||||
# is not implemented, we'd like to get an error reliably. However, the
|
||||
# behavior of `jj` without arguments depends on the value of a config, see
|
||||
# https://jj-vcs.github.io/jj/latest/config/#default-command
|
||||
if set -l completion (COMPLETE=fish jj __this-command-does-not-exist 2>/dev/null)
|
||||
# jj is new enough for dynamic completions to be implemented
|
||||
printf %s\n $completion | source
|
||||
else
|
||||
jj util completion fish | source
|
||||
end
|
||||
|
||||
20
share/completions/lazygit.fish
Normal file
20
share/completions/lazygit.fish
Normal file
@@ -0,0 +1,20 @@
|
||||
complete -c lazygit -xa "status branch log stash"
|
||||
complete -c lazygit -s h -l help -d 'Display help'
|
||||
complete -c lazygit -s v -l version -d 'Print version'
|
||||
complete -c lazygit -s p -l path -d 'Path of git repo' -xa "(__fish_complete_directories)"
|
||||
|
||||
# Config
|
||||
complete -c lazygit -s c -l config -d 'Print the default config'
|
||||
complete -c lazygit -o cd -l print-config-dir -d 'Print the config directory'
|
||||
complete -c lazygit -o ucd -l use-config-dir -d 'Override default config directory with provided directory' -r
|
||||
complete -c lazygit -o ucf -l use-config-file -d 'Comma separated list to custom config file(s)' -r
|
||||
|
||||
# Git
|
||||
complete -c lazygit -s f -l filter -d 'Path to filter on in `git log -- <path>`' -r
|
||||
complete -c lazygit -s g -l git-dir -d 'Equivalent of the --git-dir git argument' -r
|
||||
complete -c lazygit -s w -l work-tree -d 'Equivalent of the --work-tree git argument' -xa "(__fish_complete_directories)"
|
||||
|
||||
# Debug
|
||||
complete -c lazygit -s d -l debug -d 'Run in debug mode with logging'
|
||||
complete -c lazygit -s l -l logs -d 'Tail lazygit logs; used with --debug'
|
||||
complete -c lazygit -l profile -d 'Start the profiler and serve it on http port 6060'
|
||||
@@ -1,10 +1,13 @@
|
||||
complete -c md5sum -d "Compute and check message digest" -r
|
||||
complete -c md5sum -s b -l binary -d 'Read in binary mode'
|
||||
complete -c md5sum -s c -l check -d "Read sums from files and check them"
|
||||
complete -c md5sum -s t -l text -d 'Read in text mode'
|
||||
complete -c md5sum -l quiet -d 'Don''t print OK for each successfully verified file'
|
||||
complete -c md5sum -l status -d 'Don''t output anything, status code shows success'
|
||||
complete -c md5sum -s w -l warn -d 'Warn about improperly formatted checksum lines'
|
||||
complete -c md5sum -l tag -d 'Create a BSD-style checksum'
|
||||
complete -c md5sum -s t -l text -d 'Read in text mode (default)'
|
||||
complete -c md5sum -s z -l zero -d 'End each output line with NUL, not newline, and disable file name escaping'
|
||||
complete -c md5sum -l ignore-missing -d 'Don\'t fail or report status for missing files'
|
||||
complete -c md5sum -l quiet -d 'Don\'t print OK for each successfully verified file'
|
||||
complete -c md5sum -l status -d 'Don\'t output anything, status code shows success'
|
||||
complete -c md5sum -l strict -d 'With --check, exit non-zero for any invalid input'
|
||||
complete -c md5sum -s w -l warn -d 'Warn about improperly formatted checksum lines'
|
||||
complete -c md5sum -l help -d 'Display help text'
|
||||
complete -c md5sum -l version -d 'Output version information and exit'
|
||||
|
||||
@@ -141,7 +141,8 @@ complete -f -c npm -n '__fish_npm_using_command cache' -s h -l help -d 'Display
|
||||
# install-ci-test
|
||||
complete -f -c npm -n __fish_npm_needs_command -a 'ci clean-install' -d 'Clean install a project'
|
||||
complete -f -c npm -n __fish_npm_needs_command -a 'install-ci-test cit' -d 'Install a project with a clean slate and run tests'
|
||||
for c in ci clean-install ic install-clean install-clean install-ci-test cit clean-install-test sit
|
||||
# typos are intentional
|
||||
for c in ci clean-install ic install-clean isntall-clean install-ci-test cit clean-install-test sit
|
||||
complete -x -c npm -n "__fish_npm_using_command $c" -l install-strategy -a 'hoisted nested shallow linked' -d 'Install strategy'
|
||||
complete -x -c npm -n "__fish_npm_using_command $c" -l omit -a 'dev optional peer' -d 'Omit dependency type'
|
||||
complete -x -c npm -n "__fish_npm_using_command $c" -l strict-peer-deps -d 'Treat conflicting peerDependencies as failure'
|
||||
@@ -406,7 +407,8 @@ end
|
||||
complete -c npm -n __fish_npm_needs_command -a 'install add i' -d 'Install a package'
|
||||
complete -f -c npm -n __fish_npm_needs_command -a 'install-test it' -d 'Install package(s) and run tests'
|
||||
complete -f -c npm -n __fish_npm_needs_command -a 'link ln' -d 'Symlink a package folder'
|
||||
for c in install add i in ins inst insta instal isnt isnta isntal install install-test it link ln
|
||||
# typos are intentional
|
||||
for c in install add i in ins inst insta instal isnt isnta isntal isntall install-test it link ln
|
||||
complete -f -c npm -n "__fish_npm_using_command $c" -s S -l save -d 'Save to dependencies'
|
||||
complete -f -c npm -n "__fish_npm_using_command $c" -l no-save -d 'Prevents saving to dependencies'
|
||||
complete -f -c npm -n "__fish_npm_using_command $c" -s P -l save-prod -d 'Save to dependencies'
|
||||
@@ -726,4 +728,4 @@ complete -f -c npm -n '__fish_npm_using_command whoami' -a registry -d 'Check re
|
||||
complete -f -c npm -n '__fish_npm_using_command whoami' -s h -l help -d 'Display help'
|
||||
|
||||
# misc
|
||||
complete -f -c npm -n '__fish_seen_subcommand_from add i in ins inst insta instal isnt isnta isntal install; and not __fish_is_switch' -a "(__npm_filtered_list_packages \"$npm_install\")"
|
||||
complete -f -c npm -n '__fish_seen_subcommand_from add i in ins inst insta instal isnt isnta isntal isntall; and not __fish_is_switch' -a "(__npm_filtered_list_packages \"$npm_install\")"
|
||||
|
||||
@@ -169,7 +169,7 @@ complete -c pkg -n '__fish_pkg_is list' -xa '(pkg query "%n")'
|
||||
complete -c pkg -n '__fish_pkg_is add update' -s f -l force -d "Force a full download of a repository"
|
||||
|
||||
# alias
|
||||
set -l with_packge_names all-depends annotations build-depends cinfo comment csearch desc iinfo isearch \
|
||||
set -l with_package_names all-depends annotations build-depends cinfo comment csearch desc iinfo isearch \
|
||||
list options origin provided-depends roptions shared-depends show size
|
||||
|
||||
for alias in (pkg alias -lq)
|
||||
|
||||
@@ -16,12 +16,12 @@ complete -c pygmentize -s o -d "Set output file"
|
||||
complete -c pygmentize -s s -d "Read one line at a time"
|
||||
complete -c pygmentize -s l -d "Set lexer" -x -a "(__fish_print_pygmentize lexers Lexer)"
|
||||
complete -c pygmentize -s g -d "Guess lexer"
|
||||
complete -c pygmentize -s f -d "Set formater" -x -a "(__fish_print_pygmentize formaters Formater)"
|
||||
complete -c pygmentize -s O -d "Set coma-seperated options" -x
|
||||
complete -c pygmentize -s f -d "Set formatter" -x -a "(__fish_print_pygmentize formatters Formatter)"
|
||||
complete -c pygmentize -s O -d "Set coma-separated options" -x
|
||||
complete -c pygmentize -s P -d "Set one option" -x
|
||||
complete -c pygmentize -s F -d "Set filter" -x -a "(__fish_print_pygmentize filters Filter)"
|
||||
complete -c pygmentize -s S -d "Print style definition for given style" -x -a "(__fish_print_pygmentize styles Style)"
|
||||
complete -c pygmentize -s L -d "List lexers, formaters, styles or filters" -x -a "lexers formaters styles filters"
|
||||
complete -c pygmentize -s L -d "List lexers, formatters, styles or filters" -x -a "lexers formatters styles filters"
|
||||
complete -c pygmentize -s N -d "Guess and print lexer name based on given file"
|
||||
complete -c pygmentize -s H -d "Print detailed help" -x -a "lexer formatter filter"
|
||||
complete -c pygmentize -s v -d "Print detailed traceback on unhandled exceptions"
|
||||
|
||||
@@ -1,23 +1,42 @@
|
||||
complete -c python -s B -d 'Don\'t write .py[co] files on import'
|
||||
complete -c python -s c -x -d "Execute argument as command"
|
||||
complete -c python -l check-hash-based-pycs -a "default always never" -d "Control validation behaviour of pyc files"
|
||||
complete -c python -s d -d "Debug on"
|
||||
complete -c python -s E -d "Ignore all PYTHON* env vars"
|
||||
complete -c python -s h -s '?' -l help -d "Display help and exit"
|
||||
complete -c python -s i -d "Interactive mode after executing commands"
|
||||
complete -c python -s m -d 'Run library module as a script (terminates option list)' -xa '(python -c "import pkgutil; print(\'\n\'.join([p[1] for p in pkgutil.iter_modules()]))")'
|
||||
complete -c python -s O -d "Enable optimizations"
|
||||
complete -c python -o OO -d "Remove doc-strings in addition to the -O optimizations"
|
||||
complete -c python -s s -d 'Don\'t add user site directory to sys.path'
|
||||
complete -c python -s S -d "Disable import of site module"
|
||||
complete -c python -s u -d "Unbuffered input and output"
|
||||
complete -c python -s v -d "Verbose mode"
|
||||
complete -c python -o vv -d "Even more verbose mode"
|
||||
complete -c python -s V -l version -d "Display version and exit"
|
||||
complete -c python -s W -x -d "Warning control" -a "ignore default all module once error"
|
||||
complete -c python -s x -d 'Skip first line of source, allowing use of non-Unix forms of #!cmd'
|
||||
complete -c python -f -n "__fish_is_nth_token 1" -k -a "(__fish_complete_suffix .py)"
|
||||
complete -c python -f -n "__fish_is_nth_token 1" -a - -d 'Read program from stdin'
|
||||
# This function adjusts for options with arguments (-X, -W, etc.), ensures completions stop when a script/module is set (-c, -m, file, -)
|
||||
function __fish_python_no_arg
|
||||
set -l num 1
|
||||
set -l tokens (commandline -pxc)
|
||||
set -l has_arg_list -X -W --check-hash-based-pycs
|
||||
if contains -- - $tokens
|
||||
set num (math $num - 1)
|
||||
end
|
||||
for has_arg in $has_arg_list
|
||||
if contains -- $has_arg $tokens
|
||||
set num (math $num + 1)
|
||||
end
|
||||
end
|
||||
if test (__fish_number_of_cmd_args_wo_opts) -gt $num
|
||||
return 1
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
complete -c python -n __fish_python_no_arg -s B -d 'Don\'t write .py[co] files on import'
|
||||
complete -c python -n __fish_python_no_arg -s c -x -d "Execute argument as command"
|
||||
complete -c python -n __fish_python_no_arg -l check-hash-based-pycs -a "default always never" -d "Control validation behaviour of pyc files"
|
||||
complete -c python -n __fish_python_no_arg -s d -d "Debug on"
|
||||
complete -c python -n __fish_python_no_arg -s E -d "Ignore all PYTHON* env vars"
|
||||
complete -c python -n __fish_python_no_arg -s h -s '?' -l help -d "Display help and exit"
|
||||
complete -c python -n __fish_python_no_arg -s i -d "Interactive mode after executing commands"
|
||||
complete -c python -n __fish_python_no_arg -s m -d 'Run library module as a script (terminates option list)' -xa '(python -c "import pkgutil; print(\'\n\'.join([p[1] for p in pkgutil.iter_modules()]))")'
|
||||
complete -c python -n __fish_python_no_arg -s O -d "Enable optimizations"
|
||||
complete -c python -n __fish_python_no_arg -o OO -d "Remove doc-strings in addition to the -O optimizations"
|
||||
complete -c python -n __fish_python_no_arg -s s -d 'Don\'t add user site directory to sys.path'
|
||||
complete -c python -n __fish_python_no_arg -s S -d "Disable import of site module"
|
||||
complete -c python -n __fish_python_no_arg -s u -d "Unbuffered input and output"
|
||||
complete -c python -n __fish_python_no_arg -s v -d "Verbose mode"
|
||||
complete -c python -n __fish_python_no_arg -o vv -d "Even more verbose mode"
|
||||
complete -c python -n __fish_python_no_arg -s V -l version -d "Display version and exit"
|
||||
complete -c python -n __fish_python_no_arg -s W -x -d "Warning control" -a "ignore default all module once error"
|
||||
complete -c python -n __fish_python_no_arg -s x -d 'Skip first line of source, allowing use of non-Unix forms of #!cmd'
|
||||
complete -c python -n __fish_python_no_arg -f -k -a "(__fish_complete_suffix .py)"
|
||||
complete -c python -n __fish_python_no_arg -f -a - -d 'Read program from stdin'
|
||||
|
||||
# Version-specific completions
|
||||
# We have to detect this at runtime because pyenv etc can change
|
||||
@@ -25,10 +44,10 @@ complete -c python -f -n "__fish_is_nth_token 1" -a - -d 'Read program from stdi
|
||||
complete -c python -n 'python -V 2>&1 | string match -rq "^.*\s2"' -s 3 -d 'Warn about Python 3.x incompatibilities that 2to3 cannot trivially fix'
|
||||
complete -c python -n 'python -V 2>&1 | string match -rq "^.*\s2"' -s t -d "Warn on mixed tabs and spaces"
|
||||
complete -c python -n 'python -V 2>&1 | string match -rq "^.*\s2"' -s Q -x -a "old new warn warnall" -d "Division control"
|
||||
complete -c python -n 'python -V 2>&1 | string match -rq "^.*\s3"' -s q -d 'Don\'t print version and copyright messages on interactive startup'
|
||||
complete -c python -n 'python -V 2>&1 | string match -rq "^.*\s3"' -s X -x -d 'Set implementation-specific option'
|
||||
complete -c python -n 'python -V 2>&1 | string match -rq "^.*\s3"' -s b -d 'Warn when comparing bytes with str or int'
|
||||
complete -c python -n 'python -V 2>&1 | string match -rq "^.*\s3"' -o bb -d 'Error when comparing bytes with str or int'
|
||||
complete -c python -n 'python -V 2>&1 | string match -rq "^.*\s3"' -s R -d 'Turn on hash randomization'
|
||||
complete -c python -n 'python -V 2>&1 | string match -rq "^.*\s3"' -s I -d 'Run in isolated mode'
|
||||
complete -c python -n 'python -V 2>&1 | string match -rq "^.*\s3"' -o VV -d 'Print further version info'
|
||||
complete -c python -n 'python -V 2>&1 | string match -rq "^.*\s3" && __fish_python_no_arg' -s q -d 'Don\'t print version and copyright messages on interactive startup'
|
||||
complete -c python -n 'python -V 2>&1 | string match -rq "^.*\s3" && __fish_python_no_arg' -s X -x -d 'Set implementation-specific option'
|
||||
complete -c python -n 'python -V 2>&1 | string match -rq "^.*\s3" && __fish_python_no_arg' -s b -d 'Warn when comparing bytes with str or int'
|
||||
complete -c python -n 'python -V 2>&1 | string match -rq "^.*\s3" && __fish_python_no_arg' -o bb -d 'Error when comparing bytes with str or int'
|
||||
complete -c python -n 'python -V 2>&1 | string match -rq "^.*\s3" && __fish_python_no_arg' -s R -d 'Turn on hash randomization'
|
||||
complete -c python -n 'python -V 2>&1 | string match -rq "^.*\s3" && __fish_python_no_arg' -s I -d 'Run in isolated mode'
|
||||
complete -c python -n 'python -V 2>&1 | string match -rq "^.*\s3" && __fish_python_no_arg' -o VV -d 'Print further version info'
|
||||
|
||||
@@ -1,24 +1,43 @@
|
||||
complete -c python3 -s B -d 'Don\'t write .py[co] files on import'
|
||||
complete -c python3 -s c -x -d "Execute argument as command"
|
||||
complete -c python3 -s d -d "Debug on"
|
||||
complete -c python3 -s E -d "Ignore environment variables"
|
||||
complete -c python3 -s h -s '?' -l help -d "Display help and exit"
|
||||
complete -c python3 -s i -d "Interactive mode after executing commands"
|
||||
complete -c python3 -s O -d "Enable optimizations"
|
||||
complete -c python3 -o OO -d "Remove doc-strings in addition to the -O optimizations"
|
||||
complete -c python3 -s s -d 'Don\'t add user site directory to sys.path'
|
||||
complete -c python3 -s S -d "Disable import of site module"
|
||||
complete -c python3 -s u -d "Unbuffered input and output"
|
||||
complete -c python3 -s v -d "Verbose mode"
|
||||
complete -c python3 -s V -l version -d "Display version and exit"
|
||||
complete -c python3 -s W -x -d "Warning control" -a "ignore default all module once error"
|
||||
complete -c python3 -s x -d 'Skip first line of source, allowing use of non-Unix forms of #!cmd'
|
||||
complete -c python3 -n "__fish_is_nth_token 1" -k -fa "(__fish_complete_suffix .py)"
|
||||
complete -c python3 -f -n "__fish_is_nth_token 1" -a - -d 'Read program from stdin'
|
||||
complete -c python3 -s q -d 'Don\'t print version and copyright messages on interactive startup'
|
||||
complete -c python3 -s X -x -d 'Set implementation-specific option' -a 'faulthandler showrefcount tracemalloc showalloccount importtime dev utf8 pycache_prefex=PATH:'
|
||||
complete -c python3 -s b -d 'Issue warnings for possible misuse of `bytes` with `str`'
|
||||
complete -c python3 -o bb -d 'Issue errors for possible misuse of `bytes` with `str`'
|
||||
complete -c python3 -s m -d 'Run library module as a script (terminates option list)' -xa '(python3 -c "import pkgutil; print(\'\n\'.join([p[1] for p in pkgutil.iter_modules()]))")'
|
||||
complete -c python3 -l check-hash-based-pycs -d 'Set pyc hash check mode' -xa "default always never"
|
||||
complete -c python3 -s I -d 'Run in isolated mode'
|
||||
# This function adjusts for options with arguments (-X, -W, etc.), ensures completions stop when a script/module is set (-c, -m, file, -)
|
||||
function __fish_python_no_arg
|
||||
set -l num 1
|
||||
set -l tokens (commandline -pxc)
|
||||
set -l has_arg_list -X -W --check-hash-based-pycs
|
||||
if contains -- - $tokens
|
||||
set num (math $num - 1)
|
||||
end
|
||||
for has_arg in $has_arg_list
|
||||
if contains -- $has_arg $tokens
|
||||
set num (math $num + 1)
|
||||
end
|
||||
end
|
||||
if test (__fish_number_of_cmd_args_wo_opts) -gt $num
|
||||
return 1
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
complete -c python3 -n __fish_python_no_arg -s B -d 'Don\'t write .py[co] files on import'
|
||||
complete -c python3 -n __fish_python_no_arg -s c -x -d "Execute argument as command"
|
||||
complete -c python3 -n __fish_python_no_arg -s d -d "Debug on"
|
||||
complete -c python3 -n __fish_python_no_arg -s E -d "Ignore environment variables"
|
||||
complete -c python3 -n __fish_python_no_arg -s h -s '?' -l help -d "Display help and exit"
|
||||
complete -c python3 -n __fish_python_no_arg -s i -d "Interactive mode after executing commands"
|
||||
complete -c python3 -n __fish_python_no_arg -s O -d "Enable optimizations"
|
||||
complete -c python3 -n __fish_python_no_arg -o OO -d "Remove doc-strings in addition to the -O optimizations"
|
||||
complete -c python3 -n __fish_python_no_arg -s s -d 'Don\'t add user site directory to sys.path'
|
||||
complete -c python3 -n __fish_python_no_arg -s S -d "Disable import of site module"
|
||||
complete -c python3 -n __fish_python_no_arg -s u -d "Unbuffered input and output"
|
||||
complete -c python3 -n __fish_python_no_arg -s v -d "Verbose mode"
|
||||
complete -c python3 -n __fish_python_no_arg -s V -l version -d "Display version and exit"
|
||||
complete -c python3 -n __fish_python_no_arg -s W -x -d "Warning control" -a "ignore default all module once error"
|
||||
complete -c python3 -n __fish_python_no_arg -s x -d 'Skip first line of source, allowing use of non-Unix forms of #!cmd'
|
||||
complete -c python3 -n __fish_python_no_arg -k -fa "(__fish_complete_suffix .py)"
|
||||
complete -c python3 -n __fish_python_no_arg -fa - -d 'Read program from stdin'
|
||||
complete -c python3 -n __fish_python_no_arg -s q -d 'Don\'t print version and copyright messages on interactive startup'
|
||||
complete -c python3 -n __fish_python_no_arg -s X -x -d 'Set implementation-specific option' -a 'faulthandler showrefcount tracemalloc showalloccount importtime dev utf8 pycache_prefix=PATH:'
|
||||
complete -c python3 -n __fish_python_no_arg -s b -d 'Issue warnings for possible misuse of `bytes` with `str`'
|
||||
complete -c python3 -n __fish_python_no_arg -o bb -d 'Issue errors for possible misuse of `bytes` with `str`'
|
||||
complete -c python3 -n __fish_python_no_arg -s m -d 'Run library module as a script (terminates option list)' -xa '(python3 -c "import pkgutil; print(\'\n\'.join([p[1] for p in pkgutil.iter_modules()]))")'
|
||||
complete -c python3 -n __fish_python_no_arg -l check-hash-based-pycs -d 'Set pyc hash check mode' -xa "default always never"
|
||||
complete -c python3 -n __fish_python_no_arg -s I -d 'Run in isolated mode'
|
||||
|
||||
@@ -18,6 +18,7 @@ end
|
||||
|
||||
function __resolvectl_commands
|
||||
printf "%b\n" "query\tResolve domain names or IP addresses" \
|
||||
"query\tResolve domain names, IPv4 and IPv6 addresses" \
|
||||
"service\tResolve service records" \
|
||||
"openpgp\tQuery PGP keys for email" \
|
||||
"tlsa\tQuery TLS public keys" \
|
||||
@@ -26,6 +27,9 @@ function __resolvectl_commands
|
||||
"reset-statistics\tReset statistics counters" \
|
||||
"flush-caches\tFlush DNS RR caches" \
|
||||
"reset-server-features\tFlushe all feature level information" \
|
||||
"monitor\tMonitor DNS queries" \
|
||||
"show-cache\tShow cache contents" \
|
||||
"show-server-state\tShow server state" \
|
||||
"dns\tSet per-interface DNS servers" \
|
||||
"domain\tSet per-interface search or routing domains" \
|
||||
"default-route\tSet per-interface default route flag" \
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
#
|
||||
# Completion for run0
|
||||
#
|
||||
function __run0_slice
|
||||
systemctl -t slice --no-legend --no-pager --plain | string split -nf 1 ' '
|
||||
systemctl -t slice --user --no-legend --no-pager --plain | string split -nf 1 ' '
|
||||
end
|
||||
|
||||
complete -c run0 -l no-ask-password -d 'Do not query the user for authentication for privileged operations'
|
||||
complete -c run0 -l unit -d 'Use this unit name instead of an automatically generated one'
|
||||
complete -c run0 -l property -d 'Sets a property on the service unit that is created'
|
||||
complete -c run0 -l description -d 'Provide a description for the service unit that is invoked'
|
||||
complete -c run0 -l slice -d 'Make the new .service unit part of the specified slice, instead of user.slice.'
|
||||
complete -c run0 -l slice-inherit -d 'Make the new .service unit part of the slice the run0 itself has been invoked in'
|
||||
complete -c run0 -s u -l user -a "(__fish_complete_users)" -x -d "Switches to the specified user instead of root"
|
||||
complete -c run0 -s g -l group -a "(__fish_complete_groups)" -x -d "Switches to the specified group instead of root"
|
||||
complete -c run0 -l nice -d 'Runs the invoked session with the specified nice level'
|
||||
complete -c run0 -s D -l chdir -d 'Runs the invoked session with the specified working directory'
|
||||
complete -c run0 -l setenv -d 'Runs the invoked session with the specified environment variable set'
|
||||
complete -c run0 -l background -d 'Change the terminal background color to the specified ANSI color'
|
||||
complete -c run0 -l machine -d 'Execute operation on a local container'
|
||||
complete -c run0 -s h -l help -d 'Print a short help text and exit'
|
||||
complete -c run0 -l version -d 'Print a short version string and exit'
|
||||
|
||||
complete -c run0 -x -a '(__fish_complete_subcommand)'
|
||||
complete -c run0 -xa "(__fish_complete_subcommand)"
|
||||
complete -c run0 -s h -l help -d "Show help"
|
||||
complete -c run0 -s V -l version -d "Show version"
|
||||
complete -c run0 -s u -l user -d "Switches to the specified user instead of root" -xa "(__fish_complete_users)"
|
||||
complete -c run0 -s g -l group -d "Switches to the specified group instead of root" -xa "(__fish_complete_groups)"
|
||||
complete -c run0 -l no-ask-password -d "Do not query the user for authentication for privileged operations"
|
||||
complete -c run0 -l machine -d "Execute operation on a local container" -xa "(machinectl list --no-legend --no-pager | string split -f 1 ' ')"
|
||||
complete -c run0 -l property -d "Sets a property on the service unit that is created" -x
|
||||
complete -c run0 -l description -d "Description for unit" -x
|
||||
complete -c run0 -l slice -d "Make the new .service unit part of the specified slice, instead of user.slice." -xa "(__run0_slice)"
|
||||
complete -c run0 -l slice-inherit -d "Make the new .service unit part of the slice the run0 itself has been invoked in"
|
||||
complete -c run0 -l nice -d "Runs the invoked session with the specified nice level" -xa "(seq -20 19)"
|
||||
complete -c run0 -s D -l chdir -d "Set working directory" -xa "(__fish_complete_directories)"
|
||||
complete -c run0 -l setenv -d "Runs the invoked session with the specified environment variable set" -x
|
||||
complete -c run0 -l background -d "Change the terminal background color to the specified ANSI color" -x
|
||||
complete -c run0 -l pty -d "Request allocation of a pseudo TTY for stdio"
|
||||
complete -c run0 -l pipe -d "Request redirect pipe for stdio"
|
||||
complete -c run0 -l shell-prompt-prefix -d "Set a shell prompt prefix string" -x
|
||||
|
||||
@@ -1,5 +1,31 @@
|
||||
# Note that when a completion file is sourced a new block scope is created so `set -l` works.
|
||||
set -l __fish_status_all_commands basename current-command current-commandline current-filename current-function current-line-number dirname features filename fish-path function is-block is-breakpoint is-command-substitution is-full-job-control is-interactive is-interactive-job-control is-login is-no-job-control job-control line-number print-stack-trace stack-trace test-feature
|
||||
set -l __fish_status_all_commands \
|
||||
basename \
|
||||
buildinfo \
|
||||
current-command \
|
||||
current-commandline \
|
||||
current-filename \
|
||||
current-function \
|
||||
current-line-number \
|
||||
dirname \
|
||||
features \
|
||||
filename \
|
||||
fish-path \
|
||||
function \
|
||||
is-block \
|
||||
is-breakpoint \
|
||||
is-command-substitution \
|
||||
is-full-job-control \
|
||||
is-interactive \
|
||||
is-interactive-job-control \
|
||||
is-interactive-read \
|
||||
is-login \
|
||||
is-no-job-control \
|
||||
job-control \
|
||||
line-number \
|
||||
print-stack-trace \
|
||||
stack-trace \
|
||||
test-feature
|
||||
|
||||
# These are the recognized flags.
|
||||
complete -c status -s h -l help -d "Display help and exit"
|
||||
@@ -7,6 +33,7 @@ complete -c status -s h -l help -d "Display help and exit"
|
||||
# The "is-something" subcommands.
|
||||
complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a is-login -d "Test if this is a login shell"
|
||||
complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a is-interactive -d "Test if this is an interactive shell"
|
||||
complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a is-interactive-read -d "Test if inside an interactive read builtin"
|
||||
complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a is-command-substitution -d "Test if a command substitution is currently evaluated"
|
||||
complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a is-block -d "Test if a code block is currently evaluated"
|
||||
complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a is-breakpoint -d "Test if a breakpoint is currently in effect"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
function __fish_sudo_print_remaining_args
|
||||
set -l tokens (commandline -xpc) (commandline -ct)
|
||||
set -l tokens (commandline -xpc | string escape) (commandline -ct)
|
||||
set -e tokens[1]
|
||||
# These are all the options mentioned in the man page for Todd Miller's "sudo.ws" sudo (in that order).
|
||||
# If any other implementation has different options, this should be harmless, since they shouldn't be used anyway.
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
function __fish_complete_svn_diff --description 'Complete "svn diff" arguments'
|
||||
set -l cmdl (commandline -cxp)
|
||||
#set -l cmdl svn diff --diff-cmd diff --extensions '-a -b'
|
||||
set -l cmdl (commandline -cxp | string escape)
|
||||
set -l diff diff
|
||||
set -l args
|
||||
while set -q cmdl[1]
|
||||
|
||||
@@ -16,9 +16,18 @@ complete -c systemd-analyze -l to-pattern -d 'dot: show relationships matching r
|
||||
complete -c systemd-analyze -l fuzz -x -d 'critical-chain: also show units which finished timespan earlier than last unit in same level'
|
||||
complete -c systemd-analyze -l man -xa no -d 'Do not invoke man to verify the existence of man pages'
|
||||
complete -c systemd-analyze -l generators -d 'Invoke unit generators'
|
||||
complete -c systemd-analyze -l instance -r -d 'Fallback instance name for template units'
|
||||
complete -c systemd-analyze -l root -xa "(__fish_complete_directories)" -d 'With cat-files, show config files underneath the specified root path'
|
||||
complete -c systemd-analyze -l image -r -d 'With cat-files, show config files inside the specified image path'
|
||||
complete -c systemd-analyze -l image-policy -d 'Disk image dissection policy'
|
||||
complete -c systemd-analyze -l iterations -x -d 'calendar: show number of iterations the calendar expression will elapse next'
|
||||
complete -c systemd-analyze -l base-time -x -d 'calendar: show next iterations relative to the specified point in time'
|
||||
complete -c systemd-analyze -l tldr -d 'cat-config: skip comments, empty lines and section headers'
|
||||
complete -c systemd-analyze -l unit -r -d "condition: evaluate Condition and Assert assignments in unit file"
|
||||
complete -c systemd-analyze -l table -d 'plot: output raw time data in a table'
|
||||
complete -c systemd-analyze -l no-legend -d 'plot: exclude legends/hints'
|
||||
complete -c systemd-analyze -l detailed -d "plot: show activation timestamps details in SVG plot"
|
||||
complete -c systemd-analyze -l scale-svg -r -d "plot: stretch the x-axis of the plot"
|
||||
complete -c systemd-analyze -s H -l host -xa "(__fish_complete_user_at_hosts)" -d 'Execute the operation on a remote host'
|
||||
complete -c systemd-analyze -s M -l machine -xa "(__fish_systemd_machines)" -d 'Execute operation on a VM or container'
|
||||
complete -c systemd-analyze -s h -l help -d 'Print a short help and exit'
|
||||
@@ -34,6 +43,7 @@ complete -c systemd-analyze -n __fish_use_subcommand -a critical-chain -d "Print
|
||||
complete -c systemd-analyze -n "__fish_seen_subcommand_from critical-chain" -a "(__fish_systemd_units)"
|
||||
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a dump -d "Output serialization of server state"
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a malloc -d "Output internal memory state of D-Bus service"
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a plot -d "Output SVG graphic showing service initialization"
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a dot -d "Output dependency graph in dot(1) format"
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a unit-paths -d "List all directories from which unit files may be loaded"
|
||||
@@ -41,15 +51,25 @@ complete -c systemd-analyze -n __fish_use_subcommand -a exit-status -d "List exi
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a capability -d "List Linux capabilities along with their numeric IDs"
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a condition -d "Evaluate Condition and Assert assignments"
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a syscall-filter -d "List system calls contained in the specified system call set"
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a filesystems -d "List filesystems"
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a calendar -d "Normalize repetitive calendar events and calculate when they elapse next"
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a timestamp -d "Parse timestamp and output the normalized form"
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a timestamp -d "Parse time span and output the normalized form"
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a timespan -d "Parse time span and output the normalized form"
|
||||
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a cat-config -d "Show contents of a config file"
|
||||
complete -c systemd-analyze -n "__fish_seen_subcommand_from cat-config" -F
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a compare-versions -d "Compare two version strings"
|
||||
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a verify -d "Check unit files for correctness"
|
||||
complete -c systemd-analyze -n "__fish_seen_subcommand_from verify" -F
|
||||
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a security -d "Analyze security settings of specified service units"
|
||||
complete -c systemd-analyze -n "__fish_seen_subcommand_from security" -a "(__fish_systemctl_services)"
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a inspect-elf -d "Parse and print ELF object packaging metadata"
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a fdstore -d "List contents of service unit's file descriptor store"
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a image-policy -d "Analyze image policy string"
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a has-tpm2 -d "Report TPM2 support"
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a pcrs -d "Show known TPM2 PCRs"
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a srk -d "Read Storage Root Key from TPM2 device"
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a architectures -d "List known CPU architectures"
|
||||
complete -c systemd-analyze -n __fish_use_subcommand -a smbios11 -d "Show SMBIOS Type #11 strings passed to the system"
|
||||
|
||||
@@ -1,25 +1,75 @@
|
||||
function __fish_tmux_sessions -d 'available sessions'
|
||||
tmux list-sessions -F "#S #{session_windows} windows created: #{session_created_string} [#{session_width}x#{session_height}]#{session_attached}" | sed 's/0$//;s/1$/ (attached)/' 2>/dev/null
|
||||
tmux list-sessions -F "#S"\t"#{session_windows} windows created: #{session_created_string} [#{session_width}x#{session_height}]#{session_attached}" | sed 's/0$//;s/1$/ (attached)/' 2>/dev/null
|
||||
end
|
||||
|
||||
function __fish_tmux_clients -d 'connected clients'
|
||||
tmux list-clients -F "#{client_tty} #S: Created: #{client_created_string} [#{client_width}x#{client_height} #{client_termname}]" 2>/dev/null
|
||||
tmux list-clients -F "#{client_tty}"\t"#S: Created: #{client_created_string} [#{client_width}x#{client_height} #{client_termname}]" 2>/dev/null
|
||||
end
|
||||
|
||||
function __fish_tmux_panes -d 'window panes'
|
||||
#fully qualified pane names
|
||||
tmux list-panes -F '#S:#W.#P session:window.pane' 2>/dev/null
|
||||
tmux list-panes -F '#S:#W.#P'\t'session:window.pane' 2>/dev/null
|
||||
|
||||
#panes by themselves
|
||||
tmux list-panes -F '#P pane' 2>/dev/null
|
||||
tmux list-panes -F '#P'\t'pane' 2>/dev/null
|
||||
|
||||
#windows by themselves
|
||||
tmux list-panes -F '#W window' 2>/dev/null
|
||||
tmux list-panes -F '#W'\t'window' 2>/dev/null
|
||||
end
|
||||
|
||||
#don't allow dirs in the completion list...
|
||||
complete -c tmux -x
|
||||
|
||||
############### Begin: Dynamic Completions Using `tmux list-commands` ###############
|
||||
|
||||
# The dynamic completions are exhaustive. The manual completions below override
|
||||
# them with better-documented completions and custom completions for some
|
||||
# arguments, e.g. for target panes, but only have partial coverage.
|
||||
function __fish_tmux_parse_lscm_usage
|
||||
set -l lscm (tmux list-commands -F "#{command_list_name} #{command_list_alias}"\t"#{command_list_usage}" 2>/dev/null)
|
||||
or return
|
||||
|
||||
for cmd_tab_usage in $lscm
|
||||
set -l split_command (string split --max 2 \t -- $cmd_tab_usage)
|
||||
set -l cmdnames $split_command[1]
|
||||
set -l usage $split_command[2]
|
||||
|
||||
complete -c tmux -n __fish_use_subcommand -a "$cmdnames"
|
||||
|
||||
# $usage has the form '[-ABCD] [-L|-S|-U] [-e arg-name] [positional-arg-name]'
|
||||
for item in (string match -ag --regex '\[([^\]]+)\]' $usage)
|
||||
if not set -l item (string trim -l -c - -- $item)
|
||||
continue
|
||||
end
|
||||
if set -l split_item (string split -n --max 2 " " -- "$item")
|
||||
# The option should always have length 1 by tmux convention,
|
||||
# but we double-check to avoid syntax errors.
|
||||
if [ "$(string length $split_item[1])" = 1 ]
|
||||
complete -c tmux -xs $split_item[1] -n "__fish_seen_subcommand_from $cmdnames" -d "$split_item[2]"
|
||||
end
|
||||
else
|
||||
for char in (string split '' -- "$item")
|
||||
if string match -q -r '\||-' -- $char
|
||||
# TODO: Actually treat exclusive args, [-L|-S|-U], as exclusive
|
||||
# For now, we just ignore the `-`s and `|`s
|
||||
continue
|
||||
end
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $cmdnames" -s $char
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
__fish_tmux_parse_lscm_usage
|
||||
functions -e __fish_tmux_parse_lscm_usage
|
||||
|
||||
# Completions for `tmux list-commands` itself
|
||||
set -l all_commands (tmux list-commands -F "#{command_list_name} #{command_list_alias}" 2>/dev/null)
|
||||
and complete -c tmux -n "__fish_seen_subcommand_from list-commands lscm" -x -a "$all_commands"
|
||||
|
||||
############### End: Dynamic Completions Using `tmux list-commands` ###############
|
||||
|
||||
############### Begin: Front Flags ###############
|
||||
#these do not require parameters
|
||||
complete -c tmux -n __fish_use_subcommand -s 2 -d 'Force tmux to assume the terminal supports 256 colours'
|
||||
@@ -94,6 +144,8 @@ complete -c tmux -n __fish_use_subcommand -a $rename -d 'rename session'
|
||||
complete -c tmux -n __fish_use_subcommand -a $showmsgs -d 'save msgs in status bar in per-client msg log'
|
||||
|
||||
complete -c tmux -n __fish_use_subcommand -a $source -d 'execute commands from path'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $source" -F
|
||||
|
||||
complete -c tmux -n __fish_use_subcommand -a $start -d 'start tmux server if not running; do not create a session'
|
||||
|
||||
complete -c tmux -n __fish_use_subcommand -a $suspendc -d 'send SIGTSTP signal to client (tty stop)'
|
||||
@@ -113,14 +165,177 @@ complete -c tmux -xs t -n "__fish_seen_subcommand_from $detach $lockc $refresh $
|
||||
complete -c tmux -xs c -n "__fish_seen_subcommand_from $switchc" -a '(__fish_tmux_clients)' -d target-client
|
||||
|
||||
#commands with the -F format flag
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $lsc $ls" -rs F -d 'format string'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $lsc $ls" -xs F -d 'format string'
|
||||
|
||||
#commands that take shell commands
|
||||
complete -c tmux -x -n "__fish_seen_subcommand_from $new " -a '(__fish_complete_subcommand --fcs-skip=2)'
|
||||
|
||||
############### End: Clients and Sessions ###############
|
||||
|
||||
############### Begin: Windows and Panes ###############
|
||||
#TODO - these commands are not currently implemented.
|
||||
#there is a section in the tmux man page that has the same title as this section
|
||||
#use the "Clients and Sessions" code as an example when implementing this
|
||||
|
||||
set -l breakp "break-pane breakp"
|
||||
set -l capturep "capture-pane capturep"
|
||||
set -l chooseclient choose-client
|
||||
set -l choosetree choose-tree
|
||||
set -l customizemode customize-mode
|
||||
set -l displayp "display-panes displayp"
|
||||
set -l findw "find-window findw"
|
||||
set -l joinp "join-pane joinp move-pane movep"
|
||||
set -l killp "kill-pane killp"
|
||||
set -l killw "kill-window killw"
|
||||
set -l lastp "last-pane lastp"
|
||||
set -l lastw "last-window lastw"
|
||||
set -l linkw "link-window linkw"
|
||||
set -l lsp "list-panes lsp"
|
||||
set -l lsw "list-windows lsw"
|
||||
set -l movew "move-window movew"
|
||||
set -l neww "new-window neww"
|
||||
set -l nextl "next-layout nextl"
|
||||
set -l next "next-window next"
|
||||
set -l pipep "pipe-pane pipep"
|
||||
set -l prevl "previous-layout prevl"
|
||||
set -l prev "previous-window prev"
|
||||
set -l renamew "rename-window renamew"
|
||||
set -l resizep "resize-pane resizep"
|
||||
set -l resizew "resize-window resizew"
|
||||
set -l respawnp "respawn-pane respawnp"
|
||||
set -l respawnw "respawn-window respawnw"
|
||||
set -l rotatew "rotate-window rotatew"
|
||||
set -l selectl "select-layout selectl"
|
||||
set -l selectp "select-pane selectp"
|
||||
set -l selectw "select-window selectw"
|
||||
set -l splitw "split-window splitw"
|
||||
set -l swapp "swap-pane swapp"
|
||||
set -l swapw "swap-window swapw"
|
||||
set -l unlinkw "unlink-window unlinkw"
|
||||
|
||||
complete -c tmux -n __fish_use_subcommand -a $breakp -d 'break pane off into a new window'
|
||||
|
||||
complete -c tmux -n __fish_use_subcommand -a $capturep -d 'capture contents of a pane into a buffer'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $capturep" -xs a -d 'capture alternate screen'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $capturep" -xs p -d 'output to stdout'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $capturep" -xs e -d 'include color escapes'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $capturep" -xs C -d 'escape non-printable chars'
|
||||
|
||||
complete -c tmux -n __fish_use_subcommand -a $chooseclient -d 'interactively choose client'
|
||||
complete -c tmux -n __fish_use_subcommand -a $choosetree -d 'interactively choose session/window/pane'
|
||||
complete -c tmux -n __fish_use_subcommand -a $customizemode -d 'interactively customize settings'
|
||||
complete -c tmux -n __fish_use_subcommand -a $displayp -d 'display a visible indicator for each pane'
|
||||
complete -c tmux -n __fish_use_subcommand -a $findw -d 'interactively choose window matching pattern'
|
||||
|
||||
complete -c tmux -n __fish_use_subcommand -a $joinp -d 'split destination pane and move source pane into one of the halves'
|
||||
# $joinp takes a subset of $splitw arguments
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $joinp $splitw" -xs b -d 'before target'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $joinp $splitw" -xs h -d 'horizontal'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $joinp $splitw" -xs v -d 'vertical'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $joinp $splitw" -xs l -d 'size in lines/cols'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $joinp $splitw" -xs f -d 'full height/width'
|
||||
|
||||
complete -c tmux -n __fish_use_subcommand -a $killp -d 'destroy a pane'
|
||||
complete -c tmux -n __fish_use_subcommand -a $killw -d 'destroy a window'
|
||||
complete -c tmux -n __fish_use_subcommand -a $lastp -d 'select the previusly selected pane'
|
||||
complete -c tmux -n __fish_use_subcommand -a $lastw -d 'select the previusly selected window'
|
||||
complete -c tmux -n __fish_use_subcommand -a $linkw -d 'link source window to destination window'
|
||||
|
||||
complete -c tmux -n __fish_use_subcommand -a $lsp -d 'list panes'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $lsp" -xs s -d 'all in session'
|
||||
|
||||
complete -c tmux -n __fish_use_subcommand -a $lsw -d 'list windows'
|
||||
complete -c tmux -n __fish_use_subcommand -a $movew -d 'move window'
|
||||
|
||||
complete -c tmux -n __fish_use_subcommand -a $neww -d 'create a new window'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $neww" -xs k -d 'replace if exists'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $neww" -xs S -d 'select if exists'
|
||||
|
||||
complete -c tmux -n __fish_use_subcommand -a $nextl -d 'rearrange panes in a window according to the next layout'
|
||||
complete -c tmux -n __fish_use_subcommand -a $next -d 'move to the next window in the session'
|
||||
complete -c tmux -n __fish_use_subcommand -a $pipep -d 'pipe output from pane to a shell command'
|
||||
complete -c tmux -n __fish_use_subcommand -a $prevl -d 'rearrange panes in a window according to the previous layout'
|
||||
complete -c tmux -n __fish_use_subcommand -a $prev -d 'move to the previous window in the session'
|
||||
complete -c tmux -n __fish_use_subcommand -a $renamew -d 'rename a window'
|
||||
|
||||
complete -c tmux -n __fish_use_subcommand -a $resizep -d 'resize a pane'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $resizep" -xs M -d 'begin mouse resize'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $resizep" -xs T -d 'trim below cursor'
|
||||
|
||||
complete -c tmux -n __fish_use_subcommand -a $resizew -d 'resize a window'
|
||||
complete -c tmux -n __fish_use_subcommand -a $respawnp -d 'reactivate a pane where a command exited'
|
||||
complete -c tmux -n __fish_use_subcommand -a $respawnw -d 'reactivate a window where a command exited'
|
||||
complete -c tmux -n __fish_use_subcommand -a $rotatew -d 'rotate panes within a window'
|
||||
|
||||
complete -c tmux -n __fish_use_subcommand -a $selectl -d 'rearrange panes according to a given layout'
|
||||
set -l layouts 'even-horizontal even-vertical main-horizontal main-horizontal-mirrored main-vertical main-vertical-mirrored tiled'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $selectl" -x -a "$layouts" -d 'predefined layout'
|
||||
|
||||
complete -c tmux -n __fish_use_subcommand -a $selectp -d 'activate specific pane'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $selectp" -xs d -d 'disable input'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $selectp" -xs e -d 'enable input'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $selectp" -xs l -d 'previously selected'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $selectp" -xs m -d 'mark'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $selectp" -xs M -d 'unmark'
|
||||
|
||||
complete -c tmux -n __fish_use_subcommand -a $selectw -d 'activate specific window'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $selectw" -xs l -d 'previously selected'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $selectw" -xs p -d 'previous'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $selectw" -xs n -d 'next'
|
||||
|
||||
complete -c tmux -n __fish_use_subcommand -a $splitw -d 'create a new pane by splitting target-pane'
|
||||
# See also $joinp's arguments
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $splitw" -xs I -d 'show stdin contents'
|
||||
|
||||
complete -c tmux -n __fish_use_subcommand -a $swapp -d 'swap two panes'
|
||||
complete -c tmux -n __fish_use_subcommand -a $swapw -d 'swap two windows'
|
||||
complete -c tmux -n __fish_use_subcommand -a $unlinkw -d 'unlink target-window'
|
||||
|
||||
## commands with pane flag
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $breakp $joinp $swapp" -xs s -a '(__fish_tmux_panes)' -d 'source pane'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $capturep $chooseclient $choosetree $customizemode $findw" -xs t -a '(__fish_tmux_panes)' -d 'target pane'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $killp $pipep $resizep $respawnp $selectl $selectp $splitw" -xs t -a '(__fish_tmux_panes)' -d 'target pane'
|
||||
# Unclear if there's a meaningful difference between "target pane" and "destination pane", but tmux makes the distinction
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $joinp $swapp" -xs t -a '(__fish_tmux_panes)' -d 'destination pane'
|
||||
|
||||
## commands with session flag
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $lastw $lsw $next $prev" -xs t -a '(__fish_tmux_sessions)' -d 'target session'
|
||||
|
||||
## commands with the -F format flag
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $breakp $lsp $lsw $neww $chooseclient $choosetree" -xs F -d 'format string'
|
||||
|
||||
## commands with -s/-t flags that are not panes/sessions (nice completion not yet implemented)
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $linkw $movew $swapw" -xs s -d 'source window'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $breakp $linkw $movew $neww $swapw" -xs t -d 'destination window'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $killw $lastp $nextl $prevl $renamew" -xs t -d 'target window'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $resizew $reswpawnw $rotatew $selectw $unlinkw" -xs t -d 'target window'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $displayp" -xs t -d 'target client'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $lsp" -xs t -d 'target'
|
||||
|
||||
#commands that take shell commands
|
||||
complete -c tmux -x -n "__fish_seen_subcommand_from $neww $pipep $respawnp $respawnw $splitw" \
|
||||
-a '(__fish_complete_subcommand --fcs-skip=2)'
|
||||
|
||||
# Common boolean flags. TODO: -P for "print info", -Z for "zoom"
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $breakp $joinp $linkw $neww $movew $splitw $swapp $swapp" -xs d -d 'do not activate'
|
||||
|
||||
set -l updownleftright "$resizep $resizew $selectp "
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $updownleftright" -xs D -d 'down'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $updownleftright" -xs U -d 'up'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $updownleftright" -xs L -d 'left'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $updownleftright" -xs R -d 'right'
|
||||
|
||||
set -l before_after "$breakp $linkw $movew $neww "
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $before_after" -xs a -d 'after'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $before_after" -xs b -d 'before'
|
||||
|
||||
# Boolean flags, ct'd. Unclear why these are not -a/-b for after/before
|
||||
set -l updownnextprev "$rotatew $swapp "
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $updownnextprev" -xs D -d 'down/next'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $updownnextprev" -xs U -d 'up/prev'
|
||||
|
||||
# Boolean flags, ct'd. When `-a` does not mean "after"
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $lsp $lsw" -xs a -d 'all on this server'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $killp $killw" -xs a -d 'all except chosen'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $prev $next" -xs a -d 'with alert'
|
||||
|
||||
############### End: Windows and Panes ###############
|
||||
|
||||
############### Begin: Key Bindings ###############
|
||||
|
||||
2
share/completions/unbuffer.fish
Normal file
2
share/completions/unbuffer.fish
Normal file
@@ -0,0 +1,2 @@
|
||||
complete -c unbuffer -a "(__fish_complete_subcommand)" -x
|
||||
complete -c unbuffer -s p -d "Read from stdin for pipeline use, exit when stdin closes"
|
||||
@@ -75,7 +75,7 @@ function __fish_virsh_get_networks
|
||||
set -l network_autostart $network[3]
|
||||
set -l network_persistent $network[4]
|
||||
|
||||
set -l network_qualities $network_state (test $network_autostart = 'yes'; and echo 'autostart') (test $network_persistent = 'yes'; and echo 'persistant')
|
||||
set -l network_qualities $network_state (test $network_autostart = 'yes'; and echo 'autostart') (test $network_persistent = 'yes'; and echo 'persistent')
|
||||
set -l show true
|
||||
if set -q argv[1]
|
||||
for filter in $argv
|
||||
|
||||
@@ -55,7 +55,7 @@ complete -c wget -o nd -d "Do not create a hierarchy of directories"
|
||||
complete -c wget -s x -l force-directories -d "Force creation of a hierarchy of directories"
|
||||
complete -c wget -l no-host-directories -d "Disable generation of host-prefixed directories"
|
||||
complete -c wget -o nH -d "Disable generation of host-prefixed directories"
|
||||
complete -c wget -l protocal-directories -d "Use the protocol name as a directory component"
|
||||
complete -c wget -l protocol-directories -d "Use the protocol name as a directory component"
|
||||
complete -c wget -l cut-dirs -d "Ignore specified number of directory components" -xa "1 2 3 4 5"
|
||||
complete -c wget -s P -l directory-prefix -d "Set directory prefix" -r
|
||||
complete -c wget -s E -l html-extension -d "Force html files to have html extension"
|
||||
|
||||
@@ -325,7 +325,6 @@ function __fish_wine__complete_winepath_subcommand --argument-names command
|
||||
end
|
||||
|
||||
set -l command wine
|
||||
complete -c $command -f
|
||||
|
||||
complete -c $command -l help -d 'Show help'
|
||||
complete -c $command -l version -d 'Show version'
|
||||
|
||||
58
share/completions/wlr-randr.fish
Normal file
58
share/completions/wlr-randr.fish
Normal file
@@ -0,0 +1,58 @@
|
||||
# `wlr-randr` completions.
|
||||
# See: https://gitlab.freedesktop.org/emersion/wlr-randr
|
||||
|
||||
function __fish_print_wlr-randr_outputs --argument-names exclude
|
||||
if command -q jq
|
||||
wlr-randr --json | jq \
|
||||
--raw-output \
|
||||
--arg exclude "$exclude" \
|
||||
'.[] | select(.name != $exclude) | "\(.name)\t\(.make), \(.model)"'
|
||||
end
|
||||
end
|
||||
|
||||
function __fish_get_wlr-randr-current_output
|
||||
set -l last_output
|
||||
set -l tokens (commandline -xpc)
|
||||
|
||||
while set -q tokens[1]
|
||||
if test "$tokens[1]" = --output
|
||||
set last_output "$tokens[2]"
|
||||
set -e tokens[1]
|
||||
else if string match -qr -- '^--output=' "$tokens[1]"
|
||||
set last_output (string replace -r -- '--output=(.*)' '$1' "$tokens[1]")
|
||||
end
|
||||
|
||||
set -e tokens[1]
|
||||
end
|
||||
|
||||
printf "%s" $last_output
|
||||
end
|
||||
|
||||
function __fish_complete_wlr-randr_modes
|
||||
if command -q jq
|
||||
set -l output (__fish_get_wlr-randr-current_output)
|
||||
|
||||
wlr-randr --json | jq \
|
||||
--raw-output \
|
||||
--arg output "$output" \
|
||||
--arg preferred_str Preferred \
|
||||
--arg empty_str '' \
|
||||
'.[] | select(.name == $output) | .modes[] | "\(.width)x\(.height)\t\(if .preferred then $preferred_str else $empty_str end)"'
|
||||
end
|
||||
end
|
||||
|
||||
complete -c wlr-randr -f
|
||||
complete -c wlr-randr -s h -l help -d 'Show help'
|
||||
complete -c wlr-randr -l json -d 'Print as JSON'
|
||||
complete -c wlr-randr -l dryrun -d 'Dry run'
|
||||
complete -c wlr-randr -l output -x -d Output -a '(__fish_print_wlr-randr_outputs)'
|
||||
complete -c wlr-randr -l on -d 'Turn on'
|
||||
complete -c wlr-randr -l off -d 'Turn off'
|
||||
complete -c wlr-randr -l mode -x -d Mode -a '(__fish_complete_wlr-randr_modes)'
|
||||
complete -c wlr-randr -l pos -r -d Position
|
||||
complete -c wlr-randr -l left-of -x -d 'Relative left position' -a '(__fish_print_wlr-randr_outputs (__fish_get_wlr-randr-current_output))'
|
||||
complete -c wlr-randr -l right-of -x -d 'Relative right position' -a '(__fish_print_wlr-randr_outputs (__fish_get_wlr-randr-current_output))'
|
||||
complete -c wlr-randr -l above -x -d 'Relative top position' -a '(__fish_print_wlr-randr_outputs (__fish_get_wlr-randr-current_output))'
|
||||
complete -c wlr-randr -l below -x -d 'Relative bottom position' -a '(__fish_print_wlr-randr_outputs (__fish_get_wlr-randr-current_output))'
|
||||
complete -c wlr-randr -l transform -x -d Transformation -a 'normal\t 90\t 180\t 270\t flipped\t flipped-90\t flipped-180\t flipped-270\t'
|
||||
complete -c wlr-randr -l scale -x -d Scale
|
||||
@@ -51,7 +51,7 @@ end
|
||||
# don't want to inherit all completions from git
|
||||
function __fish_complete_yadm_like_git
|
||||
# Remove the first word from the commandline because that is "yadm"
|
||||
set -l cmdline (commandline -xpc; commandline -ct)[2..-1]
|
||||
set -l cmdline (commandline -xpc | string escape; commandline -ct)[2..-1]
|
||||
|
||||
# `yadm gitconfig` is same as `git config`
|
||||
if __fish_seen_subcommand_from gitconfig
|
||||
|
||||
@@ -166,13 +166,11 @@ if status --is-login
|
||||
|
||||
# Populate path according to config files
|
||||
for path_file in $argv[2] $argv[3]/*
|
||||
if test -f $path_file
|
||||
while read -l entry
|
||||
if not contains -- $entry $result
|
||||
test -n "$entry"
|
||||
and set -a result $entry
|
||||
end
|
||||
end <$path_file
|
||||
for entry in (string split : <? $path_file)
|
||||
if not contains -- $entry $result
|
||||
test -n "$entry"
|
||||
and set -a result $entry
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -40,8 +40,7 @@ if test $status -eq 0 -a (count $sysver) -eq 3
|
||||
|
||||
if test $age -ge $max_age
|
||||
test -d "$dir" || mkdir -m 700 -p $dir
|
||||
/usr/libexec/makewhatis -o "$whatis" (/usr/bin/manpath | string split : | xargs realpath) >/dev/null 2>&1 </dev/null &
|
||||
disown $last_pid
|
||||
/bin/sh -c '( "$@" ) >/dev/null 2>&1 </dev/null &' -- /usr/libexec/makewhatis -o "$whatis" (/usr/bin/manpath | string split : | xargs realpath)
|
||||
end
|
||||
end
|
||||
else
|
||||
|
||||
@@ -1,30 +1,4 @@
|
||||
function __fish_setup_cancel_text -v fish_color_cancel -v fish_color_normal
|
||||
set -g __fish_cancel_text "^C"
|
||||
if set -q fish_color_cancel
|
||||
set __fish_cancel_text (echo -sn (set_color $fish_color_cancel) $__fish_cancel_text (set_color normal))
|
||||
end
|
||||
if command -sq tput
|
||||
# Clear to EOL (to erase any autosuggestions)
|
||||
set __fish_cancel_text (echo -sn $__fish_cancel_text (tput el; or tput ce))
|
||||
end
|
||||
end
|
||||
__fish_setup_cancel_text
|
||||
|
||||
# This is meant to be bound to something like \cC.
|
||||
# This is meant to be bound to something like ctrl-c
|
||||
function __fish_cancel_commandline
|
||||
set -l cmd (commandline)
|
||||
if test -n "$cmd"
|
||||
echo -sn $__fish_cancel_text
|
||||
# `commandline -L` prints the line the cursor is on (starting from the prompt), so move the cursor
|
||||
# "to the end" then call `commandline -L` to get the total number of lines typed in at the prompt.
|
||||
commandline -C 10000000
|
||||
printf (string repeat -n (commandline -L) "\n")
|
||||
commandline ""
|
||||
emit fish_cancel
|
||||
end
|
||||
|
||||
# cancel: Close the pager if it's open (#4298)
|
||||
# repaint: Repaint even if we haven't cancelled anything so the prompt refreshes
|
||||
# and the terminal scrolls to it.
|
||||
commandline -f cancel -f repaint
|
||||
commandline -f cancel-commandline
|
||||
end
|
||||
|
||||
@@ -134,8 +134,9 @@ function __fish_complete_mount_opts
|
||||
data_err={ignore,abort} \
|
||||
barrier={0,1} \
|
||||
user_xattr \
|
||||
acl \
|
||||
set -l token (commandline -tc | string replace -r '^-o' -- '')
|
||||
acl
|
||||
|
||||
set -l token (commandline -tc | string replace -r '^-o' -- '')
|
||||
set -l args (string split , -- $token)
|
||||
|
||||
if test (count $args) -ne 0
|
||||
|
||||
@@ -10,34 +10,31 @@ function __fish_complete_subcommand -d "Complete subcommand" --no-scope-shadowin
|
||||
case '--fcs-skip=*'
|
||||
set skip_next (string split = -- $arg)[2]
|
||||
case --commandline # --commandline means to use our arguments instead of the commandline.
|
||||
set subcommand $argv
|
||||
set -e argv
|
||||
break
|
||||
complete -C "$argv"
|
||||
return
|
||||
end
|
||||
end
|
||||
set -l options_with_param $argv
|
||||
|
||||
if not string length -q -- $subcommand
|
||||
set -l cmd (commandline -cxp | string escape) (commandline -ct)
|
||||
while set -q cmd[1]
|
||||
set -l token $cmd[1]
|
||||
set -e cmd[1]
|
||||
if contains -- $token $options_with_param
|
||||
set skip_next (math $skip_next + 1)
|
||||
set -l cmd (commandline -cxp | string escape) (commandline -ct)
|
||||
while set -q cmd[1]
|
||||
set -l token $cmd[1]
|
||||
set -e cmd[1]
|
||||
if contains -- $token $options_with_param
|
||||
set skip_next (math $skip_next + 1)
|
||||
continue
|
||||
end
|
||||
switch $token
|
||||
case '-*' '*=*'
|
||||
continue
|
||||
end
|
||||
switch $token
|
||||
case '-*' '*=*'
|
||||
case '*'
|
||||
if test $skip_next -gt 0
|
||||
set skip_next (math $skip_next - 1)
|
||||
continue
|
||||
case '*'
|
||||
if test $skip_next -gt 0
|
||||
set skip_next (math $skip_next - 1)
|
||||
continue
|
||||
end
|
||||
# found the start of our command
|
||||
set subcommand $token $cmd
|
||||
break
|
||||
end
|
||||
end
|
||||
# found the start of our command
|
||||
set subcommand $token $cmd
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -99,9 +99,8 @@ end" >$__fish_config_dir/config.fish
|
||||
set -l update_args -B $__fish_data_dir/tools/create_manpage_completions.py --manpath --cleanup-in $__fish_user_data_dir/generated_completions --cleanup-in $__fish_cache_dir/generated_completions
|
||||
if set -l python (__fish_anypython)
|
||||
# Run python directly in the background and swallow all output
|
||||
$python $update_args >/dev/null 2>&1 &
|
||||
# Then disown the job so that it continues to run in case of an early exit (#6269)
|
||||
disown >/dev/null 2>&1
|
||||
# Orphan the job so that it continues to run in case of an early exit (#6269)
|
||||
/bin/sh -c '( "$@" ) >/dev/null 2>&1 &' -- $python $update_args
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -221,7 +220,11 @@ end" >$__fish_config_dir/config.fish
|
||||
|
||||
# Notify terminals when $PWD changes via OSC 7 (issue #906).
|
||||
function __fish_update_cwd_osc --on-variable PWD --description 'Notify terminals when $PWD changes'
|
||||
printf \e\]7\;file://%s%s\a $hostname (string escape --style=url -- $PWD)
|
||||
set -l host $hostname
|
||||
if set -q KONSOLE_VERSION
|
||||
set host ''
|
||||
end
|
||||
printf \e\]7\;file://%s%s\a $host (string escape --style=url -- $PWD)
|
||||
end
|
||||
__fish_update_cwd_osc # Run once because we might have already inherited a PWD from an old tab
|
||||
|
||||
|
||||
@@ -54,11 +54,15 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod
|
||||
$legacy_bind --preset $argv -k sright forward-bigword
|
||||
$legacy_bind --preset $argv -k sleft backward-bigword
|
||||
|
||||
bind --preset $argv alt-right nextd-or-forward-token
|
||||
bind --preset $argv alt-left prevd-or-backward-token
|
||||
bind --preset $argv alt-right nextd-or-forward-word
|
||||
bind --preset $argv alt-left prevd-or-backward-word
|
||||
$legacy_bind --preset $argv \e\[1\;9C nextd-or-forward-word # iTerm2 < 3.5.12
|
||||
$legacy_bind --preset $argv \e\[1\;9D prevd-or-backward-word # iTerm2 < 3.5.12
|
||||
|
||||
bind --preset $argv alt-up history-token-search-backward
|
||||
bind --preset $argv alt-down history-token-search-forward
|
||||
$legacy_bind --preset $argv \e\[1\;9A history-token-search-backward # iTerm2 < 3.5.12
|
||||
$legacy_bind --preset $argv \e\[1\;9B history-token-search-forward # iTerm2 < 3.5.12
|
||||
# Bash compatibility
|
||||
# https://github.com/fish-shell/fish-shell/issues/89
|
||||
bind --preset $argv alt-. history-token-search-backward
|
||||
@@ -67,8 +71,9 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod
|
||||
bind --preset $argv alt-o __fish_preview_current_file
|
||||
bind --preset $argv alt-w __fish_whatis_current_token
|
||||
bind --preset $argv ctrl-l clear-screen
|
||||
bind --preset $argv ctrl-c cancel-commandline
|
||||
bind --preset $argv ctrl-c clear-commandline
|
||||
bind --preset $argv ctrl-u backward-kill-line
|
||||
bind --preset $argv ctrl-k kill-line
|
||||
bind --preset $argv ctrl-w backward-kill-path-component
|
||||
bind --preset $argv end end-of-line
|
||||
bind --preset $argv home beginning-of-line
|
||||
@@ -115,7 +120,7 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod
|
||||
bind --preset $argv alt-enter "commandline -i \n" expand-abbr
|
||||
bind --preset $argv ")" self-insert expand-abbr # Closing a command substitution.
|
||||
bind --preset $argv ctrl-space 'test -n "$(commandline)" && commandline -i " "'
|
||||
bind --preset $argv -k nul 'test -n "$(commandline)" && commandline -i " "'
|
||||
$legacy_bind --preset $argv -k nul 'test -n "$(commandline)" && commandline -i " "'
|
||||
# Shift-space behaves like space because it's easy to mistype.
|
||||
bind --preset $argv shift-space 'commandline -i " "' expand-abbr
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ function __fish_whatis_current_token -d "Show man page entries or function descr
|
||||
and set desc "$token - $funcinfo[5]"
|
||||
|
||||
case builtin
|
||||
set desc (__fish_print_help $token | awk "/./ {print; exit}")
|
||||
set desc (__fish_print_help $token | awk "/./ { getline; print; exit }" | string trim)
|
||||
|
||||
case file
|
||||
set -l tmpdesc (whatis $token 2>/dev/null)
|
||||
|
||||
@@ -54,10 +54,7 @@ function edit_command_buffer --description 'Edit the command buffer in an extern
|
||||
end
|
||||
set cursor_from_editor (mktemp)
|
||||
set -a editor +$line "+norm! $col|" $f \
|
||||
'+autocmd VimLeave * ++once call writefile(
|
||||
[printf("%s %s %s", shellescape(bufname()), line("."), col("."))],
|
||||
"'$cursor_from_editor'"
|
||||
)'
|
||||
'+au VimLeave * ++once call writefile([printf("%s %s %s", shellescape(bufname()), line("."), col("."))], "'$cursor_from_editor'")'
|
||||
case emacs emacsclient gedit
|
||||
set -a editor +$line:$col $f
|
||||
case kak
|
||||
|
||||
@@ -57,18 +57,11 @@ function fish_default_key_bindings -d "emacs-like key binds"
|
||||
bind --preset $argv alt-u upcase-word
|
||||
|
||||
bind --preset $argv alt-c capitalize-word
|
||||
bind --preset $argv alt-backspace backward-kill-token
|
||||
bind --preset $argv alt-backspace backward-kill-word
|
||||
bind --preset $argv ctrl-backspace backward-kill-word
|
||||
bind --preset $argv alt-delete kill-token
|
||||
bind --preset $argv ctrl-delete kill-word
|
||||
bind --preset $argv alt-b backward-word
|
||||
bind --preset $argv alt-f forward-word
|
||||
if test "$TERM_PROGRAM" = Apple_Terminal
|
||||
# Terminal.app sends \eb for alt+left, \ef for alt+right.
|
||||
# Yeah.
|
||||
$legacy_bind --preset $argv alt-b prevd-or-backward-word
|
||||
$legacy_bind --preset $argv alt-f nextd-or-forward-word
|
||||
end
|
||||
bind --preset $argv alt-b prevd-or-backward-word
|
||||
bind --preset $argv alt-f nextd-or-forward-word
|
||||
|
||||
bind --preset $argv alt-\< beginning-of-buffer
|
||||
bind --preset $argv alt-\> end-of-buffer
|
||||
|
||||
@@ -180,8 +180,7 @@ if string match -q Darwin -- (uname) && string match -q /usr/bin/git -- (command
|
||||
else
|
||||
# git is installed, but on the first run it may be very slow as xcrun needs to populate the cache.
|
||||
# Kick it off in the background to populate the cache.
|
||||
/bin/sh -c '/usr/bin/git --version; touch /tmp/__fish_git_ready' &>/dev/null &
|
||||
disown $last_pid &>/dev/null
|
||||
/bin/sh -c '( /usr/bin/git --version; touch /tmp/__fish_git_ready ) >/dev/null 2>&1 &'
|
||||
function __fish_git_prompt_ready
|
||||
path is /tmp/__fish_git_ready || return 1
|
||||
# git is ready, erase the function.
|
||||
|
||||
@@ -7,16 +7,16 @@ function fish_print_hg_root
|
||||
# Find an hg directory above $PWD
|
||||
# without calling `hg root` because that's too slow
|
||||
set -l root
|
||||
set -l dir (pwd -P 2>/dev/null)
|
||||
set -l dir "$(pwd -P 2>/dev/null)"
|
||||
or return 1
|
||||
|
||||
while test $dir != /
|
||||
while not contains -- "$dir" "" / .
|
||||
if test -f $dir'/.hg/dirstate'
|
||||
echo $dir/.hg
|
||||
return 0
|
||||
end
|
||||
# Go up one directory
|
||||
set dir (string replace -r '[^/]*/?$' '' $dir)
|
||||
set dir (path dirname -- $dir)
|
||||
end
|
||||
|
||||
return 1
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
function fish_vi_cursor -d 'Set cursor shape for different vi modes'
|
||||
# if stdin is not a tty, there is effectively no bind mode.
|
||||
if not test -t 0
|
||||
return
|
||||
end
|
||||
|
||||
set -q fish_cursor_unknown
|
||||
or set -g fish_cursor_unknown block
|
||||
|
||||
function __fish_vi_cursor --argument-names varname
|
||||
if not status is-interactive; and not status is-interactive-read
|
||||
return
|
||||
end
|
||||
if not set -q $varname
|
||||
switch $varname
|
||||
case fish_cursor_insert
|
||||
|
||||
@@ -64,7 +64,7 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
|
||||
|
||||
# Default (command) mode
|
||||
bind -s --preset :,q exit
|
||||
bind -s --preset -m insert ctrl-c cancel-commandline repaint-mode
|
||||
bind -s --preset -m insert ctrl-c clear-commandline repaint-mode
|
||||
bind -s --preset -M default h backward-char
|
||||
bind -s --preset -M default l forward-char
|
||||
bind -s --preset -m insert enter execute
|
||||
@@ -109,18 +109,24 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
|
||||
bind -s --preset -M insert ctrl-n accept-autosuggestion
|
||||
|
||||
# Vi/Vim doesn't support these keys in insert mode but that seems silly so we do so anyway.
|
||||
bind -s --preset -M insert -k home beginning-of-line
|
||||
bind -s --preset -M default -k home beginning-of-line
|
||||
bind -s --preset -M insert -k end end-of-line
|
||||
bind -s --preset -M default -k end end-of-line
|
||||
bind -s --preset -M insert home beginning-of-line
|
||||
$legacy_bind -s --preset -M insert -k home beginning-of-line
|
||||
bind -s --preset -M default home beginning-of-line
|
||||
$legacy_bind -s --preset -M default -k home beginning-of-line
|
||||
bind -s --preset -M insert end end-of-line
|
||||
$legacy_bind -s --preset -M insert -k end end-of-line
|
||||
bind -s --preset -M default end end-of-line
|
||||
$legacy_bind -s --preset -M default -k end end-of-line
|
||||
|
||||
# Vi moves the cursor back if, after deleting, it is at EOL.
|
||||
# To emulate that, move forward, then backward, which will be a NOP
|
||||
# if there is something to move forward to.
|
||||
bind -s --preset -M default x delete-char 'set fish_cursor_end_mode exclusive' forward-single-char backward-char 'set fish_cursor_end_mode inclusive'
|
||||
bind -s --preset -M default X backward-delete-char
|
||||
bind -s --preset -M insert -k dc delete-char forward-single-char backward-char
|
||||
bind -s --preset -M default -k dc delete-char 'set fish_cursor_end_mode exclusive' forward-single-char backward-char 'set fish_cursor_end_mode inclusive'
|
||||
bind -s --preset -M insert delete delete-char forward-single-char backward-char
|
||||
$legacy_bind -s --preset -M insert -k dc delete-char forward-single-char backward-char
|
||||
bind -s --preset -M default delete delete-char 'set fish_cursor_end_mode exclusive' forward-single-char backward-char 'set fish_cursor_end_mode inclusive'
|
||||
$legacy_bind -s --preset -M default -k dc delete-char 'set fish_cursor_end_mode exclusive' forward-single-char backward-char 'set fish_cursor_end_mode inclusive'
|
||||
|
||||
# Backspace deletes a char in insert mode, but not in normal/default mode.
|
||||
bind -s --preset -M insert backspace backward-delete-char
|
||||
@@ -312,6 +318,9 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
|
||||
bind -s --preset -M visual $key beginning-of-line
|
||||
end
|
||||
|
||||
bind -s --preset -M visual -m default v end-selection repaint-mode
|
||||
bind -s --preset -M visual -m insert i end-selection repaint-mode
|
||||
bind -s --preset -M visual -m insert I end-selection beginning-of-line repaint-mode
|
||||
bind -s --preset -M visual -m insert c kill-selection end-selection repaint-mode
|
||||
bind -s --preset -M visual -m insert s kill-selection end-selection repaint-mode
|
||||
bind -s --preset -M visual -m default d kill-selection end-selection backward-char repaint-mode
|
||||
@@ -321,6 +330,7 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
|
||||
bind -s --preset -M visual -m default '",*,y' "fish_clipboard_copy; commandline -f end-selection repaint-mode"
|
||||
bind -s --preset -M visual -m default '",+,y' "fish_clipboard_copy; commandline -f end-selection repaint-mode"
|
||||
bind -s --preset -M visual -m default '~' togglecase-selection end-selection repaint-mode
|
||||
bind -s --preset -M visual -m default g,U togglecase-selection end-selection repaint-mode
|
||||
|
||||
bind -s --preset -M visual -m default ctrl-c end-selection repaint-mode
|
||||
bind -s --preset -M visual -m default escape end-selection repaint-mode
|
||||
|
||||
@@ -20,7 +20,7 @@ function funced --description 'Edit function definition'
|
||||
if set -q _flag_interactive
|
||||
set editor fish
|
||||
else if set -q _flag_editor
|
||||
set editor $_flag_editor
|
||||
echo $_flag_editor | read -at editor
|
||||
else if set -q VISUAL
|
||||
echo $VISUAL | read -at editor
|
||||
else if set -q EDITOR
|
||||
@@ -37,11 +37,8 @@ function funced --description 'Edit function definition'
|
||||
set init function $funcname\n\nend
|
||||
end
|
||||
|
||||
# Break editor up to get its first command (i.e. discard flags)
|
||||
set -l editor_cmd
|
||||
echo $editor | read -ta editor_cmd
|
||||
if not type -q -f "$editor_cmd[1]"
|
||||
echo (_ "funced: The value for \$EDITOR '$editor' could not be used because the command '$editor_cmd[1]' could not be found") >&2
|
||||
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
|
||||
set editor fish
|
||||
end
|
||||
|
||||
@@ -88,7 +85,7 @@ function funced --description 'Edit function definition'
|
||||
while true
|
||||
set -l checksum (__fish_md5 "$tmpname")
|
||||
|
||||
if not $editor_cmd $tmpname
|
||||
if not $editor $tmpname
|
||||
echo (_ "Editing failed or was cancelled")
|
||||
else
|
||||
# Verify the checksum (if present) to detect potential problems
|
||||
|
||||
@@ -239,8 +239,7 @@ function help --description 'Show help for the fish shell'
|
||||
# The space before the /c is to prevent msys2 from expanding it to a path
|
||||
$fish_browser " /c" start $page_url
|
||||
else if contains -- $fish_browser[1] $graphical_browsers
|
||||
$fish_browser $page_url &
|
||||
disown $last_pid >/dev/null 2>&1
|
||||
/bin/sh -c '( "$@" ) &' -- $fish_browser $page_url
|
||||
else
|
||||
$fish_browser $page_url
|
||||
end
|
||||
|
||||
@@ -5,18 +5,17 @@ function fish_prompt -d "Write out the prompt"
|
||||
set -l laststatus $status
|
||||
|
||||
set -l git_info
|
||||
if set -l git_branch (command git branch --format=%\(refname:lstrip=2\) 2> /dev/null)
|
||||
if git rev-parse 2>/dev/null
|
||||
set -l git_branch (
|
||||
command git symbolic-ref HEAD 2>/dev/null | string replace 'refs/heads/' ''
|
||||
or command git describe HEAD 2>/dev/null
|
||||
or echo unknown
|
||||
)
|
||||
set git_branch (set_color -o blue)"$git_branch"
|
||||
set -l git_status
|
||||
if test -n "$git_branch"; and not command git diff-index --quiet HEAD --
|
||||
if set -l count (command git rev-list --count --left-right $upstream...HEAD 2>/dev/null)
|
||||
echo $count | read -l ahead behind
|
||||
if test "$ahead" -gt 0
|
||||
set git_status "$git_status"(set_color red)⬆
|
||||
end
|
||||
if test "$behind" -gt 0
|
||||
set git_status "$git_status"(set_color red)⬇
|
||||
end
|
||||
end
|
||||
if git rev-parse --quiet --verify HEAD >/dev/null
|
||||
and not command git diff-index --quiet HEAD --
|
||||
|
||||
for i in (git status --porcelain | string sub -l 2 | sort | uniq)
|
||||
switch $i
|
||||
case "."
|
||||
@@ -35,11 +34,8 @@ function fish_prompt -d "Write out the prompt"
|
||||
end
|
||||
else
|
||||
set git_status (set_color green):
|
||||
if test -z "$git_branch"
|
||||
set git_branch -
|
||||
end
|
||||
end
|
||||
set git_info "(git$git_status"(set_color -o blue)"$git_branch"(set_color white)")"
|
||||
set git_info "(git$git_status$git_branch"(set_color white)")"
|
||||
end
|
||||
|
||||
# Disable PWD shortening by default.
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
},
|
||||
common::{
|
||||
escape, get_executable_path, save_term_foreground_process_group, scoped_push_replacer,
|
||||
str2wcstring, wcs2string, PACKAGE_NAME, PROFILING_ACTIVE, PROGRAM_NAME,
|
||||
str2wcstring, wcs2osstring, wcs2string, PACKAGE_NAME, PROFILING_ACTIVE, PROGRAM_NAME,
|
||||
},
|
||||
env::{
|
||||
environment::{env_init, EnvStack, Environment},
|
||||
@@ -80,7 +80,7 @@
|
||||
#[cfg(feature = "installable")]
|
||||
// Disable for clippy because otherwise it would require sphinx
|
||||
#[cfg(not(clippy))]
|
||||
fn install(confirm: bool) -> bool {
|
||||
fn install(confirm: bool, dir: PathBuf) -> bool {
|
||||
use rust_embed::RustEmbed;
|
||||
|
||||
#[derive(RustEmbed)]
|
||||
@@ -96,11 +96,6 @@ fn install(confirm: bool) -> bool {
|
||||
use std::io::ErrorKind;
|
||||
use std::io::Write;
|
||||
use std::io::{stderr, stdin};
|
||||
let Some(home) = fish::env::get_home() else {
|
||||
FLOG!(error, "Can't find home directory.");
|
||||
return false;
|
||||
};
|
||||
let dir = PathBuf::from(home).join(DATA_DIR).join(DATA_DIR_SUBDIR);
|
||||
|
||||
// TODO: Translation,
|
||||
// FLOG?
|
||||
@@ -197,7 +192,7 @@ fn install(confirm: bool) -> bool {
|
||||
}
|
||||
|
||||
#[cfg(any(clippy, not(feature = "installable")))]
|
||||
fn install(_confirm: bool) -> bool {
|
||||
fn install(_confirm: bool, _dir: PathBuf) -> bool {
|
||||
eprintln!("Fish was built without support for self-installation");
|
||||
return false;
|
||||
}
|
||||
@@ -300,10 +295,17 @@ fn determine_config_directory_paths(argv0: impl AsRef<Path>) -> ConfigPaths {
|
||||
}
|
||||
|
||||
if !done {
|
||||
// The next check is that we are in a reloctable directory tree
|
||||
// The next check is that we are in a relocatable directory tree
|
||||
if exec_path.ends_with("bin/fish") {
|
||||
let base_path = exec_path.parent().unwrap().parent().unwrap();
|
||||
paths = ConfigPaths {
|
||||
// One obvious path is ~/.local (with fish in ~/.local/bin/).
|
||||
// If we picked ~/.local/share/fish as our data path,
|
||||
// we would install there and erase history.
|
||||
// So let's isolate us a bit more.
|
||||
#[cfg(feature = "installable")]
|
||||
data: base_path.join("share/fish/install"),
|
||||
#[cfg(not(feature = "installable"))]
|
||||
data: base_path.join("share/fish"),
|
||||
sysconf: base_path.join("etc/fish"),
|
||||
doc: base_path.join("share/doc/fish"),
|
||||
@@ -316,6 +318,9 @@ fn determine_config_directory_paths(argv0: impl AsRef<Path>) -> ConfigPaths {
|
||||
);
|
||||
let base_path = exec_path.parent().unwrap();
|
||||
paths = ConfigPaths {
|
||||
#[cfg(feature = "installable")]
|
||||
data: base_path.join("share/install"),
|
||||
#[cfg(not(feature = "installable"))]
|
||||
data: base_path.join("share"),
|
||||
sysconf: base_path.join("etc"),
|
||||
doc: base_path.join("user_doc/html"),
|
||||
@@ -339,7 +344,8 @@ fn determine_config_directory_paths(argv0: impl AsRef<Path>) -> ConfigPaths {
|
||||
let Some(home) = fish::env::get_home() else {
|
||||
FLOG!(
|
||||
error,
|
||||
"Cannot find home directory and will refuse to read configuration"
|
||||
"Cannot find home directory and will refuse to read configuration.\n",
|
||||
"Consider installing into a directory tree with `fish --install=PATH`."
|
||||
);
|
||||
return paths;
|
||||
};
|
||||
@@ -421,8 +427,7 @@ fn check_version_file(paths: &ConfigPaths, datapath: &wstr) -> Option<bool> {
|
||||
{
|
||||
// When fish is installable, we write the version to a file,
|
||||
// now we check it.
|
||||
let verfile =
|
||||
PathBuf::from(fish::common::wcs2osstring(datapath)).join("fish-install-version");
|
||||
let verfile = PathBuf::from(wcs2osstring(datapath)).join("fish-install-version");
|
||||
let version = std::fs::read_to_string(verfile).ok()?;
|
||||
|
||||
return Some(version == fish::BUILD_VERSION);
|
||||
@@ -458,7 +463,7 @@ fn read_init(parser: &Parser, paths: &ConfigPaths) {
|
||||
);
|
||||
}
|
||||
|
||||
install(true);
|
||||
install(true, PathBuf::from(wcs2osstring(&datapath)));
|
||||
// We try to go on if installation failed (or was rejected) here
|
||||
// If the assets are missing, we will trigger a later error,
|
||||
// if they are outdated, things will probably (tm) work somewhat.
|
||||
@@ -527,7 +532,7 @@ fn fish_parse_opt(args: &mut [WString], opts: &mut FishCmdOpts) -> ControlFlow<i
|
||||
const PRINT_DEBUG_CATEGORIES_ARG: char = 2 as char;
|
||||
const PROFILE_STARTUP_ARG: char = 3 as char;
|
||||
|
||||
const SHORT_OPTS: &wstr = L!("+hPilNnvc:C:p:d:f:D:o:");
|
||||
const SHORT_OPTS: &wstr = L!("+:hPilNnvc:C:p:d:f:D:o:");
|
||||
const LONG_OPTS: &[WOption<'static>] = &[
|
||||
wopt(L!("command"), RequiredArgument, 'c'),
|
||||
wopt(L!("init-command"), RequiredArgument, 'C'),
|
||||
@@ -540,7 +545,7 @@ fn fish_parse_opt(args: &mut [WString], opts: &mut FishCmdOpts) -> ControlFlow<i
|
||||
wopt(L!("no-config"), NoArgument, 'N'),
|
||||
wopt(L!("no-execute"), NoArgument, 'n'),
|
||||
wopt(L!("print-rusage-self"), NoArgument, RUSAGE_ARG),
|
||||
wopt(L!("install"), NoArgument, 'I'),
|
||||
wopt(L!("install"), OptionalArgument, 'I'),
|
||||
wopt(
|
||||
L!("print-debug-categories"),
|
||||
NoArgument,
|
||||
@@ -576,7 +581,60 @@ fn fish_parse_opt(args: &mut [WString], opts: &mut FishCmdOpts) -> ControlFlow<i
|
||||
'h' => opts.batch_cmds.push("__fish_print_help fish".into()),
|
||||
'i' => opts.is_interactive_session = true,
|
||||
'I' => {
|
||||
install(false);
|
||||
#[cfg(not(feature = "installable"))]
|
||||
eprintln!("Fish was built without support for self-installation");
|
||||
#[cfg(feature = "installable")]
|
||||
if let Some(path) = w.woptarg {
|
||||
// We were given an explicit path.
|
||||
// Install us there as a relocatable install.
|
||||
// That means:
|
||||
// path/bin/fish is the fish binary
|
||||
// path/share/fish/ is the data directory
|
||||
// path/etc/fish is sysconf????
|
||||
use std::fs;
|
||||
let dir = PathBuf::from(wcs2osstring(path));
|
||||
if install(true, dir.join("share/fish/install")) {
|
||||
for sub in &["share/fish/install", "etc/fish", "bin"] {
|
||||
let p = dir.join(sub);
|
||||
let Ok(_) = fs::create_dir_all(p.clone()) else {
|
||||
eprintln!("Creating directory '{}' failed", p.display());
|
||||
std::process::exit(1);
|
||||
};
|
||||
}
|
||||
|
||||
// Copy ourselves there.
|
||||
let argv0 = OsString::from_vec(wcs2string(&args[0]));
|
||||
let exec_path =
|
||||
get_executable_path(<OsString as AsRef<Path>>::as_ref(&argv0));
|
||||
let binpath = dir.join("bin/fish");
|
||||
if let Ok(exec_path) = exec_path.canonicalize() {
|
||||
if exec_path != binpath {
|
||||
if let Err(err) = std::fs::copy(exec_path, binpath.clone()) {
|
||||
FLOG!(error, "Cannot copy fish to", binpath.display());
|
||||
FLOG!(error, err);
|
||||
std::process::exit(1);
|
||||
}
|
||||
println!(
|
||||
"Fish installed in '{}'. Start that from now on.",
|
||||
binpath.display()
|
||||
);
|
||||
// TODO: Reexec fish?
|
||||
std::process::exit(0);
|
||||
}
|
||||
} else {
|
||||
FLOG!(error, "Cannot copy fish to '%ls'. Please copy the fish binary there manually", binpath.display());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
let paths = Some(determine_config_directory_paths(OsString::from_vec(
|
||||
wcs2string(&args[0]),
|
||||
)));
|
||||
let Some(paths) = paths else {
|
||||
FLOG!(error, "Cannot find config paths");
|
||||
std::process::exit(1);
|
||||
};
|
||||
install(true, paths.data);
|
||||
}
|
||||
}
|
||||
'l' => opts.is_login = true,
|
||||
'N' => {
|
||||
|
||||
@@ -132,7 +132,7 @@ fn abbr_show(streams: &mut IoStreams) -> Option<c_int> {
|
||||
for abbr in abbrs.list() {
|
||||
result.clear();
|
||||
let mut add_arg = |arg: &wstr| {
|
||||
if !result.is_empty() {
|
||||
if !result.is_empty() && !result.ends_with("=") {
|
||||
result.push_str(" ");
|
||||
}
|
||||
result.push_utfstr(arg);
|
||||
|
||||
@@ -55,6 +55,7 @@ enum TokenMode {
|
||||
/// \param buff the original command line buffer
|
||||
/// \param cursor_pos the position of the cursor in the command line
|
||||
fn replace_part(
|
||||
parser: &Parser,
|
||||
range: Range<usize>,
|
||||
insert: &wstr,
|
||||
insert_mode: AppendMode,
|
||||
@@ -86,9 +87,9 @@ fn replace_part(
|
||||
|
||||
out.push_utfstr(&buff[range.end..]);
|
||||
if search_field_mode {
|
||||
commandline_set_search_field(out, Some(out_pos));
|
||||
commandline_set_search_field(parser, out, Some(out_pos));
|
||||
} else {
|
||||
commandline_set_buffer(Some(out), Some(out_pos));
|
||||
commandline_set_buffer(parser, Some(out), Some(out_pos));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -465,7 +466,7 @@ pub fn commandline(parser: &Parser, streams: &mut IoStreams, args: &mut [&wstr])
|
||||
}
|
||||
line_offset + new_coord
|
||||
};
|
||||
commandline_set_buffer(None, Some(new_pos));
|
||||
commandline_set_buffer(parser, None, Some(new_pos));
|
||||
} else {
|
||||
streams.out.append(sprintf!(
|
||||
"%d\n",
|
||||
@@ -475,7 +476,7 @@ pub fn commandline(parser: &Parser, streams: &mut IoStreams, args: &mut [&wstr])
|
||||
rstate.cursor_pos + 1
|
||||
- parse_util_get_offset_from_line(
|
||||
&rstate.text,
|
||||
i32::try_from(parse_util_lineno(&rstate.text, rstate.cursor_pos))
|
||||
i32::try_from(parse_util_lineno(&rstate.text, rstate.cursor_pos) - 1)
|
||||
.unwrap(),
|
||||
)
|
||||
.unwrap_or_default()
|
||||
@@ -631,9 +632,11 @@ pub fn commandline(parser: &Parser, streams: &mut IoStreams, args: &mut [&wstr])
|
||||
.saturating_add_signed(isize::try_from(new_pos).unwrap()),
|
||||
current_buffer.len(),
|
||||
);
|
||||
commandline_set_buffer(None, Some(new_pos));
|
||||
commandline_set_buffer(parser, None, Some(new_pos));
|
||||
} else {
|
||||
streams.out.append(sprintf!("%lu\n", current_cursor_pos));
|
||||
streams
|
||||
.out
|
||||
.append(sprintf!("%lu\n", current_cursor_pos - range.start));
|
||||
}
|
||||
return STATUS_CMD_OK;
|
||||
}
|
||||
@@ -650,6 +653,7 @@ pub fn commandline(parser: &Parser, streams: &mut IoStreams, args: &mut [&wstr])
|
||||
);
|
||||
} else if positional_args == 1 {
|
||||
replace_part(
|
||||
parser,
|
||||
range,
|
||||
args[w.wopt_index],
|
||||
append_mode,
|
||||
@@ -660,6 +664,7 @@ pub fn commandline(parser: &Parser, streams: &mut IoStreams, args: &mut [&wstr])
|
||||
} else {
|
||||
let sb = join_strings(&w.argv[w.wopt_index..], '\n');
|
||||
replace_part(
|
||||
parser,
|
||||
range,
|
||||
&sb,
|
||||
append_mode,
|
||||
|
||||
@@ -517,7 +517,8 @@ pub fn complete(parser: &Parser, streams: &mut IoStreams, argv: &mut [&wstr]) ->
|
||||
next.flags,
|
||||
faux_cmdline,
|
||||
&mut tmp_cursor,
|
||||
false,
|
||||
/*append_only=*/ false,
|
||||
/*is_unique=*/ false,
|
||||
);
|
||||
|
||||
// completion_apply_to_command_line will append a space unless COMPLETE_NO_SPACE
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user