Commit Graph

1821 Commits

Author SHA1 Message Date
Fabian Homborg
f78f51e2a7 dirh: Don't rely on negative increments in seq
Not available in BSD seq.

Fixes #3354.
2016-09-06 18:15:00 +02:00
George Christou
f0e884075c Mute output from command -v tput (#3355)
The previous change here caused an obviously unwanted path to the `tput` command to be left on the prompt after ^C.
2016-09-06 02:37:52 -07:00
Fabian Homborg
9f6ba5db7a Disable fish_vi_cursor in unsupported TERMs 2016-09-05 14:44:03 +02:00
Fabian Homborg
cac3b239e3 Use fish_vi_cursor by default
Fixes #3215.
2016-09-05 01:28:21 +02:00
Fabian Homborg
b0716885bc Set cursorshape on preexec, reset on post
Fixes #3217.
2016-09-05 01:20:12 +02:00
Fabian Homborg
7ce042ccff Really allow for hybrid bindings
The previous solution would not erase the previous bindings if
fish_vi_key_bindings was called with a mode argument. So if the user
switched to vi with a different initial mode, they'd keep their previous
bindings also.

Supersedes e89057b.
2016-09-05 00:47:37 +02:00
Fabian Homborg
30f26b62e6 Remove duplicate bindings
Some of these were defined in the shared bindings, some (like \cy yank)
were just literally duplicate in the same files.

This should _not_ change anything. In particular this does not remove
hardcoding of sequences (because terminfo might be wrong or the term
might need smkx).

Found with

```
function bind
	set -l binds (builtin bind)
    builtin bind $argv
    set -l newbinds (builtin bind)
    if set -q argv[1]; and not test "$argv[1]" = "--erase"
        if test "$binds" = "$newbinds"
            echo "Duplicate: " (string escape -- $argv)
        end
    end
end
```
2016-09-04 22:48:40 +02:00
Fabian Homborg
e89057b70c Make hybrid bindings easier to achieve
The vi-bindings function would unconditionally erase all bindings,
making it impossible to call it last. This would disable the
mode-indicator (and in future also the cursor).

Make it so any argument to fish_vi_key_bindings stops it from erasing
bindings.

It would also be possible to demand an argument to erase (or to erase as
a separate step). but the usual case seems to be _switching_ to a set of bindings.
2016-09-03 23:11:36 +02:00
Fabian Homborg
1bc887cd9f Vi-mode: Also share end/home bindings
Fixes #3298.
2016-09-03 23:11:36 +02:00
Aaron Gyes
8ca3adaa91 Fix ^C at commandline indicator for FreeBSD
This didn't work on platforms where tput exists but can never accept
terminfo names. This includes the current versions of FreeBSD - it
used to do both, now it doesn't. So, fall back to the old termcap names
by (tput smso; or tput so). Add check for the tput program before we
even try.
2016-09-01 07:30:50 -07:00
Fabian Homborg
443fc66048 alias: Use source directly
The extra things `eval` does are all for code that runs
interactively. Because we just define a function, we don't need it.

This improves alias' performance by about 20-25% (0.783608s to 0.585585s
on about 500 aliases) and avoids triggering #3345.
2016-09-01 12:27:10 +02:00
Fabian Homborg
eeb42f5e54 git completions: Only show last 1000 commits
This can be prohibitively slow on large repositories (minutes!).

While regrettable, no user is going to like waiting that long.

Work towards #3342, rerun of #3230.

