Commit Graph

2937 Commits

Author SHA1 Message Date
Fabian Homborg
c5a6d0bfde Split $fish_user_paths on ":" explicitly
It's used with $PATH, so it is _always_ split on ":".

We could also force it to be a path variable, but that seems a bit
overkill.

Fixes #5594.
2019-02-13 12:35:15 +01:00
Andrew Childs
56309f1c2e Only invoke path_helper in login shells
Matches upstream path_helper which is invoked in /etc/profile and only
applies to login shells. Enables running interactive, non-login shells
with altered PATH values.

Reverts change in c0f832a7, which reverts change in adbaddf.
2019-02-13 00:02:03 -08:00
Fabian Homborg
016d83c3fc completions/git: Handle MM files
These are files with staged modifications, and additional unstaged
ones.

In practice what happened was that you ran

   git add somefile

then editted it some more and tried to

   git add <TAB>

which didn't offer it anymore.

Now, we offer it if either modified or modified-staged is set.

Currently modified-staged isn't ever set alone, but through
all-staged, so we still need to keep offering the file then.

(This shows that the current switch/case might have some holes)

Fixes #5648.

[ci skip]
2019-02-12 16:59:44 +01:00
Aaron Gyes
1c6efc6378 'kill' is not a builtin.
I guess I was on autopilot.
2019-02-11 09:08:28 -08:00
Aaron Gyes
bcc4240d2b config.fish: Clean up the . function a bit. 2019-02-10 23:19:24 -08:00
Aaron Gyes
4d6a97d35c Retire the bit of config.fish that detected missing builtin string
It's been a few years.
2019-02-10 21:47:10 -08:00
Aaron Gyes
1c9fe71240 config.fish: loop over bg, fg, etc. wrappers
Now that we can do `builtin $x`, this code can be simplified.
2019-02-10 15:03:42 -08:00
Fabian Homborg
df28f76698 git-prompt: Test untracked the right way around
This only showed untracked files if showuntrackedfiles was != true.

That's just exactly wrong.

Fortunately this wasn't in a release.

[ci skip]
2019-02-10 14:54:32 +01:00
Fabian Homborg
b999ba7b47 Update fish_hg_prompt reference in terlar prompt 2019-02-10 14:44:50 +01:00
Fabian Homborg
3a320d7584 Update fish_vcs_prompt reference in sampleprompts 2019-02-10 14:44:50 +01:00
Fabian Homborg
9c82979459 Rename __fish_hg_prompt -> fish_hg_prompt 2019-02-10 14:44:50 +01:00
Fabian Homborg
c29023b3e8 Rename __fish_svn_prompt -> fish_svn_prompt 2019-02-10 14:44:50 +01:00
Fabian Homborg
c771334924 Rename __fish_vcs_prompt -> fish_vcs_prompt
Still keep a stub under the old name for compatibility.
2019-02-10 14:44:50 +01:00
Fabian Homborg
cb7762b7c0 Move __fish_git_prompt -> fish_git_prompt
This exposes it more, since it's quite an important function.

We should do the same with the other vcs functions.

We leave a compatibility shim in place for now.
2019-02-10 14:44:50 +01:00
Aaron Gyes
0377198fc8 Drastically improve fish completions
* complete .fish files
* --debug -> --debug-level
* add --init-command/-C
* add --debug-stack-frames/-D
* add --private/-P
* add --features/-f: lists supported features, supports foo,<TAB>
* -c now completes commands
* -d requires argument, describes 0..5
* --profile: require argument, allow file completion
2019-02-09 22:48:15 -08:00
Mahmoud Al-Qudsi
2445a76d2e Fix typo in yarn/npm completions helper script
Hat-tip @billyjanitsch
2019-02-10 00:09:21 -06:00
Aaron Gyes
0abcf9265e {forward,backward}-bigword on Shift-Left/Right
There was no way to do this at all without vi keybindings,
and it turns out shift-left/shift-right was available.

Fixes #1605
2019-02-07 13:11:34 -08:00
Aaron Gyes
1049bed5f8 string completions: add -e, -f, --no-empty, shorten -d's
I hope this is now complete.

Also, shorten enough descriptions to make `string match --<TAB>`
show a two column pager with 80 cols.

We really should have shown more retraint in the design of `string`,
not all of the flags required both a long and short option created.
2019-02-07 04:13:38 -08:00
Fabian Homborg
7c8b444927 Reduce default escape delay
300ms was waaay too long, and even 100ms wasn't necessary.

Emacs' evil mode uses 10ms (0.01s), so let's stay a tad higher in case
some terminals are slow.

If anyone really wants to be able to type alt+h with escape, let them
raise the timeout.

Fixes #3904.
2019-02-07 12:19:36 +01:00
Fabian Homborg
1a3471fa7d Revert "edit_command_buffer: Use variable-as-command"
This reverts commit 3c6844d4f4.

See #5625.
2019-02-07 09:47:24 +01:00
Fabian Homborg
8e60ebcd34 Revert "funced: Use variable-as-command"
This reverts commit 3253893923.

Fixes #5625.
2019-02-07 09:47:15 +01:00
Leonard Hecker
988283c717 Improved performance of the sorin theme
This improves performance of the sorin theme tremendously
for repositories with a large number of changes.
2019-02-06 12:29:52 +01:00
ridiculousfish
6c22c8893b Switch from tee to cat in psub --fifo
Prior to this fix, we would write to a fifo via cat >$filename & .
However in some cases (and soon in all cases) we open the file before
the fork, not after. This results in a deadlock because the file open
cannot succeed until a write begins.

Switch to using tee to write to the file. Because tee opens the file itself,
fish is no longer responsible and the deadlock is resolved.
2019-02-03 01:58:49 -08:00
ridiculousfish
6ba0d4c88a Revert io_bufferfill_t stack
This reverts commit 88dc484858 onwards.
2019-02-02 17:53:40 -08:00
ridiculousfish
b956f13880 Switch from tee to cat in psub --fifo
Prior to this fix, we would write to a fifo via cat >$filename & .
However in some cases (and soon in all cases) we open the file before
the fork, not after. This results in a deadlock because the file open
cannot succeed until a write begins.

