Commit graph

2873 commits

Author SHA1 Message Date
zabereer
a634356bcc remove redundant comment from __fish_print_pipestatus.fish 2019-03-05 18:25:16 +00:00
zabereer
d71e39f756 Revert "use global variables for $pipestatus in prompts to allow users to customize the look"
This reverts commit d5c18350a7.
2019-03-05 18:19:57 +00:00
Fabian Homborg
60f162db19 Remove single-argument test
This is an awful bit of `test` functionality that only exists to have
a clever shortcut and confuse people.

[ci skip]
2019-03-05 17:57:50 +01:00
zabereer
da2925bad7 add $pipestatus to classic_vcs.fish prompt 2019-03-04 18:25:18 +00:00
zabereer
0923712e3e add $pipestatus to informative_vcs.fish prompt 2019-03-04 18:15:04 +00:00
radek-sprta
261d48367d Add completions for Mariner (#5718)
* Add completions for Mariner

* Remove unnecessary characters
2019-03-03 20:25:31 +01:00
Fabian Homborg
8939a7ba7a completions/ipset: Don't error on loading
`ipset list --name` is a privileged operation, and it prints an
"Operation not permitted" error when done as a normal user.

What's worse, this did it on loading (the command substitution wasn't
quoted), so we'd print the error as soon as you did `ipset `.

Only do the operation when necessary, and don't print the error.

