Commit Graph

15554 Commits

Author SHA1 Message Date
Martin Pool
c0be74c55a Better documentation of forward-char and friends
This makes it match the code in reader.cpp, and explains why the default
binding of `right` accepts the complete line.

Closes #8748
2022-03-02 21:18:29 +01:00
Fabian Homborg
7555391790 Make a bit wider with less padding 2022-02-27 18:01:29 +01:00
Fabian Homborg
68f099d804 Webconfig: Go to small-screen mode earlier
Since the color previews are now wider, we had quite a wide range
where there would only be one. Remove the border around the content
earlier so windows with 1000px width still get two previews in a row.

(making the text shorter would also be an option here)
2022-02-25 18:27:17 +01:00
Fabian Homborg
0614f507ff Webconfig: Make colorscheme samples nicer to read
This makes the container fit the content, otherwise we'd be cutting
off the "> quack &" part of the first line.

Also while we're here increase the line-height a bit to give it more
breathing room, and increase the font size juuust a smidge.

Reduce margins and increase padding to make it less cramped.
2022-02-25 18:18:43 +01:00
Fabian Homborg
615ea22387 Doc theme: Use code font for in-line commands as well
This makes them stand out a bit more
2022-02-24 18:12:22 +01:00
Fabian Homborg
05ac24006e Doc theme: Rationalize line-height/margin
Now all based on multiples of 1em.
2022-02-24 18:01:25 +01:00
Fabian Homborg
6fcb6f77be Revert changes to time formatting
This reverts commits:

2d9e51b43e
d1d9f147ec
346ce8081b

The box drawing because it's entangled with the rest and we don't
currently use this anywhere I know of. Nor was it gated on terminfo,
so it could have broken things, for subjectively little gain.

Fixes #8727.
2022-02-21 22:48:43 +01:00
exploide
e0bc944d5c added kubectl completion 2022-02-19 20:03:45 +01:00
Johannes Altmanninger
2f5edfd617 Call pthread_attr_destroy even if pthread_create failed
As suggested in
63bfab9975 (commitcomment-66542462)

Also, check for errors.
2022-02-19 14:15:22 +01:00
Spenser Black
63d7386a36 completions/gpg: list only secret for gpg options that manage secret keys
Some GPG options work only with private keys but our completions suggest all
keys.  Modify `__fish_complete_gpg_user_id and __fish_complete_gpg_key_id`
to take an optional argument for the "key type" to override `--list-keys`
with like `--list-secret-keys` for the appropriate options.

Closes #8712
2022-02-19 13:48:20 +01:00
Fabian Homborg
5af1e64441 Explain the issues of setting fish as login shell
Also stop explaining this in three places. In particular this removes
an FAQ entry.

Fixes #8078
2022-02-18 15:30:57 +01:00
Marcin Zajączkowski
d485ed3d87 Add gnome-extensions completion 2022-02-17 20:47:14 +01:00
Fabian Homborg
d0667e9e88
disco prompt: Use $hostname 2022-02-16 15:07:06 +01:00
Spenser Black
1b7a43877b Disabled line length limit in share/
Many of the lines in `share/functions` and `share/completions` violate the max
line length, and it can be annoying to try to maintain consistency while
fighting against the editor trying to wrap lines.
2022-02-15 21:27:27 +01:00
Jose Riha
9d6b8266f4 Fix typo (fist -> first) 2022-02-15 14:20:05 +01:00
Aaron Gyes
d1600211e5 Docs: Posix -> POSIX 2022-02-14 16:18:16 -08:00
Fabian Homborg
b48d8188b9 Change our test emoji
The emoji we used wasn't actually widened-in-9, so we now switch to
one that does.
2022-02-14 22:31:30 +01:00
Fabian Homborg
34f4be1149 Update widecharwidth
This updates widechar_width.h to one generated from
15e782aa3df9dfef436516f66f745a90b421329.

The change here is a rationalization of doublewide vs widened-in-9.

Many emoji have been moved to widened-in-9 because we now use the
correct version (this uses the *emoji* version, and emoji version 3.0
corresponds to Unicode 9).
2022-02-14 22:19:28 +01:00
Kevin F. Konrad
707c7a7f1e replace helm completions with autogenerated script
Helm 3 provides an autogenerated completion since version 3.4.0.

The previous implementation is replaced by this because it was specific to the
now-deprecated helm 2.