Switch to using tee to write to the file. Because tee opens the file itself,
fish is no longer responsible and the deadlock is resolved.
2019-02-02 14:21:46 -08:00
ridiculousfish
fd1908e973 Switch TMUX check to FISH_UNIT_TESTS_RUNNING
Per discussion in https://github.com/fish-shell/fish-shell/commit/0c17210f056
2019-02-01 16:59:05 -08:00
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
takoyaki9n
db671e8518
Merge branch 'master' into ant_completion 2019-01-21 16:32:51 +09:00
wyahiro
9a7079190d change validation of buildfile 2019-01-18 10:24:14 +09: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
wyahiro
2c52c5285d Fix fail back value for XDG_CACHE_HOME 2019-01-17 16:32:57 +09: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
wyahiro
71f15f70ea Fixed logic for cache file generation 2019-01-14 13:08:29 +09: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
wyahiro
480e95147c use cache file for ant targets 2019-01-13 21:36:05 +09: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
Mahmoud Al-Qudsi
848ca1c1cc Improve UX by not providing yarn completions if no input
Otherwise, the interface would hang while fish processed the output of
`all-the-package-names` and then would ultimately not show any results
anyhow.
2019-01-10 23:12:49 -06:00
Mahmoud Al-Qudsi
34e104ca35 Allow more flexibility with file completions for yarn
Closes #5502
2019-01-10 23:12:49 -06:00
Varun Arora
89d77df658 add missing tmux new-session flags to tmux completion script 2019-01-10 13:22:02 +01:00
Versus
9743cd77d3 yaourt: recognize *.pkg.tar as valid package extension 2019-01-10 13:13:59 +01:00
David Adam
b4365e972a status completions: tidy, add current-command, fish-path and aliases 2019-01-09 22:32:42 +08:00
John McKay
827bce6c88 Use mandoc when nroff not available
mandoc users do not need to install nroff to be able to format and view
manual pages. If both nroff and mandoc cannot be found it will show an
error.
2019-01-08 18:25:28 +01:00
Fabian Homborg
d4be5f08f3 Fix nim prompt (via web_config)
This had a helper function defined outside of the fish_prompt
function, so `funcsave` missed it (see #736).

Fixes #5490.

[ci skip]
2019-01-07 17:25:58 +01:00
Benjamin Nied
e7bfd1d71c Remove shebangs from py scripts
Starting with Fedora 30 and RHEL 8, ambiguous python shebangs will now
throw errors during the RPM build process instead of just warnings,
since these systems have moved to Python 3 by default, and Python 2 may
not be available in the future.

See [this
page](https://fedoraproject.org/wiki/Changes/Make_ambiguous_python_shebangs_error)
for more details.

Drop these shebangs as the scripts are only ever called from fish
wrappers.
2019-01-06 20:39:04 +08:00
Fabian Homborg
04f1ea0680 share/config: Don't split /etc/paths entries on spaces
This used `read -la`, which _splits_.

Instead, don't do that, each line is its own entry.

Fixes #5481.

[ci skip]
2019-01-04 14:50:12 +01:00
wyahiro
a6062c4cdd improved completion for ant 2019-01-03 23:17:53 +09:00
Sean Molenaar
41b3331175 Add support for wayland copy/paste 2019-01-02 16:46:04 +01:00
Takuya Noguchi
7aca69780c Replace deprecated options with newly introduced options for gem.
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2019-01-01 14:28:13 +01:00
Fabian Homborg
9dc79cd8d5 completions/screen: Replace eval with var-as-command
[ci skip]
2019-01-01 14:04:47 +01:00
Fabian Homborg
4b8da10215 completions/modinfo: Don't check uname
This checks if uname exists (we already call it elsewhere without
check, nobody has complained, uname is in POSIX), then calls to see if
it's "Linux", and only then offers any completions.

Since we don't have any other version to offer, the check is worse
than useless.
2019-01-01 13:57:32 +01:00
Curtis Jiang
f871951a87 fix OpenWrt and opkg support (#5454)
* add OpenWrt and opkg support

Signed-off-by: Curtis Jiang <jqqqqqqqqqq@qq.com>

* fix opkg list

Signed-off-by: Curtis Jiang <jqqqqqqqqqq@qq.com>
2018-12-31 16:48:03 +01:00
Fabian Homborg
dabd05f2e3 Remove string fallback function
We already have a fallback here, and upgrading from 2.3.0 to 3.X will be rare.

This costs every shell on every start.

See #5279.
2018-12-30 19:24:03 +01:00
David Adam
05222a055a Merge branch 'Integration_3.0.0' 2018-12-28 22:10:49 +08:00
Mahmoud Al-Qudsi
fb679ac9c3 Add completions for pkg [info|show|list] 2018-12-23 20:06:25 -06:00
Fabian Homborg
50fbc36b73 sample_prompts/sorin: Correct git_action function name
We renamed this, and apparently missed it.

[ci skip]
2018-12-19 09:35:26 +01:00
Leonard Hecker
082450b1e7 Severely extended the sorin theme (#5411)
* Severely extended the sorin theme

This theme should now mostly match the original.

* Removed superfluous whitespace

* Inlined external links as ASCII art

* Made myself the author of the sorin theme

* Removed superfluous read delemiter

* Renamed __fish_git_action to fish_print_git_action

* Adde a minor comment
2018-12-18 15:01:38 +01:00
Fabian Homborg
e07b45f447 Revert "completions/git: Allow aliases with whitespace in the command"
This reverts commit 081e14fd21, which was bogus.
2018-12-15 11:13:38 +01:00
Mahmoud Al-Qudsi
3855c2217f Remove scripted XDG_CONFIG_HOME uses
Cleaned up the code to no longer replicate in fishscript what fish
already does (and caches to boot) in C++ in setting up the paths to the
user configuration directory.

Also introduced a `$__fish_user_data_dir` instead of the sporadic
definitions of `$userdatadir` that may or may not go through
`XDG_DATA_HOME`.
2018-12-14 22:09:29 -06:00
Aaron Gyes
c1be3284c1 __fish_config_interactive: inline combinational logic
Boost readability of this long, logic-heavy script with the new
&& and || syntax added to fish 3.
2018-12-14 05:49:08 -08:00
Aaron Gyes
ba9c387590 __fish_config_interactive: tighten up checks for OSC 7 feature
I spent some time figuring out $TERM_PROGRAM_VERSION and Terminal.app's
capabilities over time. [1]

Only use OSC 7 if running on the version of Terminal.app that added it
or newer. In the past this would have been harder because `test` couldn't
do float comparisons.

cleanup:
Don't bother setting a local $TERM_PROGRAM if it's unset: quoting
is enough to keep test happy. For the version numbers, 0"$var" is safe
against unset variables for numerical comparisons.

[1]: https://github.com/fish-shell/fish-shell/wiki/Terminal.app-characteristics
2018-12-14 05:00:55 -08:00
Fabian Homborg
081e14fd21 completions/git: Allow aliases with whitespace in the command
Fixes #5412.
2018-12-13 22:49:12 +01:00
Fabian Homborg
99ba07354a fish_vi_key_bindings: Remove weird argv handling
Instead of maybe adding "-s" and "-M" if "-s" hasn't already been
given, just add "-s" to _every_ bind invocation, and "-M" to those who
need it.

Fixes #5028.
2018-12-13 17:33:48 +01:00
David Adam
79d53a32dc history: drop use of fish_indent
Largely reverts 007d794b6e.

fish_indent is extremely resource-intensive on large inputs and can crash; it also does not handle
invalid characters gracefully.

Work on #5402.
2018-12-13 21:57:24 +08:00
Fabian Homborg
6d4eb96509 completions/git: Don't use status --ignored=something
Fixes it for git < 2.16.

Fixes #5396.

[ci skip]
2018-12-08 20:51:49 +01:00
Phuurl
46db332be5 Basic umask completion, and minor change to ulimit completion 2018-12-07 17:50:48 +01:00
Fabian Homborg
9cfb1394bf sample_prompts/sorin: Add a safe way to determine merge status
Based on what __fish_git_prompt is doing.

See #5388.

[ci skip]
2018-12-06 16:15:11 +01:00
Leonard Hecker
0b63c1f46d Don't run git merge quietly
This can and will mess up git rebases and force pushes.
2018-12-06 15:53:34 +01:00
Aaron Gyes
04795eb8ea webconfig: should know about italics, reverse, dim. 2018-12-05 01:05:33 -08:00
Fabian Homborg
03bca5f7dd webconfig: Fall back onto the default colorscheme
The solarized themes now define pager colors, while other schemes
don't.

So if a user picks one of them, and then another, they'd keep the
pager colors.

Instead, since the default theme is now complete, any theme that does
not define its own pager colors will always get the default ones.

[ci skip]
2018-12-05 09:54:31 +01:00
Fabian Homborg
fa5f3fe9a0 webconfig: Update default colorscheme
This was missing a bunch of variables from __fish_config_interactive.

Ideally we wouldn't have to duplicate this info, but I don't have a
great solution either.
2018-12-05 09:54:31 +01:00
ridiculousfish
6f33c0ccb5 Clean up some language and fix bogus escape in complete.fish 2018-12-03 23:14:01 -08:00
ridiculousfish
8521ce4cd2 Clean up complete completions
Closes #5381

Squashed commit of the following:

commit d70e3451ac
Author: TJ Rana <tj.rana@icloud.com>
Date:   Mon Dec 3 14:31:51 2018 -0500

    Update heading

commit ec44e8ed35
Author: TJ Rana <tj.rana@icloud.com>
Date:   Mon Dec 3 14:29:16 2018 -0500

    Update complete.fish

commit a7178ab163
Author: TJ Rana <tj.rana@icloud.com>
Date:   Mon Dec 3 00:46:42 2018 -0500

    Clean up completion descriptions

commit e6134ceeaa
Author: TJ Rana <tj.rana@icloud.com>
Date:   Mon Dec 3 00:26:42 2018 -0500

    Fix grammar

commit 0a805b1016
Author: TJ Rana <tj.rana@icloud.com>
Date:   Mon Dec 3 00:25:34 2018 -0500

    Add option descriptors

commit 608bb02e41
Author: TJ Rana <tj.rana@icloud.com>
Date:   Sun Dec 2 22:47:17 2018 -0500

    Fix spelling

commit 375593fef4
Author: TJ Rana <tj.rana@icloud.com>
Date:   Sun Dec 2 22:46:19 2018 -0500

    Add heading
2018-12-03 23:12:54 -08:00
Fabian Homborg
d20b3c688b Remove unused portage_print_*_categories functions
These weren't used anywhere, and were only added in
44e2c28255, which isn't in a release yet.

[ci skip]
2018-11-30 21:35:20 +01:00
Fabian Homborg
c242d923c9 sample_prompts/robbyrussell: Use fish_print_hg_root
This removes ~140ms from every single prompt.

When not in a git repo, this prompt now takes ~9ms, as opposed to
~150ms before.

Fixes #5266 harder.

[ci skip]
2018-11-30 20:59:53 +01:00
Fabian Homborg
176c84fb9f Extract code to print hg root from the prompt
This is useful in other prompts, and potentially also to users.

Don't use a dunderscore because we do way too many of them.
2018-11-30 20:57:59 +01:00
Fabian Homborg
60f8eda5c4 webconfig: Hack tmux's reset sequence
This is quite ugly, but in lieu of putting in a proper ansi
parser (i.e. the output part of a terminal), since this is the only
such sequence we have seen until now, let's just match it.

Fixes #5312.

[ci skip]
2018-11-30 20:21:36 +01:00
Fabian Homborg
91a664b9fa webconfig: Use html.escape if available
Just try to import it, on error import the old thing.

Tested with python 3.7.1 and 2.7.15.

Fixes #5125.

[ci skip]
2018-11-30 19:46:00 +01:00
crocket
35db0fb5df Improve the contrast of the pager for solarized dark theme.
By setting fish_pager_color_completion to B3A06D,
the pager gets more visual contrast.
2018-11-30 19:39:45 +01:00
Fabian Homborg
42ec4aa2dd completions/configure: Use first token ending in "configure"
Fixes #5376.

[ci skip]
2018-11-30 11:27:24 +01:00
Fabian Homborg
f0aa63cc11 man: Use new data_dir variable name 2018-11-29 20:28:29 +01:00
Fabian Homborg
eb0dd1ea78 sample_prompts/robbyrussell: Clean
- Remove use of `eval`
- Use `git rev-parse` instead of `git status` as its faster,
- especially in large repos. (in qt5: 600ms vs 1ms)

- Use return status instead of test -n

This should change nothing about the output.
2018-11-29 19:35:13 +01:00
Fabian Homborg
8ee2e54c9b sample_prompts/acidhub: Improve git parsing
Same as the sorin changes - don't parse "git branch" output.
2018-11-29 19:21:07 +01:00
Fabian Homborg
b18693f3c1 sample_prompts/sorin: Improve git parsing
This uses some more string, but the main improvement is using "git
rev-list" instead of parsing "git branch" output that happens to be localized.

[ci skip]
2018-11-29 17:38:18 +01:00
Fabian Homborg
bd1ceefb17 sample_prompts/user_host_path: Remove
I can't see the value in this, given that we have a bunch of minimalist ones.
The "escaping" here is gnarly enough that I don't want to attempt to clean it up.
2018-11-29 16:35:52 +01:00
Fabian Homborg
b794a5e476 sample_prompts/debian_chroot: Clean
- Remove begin/end in if-conditions - this used to be necessary in
  fish < 2.3.0

- Quote a `test`
2018-11-29 16:35:52 +01:00
Fabian Homborg
bcfef9268d sample_prompts/classic_status: Clean
- Remove unused variable
- Use `test` instead of `[ ]`
2018-11-29 16:35:52 +01:00
Fabian Homborg
19bcf9fc36 sample_prompts/acidhub: Clean
- Remove useless helper functions
- Remove `sed` call
- Cut down on `git` calls

The status display still needs a bit of work.
2018-11-29 16:35:52 +01:00
Fabian Homborg
ad5d400319 fixup! Fix variable names
Missed an underscore, sorry!
2018-11-29 15:36:13 +01:00
Bjorn Neergaard
958e46882f Slightly restructure man.fish for clarity
man.fish can be clarified a bit, by removing a superfluous early return. Additionally, performance can be
(ever so slightly) improved, by using the empty string to suffix an extra colon when `$MANPATH` is empty, as
described in `manpath(1)`. As `man` will internally call `manpath` as it starts, this eliminates a redundancy.
2018-11-29 15:29:18 +01:00
Fabian Homborg
2713265b01 webconfig: Improve Solarized schemes
Fixes #5315.
2018-11-29 15:18:13 +01:00
Fabian Homborg
be1c022861 webconfig: Allow setting pager colors 2018-11-29 15:18:00 +01:00
Fabian Homborg
a02eac5a7a webconfig: Update color lists
This adds the color variables from the docs to both the python script
and the js controller.

Among others, this includes "search_match", i.e.
"fish_color_search_match".

It still does not include the pager colors because the variable names
wouldn't match.
2018-11-29 15:17:44 +01:00
Fabian Homborg
20099774a0 fish_clipboard_copy: Use selection, if any
See #5368.
2018-11-25 17:33:14 +01:00
Aaron Gyes
d065ff840d Fix switch statement 2018-11-25 07:50:10 -08:00
Aaron Gyes
4ceb21cf09 rm completions: update BSD options
lined up with {Open|Net|Free}BSD & Solaris manuals.
2018-11-25 06:08:24 -08:00
Aaron Gyes
a2212876a9 add a simple 'math' completion 2018-11-25 05:13:14 -08:00
Aaron Gyes
62c6a09f1c ls.fish: simplify the logic a little. 2018-11-25 03:43:53 -08:00
Aaron Gyes
c2ae163bfe ls completions: fix mistake. 2018-11-25 03:12:44 -08:00
Aaron Gyes
e89035d76c ls completions: Solaris too. BSD vs POSIX -o conflict fixes
- Solaris is super annoying
- Also, use ls not command ls:
  if I wrapped `gls` in a `ls` function, I'd want this.
2018-11-25 03:07:16 -08:00
Aaron Gyes
c1af29f641 __fish_config_interactive: tell complete that [ wraps test
We want to show our completions for the `[` (`test`) builtin, but
we don't want to create a [.fish.
2018-11-25 02:04:56 -08:00
Aaron Gyes
a4f27bea36 cp completions: Give not-GNU cp the floam treatment 2018-11-25 01:45:45 -08:00
Aaron Gyes
7d79d326b5 test completions: we accept floats now 2018-11-25 00:15:11 -08:00
Aaron Gyes
8d0e1f3bcc test completions: don't complete files for string tests, wrap [
also removed --help - test doesn't do that.
2018-11-25 00:08:59 -08:00
Aaron Gyes
cc3fd9cf8f mv completions: Correctness improvements and updates for GNU, BSD, Solaris mv
Reflect GNU mv from this decade,  and the options handled
by specific non-GNU OSes.
2018-11-24 23:32:44 -08:00
Aaron Gyes
ca46c556c3 ls completions: BSD fixes
`ls` was suggesting options that are are not valid for my system,
omitting options that are on my system. Different BSD OSes have
different option extensions, and some of them do conflict with eachother.

I carefully checked the manuals of netbsd, macos, freebsd, and openbsd
`ls` and made the completions show the right completions in full for them.

Some verbiage tweaks as well.
2018-11-23 10:31:51 -08:00
Fabian Homborg
60fa9da3a7 Rewrite __fish_complete_proc
- No longer uses sed, sort, uniq, uname
- Stop doing too-clever filtering (e.g. the kernel thread stuff never
- really worked)
- Don't truncate for all OSen, instead just use the (correctly
- truncated) comm field.
2018-11-22 15:23:05 +01:00
Fabian Homborg
3a835ebd61 Make --help work
See #5361.
2018-11-22 12:43:35 +01:00
Fabian Homborg
b383e29a24 type: Make "--help" work
This tripped over argparse --min-args=1, but we already return 1 above
if there really is no argument.

Fixes #5361.
2018-11-22 12:27:25 +01:00
Aaron Gyes
007d794b6e history: improve interactive pager experience
- Colorize history search output when interactive, using
  fish_indent. This is the same way we colorize `type` output.

- Ask less to act like `cat` if the output will fit in the
  terminal window, so it's less jaring with short output.

- history is viewed in a pager when interactive, but pagers
  typically strip escape codes. We accomplish the above by
  doing exactly what `git` does[1] when it has colored output
  for a pager:
        if $LESS is unset, set it to enable -R, -F, and -X options.
	if $LV is unset, set it to -c.

[1]: 398dd4bd03/pager.c (L87)
2018-11-20 05:01:12 -08:00
Mahmoud Al-Qudsi
59197d12e0 Better handling of cases where man is not installed
Thanks to @floam, adapted to reduce nesting.

Works around override of command-not-found handler in previous solution
(c.f. 13e025bdb0).
2018-11-17 22:05:48 -06:00
Fabian Homborg
7b21f1c3cb Revert "mount completions: don't truncate mounts with spaces in them"
This does not work with util-linux mount, because that prints a "type" in between.

This reverts commit 1c364722a7.
2018-11-17 14:06:15 +01:00
Aaron Gyes
1c364722a7 mount completions: don't truncate mounts with spaces in them 2018-11-17 04:46:25 -08:00
Mahmoud Al-Qudsi
31d17f4559 Rename string escape --style=pcre2 to string escape --style=regex 2018-11-16 20:22:06 -06:00
Mahmoud Al-Qudsi
13e025bdb0 Clean up error message for man wrapper when man isn't installed
Closes #5329
2018-11-16 20:04:43 -06:00
Mahmoud Al-Qudsi
ab0f1d33fe Make use of the new PCRE2 escaping feature
Fixes some potentially unsafe uses of direct substitution into regex
expressions and also switches some completions to regex-based now that
there is a safe way of using it.
2018-11-15 12:37:29 -06:00
Aaron Gyes
7437f82d92 obnam completions: use $hostname instead of (hostname) 2018-11-13 15:49:03 -08:00
Aaron Gyes
920be02fe9 __update_cwd_osc: Use $hostname var instead of hostname command
Changing directories should be a few ms faster.
2018-11-13 15:40:19 -08:00
David Adam
5bd0472682 abbr: tidy description 2018-11-13 21:42:49 +08:00
Fabian Homborg
7257c69979 completions/string: Add escaping styles 2018-11-12 18:56:11 +01:00
Fabian Homborg
7a20e8d64d completions/busctl: Port to argparse
This is much faster!
2018-11-12 18:53:30 +01:00
Fabian Homborg
2d2f7c8fb1 completions/ip: Restyle
Just run `fish_indent` on the entire thing.
2018-11-12 16:28:24 +01:00
Fabian Homborg
15f089897d completions/ip: Add basic ip link set completions 2018-11-12 16:22:43 +01:00
David Adam
4b28e9d2e4 read: update completions to include --lines and --null
Does not include --all-lines pending discussion in #5332.
2018-11-12 23:13:41 +08:00
Mahmoud Al-Qudsi
d6ab3db159 fixup! Extend __fish_complete_suffix to support a virtual $PWD 2018-11-08 16:17:56 -06:00
Mahmoud Al-Qudsi
34440165aa Add completions for openocd 2018-11-07 20:08:16 -06:00
Mahmoud Al-Qudsi
da6937e0cf Extend __fish_complete_suffix to support a virtual $PWD
In writing the completion script for openocd I found the need to
complete paths at the command-line as if they were relative to a
path other than the current $PWD. Given that `$PWD` is currently
global in fish (i.e. no side-effect free `cd` within a subshell)
this is probably good to have for other completions too.

This also fixes a bug in support for explicitly supplying the
description for completions via a `$argv` parameter, which prefixed
the description with `\t` (which is correct) except it did so in
the local scope within an `if` statement, meaning the changes never
had any effect and in the output the description was directly
concatenated to the completions, instead of separated by a tab.
2018-11-07 20:08:16 -06:00
Mahmoud Al-Qudsi
6b7501d715 Correct pandoc data directory path in completions
Incorrectly assumed that pandoc uses XDG_CONFIG_HOME, it turns out the
path is hard-coded as $HOME/.pandoc unless explicitly otherwise
specified in the command-line.
2018-11-07 18:34:50 +00:00
Fabian Homborg
4d4227e57f completions/git: Match files inside directories again
Fixes #5317.
2018-11-05 15:53:06 +01:00
Mahmoud Al-Qudsi
8ebf2b8f70 Improve pandoc completions
* Only suggest PDF engines that are currently installed
* Use XDG_CONFIG_HOME (after a fashion)
* Initialize lists as arrays instead of blind strings
2018-11-04 20:49:57 -06:00
Mahmoud Al-Qudsi
ffb4ab5ca8 Prevent pandoc completions from polluting global namespace 2018-11-04 20:38:59 -06:00
Mahmoud Al-Qudsi
11b0b23587 Add git remote remove completions 2018-11-04 14:36:51 -06:00
Moritz Wilhelmy
9afc4b419e Allow cd . to re-enter the current directory
Closes #4543.
2018-11-04 21:46:24 +08:00
David Sanson
7926b69d15 Add completions for pandoc
Taken from https://github.com/dsanson/fish-completion-pandoc under the
GNU GPL as at 7195da6fc4bcbdd49ea63d47c27e4bfec2135660.

Closes #2937.
2018-11-04 21:22:58 +08:00
Mahmoud Al-Qudsi
b23bda8ed6 Only offer local branches for deletion in git completions 2018-10-30 05:14:20 +00:00
Mahmoud Al-Qudsi
1288877033 Update yarn completions
Don't attempt to complete against package names if the user is trying to
enter a switch to speed things up.

Also work around #5267 by not wrapping unfiltered `all-the-package-name`
calls in a function.
2018-10-29 13:56:40 -05:00
Clément Martinez
13c2b4cdc3 Improve virsh completions 2018-10-29 18:01:52 +01:00
ridiculousfish
e09e1e8e41 Fix funced when using the built-in editor 2018-10-27 17:19:43 -07:00
Fabian Homborg
121d61cf31 Revert "help: Use variable-as-command instead of eval"
We do a bunch of escaping before to make `eval` work, and that needs to be removed as well or fragment-urls don't work.

This reverts commit e9568069a7.
2018-10-26 10:52:02 +02:00
Fabian Homborg
c78e6a3ccf edit_command_buffer: repaint
Thanks @amosbird on gitter.
2018-10-25 17:34:01 +02:00
Fabian Homborg
fb0c1460a9 __fish_complete_pgrep: Truncate to 15 characters
Fixes #4132.
2018-10-25 12:10:17 +02:00
Mahmoud Al-Qudsi
5ad292328a Add dynamic clang completions via clang --autocomplete
Use clang/clang++'s own autocompletion support to complete arguments. It
is rather convoluted as clang generates autocompletions for a portion of
the current token rather than the entire token, e.g. while `--st` will
autocomplete to `--std=` (which is fine by fish), `--std=g` will
autocomplete to `gnu...` without the leading `--std=` which breaks fish'
support for the completion.

Additionally, on systems where clang/clang++ is the system compiler
(such as FreeBSD), it is very often for users to invoke a newer version
of clang/clang++ installed as clang[++]-NN instead of clang. Using a
monkey-patched version of `complete -p` to support that without breaking
(future) completions for commands like `clang-format`.

Closes #4174.
2018-10-24 23:14:55 -05:00
Mahmoud Al-Qudsi
ebb3a3a16e Set $fish_private_mode and show a message on private mode startup
The message can be localized and is set as a global variable shadowing
the universally-defined $fish_greeting.
2018-10-24 19:33:48 +02:00
Fabian Homborg
b427cd1823 ls.fish: Use gdircolors if available
See #5278.
2018-10-24 19:27:51 +02:00
Fabian Homborg
809998a9a5 completions/git: Use argparse
This is a tiny bit faster, but mostly it's more concise and extendable.
2018-10-24 12:26:01 +02:00
Fabian Homborg
381215ef07 completions/git: Let git glob files
Fixes #5229.
2018-10-24 12:22:31 +02:00
Fabian Homborg
d727e32934 __fish_print_help: Just use $COLUMNS
This had an undocumented internal feature that would pass the tty
width along. Instead, just have it read $COLUMNS, which we always
define anyway.
2018-10-23 15:05:15 +02:00
Fabian Homborg
5efa18da15 fixup! Add /fish to $__fish_config_dir 2018-10-21 17:20:21 +02:00
Fabian Homborg
6c988abe28 Add $__fish_config_dir variable
Contains the path to the user config.fish (e.g. ~/.config/fish)
without having to do the `set -q XDG_CONFIG_HOME` dance.

See #5270.
2018-10-21 15:42:25 +02:00
Fabian Homborg
162af88c9a __fish_parse_configure: Move some comments
This contained a commented-out `eval`, which drew my attention.
2018-10-21 15:38:31 +02:00
Fabian Homborg
3c6844d4f4 edit_command_buffer: Use variable-as-command 2018-10-21 15:34:42 +02:00
Fabian Homborg
3253893923 funced: Use variable-as-command 2018-10-21 15:34:19 +02:00
Fabian Homborg
e9568069a7 help: Use variable-as-command instead of eval 2018-10-21 15:33:29 +02:00
Fabian Homborg
fc51c156cb __fish_config_interactive: Use variable-as-command
This removes a use of eval, and some duplication.
2018-10-21 15:31:49 +02:00
Fabian Homborg
09f77a355f __fish_config_interactive: Remove unused $configdir 2018-10-21 15:31:12 +02:00
Fabian Homborg
3b2be9009e funcsave: Use mkdir -p
It's in POSIX, and simplifies stuff.
2018-10-21 15:24:38 +02:00
Mahmoud Al-Qudsi
ec2659c500 fixup! add makensis (#5242) 2018-10-16 13:50:42 -05:00
Mahmoud Al-Qudsi
c02bf2548f Close the completions pager (if it's open) on ctrl+c
If you're using the old binding that only clears the commandline and
doesn't preserve its contents and start a new line, you can use

```fish
bind \cc "commandline -f cancel; commandline ''"
```

instead.

Closes #4298.
2018-10-15 13:34:34 -05:00
Fabian Homborg
d22446f651 Let funced handle empty $EDITOR
For some weird reason we only used $editor if it wasn't empty, but
then failed to fail if it was.

This will now print an error and use fish, just like if the $EDITOR
value is invalid in any other way.

Fixes #5257.
2018-10-15 10:14:59 +02:00
Mahmoud Al-Qudsi
c140b3c724 Add completions for git config
This includes dynamic completion of existing keys.
2018-10-14 18:17:23 -05:00
Mahmoud Al-Qudsi
9c6bd8b1b4 Add completions for kitty terminal
This is a wrapper that calls kitty to dynamically provide completions,
as generated by kitty itself, via `kitty + complete setup fish`.

ref: https://sw.kovidgoyal.net/kitty/#fish
2018-10-14 16:32:49 -05:00
Xuanwo
5e77689c5a completions: Add systemctl set-property support 2018-10-09 16:51:49 +02:00
Fabian Homborg
728dd25665 [completions/git] Add rebase --exec
Fixes #5236.
2018-10-08 15:43:45 +02:00
ridiculousfish
3e4bdf51d4 Teach hg prompt to use pwd -P
The hg prompt walks up the directory hierarchy to decide if we are in a
repo subdirectory. Because hg is an external command, it resolves symlinks.
Switch to using pwd -P so hg and fish will have the same view of the hg repo.

Based on comment:
https://github.com/fish-shell/fish-shell/pull/5190#issuecomment-421912360
2018-10-06 17:03:18 -07:00
Fabian Homborg
0aedd47af2 [completions/env] Argparsify
This fixes subcommand completions by using argparse to get the
subcommand, just like we did for `sudo`.

Reported by @adregan on gitter
2018-10-02 19:31:30 +02:00
evuez
f3cee81338 Add --color completion for diff 2018-10-02 18:51:14 +02:00
Mahmoud Al-Qudsi
264d8270a7 Emit an error message on literal zero indices
Mostly resolves #4862, though there remains the lingering question of
whether or not to emit a warning to /dev/tty or stderr when a
non-literal-zero index evaluates to zero.
2018-10-01 20:58:26 -05:00
Mahmoud Al-Qudsi
5b696b5fb5 Update rsync completions
Closes #4863.
2018-10-01 20:37:53 -05:00
Fabian Homborg
444f9f8715 Add separation of "preset" bindings
This allows for marking certain bindings as part of a preset, which allows us to

- only erase those when switching presets
- go back to the preset binding when erasing a user binding
- only show user customization if requested
- make bare bind statements in config.fish work (!!!11elf!!!)

Fixes #5191.
Fixes #3699.
2018-09-30 16:54:56 +02:00
Mahmoud Al-Qudsi
f15dd314e0 Revert "Add hash function for compatibility with sh/bash"
This reverts commit dbd228cc75.
2018-09-27 17:21:12 -05:00
Mahmoud Al-Qudsi
8ff0e7441f fixup! Escape command name in __fish_default_command_not_found_handler 2018-09-27 07:56:02 -05:00
Fabian Homborg
3b3361685a [completions/git] Skip bare repositories
Otherwise this would print an unsightly error.
2018-09-27 13:18:26 +02:00
Mahmoud Al-Qudsi
dbd228cc75 Add hash function for compatibility with sh/bash 2018-09-26 12:43:40 -05:00
Digital
794b448c00 Add completions for openbsd's doas (#5196)
* Add completions for openbsd's doas

* Update CHANGELOG.md

* Implement requested changes
2018-09-25 12:31:46 +02:00
equal-l2
b4a6daef11 Fix the total page count in the history tab 2018-09-22 11:58:29 +02:00
David Adam
f823611c2e Move abbr_old to __fish_abbr_old
This is an internal function that should not be used except by the migration process.
2018-09-21 09:25:16 +08:00
Mahmoud Al-Qudsi
deb6d477d4 Escape parameters in rustc completions
Closes #5057.
2018-09-20 18:59:57 -05:00
Mahmoud Al-Qudsi
38ac7693e9 Escape command name in __fish_default_command_not_found_handler
Closes #5102
2018-09-19 18:25:47 -05:00
Sam Yu
17643ef12c Fix zypper completion
* complete installed packages only for `zypper rm`
* remove incorrect local file completion
2018-09-16 21:15:32 -07:00
Fabian Homborg
d44c21b580 Document/complete feature flags more 2018-09-16 10:39:15 +02:00
maxried
45a2ff4191 Update status.fish
Even though breakpoing sounds funnier, the completion should correctly be breakpoint.
2018-09-14 07:48:22 +08:00
Muttley
0f141b6ccf pacaur: recognize *.pkg.tar as valid package extension 2018-09-11 13:26:27 +02:00
ridiculousfish
56002abc61 Paginate history in fish_config 2018-09-09 01:01:03 -07:00
ridiculousfish
b9c50e400f Fix abbreviations in web_config 2018-09-08 21:34:54 -07:00
Tang King Fai
0e6cc13d0d Update cargo completion (#5172)
* Update cargo completion

* Show sub-command's description for completion
2018-09-07 15:29:48 +02:00
Mo Zhou
add24f96a9 completions: ninja: "ninja -f" should be followed by a *.ninja file. 2018-09-07 08:00:37 +00:00
Curtis Jiang
06e5194092 add OpenWrt and opkg support
Signed-off-by: Curtis Jiang <jqqqqqqqqqq@qq.com>
2018-09-04 01:47:30 -07:00
Vicente Reyes
3e9453840f complete stack built binaries 2018-08-26 17:00:04 -07:00
Chris
1d68b52cbc Add till/repeat/reverse jump bindings
- Add support for:
  - Jumping to the character before a target.
  - Repeating the previous jump (same direction, same precision).
  - Repeating the previous jump in the reverse order.
- Enhance vi bindings.
2018-08-18 14:42:29 -07:00
Fabian Homborg
7606bfc2e5
Merge pull request #5145 from antonv6/hg-completion
[Ready] Update Mercurial completion
2018-08-17 16:34:35 +02:00
Mahmoud Al-Qudsi
e8a35bfaa8 Prevent errors in __fish_describe_command when apropos isn't installed
__fish_describe_command now bails early if `type -q apropos` returns a
non-zero exit code.
2018-08-16 13:20:04 -05:00
Anton Shestakov
1e58e00734 hg completion: complete directories for --cwd 2018-08-16 19:26:29 +08:00
Anton Shestakov
b3a00c5389 hg completion: add :forcedump and :tagmerge merge tools 2018-08-16 19:25:16 +08:00
Anton Shestakov
8aef4330f0 hg completion: complete hg convert, email 2018-08-15 14:13:16 +08:00
Anton Shestakov
af4da66515 hg completion: do a pass over mq 2018-08-15 12:21:16 +08:00
Anton Shestakov
fb6b4b9ae5 hg completion: revert can restore deleted files too 2018-08-15 12:20:12 +08:00
Anton Shestakov
cdf39ed660 hg completion: complete hg files, rebase, shelve, unshelve 2018-08-15 12:15:07 +08:00
Anton Shestakov
6223833130 hg completion: update command descriptions, add more 2018-08-15 12:14:11 +08:00
Anton Shestakov
a175aaa18a hg completion: new flags 2018-08-14 23:51:06 +08:00
Anton Shestakov
afff92c4b1 hg completion: update descriptions 2018-08-14 23:46:51 +08:00
Anton Shestakov
0ffbb657df hg completion: remove --style (deprecated for 4 years)
It still works, but is just an alias for -T/--template.
2018-08-14 23:42:16 +08:00
George Christou
b39651f1ad completions: [git] Silence various errors outside repo 2018-08-14 17:12:43 +02:00
Anton Shestakov
60e05d82c8 hg completion: fix -r and -x flags used for options
"Fixing" boils down to:

- removing -x from options that don't take arguments
- replacing -x with -r for options that want (any) file
2018-08-14 13:05:21 +08:00
Anton Shestakov
f95431362c hg completion: add more --subrepos 2018-08-14 12:47:18 +08:00
Riccardo Azzolini
c79db8ecf7 cdh: Only replace home directory with ~ at the start of paths 2018-08-13 18:24:42 +02:00
Anton Shestakov
27c06c997c hg completion: suggest files from hg st -amr for hg diff
Added and removed files are already suggested for hg commit, makes sense
to do the same for hg diff.
2018-08-13 14:58:03 +08:00
Anton Shestakov
a9c30b05af hg completion: complete abbreviations of hg archive (plus --type) 2018-08-13 14:53:17 +08:00
Anton Shestakov
99860c8294 hg completion: also complete hg blame (alias to annotate) 2018-08-13 14:52:38 +08:00
Anton Shestakov
c8c7fec48a hg completion: complete --color=debug too 2018-08-13 14:52:10 +08:00
Alexander Dalshov
00dcc2a12d add pstack completion 2018-08-06 23:20:55 -07:00
Maximilien Mellen
78cac07d3c Fix Informative VCS sample prompt invalid state
The Informative VCS sample prompt currently sets the `__fish_git_prompt_char_conflictedstate` variable which is unused.
It should instead set the `__fish_git_prompt_char_invalidstate` variable.
2018-08-04 13:35:03 -07:00
Clément Martinez
a536d2bc1f Add xclip completions 2018-08-04 12:00:18 -07:00
Birger J. Nordølum
c300e09e8c brew.fish: Fix brew casks search 2018-08-03 22:46:54 +08:00
Mahmoud Al-Qudsi
09541e9524 Add completions for hjson 2018-07-30 14:38:00 -05:00
Mahmoud Al-Qudsi
46b65a550f Reverse order of files and directories in __fish_complete_suffix output
Ordering of directories above files was introduced in a recent change to
the same script. By default it does not matter as completions are sorted
by fish internally, but this allows the use of `-k` to sort files before
directories (or piped to `sort -r` for vice-versa).
2018-07-30 14:31:47 -05:00
Mahmoud Al-Qudsi
392cdd4338 Show a meaningful description of packages in __fish_print_packages
Use `apt-cache show` instead of `apt-cache packagenames` to efficiently
print package names and a brief description instead of the placeholder
(localized) "Package" text that was previously printed. This applies to
both available and installed packages (for inistall and remove operations,
respectively).

TODO: update `__fish_print_packages` for non-debian platforms to do the
same.
2018-07-28 17:44:17 -05:00
Mahmoud Al-Qudsi
1ca58984bf [debian] Exclude packages with dpkg state 'deinstall' from installed list
When listing packages already installed (e.g. for use with `apt remove
...`), do not consider packages return by `dpkg --get-selections` with
state 'deinstall'.

Previously the `string replace` pattern was matching both 'install' and
'deinstall' packages.
2018-07-28 17:44:17 -05:00
Clément Martinez
32ca6118a6 Add virsh completions 2018-07-28 14:44:11 -07:00
raichoo
d4f5689eaa modernize darcs completion
`darcs` has changed a lot in recent years. The completion is no longer
up to date.
2018-07-28 13:10:13 -07:00
raichoo
eb3541be86 add more options to set completion 2018-07-24 20:29:36 +08:00
Twinkle
8440d9ba86 Improve completions for serve 2018-07-24 00:22:13 -07:00
raichoo
06cd4dc66f vi key bindings: fix "*y 2018-07-23 16:22:12 +02:00
raichoo
b932522138 add more options to psub completion 2018-07-22 15:23:16 -07:00
James Lee
e26bdff487 Improve eopkg completions by using the --installed flag (#5089)
Utilized the `--install` flag added in commit #8c09d6e.

Limit `eopkg remove/autoremove/check ...` completions to installed packages.
Limit `eopkg install/upgrade/info ...` completions to available packages.
2018-07-09 23:21:44 -07:00
ridiculousfish
6a6ffe68cb Make __fish_describe_command stop barfing on /
Prior to this fix, __fish_describe_command would error if the
input contained any special characters, because it would be interpolated
into a regex. Hack in a guard to do nothing if the input contains
anything other than [a-zA-Z0-9_ ]
2018-07-09 23:13:53 -07:00
David Adam
7de9563aad docker completions: add dummy file noting they are upstream
Suggested in #5090.
2018-07-08 21:38:08 +08:00
Guilhem Saurel
994f5c500b update nim.fish sample prompt (#5066)
* update nim.fish sample prompt

- Use an helper function to wrap informations
- Add VIRTUAL_ENV infos, if any
- Add __fish_git_prompt, wrapped for the theme
- Add comments
- Remove ASCII failback symbols for tty
  (no more useful for me, but if someone really needs it, just ask)

* fish.nim: test -n __fish_git_prompt
2018-07-05 22:30:52 +02:00
Simon Legner
dfbffd13df [completions/git] Fix typo 2018-07-05 22:28:52 +02:00
Fabian Homborg
7ead8f459e [completions/git] Offer containing directories
Fixes #5083.
2018-07-04 15:11:32 +02:00
Sam Yu
495c09fe6b Add subcommand options completion for zypper 2018-07-03 13:45:39 -07:00
Mahmoud Al-Qudsi
8c09d6e063 Limit apt remove ... completions to installed packages only
Added a new flag `--installed` via `argparse` to `__fish_print_packages`
which indicates that only installed packages should be listed.

TODO: Other non-debian/apt platforms should take advantage of this flag/
behavior as well.
2018-07-02 11:43:18 -05:00
David Adam
a6031c42bf __fish_config_interactive: make default colours the same as web_config's default 2018-06-29 21:49:35 +08:00
Fabian Homborg
817adc123d [completions/git] Don't use --ignored=something
It was only introduced in 2.16, which was released in January 2018.

Instead, we just use a bare "--ignored", which is equivalent to "--ignored=traditional".

The difference to "--ignored=matching" mode shouldn't matter to us here.

Fixes #5074.
2018-06-27 22:02:49 +02:00
Mahmoud Al-Qudsi
144af5116a Allow functions -e completions to complete hidden __fish functions
...but only if the user has started their function name argument with an
underscore.
2018-06-27 14:42:42 -05:00
Mahmoud Al-Qudsi
092307d4c0 Include whatis description for kernel modules in kldload completions
Using `__fish_whatis` based on a heuristic to make sure completions are
timely available.
2018-06-27 14:38:51 -05:00
Mahmoud Al-Qudsi
121c70cf39 Add completions for FreeBSD's kldunload
Lists currently loaded kernel modules as valid completions, and obtains
a description via the newly minted `__fish_whatis` if available.
2018-06-27 14:14:40 -05:00
Mahmoud Al-Qudsi
948b9d2ab8 Add __fish_whatis helper function/wrapper for whatis
Executes `whatis` safely, returns at most one line, and strips the name
of the command from the start of line, returning a value fit for use as
the description parameter for a completion argument value.
2018-06-27 14:14:40 -05:00
Dale Eidd
8e49229d8f Fix & improve ssh_config Include directive for hostname printing
Fixes
- Use the actual path when skipping unusable paths to fix all Include
  directives being skipped when there is no ~/.ssh directory
- Prevent "No matches for wildcard" message

Improvements
- Skip paths that are directories since we only want files
- Remove `cd` as it is not needed
2018-06-27 14:07:11 +02:00
Mahmoud Al-Qudsi
49bfc4f000 fixup! Fix __fish_complete_suffix behavior for paths with literal . 2018-06-25 20:59:24 -05:00
Mahmoud Al-Qudsi
72d80c3d91 Fix __fish_complete_suffix behavior for paths with literal .
__fish_complete_suffix assumed that the only literal . in a path
would be the . before an extension, and stripped accordingly. This
behavior has been there for a long time, but broke many things
including completion of relative paths and completion of paths with
a literal . in a directory name.

__fish_complete_suffix does not just complete extensions (or at the
very least, it no longer does just that) but rather any suffix, so
isolating the path name without the extension was unnecessary in all
cases.
2018-06-25 13:54:10 -05:00
Sam Yu
9470f8a05b Fix cut completion (#5069) 2018-06-23 15:30:31 -07:00
zhustec
f025607c11 Competion: add missing list-timers for systemctl.fish 2018-06-21 20:10:14 +02:00
Mahmoud Al-Qudsi
fa00183e5f Fix and optimize kldload completions
I'm not sure what was wrong with the old syntax, but I needed to switch
the outer quotes to ' and the inner quotes to " in order for the
completions to work when they weren't explicitly sourced.

Additionally, realized that the overload for __fish_complete_suffix can
be used to get the filtered list of kernel modules from /boot/kernel in
the initial run.
2018-06-19 00:10:40 -05:00
Mahmoud Al-Qudsi
4d909b1c19 Add partial completions for curl, supporting @file syntax
Allows the most painful of curl's arguments to be completed by fish by
restoring file-based completions for paths prefixed with `@` (which are
typically used after parameters like --data).
2018-06-18 23:56:22 -05:00
Mahmoud Al-Qudsi
6e36b20e42 Optimize __fish_complete_suffix and fix duplicate listings
With a blank $suff (i.e. complete all files), __fish_complete_suffix
returned directories twice, once with the trailing `/` and once without.
This fixes that, and additionally speeds up the code by no longer
shelling out to `sort -u` as we no longer rely on brace expansion to
enumerate directories and files simultaneously.

In general, this behavior would occur when a directory exists that
matches the suffix search pattern (so a dir named 'foo.bar' with a
search pattern '.bar' would return 'foo.bar' twice).

Runtime has dropped from ~22ms to ~8ms on my machine, while also
returning more correct results.
2018-06-18 23:55:18 -05:00
Mahmoud Al-Qudsi
5061f1666b Add completions for FreeBSD's kldload 2018-06-18 21:01:05 -05:00
Mahmoud Al-Qudsi
072974ec5c Fix service completions on non-FreeBSD platforms
I never realized script-local variables set after the function
definition do not keep their value when the function is executed later
in the file.
2018-06-17 22:03:04 -05:00
Mahmoud Al-Qudsi
31745d29ab Refactor service completions to drop eval usage under FreeBSD 2018-06-17 21:49:39 -05:00
Fabian Homborg
fa665bd3c8 [completions/git] Remove unnecessary helper function 2018-06-15 15:40:04 +02:00
Fabian Homborg
7b86062720 [completions/git] Allow relative paths for files
This is _ugly_ because it is implemented for both status --porcelain
formats, but it is both fast and accurate.
2018-06-15 15:40:04 +02:00
Sam Yu
76749468aa Fix sudo completion
* fix command under sudo get sudo's option completions
* rewrite completion of command under sudo with argparse
2018-06-14 23:05:06 +02:00
Fabian Homborg
64ff2f7895 Read conf.d snippets as last part of share/config.fish
This allows snippets to use everything that is defined in config.fish,
which is our _base_ initialization.

Among other things, it enables snippets to use $PATH as it will appear
in the user's config.fish, or even to change $PATH.

Also, this is how it was in 2.7.1 and before (with the small change
that abbrs were upgraded after).
2018-06-14 22:55:52 +02:00
Gustaf Johansson
1270bb265f completions: [go] Lookup pkgs from GOPATH
As defined in the `go help packages`:
  Many commands apply to a set of packages:
    go action [packages]
  Usually, [packages] is a list of import paths.

This patch introduces automatic lookup of said packages from GOPATH
using `go list`, and provides them as options go subcmds.
2018-06-13 15:33:29 +02:00
Mahmoud Al-Qudsi
35a7e1ef0e Add intelligent service-specific completions under FreeBSD 2018-06-12 19:24:18 -05:00
Mahmoud Al-Qudsi
eca4273f77 fixup! Add OS check to pkg completions 2018-06-07 13:42:53 -05:00
Mahmoud Al-Qudsi
e8b6705067 Add OS check to pkg completions 2018-06-07 12:22:47 -05:00