Commit Graph

5127 Commits

Author SHA1 Message Date
Mahmoud Al-Qudsi
fc9a743622 completions/env: overhaul completions
The value completions were rendered almost entirely useless due to the forced
inclusion of file completions at all tokens, including in the head/command
position thanks to the use of `__fish_complete_subcommand` which doesn't
understand the semantics of `env` and expects something like `ssh`. But we don't
need it at all.
2024-05-31 20:49:48 -05:00
Mahmoud Al-Qudsi
e1ee193822 Speed up __fish_make_cache_dir
Don't fork/exec an external process, especially one performing IO, if we don't
have to.

This, in turn, speeds up __fish_source_cached_completions which is rather slow
under WSL (and slower than it needs to be on other platforms).
2024-05-30 17:03:03 -05:00
Mahmoud Al-Qudsi
98642d307a Don't use a graphical browser under SSH
...unless X is also being forwarded.

Someone else will have to figure out the Wayland equivalent (if that even
exists). Not my monkey, not my circus.
2024-05-30 16:15:07 -05:00
Mahmoud Al-Qudsi
46f6aa8024 Update ssh-keygen completions
Don't run `ssh` upon sourcing and don't rely on `ssh -Q` being available.
2024-05-29 14:08:21 -05:00
Mahmoud Al-Qudsi
828b88a212 Add issue reference to flatpak completion workaround
[ci skip]
2024-05-29 13:54:39 -05:00
Yuntao Zhao
96416cc49e
feat: improve completion for konsole (#10528)
* feat: improve konsole completion

* Improve konsole profile completion to be dynamic

Directly complete --profile as a long argument

* Dynamically complete konsole -p
2024-05-28 10:26:03 -05:00
Nguyen Huu Kim
8880fa8dd7
feat: add completions for k8s tools (kustomize, flux) (#10473)
* feat: add completions for kustomize

* feat: add completions for FluxCD

* Update flux.fish

* Update kustomize.fish

---------

Co-authored-by: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
2024-05-26 22:12:49 -05:00
Mahmoud Al-Qudsi
dbf6dfd5d2 completions/flatpak: dynamically complete flatpak install 2024-05-26 22:03:27 -05:00
Mahmoud Al-Qudsi
4868166f86 completions/rustc: preserve trailing = in -Z values 2024-05-26 21:44:02 -05:00
Mahmoud Al-Qudsi
84d057e7b7 Finish refactoring rustc completions
* Properly handle a lot more -Z completion formats as suggested by `rustc -Z
  help`
* Don't run any `rustc` commands when sourcing `rustc.fish`; these invocations
  are instead deferred until the user attempts to complete the specific switch.
* Support CSV -A/F/D/W values
2024-05-26 21:33:48 -05:00
Mahmoud Al-Qudsi
9045b251b0 Fix missing -- filter in string replace call 2024-05-26 21:33:48 -05:00
tesuji
114856e1d9
git: add --reuse-message and --reedit-message completion (#10530) 2024-05-26 20:57:43 -05:00
Klaus Hipp
cd9f5bdbaa
Add jnv completions (#10519) 2024-05-24 17:09:18 -05:00
tesuji
57963ced4b
add completions for ssh-keygen (#10508)
* add bare completions for ssh-keygen

* chore: more completions for ssh-keygen
2024-05-24 17:07:32 -05:00
Fabian Boehm
06d842b0d8 completions/csvlens: Fix a typo 2024-05-24 22:40:18 +02:00
Klaus Hipp
843933ce95
Add csvlens completions (#10520) 2024-05-24 15:38:45 -05:00
Mahmoud Al-Qudsi
b49e9b906f Wrap an unruly comment 2024-05-24 10:21:07 -05:00
Mahmoud Al-Qudsi
537cde0c72 Avoid auto-colorization of ls output if CLICOLOR_FORCE is set
We don't set this variable ourselves, but some might set it in their config out
of habit coming from shells that don't automatically colorize ls output.

This variable overrides stdout tty detection for `ls --color=auto` (but does not
modify the behavior of `ls --color=never` or `ls --color=always` regardless of
its value) under at least the BSD version of `ls`. (Under the GNU version, it
influences colorization only if stdout *is* a tty.)

If we detect CLICOLOR_FORCE *and* we are not writing directly to the tty, we
skip colorization (by clearing-but-not-erasing `$__fish_ls_color_opt`, so that
we don't end up accidentally using its value from another scope).
2024-05-23 20:50:23 -05:00
Shun Sakai
6d8b4214d5
Add completions for reuse-tool (#10511) 2024-05-23 16:53:53 -05:00
Fabian Boehm
5bd1c5ecbf completions/git: Move unmerged to git restore --staged
I still don't get how exactly restore works.

Fixes #10518
2024-05-23 15:08:55 +02:00
Fabian Boehm
00e0d6ad9d Yet more shortening 2024-05-23 14:36:56 +02:00
Johannes Altmanninger
2f84f76cc2 completions/bind: complete ctrl/alt modifier abbreviations 2024-05-22 22:38:06 +02:00
Johannes Altmanninger
de7f39d627 builtin bind: make function keys lowercase (f1 instead of F1)
All other key names are lowercase so this inconsistency is weird.
2024-05-22 22:38:06 +02:00
Mahmoud Al-Qudsi
4869b98482 completions/flatpak.fish: Use terser/faster declarative style 2024-05-22 13:53:25 -05:00
Mahmoud Al-Qudsi
c2ecfe60ac completions/flatpak: Fix compatibility with older versions
Filter out ansi control characters and pretty formatting from older versions
that don't detect the absence of a tty.

Closes #10514.
2024-05-22 13:53:25 -05:00
Michal Koutný
fa0c585662
completions/git: Add git branch --edit-description (#10512)
* completions/git: Add `git branch --edit-description`
2024-05-21 18:56:52 -05:00
Jannik Vieten
bd4e5fe69a
completions ip: silence stderr in case -d does not exist (busybox) (#10509) 2024-05-20 07:28:40 -05:00
Peter Yates
56a168d37f Prevent loading of psqlrc when listing databases
Users have the ability to override the way records are displayed in psql by
changing the format[1] and linestyle[2] settings. These settings also affect the
output of psql commands used for autocompletion, like listing databases and
users - so they inadvertantly break Fish's completion.

If we suppress the loading of psqlrc[3] the default settings are used instead.

[1] https://www.postgresql.org/docs/current/app-psql.html#APP-PSQL-META-COMMAND-PSET-FORMAT
[2] https://www.postgresql.org/docs/current/app-psql.html#APP-PSQL-META-COMMAND-PSET-LINESTYLE
[3] https://www.postgresql.org/docs/current/app-psql.html#APP-PSQL-OPTION-NO-PSQLRC
2024-05-20 14:04:38 +02:00
ridiculousfish
efefeda392 Restore some iTerm2 default key bindings
c0bcd817ba removed some key bindings, including the bindings of
ESC ESC [ C for Alt-Right. the commit claimed that
"Sequences like \e\eOC are Escape followed by an SS3 arrow key which we
can already decode separately." but for whatever reason this doesn't work:
Alt-Right is broken in iTerm2 by default.

Restore the default ESC ESC [ X bindings for iTerm2 compatibility.
2024-05-19 11:01:14 -07:00
Klaus Hipp
4659fdf704
Add git-lfs completions (#10490) 2024-05-19 09:09:33 -05:00
tesuji
255c8da22d
add completions for ibus (#10500) 2024-05-19 09:05:40 -05:00
Jannik Vieten
66d28f5fda
completions: improved ip completions (#10505)
- complete routing table names/IDs
- rudimentary completions for ip rule subcommand
2024-05-19 09:00:29 -05:00
Mahmoud Al-Qudsi
ef614ba2d9 Speed up rustc completions, filter out deprecated options
Don't unconditionally execute the plumbing to get `rustc -C` completions (use it
only when trying to complete `rustc -C`), filter out deprecated options, and use
fewer calls to the `string` builtin to optimize further.

Need to do the same thing for the `-Z` completions next, those hang the shell
for a good 1.5+ seconds.
2024-05-18 12:37:18 -05:00
Mahmoud Al-Qudsi
0a7725e469 Add comment re accuracy of cargo --target completions
[ci skip]
2024-05-18 12:00:45 -05:00
Mahmoud Al-Qudsi
cbb399f2ed completions/cargo.fish: Add python fallback for jq 2024-05-17 18:45:19 -05:00
Mahmoud Al-Qudsi
79f7b9f92a completions/cargo.fish: Dynamically generate --features completion 2024-05-17 18:17:53 -05:00
Mahmoud Al-Qudsi
f342ae6a1c Add a completion helper function to generate permutation completions
I've been needing this for some time to generate completions for functions that
we can dynamically generate completions for that take one or more
comma-separated values in any order.
2024-05-17 18:15:41 -05:00
Mahmoud Al-Qudsi
6dbae76b24 Update cargo-asm completions
Try not to let `cargo asm` build a large project and hang the terminal (and make
the fans go crazy) if we try to generate a list of functions/paths and the
project is in a dirty state. Also support dynamic completion of --target.
2024-05-17 17:10:10 -05:00
Mahmoud Al-Qudsi
1d36c6ad8c completions/cargo.fish: Generate dynamic --target options
If rustup is installed, use the existing `__rustup_installed_targets` to get a
list of installed targets to compile for. If it's not, print a list of all
targets known to rustc.

It sucks that the completions file is currently architected in a way where we
have to manually specify the arguments for each subcommand. 🤷
2024-05-17 16:57:40 -05:00
Mahmoud Al-Qudsi
9ab1ec2a9e Tweak newly added rustc completion descriptions
Addendum to https://github.com/fish-shell/fish-shell/pull/10491
2024-05-17 12:33:59 -05:00
tesuji
d3758d3751
completion: add more arguments for rustc --print (#10491)
Based off of rustc 1.80.0-nightly
2024-05-17 12:32:41 -05:00
Ian Chamberlain
1462da3ae2
Complete cargo check bin targets like build (#10499)
Since `check` operates on basically the same things as `build`, it makes
sense to complete binary targets the same way (i.e. tests, bins, examples)
2024-05-17 12:31:30 -05:00
Mahmoud Al-Qudsi
0271d91d3a Add completions for cargo-asm 2024-05-17 12:31:02 -05:00
Fabian Boehm
5dc07c9e7e completions: More shortening
Also removes a few deprecated options - there's really no need to
offer these.
2024-05-16 18:29:42 +02:00
Fabian Boehm
8bac13360b completions/gcc: More cleanup
These options, I tell you
2024-05-15 20:07:28 +02:00
Fabian Boehm
173bcf29ab completions/gcc: Cleanup options
- Remove duplicated options - we had `-type` 9 times!
- Remove deprecated options and synonyms
- Make descriptions shorter, even removing some - when they're inscrutable they might as well not be there.

Really, 99.8% of these options are of interest to nobody except possibly (a subset of) gcc developers, so it pays to have *less* on your screen that you don't use anyway.
2024-05-15 17:05:02 +02:00
Fabian Boehm
4cadaa4041 completions/gcc: Fix some options
Especially the "-l" one was *always* offered.
2024-05-15 17:05:02 +02:00
Johannes Altmanninger
35b689335a Strip control characters from pasted text
We ignore typed control characters 33a7172ee (Revert to not inserting control
characters from keyboard input, 2024-03-02).

We used to do the same for bracketed paste but that changed in 8bf8b10f6
(Extended & human-friendly keys, 2024-03-30) which made bracketed paste
behave like fish_clipboard_paste; it inserts the exact input (minus leading
whitespace etc). At that time it wasn't clear to me which behavior was the
right one (because of the inconsistency between terminal and bracketed paste).

As reported in
https://matrix.to/#/!YLTeaulxSDauOOxBoR:matrix.org/$PEEOAoyJY-644amIio0CWmq1TkpEDdSy2QnfJdK-dco
trailing tabs in pasted text can be confusing.

There seems to be not real need to insert raw control characters into the
command line, so let's strip them when pasting.

Now the only way to insert a raw control character into the command line is
to recall it from command history.  Not sure what the behavior should be for
that case, we can revisit that later. If we get rid of raw control characters
entirely, then we can also delete the new "control pictures" rendering :)
2024-05-14 23:14:49 +02:00
Fabian Boehm
24836f9652 Use set --no-event in the key binding functions
This is how we can use it in a backwards-compatible way. Eventually we
would remove the compatibility guff.
2024-05-14 17:31:47 +02:00
tesuji
f71623ec1b
Partially update zig completions for zig 0.13 (#10479)
Try for completeness with `zig -h` and `zig build -h`
2024-05-09 15:31:07 -05:00