Commit Graph

2226 Commits

Author SHA1 Message Date
Fabian Homborg
d6a9d6c59e git completions: Add missing quote
Fixes #4187.
2017-07-05 15:04:44 +02:00
Kurtis Rader
83ecf84392 harden git completion against an undef var 2017-07-04 17:34:52 -07:00
Kurtis Rader
4853ec0281 harden psub again an undef TMPDIR 2017-07-04 16:35:32 -07:00
Kurtis Rader
8caab103d8 harden man against undef vars 2017-07-04 13:56:35 -07:00
Kurtis Rader
2df89f4b0f check if $fish_color_cancel is set before using it 2017-07-04 13:56:35 -07:00
Fabian Homborg
9fb7037174 fish_key_reader: Add --version option
This should be there anyway, and we try to find fish_key_reader for
.app bundles, so this stops us from defining aliases to the command.

See #4179.
2017-07-04 22:55:47 +02:00
Kurtis Rader
f6d101e7ad fix undef var reference in history
The change for issue #4163 brought to light the pointless attempt to use
`$_` in the `history` function.
2017-07-03 16:26:27 -07:00
Kurtis Rader
0ec9acf0f0 harden abbr against undef vars
This is only needed if we make undefined vars an error as proposed in
issue #4163 but it's a good idea anyway.
2017-07-03 13:05:50 -07:00
Kurtis Rader
763063e741 more changes to better handle undef vars
This is only needed if we make undefined vars an error as proposed in
issue #4163 but it's a good idea anyway.
2017-07-03 10:16:31 -07:00
Kurtis Rader
4f345fdee7 harden *share/config.fish* against an unset var
This is only needed if we make undefined vars an error as proposed in
issue #4163 but it's a good idea anyway.
2017-07-02 21:16:48 -07:00
Kurtis Rader
ea38519a12 fix var name in __fish_git_prompt
Var `___git_ps_color_suffix_done` is supposed to be
`___fish_git_prompt_color_suffix_done`. This bug was found by an
experimental change to detect the use of undefined variables (#4163).

Similarly, we should simply test whether `__fish_git_prompt_showcolorhints`
is set rather than set to a non-empty string.
2017-07-02 20:49:40 -07:00
Kurtis Rader
85b42b22f4 define __fish_active_key_bindings before using it 2017-07-02 13:41:40 -07:00
Kurtis Rader
3284393aba cleanup some undefined var references
Testing a fix for #4163 revealed some questionable dereferencing of
variables that are not certain to be defined.
2017-07-02 13:41:40 -07:00
Sam Yu
6f6a4a842c Fix typo in zypper.fish 2017-06-30 14:46:43 +02:00
Fabian Homborg
3b5fdc3fb0 git completions: Fix aliases with weird characters
A use for the new `string escape --style=var`.

Fixes #4147.
2017-06-28 23:21:33 +02:00
Fabian Homborg
db529f06b8 type: Use command -a 2017-06-28 23:13:36 +02:00
Kurtis Rader
bb29f9f990 replace __fish_urlencode with string escape
We now have a builtin that can do URL escaping so use it. I can't find
any uses of our private `__fish_urlencode` function in any Oh-My-Fish or
Fisherman code so remove it.
2017-06-23 22:46:36 -07:00
Kurtis Rader
30368d5526 implement status function when in a breakpoint
Another step to fixing #1310. This changes means that `status -L0
function` reports the correct function when inside a breakpoint.
2017-06-23 22:14:21 -07:00
Hector Sanjuan
2d42baac35 Fix last status report (it's always 0)
It seems something is overwriting the status before it is
saved to a variable. Fixed by setting the last_status variable
at the very beginning.
2017-06-22 14:01:19 +02:00
Kurtis Rader
df01547eab implement the fish_breakpoint_prompt function
This is another step to resolving issue #1310. It makes
`fish_breakpoint_prompt` a replacement for `fish_prompt` if it is defined
and we're presenting a prompt in the context of a `breakpoint` command.
2017-06-20 17:18:59 -07:00
Kurtis Rader
bd299e96b2 implement status is-breakpoint
This implements `status is-breakpoint` that returns true if the current
shell prompt is displayed in the context of a `breakpoint` command.

This also fixes several bugs. Most notably making `breakpoint` a no-op if
the shell isn't interactive. Also, typing `breakpoint` at an interactive
prompt should be an error rather than creating a new nested debugging
context.

Partial fix for #1310
2017-06-20 17:18:59 -07:00
Rabah Meradi
d234a1870b Aucompletion for jest CLI 2017-06-19 23:27:22 -07:00
Fabian Homborg
1a135aa0b0 git completions: Make checking aliases faster
See #4117.
2017-06-19 11:04:40 +02:00
Clément Martinez
d5e1405cbe Add as completions 2017-06-18 23:10:23 -07:00
Kurtis Rader
af22bf3501 style cleanups (make style-all) 2017-06-16 21:01:57 -07:00
Fabian Homborg
cec2999983 Allow help to open the tutorial
This is unambiguous because all the anchors in tutorial.html begin
with "tut".
2017-06-14 13:52:24 +02:00
Fabian Homborg
82359ceb22 Update help completions
- More topics
- Some non-existent topics (todo/bugs) removed
- Some rewording (no more "Help on")
2017-06-14 13:40:14 +02:00
Clément Martinez
be1d32cade Add grub-install completions 2017-06-14 12:41:38 +02:00
Clément Martinez
a69537ea13 Add grub-file completions 2017-06-14 12:41:38 +02:00
Dale Eidd
2b4f61f294 Fix echo "no wildcard match" complaints for ssh completions etc 2017-06-10 14:06:20 +02:00
Dale Eidd
5b3904e66b Fix not including main ssh config in host names search 2017-06-10 14:06:20 +02:00
Clément Martinez
6161f54111 Add dhcpcd completions 2017-06-10 14:05:38 +02:00
Kurtis Rader
1f24432172 fix typo in error message 2017-06-09 12:12:36 -07:00
Daryl Roberts
a0c8a9e8ed update the node options for __fish_not_contain_opt to not have the "--" in front of their flags 2017-06-09 12:11:10 -07:00
Fabian Homborg
edaef4e6b0 Fix stray quote in magento completions
Fixes #4108.
2017-06-07 11:35:12 +02:00
Kurtis Rader
352cea1659 disable/enable bracketed paste by edit cmd buf
We need to disable/enable bracketed paste mode around running the editor
from within the `edit_command_buffer` function.
2017-06-05 11:32:06 -07:00
Kurtis Rader
5ef8b91db8 fix three explicitly translated messages 2017-06-02 20:40:58 -07:00
George Christou
5e39efa45b Fix ln file completion 2017-06-01 19:06:32 -07:00
Kurtis Rader
b8aacc29cd remove redundant output from __fish_complete_cd
Fixes #4085
2017-06-01 18:55:41 -07:00
Kurtis Rader
ee646c8dd0 move set -l to top of function
Fixes #4091
2017-06-01 17:58:29 -07:00
Martin Pelikan
65b0b947c9 Remove redundant/non-existent bind forward-kill-word 2017-06-01 17:50:05 -07:00
Kevin Ballard
3061eed647 Fix usage of osascript in help
Work around a macOS osascript bug in 10.12.5 which prevented help from
working. See #4035.
2017-05-31 23:01:31 +08:00
Kevin Ballard
5c140e5570 Revert "Use open instead of osascript in help"
This reverts commit f234637e53.
2017-05-31 23:01:31 +08:00
mascafidi
4c47fbc964 Add Expert Options to DUP command completion 2017-05-30 22:38:15 -07:00
ridiculousfish
2f5af733ba Use open instead of webbrowser.open on macOS >= 10.12.5
Works around an osascript bug. Fixes #4035.
2017-05-30 20:53:59 +08:00
ridiculousfish
f234637e53 Use open instead of osascript in help
Work around a macOS osascript bug in 10.12.5 which prevented help
from working. Fixes #4035.
2017-05-30 20:53:59 +08:00
Fabian Homborg
0fc9ec5538 type: Fix "-a"
This matched _all_ executable commands, where it should only match all
executable commands _with the given name_.

Fixes #4070.
2017-05-26 23:58:35 +02:00
Fabian Homborg
4afd41877f Fix various expansions in cd completions
This actually used the built-in file-completion logic as a fallback
for e.g. tilde-expansion (stuff like `cd ~/V`).

Fixes #4061.
2017-05-26 16:57:42 +02:00
Kevin Ballard
9bc1b44b0d Handle missing groff macro in __fish_print_help
The Xcode installation of Fish is missing the groff macro used by
`__fish_print_help`. This caused e.g. `status -h` to stop working.

Fixes #4058.
2017-05-23 19:57:18 -07:00
Kevin Ballard
4ff002b9fb Turn off bracketed paste when Fish exits 2017-05-23 17:36:09 -07:00
Kurtis Rader
a71bb03f23 fix killall completions
This fixes the obvious error in handling the `-u` short flag.
See issue #4052.
2017-05-22 20:17:08 -07:00
Fabian Homborg
036b708d99 help: Properly error out when no browser is found
See #4045.
2017-05-18 22:51:57 +02:00
Mo
71f5fe1ece Added Magento2 CLI completions (#4043)
* Added Magento2 CLI completions

This is the completion file for the Magento2 CLI application I use on my servers. It has an additional feature tho, I'm not sure if it fits into the fish completion philosophy:  
If you provide limited access credentials, it will connect to the MySQL database and provide additional suggestions, such as available users, themes or indexers in the database. If this file is never touched, those suggestions simply won't show up. I, personally, find them to be pretty useful, though.  

Should I remove those database suggestions before creating a PR?

* Removed functions using MySQL, updated formatting

* Several smaller fixes

* Improved descriptions

Tried to shorten the text as much as possible and removed unnecessary characters
2017-05-18 17:05:49 +02:00
Sven Sternberger
cbd9181b7e Update __fish_print_hostnames.fish
For Ubuntu the default global known host files are :
/etc/ssh/ssh_known_hosts  
/etc/ssh/ssh_known_hosts2
2017-05-17 16:59:18 +02:00
Alan Somers
3aa42389ef Fix syntax error in gphoto2 completions 2017-05-15 21:53:56 -07:00
Jonas Damtoft
573c539956 Gradle-completions for gradle tasks (#3972)
* Implement https://github.com/hanny24/gradle-fish/blob/master/gradle.load

* Use XDG_CACHE_HOME

* Use __funced_md5

* Fix fish_md5.fish

* Actually use the new function.

* Use string match for matching tasks

* I goofed. Actually pass a string to complete -a

* Fix attempt to remove needed function...

* Fix regex

* Fix fish_md5.fish to use a flag
2017-05-13 13:28:32 +02:00
Fabian Homborg
573e1ad4b1 type: Remove TODO
[Ci skip]
2017-05-11 15:24:47 +02:00
Clément Martinez
f0a00ab2f2 Add mkdosfs completions 2017-05-08 19:16:06 +02:00
Sebastian Keller
6620b9ec72 Add gsettings completions 2017-05-08 19:14:47 +02:00
Fabian Homborg
8814f34dc1 Improve killall completions
- Remove UID resolution, since that can be slow.
- Remove a `uname` call by storing the result
- Stringify
- Indent

Fixes #3996.
2017-05-04 23:58:45 +02:00
Adriaan Zonnenberg
09ce297352 Add completions for caddy 2017-05-04 15:09:29 +02:00
Fabian Homborg
084a820de3 Stringify xrandr completions 2017-05-03 23:36:43 +02:00
Fabian Homborg
c06a71bfbe Stringify hg completions 2017-05-03 23:36:25 +02:00
Fabian Homborg
044d45a0ff Stringify adb completions
Also reindent.
2017-05-03 23:35:34 +02:00
David Adam
d3cfab1391 webconfig: apply colour syntax highlighting to functions tab
Closes #1432.
2017-05-03 08:37:27 +10:00
David Adam
1e9caecbcb webconfig: import angular-sanitize module
Enables use of ngBindHtml.

Work on #1432.
2017-05-03 08:37:27 +10:00
Fabian Homborg
f5fac096c0 Don't move cursor in delete-char
Instead, move forward and backward in vi-mode.

Fixes #3899.
2017-04-28 22:53:03 +08:00
David Bishop
2565c5c15b Use $suffix in classic_vcs prompt instead of hardcoding to '>'
Also, ensure that suffix is local in both classic_vcs.fish and informative_vcs.fish.

Fixes #3991
2017-04-26 16:01:52 -07:00
Fabian Homborg
77201ade34 __fish_complete_users: Also test for command, not path 2017-04-25 17:36:22 +02:00
Fabian Homborg
49d3a58a9e __fish_complete_users: Use command, not a hardcoded path 2017-04-25 12:47:23 +02:00
Kurtis Rader
37508d1f1e refactor the __*_users functions
Per my comment in issue #3980 this implements `__fish_print_users` in
terms of `__fish_complete_users` so we don't have to modify both when a
change to how users are enumerated is needed.
2017-04-23 20:08:40 -07:00
Christian Rondeau
bea0b17c9e Aucompletion guards for /etc/passwd #3980 2017-04-23 19:41:07 -07:00
Fabian Homborg
ec92e91ddc fish_clipboard_paste: Turn \r into \n
We already do this in bracketed-paste because it's really confusing to
have a \r literal in the commandline.
2017-04-23 13:40:40 +02:00
Fabian Homborg
cc7d83fa94 fish_clipboard_paste: Fix multiline pasting 2017-04-23 13:38:32 +02:00
Fabian Homborg
17ba21cfe4 Fix pasting backslashes
Another missing escape.

Fixes #3981.
2017-04-23 13:32:24 +02:00
Alex Gaynor
f30c50cec5 [hg completions] remove a grep and use hg's native query syntax
This has the side benefit of working around a wild bug with readline+fish that I've reported to the upstream readline developers. (The result of that bug is that the hg processes are constantly being leaked as `bg` jobs in the shell, which is how I came to notice this in the first place)
2017-04-21 18:56:54 +02:00
Fabian Homborg
805a177673 __fish_config_interactive: Prefer python3
Also includes the CHANGELOG.
2017-04-21 13:45:49 +02:00
Fabian Homborg
e410d47565 fish_config: Pick a python
Also remove a use of `eval` and `string escape`.

Fixes #3970.
2017-04-21 13:45:49 +02:00
Fabian Homborg
7ef2d5e86f fish_update_completions: Pick a python
This removes a need for packagers to either patch our shebangs or pick
a particular python.

This was already done in __fish_config_interactive (where we need to
duplicate the code because it involves backgrounding).

Work towards #3970.
2017-04-21 13:45:49 +02:00
Kurtis Rader
b9d2e4d897 fix fish greeting regression
Fixes #3973
2017-04-20 20:17:50 -07:00
Fabian Homborg
cb9f4e621f lua completions: Try harder to find libraries
Fedora puts them in /usr/lib64 without having /usr/lib as a symlink.

Also silence errors (in case a directory doesn't exist) and stringify.

See https://bugzilla.redhat.com/show_bug.cgi?id=1442628.

CC @amluto.
2017-04-20 14:00:30 +02:00
Fabian Homborg
7c6600895e Add missing options to functions completion 2017-04-19 23:11:35 +02:00
Francisco Giordano
349eff0df7 change cancel_commandline function to use color from variable
This allows the user to define how they want the "^C" rendered when a
pending command line is interrupted.
2017-04-17 21:16:42 -07:00
Ivan Trubach
a9db99ac52 Rename replace-one to replace_one
Fixes invalid character in variable name $fish_cursor_replace-one (used by fish_vi_cursor[_handle]) by renaming bind mode 'replace-one' to 'replace_one'.
2017-04-17 21:10:23 -07:00
Adam Byrtek
e7d686461e Terraform completions (#3960)
* Basic Terraform completion supporting all commands

* Option completion for Terraform commands

* Search command line in reverse order

* CHANGELOG entry

* Fix `terraform untaint` completion

* Use common completion functions to handle subcommands

* Use imperative form and remove CHANGELOG changes
2017-04-17 17:18:39 +02:00
Adam Byrtek
dd69ca5a81 Warn when function is not modified by the editor after calling funced (#3961)
* Check whether tmp file was modified in `funced`

* More idiomatic error messages

* Store the checksum in a local variable

* MD5 function supporting both GNU and BSD

* Use `else if` in MD5 function

* Use `string` builtin instead of `cut`
2017-04-17 17:18:02 +02:00
Kurtis Rader
dcc081a594 mark __fish_sgrep as deprecated
Fixes #2450
2017-04-15 21:51:33 -07:00
Kurtis Rader
75f1e36b44 a step to remove __fish_sgrep per issue #2450 2017-04-15 21:49:08 -07:00
Kurtis Rader
b3617cfd86 a step to remove __fish_sgrep per issue #2450 2017-04-15 21:30:36 -07:00
Kurtis Rader
a381d959f2 a step to remove __fish_sgrep per issue #2450 2017-04-15 21:29:07 -07:00
Kurtis Rader
ae03df4bc4 a step to remove __fish_sgrep per issue #2450 2017-04-15 21:22:09 -07:00
Kurtis Rader
9d25b52208 a step to remove __fish_sgrep per issue #2450 2017-04-15 21:01:03 -07:00
Kurtis Rader
d48c872913 a step to remove __fish_sgrep per issue #2450 2017-04-15 20:59:09 -07:00
Kurtis Rader
4936de29e7 a step to remove __fish_sgrep per issue #2450 2017-04-15 20:23:48 -07:00
Kurtis Rader
3463e81dda a step to remove __fish_sgrep per issue #2450 2017-04-15 20:04:43 -07:00
Kurtis Rader
a3cd5bf170 a step to remove __fish_sgrep per issue #2450 2017-04-15 18:32:30 -07:00
Kurtis Rader
cc3efcc3ab a step to remove __fish_sgrep per issue #2450 2017-04-14 23:21:17 -07:00
Kurtis Rader
0be8d0d385 another __fish_sgrep replacement 2017-04-13 23:14:36 -07:00
Kurtis Rader
f20c7deaf1 a step to remove __fish_sgrep per issue #2450 2017-04-11 21:01:43 -07:00
Kurtis Rader
da09a915f2 improve __fish_complete_directories function
Reviewing a PR for a completion script caused me to look at the
implementation for the `__fish_complete_directories` function. Which in
turn lead me to create this change to improve its implementation and add
unit tests for the function.
2017-04-11 13:45:53 -07:00
Alan Somers
ed6298ad17 Fix portmaster completions when there are no matches
Don't spew warnings when there are no matches.  Also, use the string
builtin instead of calling sed.

Fixes #3949
2017-04-10 21:37:54 -07:00
Fabian Homborg
ddb9350ea9 Replace use of which with command -sq 2017-04-08 13:21:04 +02:00
Kurtis Rader
75600b6b53 fix setenv and add unit tests
Fixes #3937
2017-04-05 15:31:13 -07:00
SanskritFritz
2105bae1fc Completions for ipset 2017-04-01 01:52:05 +02:00
SanskritFritz
0c265c0f52 Obnam completions updated 2017-04-01 01:52:05 +02:00
SanskritFritz
cd8982b645 Obsolete completions removed 2017-04-01 01:52:05 +02:00
Kurtis Rader
62244f01c2 fix umask handling of symbolic modes
This fixes the handling of symbolic umask values. It also removes two
invocations of `perl` and all but two `math` commands.

Fixes #738
2017-03-28 16:28:24 -07:00
Fabian Homborg
4b9424eb20 type: Minor reformatting
Empty lines after `if` and `if begin`.
2017-03-28 15:55:10 +02:00
Fabian Homborg
c4d69ea8a1 type: Rewrite option parsing
Removes a call to `seq` and makes it a bit more readable.
2017-03-28 15:55:10 +02:00
Fabian Homborg
a3f28e221f type: Remove need for which
This should be completely equivalent without needing an external command.
2017-03-28 15:55:02 +02:00
Fabian Homborg
3d6c4adda9 Fix unescaped ' literals in bracketed-paste
This was a case of a missing \\.

Fixes #3913.
2017-03-26 09:33:11 +02:00
Fabian Homborg
83791a26c3 Stringify mkinitcpio completions
Also fixes an issue with the -k completions.
2017-03-21 01:31:26 +01:00
Fabian Homborg
70354f9f5e Add bind --list-modes option
Fixes #3872.
2017-03-20 16:42:53 +01:00
Kurtis Rader
536b1220fd cleanup __fish_complete_man.fish
I looked at this and noted some problems fixed by this change in
response to exploring if issue #726 was still unresolved.
2017-03-18 21:55:02 -07:00
Fabian Homborg
b6517250c7 vi-mode: \cd should do delete-or-exit
This just removes the special vi binding and hence falls back upon the
shared one.

Fixes #2219.
2017-03-17 12:07:10 +01:00
Fabian Homborg
99e87dded3 Auto-escape pastes inside single-quotes
This is to make pasting literals easier.

When a user pastes something, we normally take it as-is.

The exception is when a single-quote is open, e.g. the current token
is

    foo'bar

When something is pasted here, we escape single-quotes (`'`) and
backslashes (`\\`), so typing a `'` after it will turn it into a
literal token.

Fixes #967.
2017-03-16 16:08:13 +01:00
Kurtis Rader
6123d3cb50 document trap ... EXIT
Fixes #1180
2017-03-14 21:02:02 -07:00
Kurtis Rader
085a9b9267 fix stupid typo introduced by d9b30ab09 2017-03-14 13:17:53 -07:00
Kurtis Rader
d9b30ab090 setenv should behave like export
Fixes #3897
2017-03-14 12:14:22 -07:00
mus0u
b4f70cb98b include exit status indicator in robbyrussell sample prompt 2017-03-13 18:05:49 -07:00
Greynad
98f4e49669 Add string 'repeat' subcommand
This feature add the ability to repeat a string a given number of times.
For example: string repeat -n 3 foo
2017-03-12 20:30:36 -07:00
Fabian Homborg
db63be7909 Add support for bracketed paste
This is a terminal feature where pastes will be "bracketed" in
\e\[200~ and \e\[201~.

It is more of a "security" measure (since particularly copying from a
browser can copy text different from what the user sees, which might
be malicious) than a performance optimization.

Work towards #967.
2017-03-06 00:19:46 +01:00
Dan Zimmerman
f17ddb6770 Fix error when using tmux with vi mode 2017-02-28 19:05:05 +01:00
Clément Martinez
64fe617c63 Add gradle completions 2017-02-22 20:01:13 -08:00
Kurtis Rader
9dd0c47d0b harden alias against foo; bar
If the first word of the alias body ends with a semicolon we need to
strip that character, and otherwise escape the extracted command, to
ensure the subsequent function definition is valid.

Fixes #3860
2017-02-20 20:23:55 -08:00
Kurtis Rader
9f5ce04229 fix perl completions
Fixes #3856
2017-02-18 19:54:36 -08:00
Twinkle
a9617f97b6 enhance git repo for Robbyrussell prompt 2017-02-18 17:11:38 -08:00
Fabian Homborg
0a8c922d92 Use command -sq instead of redirection
This option has been available for a while now and it's a bit shorter.
2017-02-18 22:16:55 +01:00
David Adam
40de253b3a Upgrade git:// and http:// URLs to https://
Work on fish-shell/fish-site#47

[ci skip]
2017-02-17 21:31:44 +08:00
maxried
06b2775131 Improved adb completion
* Added reconnect and its subcommand
* Updated the sideload description and made its completion more advanced
* Silenced errors on backup and uninstall auto completion when no device is attached
2017-02-15 11:53:28 -08:00
Terje Larsen
22a2098c34 Add completions for helm (#3829)
* Add completions for helm

helm - is a tool for managing Kubernetes charts. Charts are packages of
pre-configured Kubernetes resources.

See: https://github.com/kubernetes/helm

* Improve helm release completions description

After some feedback from the community it seems it is good to include
the chart in the release description. This adds the chart information to
the description. So to say this is `Release of CHART`.

* Further improvements to helm completions

- Utilize complete -f, -r and -x properly
- Add some more context aware completions (chart versions, kubectl context and namespaces)
2017-02-13 17:23:29 +01:00
Alan Somers
ad6ea1691e Fix "mount -t" completions on non-Linux OSes
AFAICT Linux alone uses the "mount.XXX" convention for mount helpers.
Illumos, Irix, HPUX, OSX, and the BSDs all use "mount_XXX".

Fixes issue #3841
2017-02-12 18:05:37 -08:00
Kurtis Rader
813415302a fix clear screen invocation
It's necessary to use a subcommand to eat the newline that `string
replace` appends to the string.
2017-02-12 14:12:12 -08:00
Clément Martinez
cbea0b9378 mount & udisksctl: improve -o completions` (#3764)
* mount & udisksctl: improve `-o` completions`

* Update __fish_complete_mount_opts
2017-02-12 15:23:41 +01:00
Markus Reiter
f38646593c Allow export to set colon-separated PATH, CDPATH and MANPATH. 2017-02-12 15:20:07 +01:00
Fabian Homborg
9598218a94 Don't call fish in the background to generate completions
Fixes #3803 even harder.
2017-02-12 14:56:36 +01:00
Fabian Homborg
afdd1a98c1 Don't clear scrollback with the \cl binding
ncurses since 6.0 sends the "E3" sequence along with "clear", even for
just `clear` or `tput clear`. This deletes the scrollback buffer which
is usually not what you want.

Fixes #2855.
2017-02-12 12:01:28 +01:00
Fabian Homborg
52648acdc8 Check python version at runtime for completions
Some things like pyenv can change what `python` refers to, so what we
detect when we load the completions can become invalid later.

Also mentioned in #3840.
2017-02-11 16:07:06 +01:00
Fabian Homborg
f9664f224d Don't wrap pythonX completions
The issue here was that the `python` completion did a version check on
the `python` binary, so it would complete python2 stuff if system
python was py2, even if the user tried to complete `python3`.

This isn't beautiful, but it's more resilient than e.g. doing magic
with `commandline`.

Fixes #3840.
2017-02-11 16:07:06 +01:00
Markus Reiter
3e35e6e488 Use string split in alias. 2017-02-10 14:09:41 +01:00
Fabian Homborg
214c677032 Remove outdated completions
These are dead projects with completions that didn't provide much
value.

Fixes #3662.
2017-02-09 18:42:55 +01:00
Cristian Prieto
2bbecf4292 Yarn completion (#3816)
* Add main yarn commands and subcommands

* Add more short/long options

* Add subcommands for most main commands

* Add suboptions for mutext and access
2017-02-09 17:24:38 +01:00
Jeff Dickey
cf63d1b2a7 added mocha.fish 2017-02-08 14:22:30 -08:00
Kurtis Rader
0970cc8736 time for another make style-all 2017-02-07 21:52:35 -08:00
René Schwaiger
908ed493cc Fix wildcard bug in __fish_print_filesystems
Before this change the function `__fish_print_filesystems` would print
an error message about an empty wildcard match for the pattern
`$PATH/mount.*`, if the current operating system does not include any
helper binaries for the command `mount`. An example for such an OS is
the current version of macOS (version 10.12).
2017-02-06 08:08:54 -08:00
Rabah Meradi
a5e8b81ee3 Add completion for climate 2017-02-05 19:22:35 -08:00
ridiculousfish
8a09c99f36 Escape in vi mode to end paging, but stay in insert mode
Change the escape key binding in insert mode (in vi key bindings)
to check if we are in paging mode. If so, emit cancel and stay in
insert mode. Otherwise perform the current behavior of switching
back to default mode and adjusting the cursor.

Fixes #2871
2017-02-05 02:49:52 -08:00
Fabian Homborg
b3d5fb71f4 completion generator: Protect against undefined variable
Proc wasn't defined if $MANPATH was used.

Fixes #3808.
2017-02-03 18:32:14 +01:00
Fabian Homborg
94b71353ef completion generator: Define parent_paths directly if MANPATH is set 2017-02-03 18:32:14 +01:00
David Adam
49e98cde4c Merge branch 'Integration_2.5.0' 2017-02-03 21:14:40 +08:00
Clément Martinez
47ad707bba Add jq completions 2017-02-02 23:07:54 +01:00
Terje Larsen
bf84879134 Add completions for minikube (#3778)
* Add completions for minikube

This adds basic completions for minikube, the subcommands and their options.

* Improve minikube completions

- Use more consistent and shorter descriptions.
- Fix subcommand options
- Add more semantic completions

* Fix named variable for option value

* Add completions for minikube addons enable/disable

* Add completions for minikube addons open
2017-02-02 17:45:42 +01:00
Fabian Homborg
b7cdb6d586 Merge pull request #3757 from nim65s/master
systemctl completions: add cat & edit commands

Also use systemd version to determine the commands it knows.
2017-02-02 17:44:07 +01:00
Kurtis Rader
088b10f4c2 style fixes to previous commit
This commit addresses many of the style problems with the previous
commit. If this introduces any bugs they are solely my fault. The style
of this code needs more improvement. Some of which could be done today.
Others will have to wait until `fish_indent` is improved.
2017-02-01 22:49:40 -08:00
Dale Eidd
eff6b98813 numerous improvements to ssh/scp completions
Add IPV6 /etc/hosts completion support. Parses columns rather than values which produces improved output.

Support ssh -F and Include completion

Ignore ssh Hostname and Host with wildcard. The following only get in the way:

- Hostname: Host resolves to Hostname
- Wildcard Host: Cannot ssh to a glob pattern

Improve scp completions

* complete only local files when no host provided
* complete only remote files when host is provided
* complete local files or hosts when no separator

Disable username completion for ssh/scp

Username completion only provides local users which will unlikely be
useful on a remote machine. ssh will use the current username (the only
useful one) or one provided in the ssh config.
2017-02-01 22:12:49 -08:00
Clément Martinez
2b13472419 Improve htop completion
Add new options
Add description at the top of the file
Fix `--sort-key` completions
2017-01-31 15:52:55 -08:00
Clément Martinez
9d5471722f Improve help completions 2017-01-31 15:52:55 -08:00
Clément Martinez
0447ee7b96 Improve go completions 2017-01-31 15:52:55 -08:00
Clément Martinez
cd58e6129c Improve grep completions 2017-01-31 15:52:55 -08:00
Clément Martinez
0df65a106d Add setsid completions 2017-01-29 20:06:32 -08:00
Fabian Homborg
03e0f1eb21 create_manpage_completions: Try more ways to get manpath
Haiku only has `man --path`.

Still doesn't support OpenBSD.

Use $MANPATH if available. This needs to:

- Ignore stderr (we pipe it and throw it away)

- Read the subprocess returncode, since `man --path` is an existing
  command that fails instead of a non-existent one (that raises an
  exception)

- Properly set up the fallback

Fixes #2194.
2017-01-29 18:00:48 -08:00
Kurtis Rader
06282f02fd don't run fish_update_completions in unit tests
Running `fish_update_completions` in unit tests is not needed and
hideously expensive. To the point it can cause flakey test behavior.
2017-01-29 18:00:48 -08:00
Clément Martinez
61f272495d Add i3-msg completions 2017-01-28 19:48:57 +01:00
Cristian Prieto
7edfcd5c63 Add more options for git log
This closes #3743
2017-01-27 14:13:25 +01:00
Kurtis Rader
5b6cc5af6d time for another make style-all
Gotta keep the entropy (i.e., disorder) from increasing.
2017-01-26 20:05:46 -08:00
Fabian Homborg
98b561929f Add flatpak completions
A bit barebones, but better than nothing.
2017-01-26 22:04:27 +01:00
Fabian Homborg
f513f4e53a Add completions for xinput 2017-01-26 22:04:27 +01:00
Fabian Homborg
67a661c19f Fix dconf completions
This would always just suggest the commands.
2017-01-26 22:04:27 +01:00
Fabian Homborg
7d44f8e871 Add usermod completions
Fixes #3775.
2017-01-26 21:40:05 +01:00
Guilhem Saurel
e07928062f addressing comments 2017-01-26 00:01:34 +01:00
Clément Martinez
ec19159580 man completions: complete fish commands (#3762)
* man completions: complete fish commands

`apropos` does not output fish commands so they were not completed.

* Improve __fish_complete_man
2017-01-25 15:34:59 +01:00
Cristian Prieto
b7d60dc7bb Improve bzr completion (#3769)
* Improve bzr completion. Closes #3661

 * Add basic completion for bzr commands
 * Include short and log options for common commands
 * Removed not so common commands

* Remove trailing '.' as requested by #3769

* Remove '=' as suggested by #3769

 * We don't need '=' in long options

* Use fish helper functions for autocomplete

To avoid issues pointed out in #3769 helper functions included in fish
are used (__fish_use_subcommand and __fish_seen_subcommand).

* Fixed typo
2017-01-25 15:34:00 +01:00
Guilhem Saurel
fab4399b8c available completions for systemctl depends on its current version 2017-01-25 01:14:38 +01:00
Clément Martinez
3e10640c04 Add pv completions 2017-01-24 23:52:46 +01:00
Judicaël Grasset
730086b0f0 apt: Add completion for the autoremove subcommand (#3771) 2017-01-24 19:55:42 +01:00
Kurtis Rader
c9a409dcf3 deal with multiline commands which have flags
Fixes #3758

(cherry picked from commit 176a291ed2)
2017-01-23 09:11:06 +08:00
Kurtis Rader
176a291ed2 deal with multiline commands which have flags
Fixes #3758
2017-01-21 20:23:06 -08:00
Guilhem Saurel
1350b44ecf systemctl completions: add cat & edit commands 2017-01-22 03:22:29 +01:00
Clément Martinez
082d4b5a7e Add light completions 2017-01-21 00:33:58 +01:00
Fabian Homborg
c111a65622 Stack completions: Fix dead link
This was just reshuffled a bit. Now it uses the main page (which then
redirects to the docs anyway), which should be a bit more stable.
2017-01-20 21:46:59 +01:00
Fabian Homborg
e89c66a224 git completions: git push uses set-upstream
This was a misunderstanding in 96a28df. git _branch_ now uses
set-upstream-to, while git _pull_ still only has set-upstream.

Thanks @moverest.
2017-01-20 15:55:39 +01:00
Clément Martinez
85212c57e8 Add castnow completions 2017-01-19 21:59:59 -08:00
Fabian Homborg
5996962749 Use normal fish_title in Terminal.app
This needs to be done only for new enough Terminal.app versions, which
we don't have enough time to figure out for 2.5.0.

Fixes #3629.
2017-01-19 14:38:11 +01:00
Mehul Tikekar
59eb75021b Remove cd in __fish_print_interfaces 2017-01-18 15:44:28 -08:00
mathbunnyru
7a80610300 Delete trailing spaces 2017-01-15 14:57:21 -08:00
Kurtis Rader
8d32eb62ae reinstate some bindings for vi mode
Fixes #3731
2017-01-15 13:55:43 -08:00
Kurtis Rader
d37e7bcc25 reinstate some bindings for vi mode
Fixes #3731
2017-01-15 11:11:38 -08:00
Cristian Prieto
6f9f7632f3 Added default mode prompt function (#3727)
* Added new function for the default prompt mode

Now fish mode prompt will call fish_default_mode_prompt, this will solve #3641

* Added function description

* Change wording for documentation about default mode prompt

* Finish changes requested in code review
2017-01-12 16:07:41 +01:00
Michael Alexander
dcf3d03e54 Implemented Dracula colors 2017-01-11 22:35:15 +08:00
David Adam
41a41b1591 set_color: add completions for italics, dim and reverse 2017-01-11 22:00:33 +08:00
Clément Martinez
4bed9ea56d Add xz support to __fish_complete_tar function 2017-01-10 16:09:49 +01:00
Clément Martinez
c28bd74ca7 Add --xz, -J completion options to tar command 2017-01-10 16:09:49 +01:00
Kurtis Rader
4223b3da68 deal with BC_LINE_LENGTH not being honored
FreeBSD 12, Dragonfly BSD, and presumably other BSDs don't recognize the
BC_LINE_LENGTH env var and might split the output at 70 chars.

Fixes #3414
2017-01-09 17:32:11 +08:00
Fabian Homborg
5ca63c4956 dirs: Stringify
Two useless forks plus one per element in $dirstack.
2017-01-06 16:13:01 +01:00
Fabian Homborg
a070dffc4e Merge pull request #3666 from drwilly/master
mixed bag of shell scripting improvements
2017-01-06 16:10:03 +01:00
Fabian Homborg
1f836f72b3 pushd: Use $PWD instead of command pwd
Useless forks.
2017-01-05 01:49:44 +01:00
dareg
89e48ba0b3 Add completion for the changelog subcommand 2017-01-03 20:59:18 -08:00
Oliver Gondža
dddbdddcff Avoid using empty description for complete in maven completion 2017-01-03 16:57:12 +01:00
Aaron Gyes
1fb92b6f8c Use new set_color features for __fish_cancel_commandline
We still apparently need to rely on tput for 'el'.
2016-12-31 06:12:05 -08:00
Fabian Homborg
3da3558e35 Remove eval in __fish_complete_proc
This was completely useless.
2016-12-29 15:35:19 +01:00
Fabian Homborg
b29b026106 math: Set BC_LINE_LENGTH to a very high number
This means we no longer have to do manual stitching which improves performance.
2016-12-29 15:13:48 +01:00
Fabian Homborg
11f4e64e45 Revert "Use BC_LINE_LENGTH=2 for bc."
This would fail on very long numbers, e.g.

`math "1 + 1233242342353453463458972349873489273984873289472914712894791824712941"`

would now return "42", where it previously returned the correct "1233242342353453463458972349873489273984873289472914712894791824712942".

This reverts commit 26e781ef5a.
2016-12-29 13:53:11 +01:00
Fabian Homborg
bd93a9e6ff Remove useless-use-of-echo in git_prompt 2016-12-29 13:49:21 +01:00
Aaron Gyes
aed5267fd1 Stringify __fish_git_prompt 2016-12-29 04:11:23 -08:00
Aaron Gyes
26e781ef5a Use BC_LINE_LENGTH=2 for bc.
It's not the case that macOS and old BC doesn't respect this environment
variable, just that they don't have special behavior when it's set to 0.
However, there is rather universal favorable behavior with a value of 2.

Output is of the form:
\
999999999999999999999999999999999...

with the second line being arbitrarily long. So just grab that line
instead of stitching with `string`.

This can yield a 25-30% speedup.
2016-12-29 03:47:37 -08:00
Samantha Marshall
4cd34816cf Adding subcommand completions for launchctl 2016-12-28 18:39:25 +01:00
Radomír Bosák
f9835b5077 Add support for subcommands in __fish_man_page
This commit adds a feature that after typing "git add" and pressing
"alt+h", the manpage for "git-add" instead of "git" would be displayed.

The new logic takes the first argument which doesn't start with a dash
and tries to display manpage for "command-argument"; it falls back to
"man command" it the first try doesn't succeed.

Fixes #3618.
2016-12-27 16:03:21 -08:00
Sam H
6b536922af Append paths from /etc/manpaths and /etc/manpaths.d/* to MANPATH, for #1092.
* Only append paths if `MANPATH` is already set, to match behavior of macOS
     `path_helper` utility.
   * Use the same technique as is used above to set PATH from /etc/paths and
     /etc/paths.d/*.
2016-12-27 14:21:36 -08:00
Terje Larsen
2740cc80d2 improve make target completion
- Support completing dynamic make targets.
- Support completing make targets when using -C/--directory.
- Support `-Cdir/path`, `-C dir/path`
- Support `--directory=dir/path`, `--directory dir/path`

This detects if the make command have the `-p` switch otherwise it
assumes it is BSD make and will run a different command to try to figure
out the available targets.
2016-12-21 19:04:15 -08:00
Kurtis Rader
1f2432d63a reinstate VBox* completions
Commits 48aa92900 and 77d4d21ca each added two files with the same name
differing only in letter case. That causes problems on systems like
macOS and MS Windows. Remove the lowercase file names. Anyone needing
those completions can do (same for VBoxHeadless):

function vboxsdl --wraps VBoxSDL
    VBoxSDL $argv
end
2016-12-21 16:03:32 -08:00
ridiculousfish
a70ed0282b Revert "Add VBoxSDL completions"
This commit confused git on case-insensitive HFS+

This reverts commit 48aa929008.
2016-12-21 15:53:51 -08:00
ridiculousfish
a7e3678d3e Revert "Add VBoxHeadless completions"
This commit confused git on case-insensitive HFS+

This reverts commit 77d4d21caa.
2016-12-21 15:53:38 -08:00
Wilke Schwiedop
fa7682ec3c posixify! 2016-12-21 18:47:04 +01:00
Wilke Schwiedop
28cde83c33 requested changes 2016-12-21 18:44:34 +01:00
Clément Martinez
96157a05f6 Update fish_indent completions 2016-12-21 14:51:48 +01:00
Clément Martinez
b9f0842d7e Add base64 completions 2016-12-21 14:51:48 +01:00
Clément Martinez
77d4d21caa Add VBoxHeadless completions 2016-12-21 14:51:48 +01:00
Clément Martinez
48aa929008 Add VBoxSDL completions 2016-12-21 14:51:48 +01:00
Clément Martinez
291a28e79c Add __fish_print_VBox_vms function
Improve __fish_print_VBox_vms
2016-12-21 14:51:48 +01:00
Clément Martinez
6ab97227de Add objdump completions 2016-12-21 14:51:48 +01:00
Clément Martinez
6dec6ddc26 Fix netctl-auto completions 2016-12-21 14:51:48 +01:00
Clément Martinez
0785260365 Fix pygmentize completion
The previous implementation didn't take into account that a lexer could
have multiple names and gave `cpp, c++` instead of `cpp` and `c++` when
completing `pygmentize -l c`.
2016-12-21 14:51:42 +01:00
Clément Martinez
885de80a0e Add feh completions 2016-12-21 14:45:02 +01:00
Wilke Schwiedop
8204d3103b fix gpg completion 2016-12-21 13:46:43 +01:00
Wilke Schwiedop
0814797444 misc improvements to scripts 2016-12-21 13:46:43 +01:00
Wilke Schwiedop
e8bed9e038 replace "sort | uniq" with "sort -u" in scripts 2016-12-21 13:46:43 +01:00
Wilke Schwiedop
a927efa015 remove "cat file |" from scripts 2016-12-21 13:46:43 +01:00
Fabian Homborg
05ab849b72 Remove more complete "-u" and "-A" switches
Some of these were missed in #3660.
2016-12-21 13:07:27 +01:00
Radomír Bosák
720c0ddb35 Remove -u and --unautoritative from completions
--authoritative and --unauthoritative 'complete' builtin switches have no effect anymore.
This commit removes usage of --unautoritative/-u in completions.
2016-12-20 17:16:22 -08:00
Radomír Bosák
2900352e04 Remove -A and --autoritative from completions
--authoritative and --unauthoritative 'complete' builtin switches have no effect anymore.
This commit removes usage of --autoritative/-A in completions.
2016-12-20 17:16:22 -08:00
Fabian Homborg
e8c18386c8 Bind \x7f to backward-{delete,}-char in vi-mode again
Partially reverts 745bceb9d8.

This is now again in line with the default bindings.
2016-12-18 21:25:56 +01:00
Kurtis Rader
745bceb9d8 fix backspace/del vi mode bindings
The recent refactoring to separate default (emacs) from vi key bindings
overlooked adding `\cH` bindings to vi mode. This also fixes the
behavior of the [del] key bindings (\x7F).

Fixes #3653
2016-12-16 21:52:58 -08:00
Tim Smith
1a1a9b9927 Prevent error in acidhub prompt by quoting the regex
string errors if this regex isn't quoted. This results in this error:

http://stackoverflow.com/questions/40942185/fish-shell-init-git-repo-yields-constant-terminal-output-after-every-command

Signed-off-by: Tim Smith <tsmith@chef.io>
2016-12-16 10:43:40 -08:00
Piotr Matląg
d885f00941 Update nmcli completions 2016-12-14 17:06:10 +01:00
Pierre Neidhardt
5a5b51c909 Fix fusermount completion 2016-12-13 12:54:13 +01:00
Radomír Bosák
896b9ecc70 Add descriptions for dconf subcommands
Suggestions for the dconf command were missing descriptions (it was
marked as TODO). This commit adds them.
2016-12-12 11:56:29 +01:00
Fabian Homborg
4c7baa37a3 Add dconf completions
A configuration tool common with gnome stuff.

Fixes #3638.
2016-12-11 21:12:37 +01:00
Fabian Homborg
90f7d4b081 clipboard_paste: Require non-empty clipboard contents
Fixes #3637.
2016-12-10 21:30:57 +01:00
Fabian Homborg
029d88e962 vi_cursor: Refactor detection logic
Makes it a bit easier to read.

Now we can begin reworking it (again) to make iTerm work.
2016-12-09 19:32:18 +01:00
Kurtis Rader
59fa04bd91 function for editing command line in ext editor
This implements a standard function and bindings for editing the command
line in an external editor. This feature has been requested multiple
times in the past year with various solutions cut and pasted into those
issues. This change combines the best aspects of those solutions.

Fixes #1215
2016-12-08 19:17:09 -08:00
Kurtis Rader
b48b2ddfb2 fix extraction of LS_COLORS
Strip surrounding quotes if present.

Fixes #3630
2016-12-07 14:22:42 -08:00
Kurtis Rader
e79d42aa52 fix handling dircolors output on Cygwin
Fixes #3563
2016-12-04 18:47:39 -08:00
Kurtis Rader
7bb3bf7c74 fix regression from commit 20bcbcc2
There were two places in the code that used the anti-pattern of
returning True on success else an error message. In python you should
always be able to replace `if x == True:` with just `if x:`. Which is
what the lint tool recommended. Unfortunately I didn't notice how the
return value was being used. This fixes that by changing the two
affected functions to return an error message or None on success.

This also adds `from __future__ import print_function` since the code
uses the `print(msg)` function form rather than the `print msg`
statement form. The former works by accident on python2 because the
parens are interpreted as creating parenthesized expression that
devolves to the single string inside the parens. So while the future
import isn't strictly speaking necessary it will help avoid mistakes in
the future if more complex `print()` calls are added.

Partial fix for #3620
2016-12-04 16:01:32 -08:00
David Adam
41acaced3f webconfig: separate arguments to abbr
`abbr` used to take a single argument and split in on the first space,
but 309e10e7 and predecessors altered this behaviour. Update the web
config use of abbr to the newer format.

Fixes #3620.
2016-12-04 21:32:49 +08:00
Kurtis Rader
42eaacd3a1 enable make style-all doing fish scripts
I had disabled having `make style-all` restyling fish scripts because a
majority of them did not conform to the style enforced by `fish_indent`.
I recently restyled most of the fish scripts with the exception of the
completion scripts. So this re-enables restyling all scripts with the
exception of completion scripts.
2016-12-03 20:39:32 -08:00
Maciej Ostaszewski
4288db9d39 correct option for bc completion 2016-12-04 00:22:31 +01:00
Kurtis Rader
d73ff39393 fish vi mode cursor shape on iTerm2
Fixes #3593
2016-12-02 19:49:15 -08:00
Fabian Homborg
422ff0f173 Don't paste if xsel fails
This silences a rather verbose error.
2016-12-02 01:29:58 +01:00
Radomír Bosák
1fbcb1ee9d Add the possibility to rename abbreviations
The abbr function doesn't have the possiblity to rename abbreviations.
You have to delete the old one and create a new one. This commit adds
this functionality and uses the syntax:

abbr -r OLD_KEY NEW_KEY

Fixes #2155.
2016-12-01 14:42:20 -08:00
Kurtis Rader
1ca1667786 fix bug introduced by fish_indent
Commit 11a60c8 restyled all the fish scripts using fish_indent. Sadly a
bug in fish_indent did not correctly reformat an unusual structure.
2016-11-28 17:13:01 -08:00