Commit Graph

3992 Commits

Author SHA1 Message Date
exploide
f32b887dba added completions for ethtool 2021-09-14 21:44:44 +02:00
Johannes Altmanninger
51a3885d8c funced: avoid interpreting special characters in function name
Commit c3374ffd0 ("Use read --tokenize instead of eval for $BROWSER &
$EDITOR") converted uses of "eval" for environment variables to use the
safer "read -at", which performs word splitting but no other expansion.

funced contained a leftover instance of "eval". Remove it in favor
of using the editor command that was already word-split.
This means that we don't accidentally evaluate the file name.

(Also "set -gx EDITOR=~/my-editor" won't work anymore because the ~
is not expanded anymore but no one has complained about that behavior
in edit_command_buffer.)

Fixes #8289
2021-09-13 19:16:41 +02:00
Victor Diaz
8c09fc7a3a Prepend command to cat
*Problem:*
edit_command_buffer uses `cat` to return the modified content.
If a person has an alias for `cat` to a different command such `bat`** the editing will not be useful anymore since bat decorates the text with frames, line counts, etc

*Solution*
Appending command to cat, fish will ignore the alias and execute the real command according to this https://fishshell.com/docs/current/cmds/command.html

** https://github.com/sharkdp/bat
2021-09-12 22:11:01 +08:00
Kid
139b74d8eb Fix fish_key_reader wrapper check 2021-09-05 21:42:35 +02:00
Fabian Homborg
aa58a54224 Webconfig: Add my own colorscheme
Already added my prompt, might a well.
2021-09-03 17:38:34 +02:00
Fabian Homborg
08690e0303 Webconfig: Use theme's name if available
The "name" here refers to the `# name:` line from the .theme file.
That's a much more descriptive name and allows using simpler filenames.
2021-09-03 17:37:54 +02:00
Fabian Homborg
4194977569 Prompt demo: Only the unmatched quote is an error
The text after is normal quoted text since
822b53c67a.

We might want to find nicer error text.

Fixes #8260.
2021-08-30 17:32:55 +02:00
mtoohey31
25b9568f2a completion: exif (#8246)
Adds completion support for the exif command line tool (upstream:
https://github.com/libexif/exif).
2021-08-29 11:35:08 +02:00
Akatsuki Rui
9022b9bef6 feat(completions/coredumpctl.fish): new complete for systemd 249 2021-08-28 19:36:23 +02:00
Akatsuki Rui
a113b3a755 fix(completions/coredumpctl.fish): missing --arguments 2021-08-28 19:36:23 +02:00
Takumi Kameyama
6bd25ed599
Fix completions/ls.fish (#8249)
* Fix ls.fish: add -l option to GNU ls

* Sort alphabetically and remove --lcontext and --scontext (what are these?) on shared and GNU part.

* Revert --lcontext and --scontext options.
2021-08-24 19:29:32 +02:00
Kid
48e4ce2f6d Add and fix completions for new options 2021-08-23 18:04:11 +02:00
Lars Lenckowski
284b7d8eb0 complete "mpc load" 2021-08-23 18:03:57 +02:00
Fabian Homborg
0e06a53dff help: Add sections directly via the <span id>
This should add all the sections that aren't linked internally,
including "identifiers".

(also give up on the line breaking because it makes it annoying to do
automatically)

Fixes #8245.
2021-08-22 13:14:59 +02:00
Fabian Homborg
fe71e62a68 help: Update sections
This was semi-automated with

```fish
for file in $argv
    set -l varname (string replace -r '.*/(.*).html' '$1' -- $file | string escape --style=var)pages
    set -l sections (string replace -rf '.*class="headerlink" href="#([^"]*)".*' '$1' <$file)

    echo set -l $varname $sections
end
```

(where $argv contains the path to faq, fish_for_bash_users,
interactive, language and tutorial.html)

Building help.fish at compile time would work, but only for users who
build the docs.
2021-08-20 17:40:57 +02:00
Mahmoud Al-Qudsi
d27f477ba6 Fix truncated completions for pkg install <foo>
The same hack that is used for `pkg remove <foo>` is required here, too.
Due to the massive number of results, we use `head -n 250` to prevent
the completion from hanging or the shell from being overencumbered by
too many possibe completions. However, this would only generate matches
for any of the first 250 packages, rather than printing the first 250
packages that match.

[ci skip]
2021-08-18 00:20:08 -05:00
aca
321fd74de0 edit_command_buffer: use "command" to ignore any functions with the same name 2021-08-17 06:24:09 +02:00
David Adam
ff8f26e65a funced: suggest saving functions when an editor is used 2021-08-16 21:45:23 +08:00
David Adam
8dd4c67db1 funcsave: edit the whole file containing a function
Many functions ship in files with helper functions, and it is useful to
edit those too.

Closes #391.
2021-08-16 21:45:22 +08:00
David Adam
52eff27239 funced: don't source or save unmodified files
If funced is just used to inspect a function, there's no need to write
it to storage or to reload it.
2021-08-16 21:44:43 +08:00
David Adam
911269c4a9 funcsave: avoid the edited function's path being a temporary file
As functions know where they are loaded from now, there is no point in
them being marked as loaded from a temporary file that has been removed.
Source the function via a redirect instead.
2021-08-16 21:44:43 +08:00
mtoohey31
703a717660 completion: support --no prefixes for mpv flag options 2021-08-14 10:56:23 +02:00
ridiculousfish
b0b6a585a8 Support Apple_Terminal in fish_vi_cursor
This enables it unconditionally, as tests show that the cursor escapes
are ignored before 10.12.

Fixes #8167
2021-08-10 13:23:08 -07:00
Johannes Altmanninger
7b55c0edb4 completions/git: finish completions for git bisect 2021-08-10 21:01:39 +02:00
Johannes Altmanninger
96e665f9ec __fish_complete_subcommand: (re)move confusing comment 2021-08-10 21:01:39 +02:00
Fabian Homborg
6c1ec98e92 prompt_pwd: full-dirs set to 0 means not even last component is safe
Alternative is to print an error.
2021-08-09 17:42:00 +02:00
Fabian Homborg
af2952dd2f Allow passing directories to prompt_pwd
This allows us to test it without cd-ing about the place.
2021-08-09 17:42:00 +02:00
Fabian Homborg
7a8feb4656 prompt_pwd: Allow keeping components full length
And allow passing the parameters as options.
2021-08-09 17:42:00 +02:00
Andrew Schulman
afef67b4e8 Fix dirs returns false when $dirstack is empty 2021-08-09 12:43:03 +02:00
exploide
60a9dcbf05 updated ping completions
support for ping from iputils (version 20210202)
support for ping from inetutils (version 2.1)
support for ping from busybox (version 1.33.1)
support for ping from FreeBSD and macOS (by @juntuu)
2021-08-06 17:08:50 +02:00
Fabian Homborg
3ed49304f2 Completions 2021-08-04 21:09:47 +02:00
Fabian Homborg
fcbf303e05 Only do the macOS apropos thing if makewhatis is available
This won't work without it, and happens to be broken on jailbroken
iOS.

Fixes #8205.
2021-08-04 18:55:01 +02:00
Kid
c7c67755d3
Add --function to set completion (#8202)
* Add `--function` to `set` completion

* Resolve review

* Revert other changes
2021-08-04 08:49:51 +02:00
Johannes Altmanninger
1b20e75f19 Run fish_indent on share/**.fish 2021-08-01 18:59:45 +02:00
Branch Vincent
bb10cdbd77 add missing git commit completions 2021-07-30 19:39:53 -07:00
Sam Yu
ac6507776f
Add zypper subcommands completion (#8183)
* Add zypper subcommands completion

rename functions to avoid confusion

* Revert partial changes
2021-07-30 18:24:32 +02:00
exploide
ac81d370cd completion nmap: suppress warning when local scripts folder exists 2021-07-30 17:41:55 +02:00
Kevin Konrad
413fd2fc03 extract argcomplete completion mechanism into its own function 2021-07-28 18:10:59 +02:00
Kevin Konrad
336de2d9fa add completion for qmk 2021-07-28 18:10:59 +02:00
YAKSH BARIYA
0b8b535187
Add completions for gping (#8181) 2021-07-28 17:53:44 +02:00
Branch Vincent
d8465e0a86 document --no-config 2021-07-27 23:00:23 +02:00
Johannes Altmanninger
6c0af841e2 completions/set: fix quoting error 2021-07-23 22:02:01 +02:00
Johannes Altmanninger
72fd328ad2 fish_clipboard_{copy,paste}: only use xsel/xclip if $DISPLAY is set
Ubuntu's fish package on WSL 1 has xsel as recommended dependency,
even though there is no X server available.  This change makes us
use Windows' native clipboard even when xsel is installed.
2021-07-23 20:55:07 +02:00
Fabian Homborg
7167ba6e08 Work around Terminal.app's awkward alt-left/right sequences
Just do the more involved thing.

Blergh.

Fixes #2330.
2021-07-23 19:38:43 +02:00
Aniruddh Agarwal
0445126c2e Undunder __fish_is_nth_token
We keep __fish_is_nth_token for compatibility and edit the
implementations of __fish_is_nth_token, __fish_is_first_token and
__fish_is_token_n to use fish_is_nth_token
2021-07-23 17:25:50 +02:00
Fabian Homborg
c35ffc58fc
Merge pull request #8134 from thunder-coding/complete-more-git-commands
Add missing completions for some git commands
2021-07-23 08:01:38 +02:00
Yaksh Bariya
e9a16ed7b5
Fix typos 2021-07-23 06:55:07 +05:30
Yaksh Bariya
692c6ae118 Add completions for git-sizer 2021-07-22 19:29:05 +02:00
Fabian Homborg
11da6db009 Cleanup of a comment 2021-07-22 19:19:49 +02:00
Yaksh Bariya
29fc74bc6a
Remove -F supplied to complete
Using `complete -F -c git -n __fish_git_needs_subcommand -a $command -d
$description` causes file completions to be forced on entire git command
which is not a desired result. Morever without the `-F` flag file
completions work just as expected and is useless addition
2021-07-22 17:06:59 +05:30