The completions appear to be fully featured including descriptions and
completion for dynamic arguments such as namespaces and releases.
2022-02-13 16:52:30 +01:00
Johannes Altmanninger
47b0d0c293 Make __fish_is_nth_token and __fish_nth_token private again
Their names are not perfect, so let's keep them as internal functions,
until we figure out how/if we want to expose this.

This reverts 0445126c2 (Undunder __fish_is_nth_token, 2021-06-29) (but I
did it without "git revert").

Closes #8008
2022-02-13 10:45:38 +01:00
ridiculousfish
a7102f179b stdin_nonblocking.py test to not leave background processes
fish_test_helper was sometimes left running.
2022-02-12 11:48:55 -08:00
ridiculousfish
133e359d70 Add a test that stdin is always handed-off as blocking
No functional change here, just closing a gap in our coverage.
2022-02-12 11:41:03 -08:00
Pierrick Guillaume
2164d40b73
Allow better completion for git submodules (#8716)
* Allow better completion for git submodules

* Add change for git completion in changelog

* Fix git submodule absobgitdirs description
2022-02-11 15:56:14 +01:00
Marius Müller
920e89e2ac Extend dnf completions
to include syntax for the dnf-plugin system-upgrade
2022-02-11 09:23:01 +01:00
Mahmoud Al-Qudsi
6c81e2a627 zfs: Complete values for all properties
This patch adds completions for the values of properties, emitted once the
current token matches the name of a zfs property in full, for the various places
where such a property can be assigned.

e.g.

zfs set canmoun<TAB> continues to only provide "canmount" as a completion, but
zfs set canmount<TAB> will provide a list of all valid values for the property.

The existing code made an attempt to complete the values for the specific case
of `zfs set PROP=` but I could never get it to work for me under FreeBSD, so I
presume it was Linux-specific. This patch should be cross-platform and extends
the completions to anywhere where a property may be set.
2022-02-09 14:24:06 -06:00
Johannes Altmanninger
210e7a9cc9 Correct error on when complete -C is used without argument
The new --escape option means that -C is not necessarily the last option;
We have this scenario where we produce a bogus error

    $ fish -c 'complete -C --escape'
    complete: --escape: option requires an argument

--escape doesn't take arguments, so let the error message say -C.
2022-02-09 08:57:05 +01:00
Nadav Zingerman
9e0f74eb6c Add --escape option to complete -C
An example use case is an external completion pager:

    bind \cg "commandline -rt (complete -C --escape|fzf|cut -d\t -f1)\ "

Fixes #3469
2022-02-09 08:34:03 +01:00
Aaron Gyes
d1d9f147ec Update tests for time output. 2022-02-08 16:57:01 -08:00
Aaron Gyes
63bfab9975 Start threads detached. 2022-02-08 16:44:20 -08:00
Aaron Gyes
e0c8e1cd70 iothread: Remove most of a comment
Remove the narrative here that can set a reader up for confusion.

018e51c935
2022-02-08 16:44:20 -08:00
Aaron Gyes
346ce8081b time: use box drawing characterts for the separator
This spruces up output slightly to render a solid
line instead of a bunch of dashes for the horizontal
rule shown in time output.
2022-02-08 16:44:20 -08:00
Aaron Gyes
2d9e51b43e builtin time: Use more familiar time unit abbreviations
Use ms, μs as opposed to "millis", etc.
2022-02-08 16:44:20 -08:00
Mahmoud Al-Qudsi
4ea5a8a5c6 CHANGELOG.rst: Add vim text width override
If you have vim set up to recognize `.editorconfig` files, the 80-char limit
from ours causes vim to keep chopping lines. This makes it ignore that limit
when editing `CHANGELOG.rst`
2022-02-08 14:37:23 -06:00
Mahmoud Al-Qudsi
ddc4d8ba9b Changelog: fish_is_nth_token + fish_nth_token
See re-opened issue #8008 for discussion regarding the name of these functions -
this might need to be revisited pending a decision there.
2022-02-08 14:17:00 -06:00
Mahmoud Al-Qudsi
497cebab64 Changelog: OpenZFS completion improvements 2022-02-08 14:17:00 -06:00
Mahmoud Al-Qudsi
b3142a29e7 Fix zfs add completions 2022-02-08 14:17:00 -06:00
Mahmoud Al-Qudsi
5b7dd5e806 Fix zpool attach completions
The previous behavior vs the current (hopefully ideal) behavior:

* zpool attach [lists pools and devices - should list only pools]
* zpool attach tank [lists pools and devices - should list only devices already
    part of pool "tank"]
* zpool attach tank da1 [lists pools and devices - should list only devices not
    already part of pool "tank" or any pool, depending on -f flag to attach]
2022-02-08 14:17:00 -06:00
Mahmoud Al-Qudsi
b06a8a2e0c Add public function fish_nth_token to mirror fish_is_nth_token
Completions may benefit from using these in tandem to dynamically generate
completions predicated on the value of an earlier token in a cleaner fashion.
(Currently, most of called completion helper functions introspect the command
line to get the value of an earlier argument, making them less reusable for
different expressions that need completions of the same type. This way, the
completion can provide the function with the argument value explicitly.)
2022-02-08 14:17:00 -06:00
Mahmoud Al-Qudsi
99e0aa3c64 Clarify fish_is_nth_token description
Yes, this does make it longer but it's a very important point.
2022-02-08 14:17:00 -06:00
Mahmoud Al-Qudsi
8d386a27f3 zfs completions: Factor out OpenZFS features and support
As of FreeBSD 13 (released April 2021), FreeBSD has rebased its zfs support on
top of the OpenZFS distribution previously used only/chiefly by Linux;
accordingly, it has gained support for some previously Linux-only completions.
This patch changes some completions previously predicated on a Linux ZFS
installation to the presence of an OpenZFS installation. Note that there
continue to be (and probably always will be) separate Linux-only and
FreeBSD-only completions (and not just when it comes to interacting with the
device subsystem, etc).
2022-02-08 14:17:00 -06:00
Tristan McLain
06c474da2e
Shortened quilt definitions (#8667)
* shortened quilt function definitions

* fixed some changes with quilt definitions

Co-authored-by: Tristan McLain <tristan@Tristans-Laptop.localdomain>
2022-02-08 20:19:03 +01:00
Shay Aviv
2ef12af60e Fix comment parsing inside command substitutions and brackets 2022-02-08 16:20:31 +01:00
ridiculousfish
627033f447 fish_wcswidth_visible to use int instead of size_t
Credit to lilyball for spotting this.
2022-02-07 22:17:47 -08:00
Johannes Altmanninger
e8372db781 completions/set: only show foreground/background colors if relevant
Cursory experiments reveal that there are only three color options where
the background color is not ignored (though I didn't check all of them).
For these three options, the foreground color is ignored.  Similar for
bold/italics/underline.
Teach set completions to only show the colors that won't be ignored.

Unrelated observation: we write

	-a '--background=(set_color --print-colors)'

instead of

	-l background -a '(set_color --print-colors)'

because we want all colors to show straight away (there are no other
meaningful arguments).
2022-02-07 20:53:55 +01:00
Johannes Altmanninger
1a0fed2800 completions/set: fix completion of locales
4b018a760 (set completions: add more special variables, fix colors, 2021-12-13)
changed a global variable to a local, which is no longer visible to this
function. Fix this, so "set LANG <TAB>" works again.
2022-02-07 20:53:55 +01:00
Johannes Altmanninger
13edce3671 share/**.fish: reformat with fish_indent 2022-02-07 20:53:55 +01:00
Johannes Altmanninger
8b9f7dbf45 Commit transient edit when history search ends
A history search ends when you move the cursor, but the commandline inserted by
history search is still marked as transient. This means that the next history
search will clear the transient commandline. This means we are dropping an undo
point, for example:

	echo 11
	echo 1
	echo autosuggestion
	echo^P # commandline is "echo 1"
	^A # stop history search
	^P # commandline is "echo 11"
	^Z # Bug: commandline goes back to "echo", but it should be "echo 1"

In the worst case, we are switching from line-search to token-search (see
the attached test case).  Clearing the transient edit means the line is gone
and only the token is left on the command line.
2022-02-07 17:38:11 +01:00
Johannes Altmanninger
6bdb99972d editorconfig: use 80 columns for commit messages, not 100
Our current style favors < 80 columns in commit messages (or we just don't
use editorconfig here?).
2022-02-07 17:16:51 +01:00
Jakub Panek
964b7a729a completions(apk.fish): remove non-existent short flags, add prune flag
Signed-off-by: Jakub Panek <me@panekj.dev>
2022-02-06 08:41:56 +01:00
ridiculousfish
7f31acbf9b Prevent fish_title output from triggering a bel
fish outputs the result of fish_title inside an escape sequence, which
happens to be terminated by \a (BEL). It may happen that the initial
output is interrupted; fish then emits the closing BEL and that makes an
annoying beep. Output the fish_title all at once, even if a signal is
delivered (so we don't get "stuck inside" the sequence).

This is related to #8628 in that it's a "torn escape sequence."
2022-02-05 13:18:37 -08:00