Commit graph

2655 commits

Author SHA1 Message Date
Birger J. Nordølum
df375ea12d brew.fish: Add update-reset subcommand completion (#5608)
* brew.fish: Add `update-reset` subcommand

This command resets all tap's remotes to the latest available upstream.  Ideal for debugging before reporting bugs or just housekeeping.
 
Add missing newlines.

* Add `brew.fish` changes to CHANGELOG.md
2019-02-01 18:02:05 +01:00
ridiculousfish
0c17210f05 Fix the expect tests under tmux by inspecting TERM
We were checking for the $TMUX variable to determine if we were
running under tmux. However when running the tests, the terminal becomes
expect, even though the TMUX variable is still set, so we spew tmux-isms
at expect. Check the value of $TERM for 'screen'.
2019-01-31 12:30:41 -08:00
raichoo
aebe040fdc document private mode in fish completion 2019-01-31 20:30:41 +01:00
Aaron Gyes
6b16975359 Add a colon to command-not-found dealio.
The previous commits to fix #5588 removed quoting.
2019-01-28 19:35:17 -08:00
ridiculousfish
4064ab8183 Stop emitting extra new lines under tmux 2019-01-28 16:49:31 -08:00
Fabian Homborg
7eee158292 Don't test with one argument
[ci skip]
2019-01-27 15:38:03 +01:00
Fabian Homborg
c776414674 functions/trap: Don't test with one argument
That's a POSIX misfeature.

Also there was one actually wrong `test sig` that should have been
`test $sig`.
2019-01-27 15:38:03 +01:00
Fabian Homborg
63c072e225 default_command_not_found_handler: Only use $argv[1]
That's probably the nicer fix, otherwise this would print things like

    Unknown command 'aiohsd 1 2 3'

when it should just say

    Unknown command aiohsd
2019-01-26 21:50:49 +01:00
Fabian Homborg
02628d1b02 default_command_not_found_handler: Join arguments
Without it, this would print the error multiple times, like

    Unknown command: echs
    Unknown command: 1
    Unknown command: 2
    Unknown command: 3

Fixes #5588.
2019-01-26 21:21:20 +01:00
Fabian Homborg
a0fbb8dea7 Redraw vi cursor if tmux pane focus changes
Fixes #4788.
2019-01-26 19:38:28 +01:00
Fabian Homborg
1cad15b01f Stringify a few more completions
[ci skip]
2019-01-26 19:29:25 +01:00
Fabian Homborg
c775335b2a functions/__fish_print_cmd_args_without_options: Stringify
[ci skip]
2019-01-26 19:20:16 +01:00
Fabian Homborg
b8fd08811c functions/__terlar_git_prompt: Stringify
[ci skip]
2019-01-26 19:20:11 +01:00
Fabian Homborg
0640e7bae9 Move prt-get functions into the completion script
These were not used elsewhere.

Part of #5279.

[ci skip]
2019-01-26 19:16:25 +01:00
Fabian Homborg
7ad779ac00 Remove __fish_can_complete_switches
This was only used in __fish_should_complete_switches, and is a tiny
helper function that is better integrated directly.

Part of #5279.

[ci skip]
2019-01-26 19:16:18 +01:00
Fabian Homborg
882da75d29 Remove __fish_commandline_test function
This was only ever used in the commandline completions, and is
equivalent to (a weird example of) __fish_contains_opt.

Part of #5279.

[ci skip]
2019-01-26 19:16:12 +01:00
Fabian Homborg
1e3a46f423 Remove __fish_bind_test* functions
These were only used in the bind completions, so there's no need to
keep these two separate.

Part of #5279.

[ci skip]
2019-01-26 19:16:06 +01:00
Fabian Homborg
354c6b1b67 git_prompt: Read "bash.showInformativeStatus" git config variable
This allows disabling _just_ the informative status.

We still also use the dirty and untracked variables, but only if
informative status hasn't explicitly been enabled.
2019-01-26 14:52:37 +01:00
Fabian Homborg
15cf45a2a0 git_prompt: Allow overriding informative status via git config
If either of the two git config variables:

- bash.showDirtyState
- bash.showUntrackedFiles

is explicitly set to false, we will disable informative status, and
fall back on the non-informative version (most likely still with
either dirty or untracked files, since we already use the variables
for that).

These vars are read by the official git prompt, so we use them instead
of inventing our own "fish.showInformativeStatus".

(Note: This also uses $__fish_git_prompt_showdirtystate and friends,
but only when there's nothing set in the repo, and there's really no
reason to set those to false if using the informative status)

Fixes #5551.

[ci skip]
2019-01-26 14:52:37 +01:00
Hideki Hamada (jakalada)
5c689bb50c fix dirh output with reversed $dirnext 2019-01-26 13:30:45 +01:00
Matan Kushner
4567d3ae52 Fix typo setting fish_color_error (#5577) 2019-01-23 17:34:28 -08:00
wyahiro
e9f0a8cf2c Redo ant completions
Closes #5475
2019-01-23 18:00:21 -06:00
Mahmoud Al-Qudsi
d651cdacbe Extend type --path to print path to script defining named function
Expands the utility of `type -p foo` by allowing it to print the path to
the script that defines `foo` when `foo` is a valid function that was
sourced from a path on disk (rather than interactively defined).

This does not change the behavior of `type -P`/`type --force-path`,
which should have already been used if the desire was to resolve the
path to an executable file (otherwise the output would have been blank
if a function was shadowing an executable file of the same namea), so no
backwards compatibility issues are expected.
2019-01-23 17:51:47 -06:00
Fabian Homborg
432ed621fd completions/git: Don't sort tags or commits
Sorting these alphabetically just makes no sense, but takes time.

[ci skip]
2019-01-23 15:53:47 +01:00
Fabian Homborg
4af2a681b8 completions/git: Stop offering :/ files so much
Don't do it when the relative path is simple (purely descending),
unless the token starts with ":/".

Also stop offering directories - if they need to be disambiguated, the
normal completion logic will take care of that.

Fixes #5574.

[ci skip]
2019-01-23 14:03:38 +01:00
Johannes Altmanninger
eee4dd8248 __fish_complete_man.fish: escape for regex
Previously, using special regex characters or slashes would result in an
error message, when pressing tab in a command-line such as
"man /usr/bin/time ".
2019-01-23 11:58:30 +01:00
Aaron Gyes
b23403ee6b Revert "__fish_complete_suffix: do not show description when not passed one"
This reverts commit 367661d4f1.

This was the wrong way to address this annoyance of mine.
2019-01-21 22:55:56 -08:00
Aaron Gyes
23e94d8349 improve GNU patch completions
shorter descriptions that can fit in a terminal window, and option arguments added.

hide one option that is only functional on Cygwin unless we are on Cygwin
2019-01-21 22:37:45 -08:00
Aaron Gyes
367661d4f1 __fish_complete_suffix: do not show description when not passed one
Make it so that the generated completion has the form \t\n
when the optional description has been ommitted - otherwise
the original option's description gets inherited and is seen hundreds
of times repeating in the pager.
2019-01-21 22:37:45 -08:00
Aaron Gyes
3115446a07 string completions: add missing upper, lower, split0, join0, unescape
and --style=regex
2019-01-21 17:08:49 -08:00
Aaron Gyes
8743961301 Fix fish_config rendering brights as normal on prompt previews
I noticed our default brgreen for fish_color_user was rendering
as just unstyled white.
2019-01-21 13:59:36 -08:00
Aaron Gyes
a5e5f90f73 ls.fish: fix colorless ls not taking options
That -- no-op would have the effect that a user can not pass more
options to ls, they would be interpreted as file names.
2019-01-21 07:52:26 -08:00
Aaron Gyes
488e208cca ls.fish: also show indicators on non-GNU ls, refactor
GNU ls's --indicator-style=classify is the same as POSIX -F.

Refactor and change command testing logic so that we define the
function in the same place for all platforms, and use -F on all
the platforms when stdout is a TTY.
2019-01-21 06:56:57 -08:00
Aaron Gyes
5dc0ff0a90 ls.fish: remove for loop
`command -s` can take multiple arguments to try.
2019-01-21 03:15:43 -08:00
Sam Yu
02c32c638f Fix completion of directories for configure 2019-01-17 10:13:27 +01:00
Fabian Homborg
84339d5636 Don't wrap functions with themselves
Our weird %-expanding function wrappers around kill et all defined
"--wraps" for the same name.

As it turns out, fish follows that one, and executes the completion
multiple times.

I didn't notice because these tend to be rather quick on linux, but on
macOS that's apparently a real issue.

Fixes #5541.

[ci skip]
2019-01-17 09:46:55 +01:00
Aaron Gyes
fb74ccb1f2 set's color completions: remove Color description.
On `set fish_color_cwd <TAB>`, a bunch of named colors are
shown in the pager. Each and every one has a description of "Color".

These are all very obviously colors, and none are not colors,
the description does not tell us anything specific about the item.

Descriptions in situations like this are actually a hinderance
because of the way they cause less to fit into the pager. Remove it
2019-01-16 10:34:16 -08:00
Fabian Homborg
5779d99a81 fish_vi_cursor: Check for tput before using
If tput isn't available, that's the same as if it failed.

This is the last bit necessary to make the tests work on alpine on builds.sr.ht.
2019-01-16 11:08:47 +01:00
Fabian Homborg
c9fe59237b webconfig: Allow \co sgr0 in one more place
Some $TERMs like tmux and linux use an sgr0 ("reset") value that ends
in \co instead of "m". We need to adjust our regex here to catch that,
or we'd miscount lines with it.
2019-01-16 10:23:53 +01:00
Fabian Homborg
d7dac4d077 webconfig: Use history -z
This did some weird stuff with \x1e.

[ci skip]
2019-01-16 09:32:26 +01:00
Fabian Homborg
2b426c1047 webconfig: Fix binding tab
This broke when --preset was introduced.

We allow a "--preset" or "--user" to appear right after the "bind",
and save the value, but don't use it yet.

Fixes #5534.

[ci skip]
2019-01-16 09:32:26 +01:00
Aaron Gyes
c94adb9d3e fish_config: make clear python 2 or 3 will both work.
A person stuck installing it just for fish on their server
doesn't want to waste time installing the wrong one, so assuage that.

Also tweak to look nicer with 80 columns
2019-01-14 03:29:57 -08:00
Aaron Gyes
7d16714dd3 fish_config: tell the user some nice things without Python
As discussed in #5492, it would be good if running fish_config without
Python actually told the user to install Python.

Further, let's give the person some hints on how to configure these
things by hand, since they may have to.
2019-01-14 03:08:44 -08:00
Mahmoud Al-Qudsi
2fdcc4544a Fix extra space in fish_title
Closes #5517. Credit goes to @jadenPete.

[skip-ci]
2019-01-13 16:14:58 -06:00
Fabian Homborg
6d11e46428 completions/git: Also don't use files for porcelain=2
This was an oversight from the previous commit. Not that it matters
much, because we already removed $files.

Still, this would fail if someone defined a global $files, so let's fix it.

[ci skip]
2019-01-13 21:33:00 +01:00
Fabian Homborg
787f453ec2 completions/git: Skip "!" shell-aliases for wrapping
We can't complete these, and now the user can do

```
set -g __fish_git_alias_$alias $command
```

e.g.

```
set -g __fish_git_alias_co checkout
```

if the arguments in the alias end up going to `git alias`.

Fixes #5412.

[ci skip]
2019-01-13 17:20:10 +01:00
Fabian Homborg
73bae383e0 completions/git: Stop limiting to the token
This enables fuzzy-matching outside of the current directory again.

As it turns out, the performance impact here isn't as large as I
thought - it's massively dependent on caching.

Fixes #5476.
2019-01-13 17:05:05 +01:00
Aaron Gyes
6c9065e9ef abbr -e: use same exit code as set -e if abbr doesn't exist
Which is 4, apparently.. (builtin_set.cpp returns ENV_NOT_FOUND)
here. This was previously hardcoded to our 121, which used to be
what builtins used for invalid arguments.

4 is pretty arbitrary but at least this is more consistent.
2019-01-11 00:50:01 -08:00
Mahmoud Al-Qudsi
6ea7aa8a00 Share code between yarn and npm completions
I had previously introduced a lot of updates and fixes to npm registry
based completions for `yarn` but hadn't ported them to `npm` as well
(although they can be dropped in as-is). This patch shares the code
between the two, which resides in an explicitly sourced multi-function
fish script.
2019-01-10 23:12:49 -06:00
Mahmoud Al-Qudsi
56cedac3b5 Show info about all-the-package-names helper for yarn/npm completions
The informational message is only shown the first time an attempt at
completing `yarn add` is made per session. This should vastly improve
the discoverability of this feature as regular yarn/npm users would
never have `all-the-package-names` installed normally.
2019-01-10 23:12:49 -06:00