Commit Graph

16891 Commits

Author SHA1 Message Date
Jason Nader
1119f68e66 completions: add ibmcloud (#10004)
* completions: add ibmcloud

* Update ibmcloud.fish

(cherry picked from commit d6e234c60c)
2023-10-08 17:15:20 +02:00
Asuka Minato
8235fd49ce add gcc completion for link lib (#10007)
* add completion for lib

* use path basename && use -a

(cherry picked from commit 3bf80b2374)
2023-10-08 17:15:20 +02:00
Fabian Boehm
67a0c04605 reader: Use existing search string when opening the history pager
I sometimes find myself doing something like this:

- Look for a commandline that includes "echo" (as an example)
- Type echo, press up a few times
- I can't immediately find what I'm looking for
- Press ctrl-r to open up the history pager
- It uses the current commandline as the search string,
  so now I'm looking for "echo foobar"

This makes it so if the search string already is in use, that's what
the history-pager picks as the initial search string.

(cherry picked from commit 5b44c26a19)
2023-10-08 17:15:20 +02:00
Fabian Boehm
465da28f20 docs/commandline: Add more on the -oc/-ct thing
This was the remaining immediately actionable part of #7375.

It's not definitely the last word, but a change here would require a
bigger plan.

Fixes #7375

(cherry picked from commit 0e81d25b36)
2023-10-08 17:15:20 +02:00
Xiretza
0b1aa0b12e completions: make: respect line continuations in recipes
Without this, a recipe containing a trailing backslash followed by a line not
beginning with tab (like any non-continued recipe lines would) would result in
the continuation showing up in completions.

Whenever a line ends in a backslash, consider the next line invalid as a target.

Regex explanation:

^([^#]*[^#\\])? -- optional prefix not containing comment character and not
                   ending in backslash
(\\\\)*\\$      -- 2n+1 backslashes at end of line (handles escaped backslashes)

(cherry picked from commit fff320b56b)
2023-10-08 17:15:20 +02:00
ghostflyby
f82f92df13 completion for macOS java_home
(cherry picked from commit 33ec25da8a)
2023-10-08 17:15:20 +02:00
Yuntao Zhao
34c19bcee1 Improve completion for rpm-ostree (#9910)
* Some temporary change until compose - commit

* First draft

* Fix an error that prints double completion

* Fix completion errors. Add rpm-ostree alias.

Fix cimpletion where it trigger by multiple commands.
Add update and remove, which are aliases for upgrade and uninstall.

* Remove -r when it is unnecessary

Some command need path completion for arguments no matter what,
which makes -r flag useless

* Remove -x for compose image
-x does not block the path anyway

* Add missing short otpion in compose image

Revert the last change to block -l completion

* Fix description

Fix multiple description.

(cherry picked from commit 9d0d16686e)
2023-10-08 17:15:20 +02:00
Jason Nader
80e5f6b2f8 scp completions: fix path escaping
(cherry picked from commit f6123d235c)
2023-10-08 17:15:20 +02:00
Fabian Boehm
65db0b2ec8 fish_key_reader: Humanize key descriptions
This used to print all codepoints outside of the ASCII range (i.e.
above 0x80) in \uXXXX or \UYYYYYYYY notation.

That's quite awkward, considering that this is about keys that are
being pressed, and many keyboards have actual symbols for these on
them - I have an "ö" key, so I would like to use `bind ö` and not
`bind \u00F6`. So we go by iswgraph.

On a slightly different note, `\e` was written as `\c[ (or \e)`. I do
not believe anyone really uses `\c[` (the `[` would need to
be escaped!), and it's confusing and unnecessary to even mention that.

(cherry picked from commit 55c425a0dd)
2023-10-08 17:15:17 +02:00
Fabian Boehm
4d59d9cfb5 Also allow command and in a pipeline
Similar to `time`, except that one is more common as a command.

Note that this will also allow `builtin and`, which is somewhat
useless, but then it is also useless outside of a pipeline.

Addition to #9985

(cherry picked from commit b454b3bc40)
2023-10-06 18:54:25 +02:00
Fabian Boehm
7815cb363c parse_util: Only reject time in a pipeline without decorator
This allows e.g. `foo | command time`, while still rejecting `foo | time`.

(this should really be done in the ast itself, but tbh most of
parse_util kinda should)

Fixes #9985

(cherry picked from commit 482616f101)
2023-10-06 18:50:02 +02:00
Fabian Boehm
651c1d2dc8 Css refresh (#9982)
This cleans up the CSS, reduces the number of different colors and special settings we use.

It increases contrast so we now pass WCAG AAA (according to chromium), and switches to css variables for colors to make dark mode simpler to implement.

(cherry picked from commit b48fa1f1a0)
2023-10-06 18:49:55 +02:00
Fabian Boehm
04b2e9629f math: Fix docs on --scale
Fixes #9983

(cherry picked from commit e555f1b235)
2023-10-06 18:49:55 +02:00
Fabian Boehm
7260e1f828 sample_prompts/scales: Silence one last git call
Fixes #9975

(cherry picked from commit 5b1ff9459a)
2023-10-06 18:49:55 +02:00
Fabian Boehm
136b99839b print_apt_packages: Go back to apt-cache for non-installed packages
Unfortunately, /var/lib/dpkg/status on recent-ish Debian versions at
least only contains the *installed* packages, rendering this solution
broken.

What we do instead is:

1. Remove a useless newline from each package, so our limit would now
let more full package data sets through
2. Increase the limit by 5x

This yields a completion that runs in ~800ms instead of ~700ms on a
raspberry pi, but gives ~10x the candidates, compared to the old
apt-cache version.

This partially reverts 96deaae7d8

(cherry picked from commit 81cd035950)
2023-10-06 18:49:46 +02:00
figurantpp
ab45e4abf2 Shortens rsync completion description
(cherry picked from commit 6473a9c763)
2023-10-06 18:48:25 +02:00
Kevin Cali
9dc0d3a6e8 docs: correct insert mode key
(cherry picked from commit 716001789b)
2023-10-06 18:48:25 +02:00
ysthakur
5354fe1119 Replace more escapes with quotes in man parser (#9961)
* Replace \(aq with "'" in man parser

* Also replace oq, dq, lq, and rq

(cherry picked from commit 0f19d7118b)
2023-10-06 18:48:25 +02:00
Roland Fredenhagen
85267199c7 completions/iwctl: Show network details in completion (#9960)
* completions/iwctl: Show network details in completion

* apply review comments

(cherry picked from commit 556bee6893)
2023-10-06 18:48:25 +02:00
Axlefublr
cf955c07fc fix __fish_list_current_token not recognizing ~ as $HOME (#9954)
* fix __fish_list_current_token not recognizing ~ as $HOME

* right. it was supposed to be $HOME. lol.

(cherry picked from commit fd68aca6ea)
2023-10-06 18:48:25 +02:00
Fabian Boehm
7bf704fe87 docs: Mention fish_cursor_replace
Fixes #9956

(cherry picked from commit c07136e8d3)
2023-10-06 18:37:46 +02:00
Gregory Anders
c5490893c2 Enable PWD reporting for iTerm2
(cherry picked from commit 69ef51f417)
2023-10-06 18:35:51 +02:00
Roland Fredenhagen
4e63cc23a4 Add iwctl completions (#9932)
* Add iwctl completions

* review-comments

* options

(cherry picked from commit 408ab86090)
2023-10-06 18:35:33 +02:00
Emily Grace Seville
c8177bdd30 Add horcrux completion (#9922)
* feat(completions): horcrux

* feat(changelog): mention completion

* fix(completion): condition for -n

(cherry picked from commit f9d21cc21d)
2023-10-06 18:35:32 +02:00
Gabriel Górski
7a60613b79 Simplify and fix __fish_is_zfs_feature_enabled (#9939)
* Simplify and fix `__fish_is_zfs_feature_enabled`

Previously `__fish_is_zfs_feature_enabled` was doing
`<whitespace>$queried_feature<whitespace>` pattern matching which
was skipping the state part expected in the follow-up checking code.

Passing the dataset/snapshot in a `target` argument is pointless. As
none of the existing code attempts to do this plus it is also a
private function (`__` prefix), rename of the argument and removal
of extra text replacement should not be considered a breaking change.

* Changed the `&& \` into `|| return`

* Run `fish_indent`

(cherry picked from commit 21ddfabb8d)
2023-10-06 18:35:26 +02:00
Fabian Boehm
d1f3058c6d Remove a waccess call when completing executables
We have already run waccess with X_OK. We already *know* the file is
executable.

There is no reason to check again.

Restores some of the speedup from the fast_waccess hack that was
removed to fix #9699.

(cherry picked from commit ee75b45687)
2023-10-06 18:35:26 +02:00
AsukaMinato
7e75fe3d37 add gcc completion lm lz lrt (#9919)
add some gcc completion options

(cherry picked from commit 9a9e133b18)
2023-10-06 18:35:26 +02:00
AsukaMinato
f2d8112136 more gcc -O completion
https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
(cherry picked from commit 2110b36426)
2023-10-06 18:35:26 +02:00
Emily Grace Seville
cc72a88ba0 Add Krita completions (#9903)
* feat(completions): support Krita

* feat(completions): support summary options for Krita

* feat(completions): support remaining options for Krita

* feat(completions): remove debug instructions

* feat(completions): hide completions for sizes for Krita

* feat(completions): fix Krita

* feat(changelog): mention new completion

* fix(completions): refactor Krita

* fix(completion): reformat

* feat(completion): dynamically generate workspace list

* fix(completion): refactor

* fix(completion): krita

* fix(completions): use printf

(cherry picked from commit 6ce2ffbbb0)
2023-10-06 18:35:25 +02:00
Emily Grace Seville
8430afbead Add Blender completions (#9905)
(cherry picked from commit 8d3885b9cb)
2023-10-06 18:35:16 +02:00
Pavel savchenko
7c44f78490 Docs: correct small grammatical error in read.rst
(cherry picked from commit c56f9e1981)
2023-10-06 18:35:10 +02:00
EmilySeville7cfg
f95b8470a2 feat(completions): gimp support
(cherry picked from commit 2bc605625e)
2023-10-06 18:35:10 +02:00
Henrik Hørlück Berg
a7c8e0cdfb Fix #9899 integer overflow in string repeat
We could end up overflowing if we print out something that's a multiple of the
chunk size, which would then finish printing in the chunk-printing, but not
break out early.

(cherry picked from commit 6325b3662d)
2023-10-06 18:35:06 +02:00
Fabian Boehm
a573d13cf0 completions/unzip: Dangit FreeBSD
No "--help" and the man page doesn't mention "-h".

(cherry picked from commit 0cfdc90551)
2023-10-01 16:23:52 +02:00
Fabian Boehm
9892ce3a5a wildcard: Remove useless access() call for trailing slash
This confirmed that a file existed via access(file, F_OK).

But we already *know* that it does because this is the expansion for
the "trailing slash" - by definition all wildcard components up to
here have already been checked.

And it's not checking for directoryness either because it does F_OK.

This will remove one `access()` per result, which will cut the number
of syscalls needed for a glob that ends in a "/" in half.

This brings us on-par with e.g. `ls` (which uses statx while we use
newfstatat, but that should have about the same results)

Fixes #9891.

(cherry picked from commit 6823f5e337)
2023-10-01 10:37:29 +02:00
Fabian Boehm
72edd888f1 Return a falsey status if the last -c command has a parse error
This makes `fish -c begin` fail with a status of 127 - it already
printed a syntax error so that was weird. (127 was the status for
syntax errors when piping to fish, so we stay consistent with that)

We allow multiple `-c` commands, and this will return the regular
status if the last `-c` succeeded.

This is fundamentally an extremely weird situation but this is the
simple targeted fix - we did nothing, unsuccessfully, so we should
fail.

Things to consider in future:

1. Return something better than 127 - that's the status for "unknown
command"!
2. Fail after a `-c` failed, potentially even checking all of them
before executing the first?

Fixes #9888

(cherry picked from commit a6c36a014c)
2023-10-01 10:37:29 +02:00
Adam J. Stewart
4ba7855699 Docs: fix code block
(cherry picked from commit 72de1dc201)
2023-10-01 10:37:28 +02:00
Adam J. Stewart
8a7a2f67ca Fix grammar in completion docs
(cherry picked from commit e31c0ebb05)
2023-10-01 10:37:28 +02:00
Fabian Boehm
7b9dafb9e4 completions/rclone: Add version parsing
This had a weird, unnecessary and terrible backwards-incompatibility
in how you get the completions out.

I do not like it but I am in a good enough mood to work around it.

See #9878.

(cherry picked from commit bfd97adbda)
2023-10-01 10:37:28 +02:00
pd
330942cc30 Fix rclone autocompletion script sourcing issue in fish shell
(cherry picked from commit ac2810e9ef)
2023-10-01 10:37:28 +02:00
may
d1b7a2e2e7 add stash completions to git show and git diff
(cherry picked from commit e3e7ab77ad)
2023-10-01 10:37:28 +02:00
AsukaMinato
5699e7857a Add i o for unzip (#9850)
* add -I -O for unzip

* for different distroes.

* avoid grep

(cherry picked from commit bab8fb9517)
2023-10-01 10:37:28 +02:00
Fabian Boehm
8525844961 alias: Escape the function name when replacing
Fixes #8720

(cherry picked from commit 38ac21ba5e)
2023-10-01 10:37:28 +02:00
Andre Eckardt
74bea87244 improved print CSS for fish_config
This commit introduces a fishconfig_print.css that contains special CSS styles that only apply when printing the fishconfig page. This is especially useful when the user wants to print out the key bindings.

(cherry picked from commit cbf9a3bbbd)
2023-10-01 10:37:28 +02:00
Amy Grace
c6c6ac1c69 Force use of macOS's builtin manpath
Prevent a useless warning msg if Homebrew's `man-db` is installed and configured

(cherry picked from commit 4c9fa511e8)
2023-10-01 10:37:28 +02:00
Simon Börjesson
0d65d5a422 Redraw pager on new selection when nothing was selected previously
(cherry picked from commit 71c320ca32)
2023-10-01 10:37:28 +02:00
Zehka
f5f1db4f5b fixed a few smaller things in my translations
(cherry picked from commit a0a2475ccb)
2023-10-01 10:37:28 +02:00
Zehka
2d97e24006 another commit to rectify the chaos i created
(cherry picked from commit 6c6d281938)
2023-10-01 10:37:28 +02:00
Zehka
feccbeeee7 added some german translations
(cherry picked from commit b5fae430c0)
2023-10-01 10:37:28 +02:00
Jo
47c90bf5cd Fix a typo in language.rst
(cherry picked from commit 272d123431)
2023-10-01 10:37:28 +02:00