Commit Graph

3758 Commits

Author SHA1 Message Date
Fabian Homborg
0a3fec5e8b __fish_print_pipestatus: Reset modifiers again
Called as

__fish_print_pipestatus "[foo" "oof]" "|" (set_color green) (set_color --bold blue) 0 1 2

it would make the closing `oof]` bold green.

Fixes #7771.
2021-03-03 19:20:28 +01:00
exploide
1f3fdf2de6 added hashcat completions 2021-02-28 12:13:58 +01:00
exploide
5ab61dde12 added completions for JohnTheRipper 2021-02-28 12:13:58 +01:00
Brett Jia
384975c892
git: Shorten various long descriptions (#7752)
* Shorten various long descriptions

* Address review comments
2021-02-28 12:12:57 +01:00
Afsar Pasha
9909623262 Fixed __fish_adb_get_devices 2021-02-28 12:12:01 +01:00
Birk Tjelmeland
2719179bc1 Fix pandoc completion error
Pandoc completions would give an error if the folder `~/.pandoc`
does exist. This commit fixes that.
2021-02-27 22:31:42 +08:00
nosed1ve
aa608a42ff
Ensure web_config works on WSL (#7742)
* Ensure web_config works on WSL

web_config could sometimes fail on WSL if the user chose not to append
windows directories to their linux $PATH. This change ensures that the
cmd.exe executable is found in most cases even if windows directories
are not appended to $PATH on linux.

An error message letting the user know that cmd.exe was not found, and
that they should add the cmd.exe dir to their $PATH before running
fish_config is displayed if cmd.exe is still not found.

* Exit with a non 0 status code if cmd.exe is not found
2021-02-25 16:21:34 +01:00
David Adam
39230978b3 docs: call the CHANGELOG "release notes" 2021-02-25 22:46:24 +08:00
Fabian Homborg
b8d28158a6 Do disown the completion updating without $last_pid
In this context, as it stands, $last_pid will give fish's pid (because
of pgroup shenanigans).

Since that doesn't really work, just `disown` without and let fish
figure out what the last process was.

Theoretically this has an issue if someone started a background
process *before* the python script *and* that exits before we run
disown.

That's a vanishingly small window and this is only run on first start,
so it seems acceptable.

Fixes #7739.
2021-02-24 20:30:01 +01:00
ridiculousfish
e7d5a40252 Correct description for 'git worktree lock' description
Fixes #7731.
2021-02-20 11:36:36 -08:00
Jason
1f546ac1d0 abbr: improve error handling when --erase called with no args 2021-02-20 11:33:48 -08:00
Fabian Homborg
477587a4d4 webconfig: Remove more margins on small screens
This still showed the background gradient, which is just a waste and
looks weird.

Instead make the actual content fullscreen (except for the border
radius, for now)
2021-02-15 20:07:24 +01:00
ridiculousfish
c35535dee7 Do not show the history variable in fish_config
The history variable may be so large that it hangs the browser, as
spotted in #7714. Omit this from the variable list.
2021-02-15 10:47:13 -08:00
Johannes Altmanninger
e16a1d7065 Add deprecated compatibility wrapper for __fish_commandline_is_singlequoted
It could be really annoying if Ctrl-V stopped working when switching between
fish versions, for example when using different machines.
2021-02-13 08:55:59 +01:00
Johannes Altmanninger
4c1173f2ae fish_clipboard_paste: trim indentation when pasting multiple lines
When pasting a multiline command with indented blocks, extra indentation
from spaces, or tabs, is generally undesirable, because fish already indents
pipes and blocks. Discard the indentation unless the cursor or the pasted
part is inside quotes.

Users who copied fish_clipboard_paste need to update it because
__fish_commandline_is_singlequoted had an API change and was renamed.
2021-02-13 08:55:59 +01:00
Johannes Altmanninger
f99c275e42 completions/tig: directory completions after -C want a space
Since https://github.com/jonas/tig/releases/tag/tig-2.5.2
2021-02-13 08:07:20 +01:00
exploide
2bab31a316 updated metasploit completions 2021-02-09 23:11:50 +01:00
Johannes Altmanninger
330883b6fd Run fish_indent on share/**.fish
This is mostly to show that some of my following indent changes don't break
current behavior.
2021-02-08 07:31:33 +01:00
Ilya Grigoriev
254729f86d Fix Alt+L when using the "Informative" prompt
I ran into problems described in https://github.com/fish-shell/fish-shell/issues/718 when using this prompt. This seems to be a bug in the prompt -- this change fixes it, at least on my system. 

I tried this in tmux (TERM=screen) and gnome-terminal (TERM=xterm-256) with fish 3.1.2, on Linux.
2021-02-07 08:54:02 +01:00
Fabian Homborg
2a9edfe26e help: Better handle builtins when docs aren't installed
__fish_print_commands just prints the commands we have man pages for,
and help uses that to figure out whether it should link
a command or a section. If the docs aren't installed it won't find
anything.

At least check the builtins, because we document them and it's easy.

This probably needs to be added at build time - glob
doc_src/cmds/*.rst.
2021-02-05 17:19:07 +01:00
Shun Sakai
d8530257c7 Add completions for libavif 2021-02-05 12:25:04 +01:00
Shun Sakai
060e796577 Add completions for the JPEG XL Reference Software 2021-02-05 12:24:23 +01:00
Fabian Homborg
cf4f8ae929 Revert "Color "ip" output if available"
This reverts commit abb59a6ec9.

This is still buffered if piped to another function, like with the default `grep`.

See #5340, #5356.
2021-02-02 18:44:44 +01:00
Johannes Altmanninger
29ee4d318d Do use autogenerated completions for external git subcommands
Some third party Git tools provide a man page, which we can at least use
for completing options.

The old logic excluded all generated completions for Git subcommands.
Instead, try to load completions for all available external subcommands.
We can use $PATH/git-* because /bin/git-add and friends were removed in Git
1.6.0 in 2008.

Closes #4358 (the "git-foo" wrapping was added in #7652)
2021-02-02 07:54:28 +01:00
Johannes Altmanninger
abb59a6ec9 Color "ip" output if available
This is supported since iproute2 v4.19.0

Closes #5340
2021-02-02 06:39:40 +01:00
Fabian Homborg
dd48fdc970 Remove hostname function
This was only a thing in cygwin, and only a workaround because
cygwin's hostname was broken in 2013 and our sample prompts called it,
which caused errors in fish_config.

Our sample prompts no longer call `hostname` at all (they use
`prompt_hostname`, which uses the variable), and it's possible
cygwin's hostname was fixed in the meantime.

Fixes #7669.
2021-01-31 08:36:00 +01:00
Akatsuki Rui
176e6a9ce1
completions/userdbctl: init (#7667)
* completions/userdbctl: init

userdbctl:
    Show user and group information.

A part of systemd.

* completions/userdbctl: fix complete services

Complete the services at the completion time.
2021-01-30 18:25:22 +01:00
Akatsuki Rui
350f6fe350
completions/networkctl: add missing commands (#7668)
* completions/networkctl: add missing commands

* completions/networkctl: fix complete devices

Complete the devices at the completion time.
2021-01-30 18:24:41 +01:00
Fabian Homborg
594d51e7eb Add a separate --profile-startup option to profile startup
This goes to a separate file because that makes option parsing easier
and allows profiling both at the same time.

The "normal" profile now contains only the profile data of the actual
run, which is much more useful - you can now profile a function by
running

   fish -C 'source /path/to/thing' --profile /tmp/thefunction.prof -c 'thefunction'

and won't need to filter out extraneous information.
2021-01-29 20:46:34 +01:00
Johannes Altmanninger
0ed7d67532 completions/git: minor cleanup 2021-01-27 07:31:54 +01:00
Johannes Altmanninger
085c1d2096 completions/git: avoid loading git-foo completions twice
We were soucing it manually, and implicitly via the `complete -C "git-foo "`
wrapper. Always use the latter, so fish knows that the completion is already
loaded.
2021-01-27 07:31:54 +01:00
Fabian Homborg
a78ec8c8cb webconfig: Use flexbox for the colorschemes
This had a classic float:left layout, which led to awkward gaps and
stuff.

Since what we want here is basically 100% exactly a flexbox, just use that.

Note: No flexbox for the prompts, atm, because having multiple of
those next to each other looks a bit weird.
2021-01-26 20:47:18 +01:00
Fabian Homborg
b722e9ae32 sample_prompts/sorin: Move the right prompt into the prompt function
Our old problem with fish_config
2021-01-26 19:23:59 +01:00
Johannes Altmanninger
09161761c1 Complete custom "git-foo" commands from "git foo"
Since #7075, git-foo.fish files are sourced when Git completions are loaded.
However, at least Cobra (CLI framework for Go) provides completions like

	complete git-foo ...

This means that completions are only offered when typing "git-foo <TAB>"
and not on "git foo <TAB>". Fix this by forwarding the completion requests.
Take care to only forward if there are actually completions for "git-foo",
to avoid adding filename completions.
2021-01-25 19:09:56 +01:00
Fabian Homborg
8907606b07
completions/ps: Fix typo
Fixes #7657
2021-01-25 13:22:14 +01:00
Fabian Homborg
28f4f82246 completions/gem: Unbreak
See #7655.
2021-01-24 21:00:50 +01:00
Fabian Homborg
66932b74b2 completions/launchctl: Unbreak
These passed the description as part of the argument but didn't escape
them properly.

Instead, let's just use a description.

Fixes #7655.
2021-01-24 20:08:22 +01:00
Johannes Altmanninger
58df0bc051 __fish_print_pipestatus: remove fallback colors for missing arguments
The arguments were not optional because we use
"set -e argv[1 2 3 4 5]"
2021-01-24 14:28:14 +01:00
Wez Furlong
4b0152575e Enable OSC 7 when running in WezTerm
Over in https://github.com/wez/wezterm/issues/115#issuecomment-765869705 one of my users noted that fish had automatic OSC 7, but that it wasn't enabled under WezTerm.

You can detect WezTerm through the `$TERM_PROGRAM` environment.  In practical terms, all versions of wezterm in the wild support OSC 7 so a version check is not needed.

I'm not a fish user myself, but I did give the equivalent change to this a try on my Fedora 33 machine (it has an older version of fish).

I can see in this file that there's some stuff with `__fish_enable_focus` that you may also want to enable under wezterm; the escape sequence is supported as are panes, tabs and windows.
2021-01-23 18:10:32 +01:00
Fabian Homborg
3eff7b26bf __fish_print_pipestatus: Add missing quotes
If this was called without an argument you'd not have a valid `test`
invocation.

Gosh I hate test.
2021-01-22 21:55:35 +01:00
Fabian Homborg
a407af2944 completions/git: Silence git's errors
This can spew about not finding the ignore file in some circumstances.
2021-01-22 21:54:36 +01:00
Alexander Sieg
ddab61616f
Include completion for all pkg alias subcommands (#7642)
* Include completion for all pkg alias subcommands

* Formatting and dynamic evaluation of alias subcommands

* only set package_name completion once

* fixed syntax error
2021-01-21 18:43:26 +01:00
Akatsuki Rui
1a9835f55e
completions/mtr: init (#7638)
* completions/mtr: init

Add mtr completion.

[ci skip]

* completions/mtr: edit descriptions
2021-01-19 18:09:09 +01:00
Mahmoud Al-Qudsi
e2273bacb2 Separate completions for GNU and BSD ps command
It's not just -F; the majority of options are actually not portable
between the two.

Closes #7545
2021-01-18 14:23:39 -06:00
Fabian Homborg
bc6414aaa8
!fixup fish_git_prompt: Fix variable name
This missed one use of $user_variable
2021-01-18 12:37:30 +01:00
Fabian Homborg
dbfd3b5c39 fish_git_prompt: Remove a few unneeded variables 2021-01-17 21:04:16 +01:00
Johannes Altmanninger
f176503c0f Remove the explicit undo group in fish_clipboard_paste
It doesn't change the behavior, see
7669e8e497 (r45675920)
2021-01-15 20:23:59 +01:00
Johannes Altmanninger
692a8aef03 completions/xargs: provide subcommand completions 2021-01-15 20:23:59 +01:00
Fabian Homborg
e192066e98 Add $fish_handle_reflow to disable winch handler
Overriding event handlers is annoying.
2021-01-15 18:37:06 +01:00
Fabian Homborg
48082daad4 Turn off reflowing for Konsole >= 21.04 as well
See https://bugs.kde.org/show_bug.cgi?id=196998, https://invent.kde.org/utilities/konsole/-/merge_requests/321

Part of #7491.
2021-01-15 18:37:06 +01:00