This'll effectively only make it work for root shells (not e.g. `sudo
ipset`), but I don't want to sprinkle `sudo` in the completion.

(Also why does listing stuff require root? That's not how it works
e.g. for ips. But I don't actually know what ipset is for, so maybe
there is a good reason.)

[ci skip]
2019-03-03 12:43:05 +01:00
zabereer
d5c18350a7 use global variables for $pipestatus in prompts to allow users to customize the look 2019-03-01 19:55:28 +00:00
zabereer
e157ba131b add $pipestatus to informative.fish prompt 2019-02-28 06:37:56 +00:00
zabereer
ead26881f0 create __fish_print_pipestatus function to reduce code duplication in other prompts when adding $pipestatus 2019-02-28 06:19:28 +00:00
zabereer
8ebbe67ff1 Use string match instead of for loop to simplify classic_status.fish 2019-02-27 06:11:03 +00:00
zabereer
a6f9140963 remove redundant echo from __fish_pipestatus_with_signal.fish 2019-02-27 05:39:17 +00:00
zabereer
378b5d7295 update classic_status.fish prompt to include $pipestatus 2019-02-26 18:27:59 +00:00
zabereer
0071ad0409 add __fish_status_to_signal.fish and __fish_pipestatus_with_signal.fish 2019-02-26 18:09:37 +00:00
Fabian Homborg
ddc0e68f29 functions/fish_update_completions: Stop cleaning up in ~/.config
That seems suspect.

It removes files starting with "# Autogenerated", but those files
usually do not show up in ~/.config - they're in ~/.local/share.

So let's be careful and not mess with the user's config.

(I'm pretty sure that the previous commit re-enabled cleanup as the
`~` was quoted before then)

[ci skip]
2019-02-26 09:24:38 +01:00
Fabian Homborg
4b6c682b2d functions/fish_update_completions: Let the python parse options
This did `argparse`, but only handled "--help". Any other options
would be ignored.

Instead, we just pass all the options through to python, and that'll
display help if needed.

This allows passing e.g. `--verbose 1` to help with debugging.

[ci skip]
2019-02-26 09:22:09 +01:00
Kevin Konrad
0f6b3fd9e4 add completions for cf and bosh 2019-02-25 09:00:42 -08:00
The0x539
e330dafd24 Improve completions for mkvextract
A key frustration with the prior version of mkvextract completions was
that even in a position where a filename would be expected, no
completions for a filename were offered. This update introduces more
rigorous argument handling, most importantly restricting
track/attachment completion to when both a mode and a file are
specified.
2019-02-24 21:17:10 -08:00
Collin Styles
195020ff89 screen: Add completions for -R and -RR options 2019-02-24 21:08:56 -08:00
Collin Styles
06f832aae1 Allow filename completion for screen
Screen commands can be passed an executable to run like:

$ screen -dR my_session /usr/bin/fish

This commit enables completion for that filename
2019-02-24 21:08:56 -08:00
Collin Styles
e475b1a375 Fix screen session name completion for non-Ubuntu distros
For some reason Ubuntu's version of screen includes timestamps in the
output of `screen -list`. The timestamps aren't present on other
distributions (tested on Fedora and Arch Linux), nor when building from
source. This commit fixes the regex so that with or without the
timestamp, fish will correctly show suggestions for screen sessions.
2019-02-24 21:08:56 -08:00
Fabian Homborg
f451499aa6 completions/valgrind: Fix option typo
Fixes #5688.

[ci skip]
2019-02-22 20:03:53 +01:00
Fabian Homborg
c6ec423513 completions/systemctl: Harden version comparison
Arch changed the version string to include the package rel, so it
looks like

    systemd 241 (241.7-2-arch)

which would break our simple `string replace` and `test`.

Fixes #5689.

[ci skip]
2019-02-22 20:00:08 +01:00
Max Nordlund
44ad92ef50 Fix typo 2019-02-20 16:00:59 -08:00
Fabian Homborg
50f6fa048e completions/sudo: Quote ?
This was treated as a glob where it was still enabled, most likely removing the "-E" option from argparse,
which caused `sudo -E` to not be parsed correctly, breaking completion.

(There was no error because the glob was used with `set`)

Fixes #5675.

[ci skip]
2019-02-20 22:30:29 +01:00
Fabian Homborg
59955391ad completions/yarn: Allow running scripts as subcommand
Fixes #5674.

[ci skip]
2019-02-19 14:24:02 +01:00
Fabian Homborg
8a93c7d0ea abbr: Add "-q"/"--query" option
[ci skip]
2019-02-19 11:02:58 +01:00
Collin Styles
8a0be93e50 Add completions for "git remote get-url" 2019-02-17 16:30:00 +01:00
Aaron Gyes
05701a779b isatty: command [ instead of command test
I don't know why but Go users keep having random tools installed into
PATH named `test`. Fixes #5665
2019-02-16 17:15:52 -08:00
Fabian Homborg
d48eb56aea Improve curl completions
Just a bunch of rewriting descriptions and some arguments.

Most arguments here are uncompleteable, and most of these options will
never be used.

[ci skip]
2019-02-16 17:01:02 +01:00
Fabian Homborg
dbeaa0c8de Add curl completion
Mostly copying the autogenerated stuff with some light description
cleanup.

Fixes #5664.

[ci skip]
2019-02-16 16:40:13 +01:00
Aaron Gyes
f10c0dde3b __init_uvar: match previous behavior
query for any set variable, not just universals, lest someone
avoiding uvars intentionally has a problem.
2019-02-14 21:42:42 -08:00
Aaron Gyes
619a248a35 Clean up uvar initialization with a wrapper function
Adds __init_uvar
2019-02-14 17:09:16 -08:00
Fabian Homborg
13eb01bc97 share/config: Guard contains against options
Fixes #5662.

[ci skip]
2019-02-14 11:00:47 +01:00
Fabian Homborg
5814b1b8e2 Fix man function for NetBSD
NetBSD's man is unusual in that it doesn't understand an empty
$MANPATH component as "the system man path", and doesn't have a
`manpath` or `man --path`.

It has a `-m` option that would be useful, but other mans also have a
`-m` option that isn't, so detecting it is tough.

It does have a `-p` option that almost does what one would want here,
so we hack around it to make things work.

Fixes #5657.

[ci skip]
2019-02-14 10:57:38 +01:00
Fabian Homborg
02ca7be416 functions/_.fish: Use ggetext if available
It turns out the default gettext on the sunny operating system with
the many names interprets at least `\n` itself, so we'd end up
swallowing it.

This allows us to move past the interactive tests and onto the expect
ones.

See #5472.
2019-02-13 13:05:50 +01:00
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