Many thanks to @gladhorn for the idea!
2016-08-30 23:25:42 +02:00
Fabian Homborg
3702616b60 pushd: Remove unnecessary forks
Convert sed to string and remove unnecessary math calls.
2016-08-29 00:01:13 +02:00
Frederik Gladhorn
f37995c676 git completion: Limit the number of commits for --fixup (#3230)
Offering auto completion for existing commits is great, but on big
repositories, it suddenly becomes really slow, even with fast hard
disks, since each commit is read and then a line processed for it.

Instead limit to the last 500 commits (arbitrary number) which still
feels fast. Going back further in history can easily and more reasonably
done with git log etc.
2016-08-27 20:23:39 +02:00
Boris Aranovich
5328d6b83c Perforce completions (#3314)
* completions/p4.fish

* Updated per comments + added p4 clients

* p4 completions: integ, opened, reopen. "default" CL support.

* Perforce RCS -> SCM

* p4 reopen: list opened files

* Fixed per review, added -d for all functions

Fixed per comments in review by @faho,
Added -d for all functions,
Renamed ”subcommand" term to “command” (so there’s probably diff noise)

* p4 completions with submit list of files

* p4 completions for submit: lists open files
2016-08-27 20:20:40 +02:00
Cobrand
172541c689 fix error when completing vi if it didnt exist (#3336) 2016-08-27 15:37:18 +02:00
Kurtis Rader
cfefaaf4ee revert the --shadow-builtin flag
Implementing the --shadow-builtin flag has proven to be highly controversial.
Revert the introduction of that flag to the `function` command. If someone
shoots themselves in the foot by redefining a builtin as a function that's
their problem and not our responsibility to protect them from doing so.

Fixes #3319
2016-08-24 22:56:19 -07:00
Jin Liu
476ffe12f6 fish_config: fix binding filter regression (#3327) 2016-08-24 01:30:33 -07:00
Aaron Gyes
b0184f1476 Sync up history completion 2016-08-23 18:07:50 -07:00
Jin Liu
4d04125fa1 fish_config: capitalize keynames to match parser output 2016-08-23 18:40:37 +08:00
Jin Liu
ecaba64056 fish_config: show btab as "Shift Tab" in bindings 2016-08-23 18:40:08 +08:00
Jin Liu
4906a5f390 fish_config: fix keybinding parser bugs
1. \r shown as r
2. putty-specific Home/End
3. backspace
4. show unparsable sequence as "unknown-control-sequence"
2016-08-23 18:34:23 +08:00
Jin Liu
f76e620be8 fish_config: filter out uninteresting bindings
currently: self-insert and 'begin;end'
2016-08-23 17:34:21 +08:00
Jin Liu
bfee664af3 fish_config: group bindings by command, show raw binding commands on click 2016-08-23 17:10:30 +08:00
Fabian Homborg
4e2d2c125c Silence math errors in git prompt
It's not ideal since we can't get the real result so we just assume it's
"0". That triggers the easier path, which still might display the wrong
thing, but we have to pick something.

Possible fix for #3321.
2016-08-22 17:06:29 +02:00
ArkBriar
044efef577 fix broken completion of screen on osx, test on ubuntu and mac (#3271)
* fixes broken completion of screen on osx, test on ubuntu and mac with fish 2.3.1
* replaces sed, __fish_sgrep with fish builtin string
* add completion for `screen -x`
* adjust format (e.g. 12345.socket\t01/01/16 09:55:00 Detached)
2016-08-19 12:00:18 -07:00
Date Huang
5dd959070c Fix brew completion for brew install (#3309)
* Fix brew completion for `brew install`
* Using `brew search` rather than `brew --repository`
- Homebrew migrated the directory holding their Formulas into Taps, breaking fish's completions.
- New method to find all Homebrew-core Formulas
- Compatible with old versions of Homebrew and more future proof
* Replace fixed path to search formula with `brew --repository`
* Replace `sed` with builtin `string replace`
2016-08-19 03:58:37 -07:00
Fabian Homborg
790968120d Give up earlier when we can't find default key bindings.
This relates to #3302.
2016-08-15 22:39:51 +02:00
Jens Fredskov
2a119ff082 Aura: Show installed packages on remove-completion (#3297) 2016-08-11 20:07:59 +02:00
Kurtis Rader
710addde16 fix history --delete regression
The recent change to reconcile the history builtin command and function
broke an undocumented behavior of `history --delete`. This change
reinstates that behavior. It also adds an explicit `--exact` search mode
for the `--search` and `--delete` subcommands.

Fixes #3270
2016-08-10 21:51:01 -07:00
Boris Aranovich
dc02587ac4 __fish_git_prompt: untracked files using git ls-files | wc -l | string trim 2016-08-10 14:51:18 -07:00
Boris Aranovich
077a0e1b47 Counting the number of unstaged files using wc -l pipe 2016-08-10 14:51:18 -07:00
Kurtis Rader
e46978fedb simplify previous change to the _ script
There's no need for a local var or echo in a subcommand. Also, fix the
formatting to match the style guide.
2016-08-07 19:29:14 -07:00
Aaron Gyes
7e0e745958 The last commit introduced a Travis failure.
Only on the OS X travis build.

I can't reproduce it but I figure it's something to do
with test -e vs test -x or the echo -n in command substitution.
Oops.
2016-08-07 15:48:41 -07:00
Aaron Gyes
43515e1298 Use command -v instead of which in _.fish
I didn't know that there was any which usage outside of type -a
in our functions, until I grepped and noticed this.
2016-08-07 15:23:51 -07:00
Jin Liu
ccd62ff44b Bug fix: fish_config/bindings display ESC as "ALT-e"
Fixes #3286
2016-08-04 12:39:32 -07:00
Fabian Homborg
744da2cab2 Add backspace bindings to vi-mode
This was erroneously omitted from the previous commit.

Now backspace in insert mode does backward-delete-char, in default mode
backward-char (i.e. no deleting, just moving). This is consistent with vim.
2016-08-04 20:45:21 +02:00
Fabian Homborg
93b9e7443e Share some bindings between vi- and emacs-mode
This undoes the inheritance since it shared too much.

The idea here is to share bindings that aren't something the editors we're inspired by do - there's no "execute" in vi.
The basic editing and moving bindings are now vi-style in vi-mode and emacs-style in default mode.
2016-08-04 14:03:13 +02:00
Hunsu
b1f576deae Add completions for Arcanist (#3256) 2016-08-03 15:08:22 +02:00
Fabian Homborg
d68320a3c6 Enable 24bit mode less often
In particular, Screen and emacs' "ansi-term" behave like neovim in that
they just ignore the sequences, which leads to the terminal rendering
default color (most of the time white) instead.
2016-08-03 01:13:31 +02:00
[Redacted]
00cb9ce80a Add git shortlog completion (#3274) 2016-08-02 19:34:28 +02:00
Fabian Homborg
afa266a7ea git completions: Fix cases without current branch
Sometimes git just isn't on a branch.
2016-08-02 00:12:31 +02:00
Aaron Gyes
8277f6a1ba Let git normalize line-endings upon commit (LF)
Only one file belonging to fish-shell had DOS/bogus line endings,
with `git add' picking up changes after updating .gitattributes:
hostname.fish.

Unsurprisingly, it has code to support cygwin and was likely
worked on by a user on a Windows machine. This will help
such cases in the future.

Also, in pcre2-10.21/, there was RunTest.bat which was (correctly)
CRLF formatted.  We don't use this batch script at all, so rather
than LF it or add an exception, blast it away like the other pcre2
files omitted from the repo.
2016-08-01 04:38:08 -07:00
Aaron Gyes
b77e2a67f8 Only do fish_greeting if interactive
Even if __fish_config_interactive, it can be shown when a script
uses `read`.

Fixes #3261, #1401.
2016-07-30 22:47:17 -07:00
Aaron Gyes
e75fc8452f Strip out brackets from generated-by-manpage completions.
Handles cases like cupsctl --\[no-\]remote-admin and
unxz --powerpc[ better.

Fixes #3272
2016-07-30 22:01:59 -07:00
Fabian Homborg
0a51b17716 if started without a locale read system config
A common problem for users is that fish doesn't get a locale. This often
happens if systemd is used with getty and fish as login shell.

Fixes #277

Note that I (@krader) made editorial changes before merging this. For
example, running `make style` and otherwise changing long statements to a
series of shorter statements. So if there are any problems it is possible
I introduced them.
2016-07-27 22:15:54 -07:00
Fabian Homborg
49008d7a1c Fix escaping in abbr --erase completions
Fixes #3267
2016-07-26 15:23:02 +02:00
Aaron Gyes
3669805627 Improve compatibility with 0-16 color terminals.
Fish assumed that it could use tparm to emit escapes to set colors
as long as the color was under 16 or max_colors from terminfo was 256::

 if (idx < 16 || term256_support_is_native()) {
    // Use tparm to emit color escape
    writembs(tparm(todo, idx);

If a terminal has max_colors = 8, here is what happenened, except
inside fish:

 > env TERM=xterm tput setaf 7 | xxd
   00000000: 1b5b 3337 6d                             .[37m
 > env TERM=xterm tput setaf 9 | xxd
   00000000: 1b5b 3338 6d                             .[39m

The first escape is good, that second escape is not valid.
Bright colors should start at \e[90m:

 > env TERM=xterm-16color tput setaf 9 | xxd
   00000000: 1b5b 3931 6d                             .[91m

This is what caused "white" not to work in #3176 in Terminal.app, and
obviously isn't good for real low-color terminals either.

So we replace the term256_support_is_native(), which just checked if
max_colors is 256 or not, with a function that takes an argument and
checks terminfo for that to see if tparm can handle it. We only use this
test, because otherwise, tparm should be expected to output garbage:

 /// Returns true if we think tparm can handle outputting a color index
 static bool term_supports_color_natively(unsigned int c) { return max_colors >= c; }
...

 if (term_supports_color_natively(idx) {

And if terminfo can't do it, the "forced" escapes no longer use the fancy
format when handling colors under 16, as this is not going to be compatible with
low color terminals. The code before used:

 else {
     char buff[16] = "";
     snprintf(buff, sizeof buff, "\x1b[%d;5;%dm", is_fg ? 38 : 48, idx);

I added an intermediate format for colors 0-15:

 else {
     // We are attempting to bypass the term here. Generate the ANSI escape sequence ourself.
     char buff[16] = "";
     if (idx < 16) {
         snprintf(buff, sizeof buff, "\x1b[%dm", ((idx > 7) ? 82 : 30) + idx + !is_fg * 10);
     } else {
         snprintf(buff, sizeof buff, "\x1b[%d;5;%dm", is_fg ? 38 : 48, idx);
     }

Restores harmony to white, brwhite, brblack, black color names.
We don't want "white" to refer to color color #16, but to the
standard color #8. #16 is "brwhite".

Move comments from output.h to output.cpp

Nuke the config.fish set_color hack for linux VTs.

Sync up our various incomplete color lists and fix all color values.
Colors 0-8 are assumed to be brights - e.g. red was FF0000. Perplexing!

Using this table:
 <http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html>

Fixes #3176
2016-07-24 17:02:29 -07:00
ridiculousfish
46fba342db Revert "Only show greeting on interactive login sessions"
This reverts commit 3d0ea5fe79.
2016-07-24 16:39:44 -07:00
ridiculousfish
5eedb0ee9c Revert "Only show fish greeting for interactive logins"
This reverts commit 3a7a6f16ef.
2016-07-24 16:39:43 -07:00
ridiculousfish
325f047803 Revert "Update __fish_config_interactive.fish"
This reverts commit ec292ec51b.
2016-07-24 16:39:41 -07:00
ridiculousfish
c76f896f69 Revert "Revert "Only show greeting on interactive login sessions""
This reverts commit 88688d02b2.
2016-07-24 16:39:40 -07:00
Aaron Gyes
88688d02b2 Revert "Only show greeting on interactive login sessions"
This reverts commit 3d0ea5fe79.
2016-07-24 03:53:27 -07:00
Aaron Gyes
ec292ec51b Update __fish_config_interactive.fish 2016-07-24 01:42:58 -07:00
Aaron Gyes
3a7a6f16ef Only show fish greeting for interactive logins
This is a regression introduced by 834ebef53c
Bolster with a check for only login sessions too -- hopefully makes it
less annooying on subshells in general.

Fixes #3261
2016-07-24 00:05:05 -07:00
Aaron Gyes
3d0ea5fe79 Only show greeting on interactive login sessions
Fixes #3261
2016-07-23 23:33:20 -07:00
Aaron Gyes
d252704fdb checkout non-empty colorutils.js
The last commit was obviously an error!
2016-07-23 17:18:10 -07:00
Aaron Gyes
dfe363c945 clang-format colorutils.js
.... should make the #3260 diff shorter.
2016-07-23 17:03:32 -07:00
Scott Bonds
99351fcb44 Don't use getent to list hosts if its not supported (#3259)
Fixes #2137 on OpenBSD
2016-07-23 13:24:12 +02:00
Kurtis Rader
b53f42970c correct handling of history args
This fixes several problems with how the builtin `history` command handles
arguments. It now complains and refuses to do anything if the user specifies
incompatible actions (e.g., `--search` and `--clear`). It also fixes a
regression introduced by previous changes with regard to invocations that
don't explicitly specify `--search` or a search term.

Enhances the history man page to clarify the behavior of various options.

This change is already far larger than I like so unit tests will be added
in a separate commit.

Fixes #3224.

Note: This fixes only a couple problems with the interactive `history
--delete` command in the `history` function. The main problem will be
dealt with via issue #31.
2016-07-20 21:18:48 -07:00
Frederik Gladhorn
190fb4a665 git completion: add --stat to show
Of the various options for show, --stat is the one I
regularly use to know the size of a commit.
2016-07-16 20:20:33 -07:00
Frederik Gladhorn
6b99af05a5 Git mergetool completion (#3226)
* git completion: add mergetool

The list of tools is stole from the bash completion file that comes with
git.

* git completion: complete files with merget conflict for mergetool
2016-07-16 00:34:05 +02:00
Frederik Gladhorn
2df263fa26 git completion: Add HEADS
Ranges work with tags and HEAD etc.

Allows to complete "git checkout FETCH_HEAD" and similar.
2016-07-14 22:22:28 +02:00
Frederik Gladhorn
06003f82ae git completion: Rename __fish_git_heads to __fish_git_refs
In git speak, these are refs, while there can be several heads which are
refs in turn.
2016-07-13 11:45:42 +02:00
Aaron Gyes
fb3c839a15 fish_indent did something surprising. 2016-07-11 06:53:20 -07:00
Aaron Gyes
e3187b2361 Actually fix #3221 2016-07-11 06:43:33 -07:00
Aaron Gyes
09291735e6 Use locales preferred date format, fix up options
We don't seem to mention in the documentation that we were forcing
-t for all interactive uses. If we want to do that we should apply
that in the builtin.

history.fish reimplementing every option and doing things kind of
differently is a real pain and it's not clear if the docs are
referring to the or the wrapper script or both.
2016-07-11 01:45:30 -07:00
Aaron Gyes
013506dfd5 Merge pull request #3218 from floam/manparser
Minor manpage completion utility improvements
2016-07-10 10:32:45 -07:00
ridiculousfish
bd2b7764c7 __fish_make_completion_signals to stop spewing on OS X
OS X does not support kill -L or kill -t.
Use the POSIX path to populate __kill_signals
2016-07-09 17:45:16 -07:00
Aaron Gyes
6e0521e23f Completions (mostly): s/.../…/g 2016-07-09 10:57:59 -07:00
Aaron Gyes
d895f876b4 Fix "UNINDENT ..." junk in manpage completions
Problem with Type2ManParser

before:
    complete -c xcode-select -s h -l help --description 'Prints the usage
message. UNINDENT NDENT 0. 0.'
after:
    complete -c xcode-select -s h -l help --description 'Prints the
usage message.'
2016-07-09 07:19:15 -07:00
Aaron Gyes
bb6ce9d142 minor create_manpage_completions.py improvements
Don't truncate long lines with " [See Man Page]" suffix - use the
reclaimed 15 characters for more-useful usage info.

Improve the --verbose output with:
 - spacing fixes
 - diagnostics related to input print repr()/quoted as %r to be less
   confusing.
 - get rid of stupid name() and use type()/__class__.__name__,

- Always use new-style (new as in post python 2.2) classes so this
  behaves the same whether we run in python 2 or 3.

- Properly convert left-quotes and right-quotes to that character in
  deroff.py
2016-07-09 05:51:32 -07:00
Kurtis Rader
14c7cfa84b make kill/pkill completions more robust (#3200)
Someone running fish in an unusual locale reported that an `assert()` was
firing when they typed `pkill c`. I traced it to two bugs. First, the
__fish_make_completion_signals command was producing a weird result. Second,
the builtin `complete` command wasn't adequately verifying its arguments.

Fixes #3129
2016-07-07 18:44:35 -07:00
David Adam
3cd1ef23ab Merge branch 'Integration_2.3.1'
Includes the `string` fallbacks for upgrades from 2.3.1 (as discussed in
issue #3057).
2016-07-03 22:18:55 +08:00
Fabian Homborg
9b4938e2c2 clipboard_paste: Fix lines starting with "-"
Previously, trying to paste "--something" would result in an error from
commandline.
2016-07-03 12:29:58 +02:00
Aaron Gyes
f966248f16 string.fish: use if/else. Reindent. 2016-07-02 11:40:22 -07:00
Aaron Gyes
e597df70d7 Check if fish -c string will work first. 2016-07-02 11:05:04 -07:00
Aaron Gyes
c79e9c7d4e Lossless recompress of images with pngcrush+zopfli
And tweak RTF.
2016-07-01 14:58:56 -07:00
Aaron Gyes
8e7f0e781d Completion for string match --invert
Also adds descriptions for some other options which were absent.
2016-07-01 13:44:14 -07:00
Aaron Gyes
edee3e5eb2 Use fonts found on terminals for the web config.
Instead of just using Courier New across the board, have the
browser try several likely available fonts before defaulting
to the system's "monospace".

Thanks @MarkGriffiths
Fixes #2924
2016-07-01 13:41:06 -07:00
Aaron Gyes
bc693bd4e0 fish_indent type -a's function output and colorize
Doesn't colorize if output is redirected.
This is "fun" and indenting happens to make most of the included
functions display more narrow and fit better into a terminal window.
2016-07-01 06:45:03 -07:00
Aaron Gyes
cd422e5d78 fish_indent type -a's function output and colorize
Doesn't colorize if output is redirected.
This is "fun" and indenting happens to make most of the included
functions display more narrow and fit better into a terminal window.
2016-07-01 06:01:37 -07:00
Aaron Gyes
ca6cda20a3 Fix fish_config in .app
* Export $__fish_bin_dir
* Fix incorrect bundle path in fish.cpp - fish is not in MacOS/ (it should be!)
2016-07-01 04:43:57 -07:00
Aaron Gyes
63120a9962 Fix fish_config in .app
* Copy docs into Resrouces
* Export $__fish_bin_dir
* Fix incorrect path in fish.cpp - fish is not in MacOS (it should be!)
2016-07-01 03:57:16 -07:00
Aaron Gyes
807dc82a75 Rename things to avoid conflicts in headers
Was breaking builds

 * ncurses.h: can declare `char *const key_name'.
 * netbsd term.h: has `newline', `lines' macros.
2016-07-01 03:57:16 -07:00
Aaron Gyes
47fbfdca3e Add note about the zombie process 2016-07-01 02:21:13 -07:00
Aaron Gyes
772e35562a suspend output after '\n' not printing before kill 2016-07-01 01:53:43 -07:00
Aaron Gyes
e42f593553 show 'fg' usage for suspend if not forcing 2016-07-01 01:27:03 -07:00
Aaron Gyes
9642fcb589 Update suspend docs. When used, show how to resume
Fixes #3154
2016-07-01 01:18:07 -07:00
Aaron Gyes
7e58a3982a string escape some eval calls 2016-07-01 00:08:46 -07:00
Aaron Gyes
431589a16a Use fish -c string ... as the string fallback.
We can again drop the prompt_pwd check.
2016-07-01 00:00:53 -07:00
Kurtis Rader
cbee315b1b fix the history function and man page
The previous commit to add a `--with-timestamp` flag to the `history` command
caused me to notice the history function didn't recognize the new long option.
Neither did it recognize the short options for the builtin command. This
change fixes both of those issues.
2016-06-30 22:01:59 -07:00
Aaron Gyes
d69a68e265 Comment fixes. 2016-06-26 21:14:45 -07:00
Aaron Gyes
534c1287ca Add back prompt_pwd to solve empty output problem
..by not manipulating path at all if we do not have
the tools to do so.

Tag changes with better comments.
2016-06-26 20:54:04 -07:00
Aaron Gyes
81dee16d69 Add back prompt_pwd to solve empty output problem
..by not manipulating path at all if we do not have
the tools to do so.

Tag changes with better comments.
2016-06-26 20:25:11 -07:00
Aaron Gyes
02f578a82d echo the no-string errors to stderr and return 1.
Fix output on launch

Drop __fish_urlencode.fish

Drop prompt_pwd.fish
2016-06-26 16:25:41 -07:00
Aaron Gyes
dfb4998778 Work around absent `string' in old fishies upgrading.
Improves experience during upgrades, accidentally running
an old fish with a new environment. No errors just from
printing a prompt. Fixes #3057.

Print helpful notice also when launching mismatched fish.

Autoloadable string.fish -- only create function if not builtin.
2016-06-26 16:25:41 -07:00
Fabian Homborg
8070cd81d6 npm completions: Check command npm existence
Really fixes #3158 and #3152.

(cherry picked from commit 10661bb024)
2016-06-21 17:43:55 +02:00
Fabian Homborg
10661bb024 npm completions: Check command npm existence
Really fixes #3158 and #3152.
2016-06-21 17:42:22 +02:00
Fabian Homborg
7365b6bd0c Bind clipboard-copy to \cx, restore yank binding
Fixes #3160.
2016-06-21 16:19:40 +02:00
Fabian Homborg
d66d51f101 systemctl completions: Add reset-failed completion
Fixes #3153.
2016-06-21 12:43:50 +02:00
Fabian Homborg
bc8ec46ef9 npm completions: Call command npm
npm is often wrapped by a function.

Fixes #3158.

(cherry picked from commit 3a0d417b9e)
2016-06-21 12:40:23 +02:00
Fabian Homborg
3a0d417b9e npm completions: Call command npm
npm is often wrapped by a function.

Fixes #3158.
2016-06-21 12:03:29 +02:00
Fahri Cihan Demirci
db0176b884 Add Purge Subcommand Completion for Apt (#3097) 2016-06-20 18:23:12 -07:00
Jens Fredskov
7cf6ef675a correct __fish_contains_opts to __fish_contains_opt (#3102)
Completion throws and error about the command `__fish_contains_opts` beings unknown. It seems to be a simple typo, as all other completions use `__fish_contains_opt`
2016-06-20 18:16:10 -07:00
Fabian Homborg
29664c42a0 git completions: Ignore stderr everywhere
This allows us to run git commands outside of a git repo.

Fixes #3114.
2016-06-20 18:11:26 -07:00
Fabian Homborg
8dc4b0d4b2 Merge pull request #3123 from moverest/completion
Extend autocompletion support
2016-06-20 18:05:01 -07:00
Boris Aranovich
cb74f0f60e Refine reading ssh_config (#3146)
https://www.freebsd.org/cgi/man.cgi?query=ssh_config&sektion=5
1. It is possible to add multiple whitespace characters between the keyword (i.e. Host) and the argument(s).
2. It is allowed to have a single = and whitespace between the keyword and the argument(s).
3. It is possible to add multiple host names under a single Host directive by spacing the names apart.

1. and 3. are actual conventions that we use in our team, and I couldn't get auto-complete working for fish without this modification.

Modification explained:
a. The space between Host(?:name)? and the \w.* was replaced by (?:\s+|\s*=\s*) to match any sequence of whitespace characters, or optional whitespaces with a single =, per spec.
b. Result of first replacement is piped through another string replace to switch duplicate whitespace characters to a single space, and then piped to be split by that space. This allows specifying several aliases or host names in a single Host/Hostname definition, also per spec.
2016-06-20 17:06:45 -07:00
Aaron Gyes
7ac32e45cb Remove SHLVL check.
Fixes #3154.
2016-06-18 22:20:18 -07:00
Aaron Gyes
f04644f749 Lossless recompress of images with pngcrush+zopfli
And tweak RTF.
2016-06-18 10:03:26 -07:00
Aaron Gyes
e6d4ac5ee2 Decrease minimum SHLVL for suspend without --force
There is some discussion on #2269
2016-06-15 23:05:36 -07:00
Aaron Gyes
cfe3fc301c string escape some eval calls 2016-06-15 21:41:37 -07:00
Boris Aranovich
cbe97ac1a1 Refine reading ssh_config (#3146)
https://www.freebsd.org/cgi/man.cgi?query=ssh_config&sektion=5
1. It is possible to add multiple whitespace characters between the keyword (i.e. Host) and the argument(s).
2. It is allowed to have a single = and whitespace between the keyword and the argument(s).
3. It is possible to add multiple host names under a single Host directive by spacing the names apart.

1. and 3. are actual conventions that we use in our team, and I couldn't get auto-complete working for fish without this modification.

Modification explained:
a. The space between Host(?:name)? and the \w.* was replaced by (?:\s+|\s*=\s*) to match any sequence of whitespace characters, or optional whitespaces with a single =, per spec.
b. Result of first replacement is piped through another string replace to switch duplicate whitespace characters to a single space, and then piped to be split by that space. This allows specifying several aliases or host names in a single Host/Hostname definition, also per spec.
2016-06-15 17:54:40 +02:00
Aaron Gyes
ab1db7ebee Quote eval ... webconfig.py in fish_config.fish
This was causing issues launching fish_config on OS X if fish.app is
renamed to contain a space (noted, but likely not the actual problem,
in issue #3140)
2016-06-14 11:31:10 -07:00
Aaron Gyes
723d689679 Completion for string match --invert
Also adds descriptions for some other options which were absent.
2016-06-13 23:10:05 -07:00
Fabian Homborg
5d20750aaa Merge pull request #3123 from moverest/completion
Extend autocompletion support
2016-06-10 18:47:55 +02:00
Fabian Homborg
222a07e907 Allow compressed man pages in help
It seems Fedora compresses our whopping 340k of man pages.

Fixes #3130.

Inspired by @TieDyedDevil's work there.
2016-06-10 14:13:15 +02:00
Clément Martinez
4d49c902ac Fix and enhance netctl-auto completions
I mixed things up with `netctl` somehow. Since the two are quite
different they do not have the same function, they should not have
the same completions.

I also find that I would be smarter to only display the relevent
profiles given what we want to do. If we want to disable a profile
we should only complete with enabled profile for completion for
instance. I don't know if the implemention is nice enough however.
2016-06-08 23:34:51 +02:00
Clément Martinez
65ed22d5a6 Add help option completions for godoc, gofmt, goimports, golint, gorename 2016-06-08 17:21:16 +02:00
Clément Martinez
09f9d71bb2 Clean mkdir completions 2016-06-08 16:03:21 +02:00
Clément Martinez
059e11078c Split __fish_print_modules from modprob.fish and modinfo.fish 2016-06-08 15:13:18 +02:00
Clément Martinez
e30db95baa Refine mkdir completions for non SELinux and non GNU 2016-06-08 14:30:39 +02:00
Clément Martinez
970d895aca Add xz completions 2016-06-08 13:40:27 +02:00
Clément Martinez
c9b3220160 Add modinfo completions 2016-06-08 13:40:27 +02:00
Clément Martinez
10575d895d Add lscpu completions 2016-06-08 13:40:27 +02:00
Clément Martinez
67f3c01396 Add gorename completions 2016-06-08 13:40:27 +02:00
Clément Martinez
536d6cebd9 Add golint completions 2016-06-08 13:40:27 +02:00
Clément Martinez
7a97095583 Add goimports completions 2016-06-08 13:40:27 +02:00
Clément Martinez
f37dafdf52 Clean udisksctl 2016-06-08 08:32:50 +02:00
Clément Martinez
c84137aec8 Clean netctl-auto and udiskctl completions 2016-06-07 20:41:04 +02:00
Clément Martinez
f1dc1cd92b Add udisksctl autocomplete 2016-06-07 16:50:28 +02:00
Clément Martinez
41f2344cea Add termite autocomplete 2016-06-07 16:50:28 +02:00
Clément Martinez
a965a71079 Add poweroff autocomplete 2016-06-07 16:50:28 +02:00
Clément Martinez
913624cbfa Add netctl-auto autocomplete 2016-06-07 16:50:28 +02:00
Clément Martinez
220fd418a7 Add mkdir autocomplete 2016-06-07 16:50:28 +02:00
Clément Martinez
5dda908c1f Add gofmt autocomplete 2016-06-07 16:50:28 +02:00
Clément Martinez
b7f45c3783 Add godoc autocomplete 2016-06-07 16:50:28 +02:00
Clément Martinez
3a6e239437 Add alsamixer autocomplete 2016-06-07 16:50:28 +02:00
Fabian Homborg
fcbeddc3eb Remove $__fish_vi_mode
This makes fish_mode_prompt rely on $fish_key_bindings instead.

fish_bind_mode is also set in default mode (only always "default"), so
it can't be used as the indicator.

Closes #3067.

(cherry picked from commit 8ab980b793)
2016-06-06 22:21:52 +08:00
Fabian Homborg
32a585a52b git completions: Only take general options before command 2016-06-04 12:27:06 +02:00
Fabian Homborg
410d92ed61 git completions: Ignore stderr everywhere
This allows us to run git commands outside of a git repo.

Fixes #3114.
2016-06-04 12:26:06 +02:00
Hunsu
24d6f6d066 Add completions for git blame command (#3094) 2016-06-02 12:49:01 +02:00
Jorge Bucaran
aee9d2c9d7 Do not hardcode RGB values in color definitions. 2016-06-01 21:50:19 -07:00
Jens Fredskov
29c38d73a2 correct __fish_contains_opts to __fish_contains_opt (#3102)
Completion throws and error about the command `__fish_contains_opts` beings unknown. It seems to be a simple typo, as all other completions use `__fish_contains_opt`
2016-06-01 23:58:38 +02:00
Fahri Cihan Demirci
8d11bb9f86 Add Purge Subcommand Completion for Apt (#3097) 2016-06-01 00:56:22 +02:00
Fabian Homborg
2768d2ea06 Style fixes for fish_vi_cursor
"$fcn"

[ci skip]
2016-05-30 16:40:49 +02:00
Andreas Wagner
3d19b549c8 Fix utf-8 decoding error in file_is_overwritable of create_manpage_completions.py 2016-05-29 14:12:32 -07:00
Fabian Homborg
bfb5fec330 Remove stray "0" output from man completions 2016-05-29 14:34:20 +02:00
Fabian Homborg
0d257fd651 Man completions: Don't show sections when completing pages 2016-05-29 14:31:42 +02:00
Fabian Homborg
ebde55f704 Man completions: Show all pages for a section
If one is given, of course.
2016-05-29 14:31:12 +02:00
Fabian Homborg
f23464001f Indent __fish_git_prompt 2016-05-29 14:10:10 +02:00
Fabian Homborg
0882e0cb95 Git prompt: Remove legacy option
Git has supported `rev-list --count` for years, so this shouldn't be
needed anymore.
2016-05-29 14:07:15 +02:00
Fabian Homborg
763c620d0b Stringify git prompt 2016-05-29 14:06:12 +02:00
Fabian Homborg
2871096f9c git completions: Add general options
These are the options between `git` and the subcommand.

Fixes #3087.
2016-05-29 13:59:22 +02:00
Fabian Homborg
8e88b29eeb Git prompt: Shorten the sha ourselves
Possibly fixes #3083.
2016-05-28 19:30:29 +02:00
Fabian Homborg
aaaea44714 Git prompt: Only shorten sha if needed
This speeds up the common case when IO is slow, e.g. when used with
sshfs.

We only use the short sha for figuring out whether the state is
valid (for which a long sha should also work) and for display when HEAD
is detached (I think that's the correct git-ism).

Working towards #3083.
2016-05-28 17:58:29 +02:00
Fabian Homborg
d79a5a3152 Funced: Make removal safer, take two
Now we try to remove the file and then the directory, without forcing
anything, showing any (quite unexpected) error to the user, once.
2016-05-28 12:34:04 +02:00
Frederik “Freso” S. Olesen
7af9e1f5c5 Split off __fish_complete_blockdevice from mount.fish.
The __fish_complete_blockdevice function can be useful to other
completions than mount.fish, so it should live on its own so its
available to those.
2016-05-27 14:56:47 -07:00
Frederik “Freso” S. Olesen
980fb59232 Remove executable flag from pacaur completion. 2016-05-27 14:48:41 -07:00
Fabian Homborg
53c506f109 Run fish_indent on default_key_bindings 2016-05-25 16:10:16 +02:00
Fabian Homborg
7d1f45e25f Add clipboard helper functions and bind them
\cy copies, \cv pastes.
2016-05-25 16:10:16 +02:00
Fabian Homborg
b9848538e3 Funced: Limit damage when removing tmpfile
This will now only forcibly remove _files_, not directories.

$tmpdir _should_ be something only we use in /tmp, but mktemp might screw up.
2016-05-24 13:55:09 +02:00
Dan Underwood
475439fa0b Test for Atom Package Manager now passes correctly
Move to `string match` syntax from `grep` caused test to see if the Atom Package Manager is installed to always fail. This appears to fix the issue (tested on fish 2.3.0 with apm 1.6.0).
2016-05-24 11:24:01 +00:00
Fabian Homborg
dac8483f7e Simplify some code in abbr
We actually need less duplication here.
2016-05-23 19:59:02 +02:00
Fabian Homborg
46f4819ffa Fix printing "--" in abbr --show 2016-05-23 19:59:02 +02:00
Fabian Homborg
c238ad35bd Fix "--" argument in abbr 2016-05-23 19:59:02 +02:00
Fabian Homborg
309e10e7a2 Don't mangle arguments in abbr
This now (rightly) throws an error if there's a space in the
key (because we can't store it).

Fixes #2997.
2016-05-23 19:59:02 +02:00
Fabian Homborg
5accc7c6c5 Fix funced's tmpfile generation on OSX
OSX mktemp... isn't great, so work around that fact.
2016-05-23 00:49:09 +02:00
Fabian Homborg
60317190bd Check validity of fish_key_bindings
This potentially leads to an unusable session (when fish_key_bindings is
set in config.fish to a value without corresponding function), so we
should take care.
2016-05-22 19:56:47 +02:00
Jorge Bucaran
14b953e414 Add missing color definitions to __fish_init_1_50_0 reset. (#2987)
* Add missing color definitions to __fish_init_1_50_0 reset.

The values where determined by inspecting the values of:

* fish_color_end
* fish_color_user
* fish_color_host

after resetting the color theme via fish_config.

* Add documentation for fish_color_user and fish_color_host.

(cherry picked from commit 08c29727e0)
2016-05-20 21:02:56 +00:00
Fabian Homborg
573b3797a5 Improve asp's package completion 2016-05-19 14:52:38 +02:00
Fabian Homborg
a0b3b8ac4c Add networkctl completion
Very simple, but effective.
2016-05-19 14:50:25 +02:00
Fabian Homborg
4d63ebde15 Remove stray "=" from completions. 2016-05-19 14:29:04 +02:00
Fabian Homborg
9cee3f13a1 Implement src:dest for git push completion
This allows specifying a local branch to push to a certain remote
branch.

Fixes #3035.
2016-05-19 14:11:27 +02:00
Fabian Homborg
8dc74de92e Add completion for ip
This is quite ugly because the syntax is ugly, the documentation both
under- and overspecified at the same time (a BNF that isn't...) and it
has a lot of functionality.

But the completion works half-decent for `ip address`, so let's ship it.
2016-05-19 13:23:00 +02:00
Aaron Gyes
00e32a0909 Use fonts found on terminals for the web config.
Instead of just using Courier New across the board, have the
browser try several likely available fonts before defaulting
to the system's "monospace".

Thanks @MarkGriffiths
Fixes #2924
2016-05-18 11:21:14 -07:00
Kurtis Rader
51468b7646 add function --shadow-builtin flag
It's currently too easy for someone to bork their shell by doing something
like `function test; return 0; end`. That's obviously a silly, contrived,
example but the point is that novice users who learn about functions are
prone to do something like that without realizing it will bork the shell. Even
expert users who know about the `test` builtin might forget that, say, `pwd`
is a builtin.

This change adds a `--shadow-builtin` flag that must be specified to
indicate you know what you're doing.

Fixes #3000
2016-05-14 20:38:32 -07:00
ridiculousfish
768277a312 Remove the errant newline in __fish_cancel_commandline again
(cherry picked from commit 149e601743)
2016-05-13 23:19:53 +01:00
ridiculousfish
149e601743 Remove the errant newline in __fish_cancel_commandline again 2016-05-13 12:10:17 -07:00
Fabian Homborg
a998921f39 git: Complete reflog for reset 2016-05-13 16:18:29 +02:00
CoolOppo
3daccf3c22 fix typo in webconfig.py comment 2016-05-11 19:51:08 -07:00
Fabian Homborg
c63c88262b Indent git completion
It's about time I finally fixed my emacs config.
2016-05-11 15:06:10 +02:00
Fabian Homborg
fbe2cdc3c7 git completion: Complete commits for cherry-pick if at least three
characters are given
2016-05-11 15:05:56 +02:00
Fabian Homborg
b60ef72c3d git completion: Fix option-before-command for stash
Because it allows sub-subcommands, it has functions to determine which,
if any, is used. These were too simplistic.
2016-05-11 15:03:05 +02:00
Fabian Homborg
d2e79cf6f6 git completion: More stringification 2016-05-11 15:03:05 +02:00
Fabian Homborg
a38d5504ac git completion: Allow --pretty for more commands
This _should_ be all of them.
2016-05-11 15:03:04 +02:00
Fabian Homborg
76d24aa1bc git completion: Allow more than one arg to using_command
Now we can easily add an option to multiple commmands.

This should also fix some edgecases.
2016-05-11 15:03:04 +02:00
Fabian Homborg
a7605d584b git completion: Show commits for revert and tag --contains 2016-05-11 14:51:54 +02:00
Terje Larsen
4244a6e6fe Add git commit --fixup completions (#3021) 2016-05-11 13:33:22 +02:00
Kurtis Rader
3626c39398 fix the style of several functions
I'm going to modify these functions as part of dealing with issue #3000
and don't want those changes to be masked by running the files through
`make style`.
2016-05-08 16:27:15 -07:00
Daniel Bergmann
c53951b9b3 Add tags to completion list for git show. (#2998)
(cherry picked from commit ac47100a7d)
2016-05-08 14:07:32 +02:00
[Redacted]
4d1e77fcae Added completions for rmmod (#3007)
(cherry picked from commit 59c8800c4d)
2016-05-08 14:07:32 +02:00
Vladimír Čunát
4efd0dfd65 docs: fix location of generated_completions (#3010)
(cherry picked from commit 100eef4e42)
2016-05-08 14:07:32 +02:00
Vladimír Čunát
100eef4e42 docs: fix location of generated_completions (#3010) 2016-05-08 13:51:30 +02:00
[Redacted]
59c8800c4d Added completions for rmmod (#3007) 2016-05-08 10:01:57 +02:00
Daniel Bergmann
ac47100a7d Add tags to completion list for git show. (#2998) 2016-05-07 12:05:44 +02:00
Elis Axelsson
8ec81393a3 Change abbr to allow non-letter keys (#2996)
(cherry picked from commit 1c6f6df2b3)
2016-05-06 16:17:01 +02:00
Elis Axelsson
1c6f6df2b3 Change abbr to allow non-letter keys (#2996) 2016-05-06 16:15:47 +02:00
Fabian Homborg
527e5f52ba Remove useless case completions
It doesn't take options and what it takes (arbitrary strings) we can't
sensibly complete.
2016-05-04 14:51:09 +02:00
Kurtis Rader
d97c22df2d add floating point output to math command
This makes it easy for the user to request floating point output with the
desired number of digits after the decimal point (not to be confused with
significant digits).

Note that this is just a thin wrapper so someone can say `math -s3 10 / 3`
rather than `math "scale=3; 10 /3"`.

Resolves #1643
2016-05-03 19:29:04 -07:00