Commit Graph

1900 Commits

Author SHA1 Message Date
Fabian Weisshaar
180c211dd2 add mdimport completion 2016-11-06 05:43:45 -08:00
Fabian Weisshaar
848495d4cf add mddiagnose completion 2016-11-06 05:43:45 -08:00
Fabian Weisshaar
87c51f2c10 add tmutil completion 2016-11-06 05:43:45 -08:00
Fabian Weisshaar
b41fced062 add mdfind completion 2016-11-06 05:43:45 -08:00
Fabian Weisshaar
71e835feec add mdls completion 2016-11-06 05:43:45 -08:00
Fabian Weisshaar
313cb0d248 add mdutil completion 2016-11-06 05:43:45 -08:00
Fabian Weisshaar
0c4ede5627 add nvram completion 2016-11-06 05:43:45 -08:00
Aaron Gyes
87bfd1a01e Revert "Add a fish_key_reader wrapper"
This reverts commit c02f5ceb0f.
2016-11-04 19:08:48 -07:00
Aaron Gyes
95385eda80 Create a fish_key_reader wrapper ala fish_indent
Needed for fish_key_reader to work in a .app bundle without
fish previously installed.

I just copied fish_indent.fish and s/indent/key_reader
2016-11-04 19:07:37 -07:00
Aaron Gyes
c02f5ceb0f Add a fish_key_reader wrapper
This will be necessary for fkk to work when one is using the .app
bundle and has not installed fish otherwise.

I just copied fish_indent.fish.
2016-11-04 19:05:10 -07:00
Manzur Mukhitdinov
00a8766635 auto-complete for sysbench (0.4.12)
SysBench is a modular, cross-platform and multi-threaded benchmark tool for
evaluating OS parameters that are important for a system running a database
under intensive load
2016-11-04 22:22:12 +01:00
Fabian Weisshaar
097d2246c2 add dig completion 2016-11-04 22:19:55 +01:00
Patrick Häcker
72e687296b Create autocompletion for dpkg-reconfigure
The dpkg-reconfigure command is used on Debian and Ubuntu based systems to reconfigure packages.

According to the relevant manpage's the commited completion file should be complete.
2016-11-03 13:14:28 +01:00
Fabian Homborg
b9b66791c1 fish_vi_cursor: Ignore errors from tput
Fixes #3519.
2016-11-03 08:34:55 +01:00
Kurtis Rader
c10952c354 lint: fish_indent all sample prompts 2016-11-01 19:19:45 -07:00
Aaron Gyes
19e12e3747 Revert mistaken file inclusion.
I was testing command descriptions and mistakenly left in a bogus file.
2016-10-31 23:46:40 -07:00
Aaron Gyes
edcf15e3d7 Sorin prompt: updates
Use $USER, prompt_hostname, string
Update to use correct color names such as magenta over purple.
Use bright color variants instead of bold in some cases.
2016-10-31 23:41:04 -07:00
Aaron Gyes
9f05697dcc sorin right prompt: reset color at end
bold mode being left enabled was causing issues in the pager.
2016-10-31 23:40:29 -07:00
Fabian Homborg
2a5ad198bf Rework cursor detection
Fixes #3499.
2016-10-31 21:51:06 +08:00
Aaron Gyes
960cc628b2 Don't choke defining aliases with quotes
Fixes #3510
2016-10-31 01:37:23 -07:00
Aaron Gyes
c4bd110fca List alias-created functions on alias sans args
The previous change I made here makes this not hard to do, but
kind of lame in implementation.
2016-10-28 22:31:58 -07:00
Aaron Gyes
2d46969d3e alias: identify as alias in description.
Like so:

~ $ alias foo=bar
~ $ functions foo
function foo --description 'alias foo=bar'
	bar  $argv;
end
2016-10-28 14:44:55 -07:00
Fabian Homborg
7ea2dc4488 Disable vi-cursor on xterm < 282
Fixes #3499.

@zanchey: This is for integration-2.4.0.
2016-10-27 10:16:57 +02:00
Fabian Homborg
56679d4776 Don't use open function if a command exists
Turns out this is also the case on Haiku.

It also eliminates a fork.

Closes #3487.
2016-10-26 15:48:42 +02:00
Kurtis Rader
37d91d0c29 change name of the function 2016-10-23 15:02:14 -07:00
Kurtis Rader
8dfee7ff76 add new file to change 2016-10-23 14:56:18 -07:00
Kurtis Rader
07de13f61f implement a fish_prompt_hostname function
Standardize how the host name is included in the prompts that do so.

Fixes #3480
2016-10-23 14:20:54 -07:00
Aaron Gyes
668de88e69 Supress fish_title only for Terminal.app
VTE terminals apparently do not use the OSC sequence to compose
title components.
2016-10-23 12:02:01 -07:00
Aaron Gyes
cbe2d4b5f1 defaults completions: shorten and improve brevity
At 80 columns the description obscured 'find' in 'default find'.

Improve others.
2016-10-22 12:37:00 -07:00
Fabian Weisshaar
7878dbc4f0 add defaults (macOS) completion 2016-10-22 20:13:18 +02:00
Fabian Weisshaar
e16f6ca2aa add listFilesystems to diskutil completion 2016-10-22 20:13:18 +02:00
Aaron Gyes
c7e26e494e Fix Terminal.app title
Defining fish_title here is too late because there will already be a
title set. Work around issue by clearing it at same time.
2016-10-22 10:47:46 -07:00
Kurtis Rader
345950ac1b workaround broken groff man page config
Fixes #2673
2016-10-19 13:43:04 -07:00
Aaron Gyes
b560daac21 suspend.fish: print help on -h, --help 2016-10-17 15:31:27 -07:00
Hunsu
d474368ea5 Add HTTPS and HSTS options to wget completions (#3470) 2016-10-17 08:31:35 -07:00
Kurtis Rader
a26f68d63f handle multiline commands in history search output
Fixes #31
2016-10-16 21:33:12 -07:00
Kurtis Rader
f490b56378 make history searching case insensitive by default
Fixes #3236
2016-10-16 20:18:16 -07:00
Olivier Perret
36352c0370 Add completions for connmanctl (#3419)
* Add completions for connmanctl

* Move connmanctl functions to completion file

* Add description for services completion in connmanctl

* Fix connmanctl services completion regex

* Also fix connmanctl vpnconnections regex
2016-10-16 11:02:12 +02:00
Kurtis Rader
3663726689 fix interactive deletion of "all" items
While working on making the history command support case-sensitive and
insensitive searches I noticed that entering "all" when interactively
deleting history entries resulted in an error. That's because the
history builtin currently only supports `--exact` so we need to loop
over the matching entries and delete them one at a time.

Fixes #3448
2016-10-11 19:05:23 -07:00
Kurtis Rader
f33ece11ac simplify invoking create_manpage_completions.py
My previous change to avoid creating a *.pyc file when running
create_manpage_completions.py was wrong because I put the
`sys.dont_write_bytecode = True` on the wrong line. Rather than simply
move that statement make the simpler, cleaner, fix that removes the need
for `eval` where that program is invoked.
2016-10-09 18:42:55 -07:00
Kurtis Rader
92e14d7e4a deal with Linux shebang handling
The Linux kernel only splits on the first whitespace in the shebang line
(unlike BSD which splits on all whitespace). Which means there can be
only one argument after the path to the program.
2016-10-09 15:09:44 -07:00
Kurtis Rader
c07c98ac05 eliminate many "unused parameter" warnings
Partially addresses issue #3430.
2016-10-09 14:38:26 -07:00
Kurtis Rader
213ef3ee56 don't produce *.pyc files
Producing man pages is done infrequently (basically just at `make test`
and `make install`) so there isn't any point in writing compiled
byte-code versions of the python modules.
2016-10-09 14:11:04 -07:00
Aaron Gyes
4e1226a313 Fix git prompt noise
Issue reported on Gitter:
> If I go into an empty git repository (i.e. git init) and hit enter a few times, I get:
> fatal: bad revision 'HEAD
2016-10-07 05:59:54 -07:00
Fabian Homborg
91a311c156 Also set vi-cursor in tmux in vte-terminals
Fixes #3429.
2016-10-07 11:47:19 +02:00
Kurtis Rader
f7f39b8c90 make fish's realpath compatible with GNU realpath
After implementing `builtin fish_realpath` it was noticed that it did
not behave like GNU `realpath` without options. Which is super annoying
since that was the whole point of implementing the command. Major
failure on my part since I wrote the unit tests to match the behavior of
the existing `wrealpath()` function that I simply exposed as a builtin
command. Rather than actually verifying it behaved in a manner
compatible with GNU realpath.

Also, while the decision to call the builtin `fish_realpath` seemed to
make sense at the time of the original commit further reflection has
shown that to be a silly, idiosyncratic, thing to have done. So rename
it to simply `realpath`.

Fixes 3400
2016-10-04 20:19:44 -07:00
Branislav Šott
61388cff02 Add completions for ninja build system 2016-10-04 12:32:28 +02:00
Aaron Gyes
c5b17b5310 Quote test check to cause usage ouput 2016-10-02 02:52:34 -07:00
Aaron Gyes
36fe172932 Fix obvious realpath.fish bug.
We want to run the builtin on the argument we just sanitized, not all of them given!
2016-10-02 02:47:12 -07:00
Aaron Gyes
94aeb47f63 improve realpath.fish comments 2016-10-02 02:44:33 -07:00
ridiculousfish
eeea3f3b3c Revert "Add completions for cd -"
This reverts commit 9d69f44550.
2016-10-01 16:48:12 -07:00
Sajjad Hashemian
ca929e088e Add brew services completions 2016-09-28 15:58:38 +02:00
Aaron Gyes
01fa31f313 Fix spelling in realpath.fish 2016-09-27 16:28:24 -07:00
Fabian Homborg
662ba60d63 Guard some contains calls in config.fish
Fixes #3409.
2016-09-26 16:49:06 +02:00
Kurtis Rader
e9b5505169 add a flag to limit history search results
This adds a flag to the `history search` command to limit the number of
matching entries to the first "n". The default is unlimited. This is
mostly useful in conjunction with aliases (i.e., functions) that are
intended to report the "n" most recent matching history entries without
piping the result through the user's pager.

Fixes #3244
2016-09-23 19:43:58 -07:00
Aaron Gyes
4c34ba9959 Make fish_indent less spooky
Don't wrap fish_indent at all if the version in $PATH matches
$FISH_VERSION.

When we do wrap it, resolve the path once, and use that via alias
machinery instead of doing an eval each time.

In both cases, `type fish_indent` can tell us what it's actually going
to do now.

clarity aside, it's faster if we only eval the one time.
eval is not only evil, but slow.

> for h in $history[1..100]; echo $h | fish_indent --no-indent; end

before: CMD_DURATION = 1005
if fish_indent is kosher in PATH: 549
if not, using alias: 687
2016-09-23 07:59:45 -07:00
Kurtis Rader
204e79105a allow customizing history --show-time format
It would make fish more friendly if we allowed the user to specify the
format of the history entry timestamps.

Fixes #3361
2016-09-20 20:14:02 -07:00
Aaron Gyes
2c8bc05826 Skip OSC 7 inside emacs, let VTE/Terminal do title
these modern terminals both compose a nicer title if we don't try to provide a custom one (no path in title twice, "fish" in title twice) - and the user can configure which components they'd like in their terminal inside the terminal preferences.

Also make test "$VTE_VERSION" -ge .. work once I commit `test` strtoi
fix - the trick is to add a zero before it so the numeric comparison
works even if it's empty.

Fixes #107
2016-09-19 18:44:44 -07:00
Andrew Schulman
d71b97c2cf update and correct cygport completions (#3392) 2016-09-19 23:25:55 +02:00
Kurtis Rader
76c73aa8ce alter history sub-command handling
This deprecates the use of long options for history sub-commands (e.g.,
`history --delete`) in favor of proper sub-commands (e.g., `history
delete`). It also eliminates the short options for those sub-commands.

Also change option processing to allow options anywhere on the command
line to match how the vast majority of fish builtins handle flags.

Replace --with-time with --show-time.

Fixes #3367
2016-09-18 20:09:06 -07:00
Aaron Gyes
be0bd999ad Commit __fish_config_interactive where I have it
Nuke the cool surprise deletion feature
2016-09-18 04:18:33 -07:00
David Adam
92e3a3c8ef Merge branch 'master' of https://github.com/fish-shell/fish-shell 2016-09-18 18:12:34 +08:00
Aaron Gyes
96ebfaaf87 Use 'grealpath' if installed for realpath fallback (#3374)
* Use 'grealpath' if installed for realpath fallback

See discussion in #3370

* fish_realpath: filter out dangerous options

Per feedback do not use aliases to declare wrapped functions.
2016-09-18 02:08:19 -07:00
Clément Martinez
fc3cd77c2f Add pygmentize completions 2016-09-16 19:23:22 +02:00
Clément Martinez
22c20f36cb Add ranger completions 2016-09-16 19:23:22 +02:00
Clément Martinez
46ab1a155c Add mdbook completions 2016-09-16 19:23:22 +02:00
Clément Martinez
29b9e6705a Add figlet completions 2016-09-16 19:23:13 +02:00
Clément Martinez
ed7bf83b56 Fix xz file completion
The previous completion gave every files.
Here, we only show files with the .xz, .txz, .lzma or .tlz extension.
2016-09-16 19:22:59 +02:00
Andrew Schulman
0a6dc2addb use PATH to find getent in __fish_complete_groups (#3383) 2016-09-16 18:26:27 +02:00
Andrew Schulman
05b52eaa0b use __fish_complete_groups to complete group names for chown (#3380)
chown completion chown currently uses cat /etc/group to fetch the list of group names. In Cygwin there's no /etc/group file any more (user and group names are fetched directly from the OS), so when a user tries to tab-complete the group name they get an error message:

ASchulma@LZ77E1AASCHULMA ~/d/fish> chown ASchulma🐱 /etc/group: No such file or directory

This change fixes that by using getent group (via __fish_complete_groups) by preference to get the group names, and falling back to /etc/group. This is more portable.
2016-09-16 16:35:55 +02:00
EMayej Bee
85cd372a4e Fix index out of bounds
When current dir is the first one in history. There is no previous dirs.
2016-09-13 20:59:18 -07:00
Kurtis Rader
f9115b5ef1 fix use of subcommand in __fish_config_interactive.fish 2016-09-12 18:47:59 -07:00
Fabian Homborg
9d69f44550 Add completions for cd -
Fixes #3353.
2016-09-12 23:13:32 +02:00
Fabian Homborg
c57b30cba1 Check /etc/os-release for Suse's CNF-handler
This has the same name and path as ubuntu's, but takes less arguments.

So we need to actually find if the distro thinks it is suse, and then
use it.

Fixes #3366.
2016-09-12 22:59:35 +02:00
Fabian Homborg
bb754c2085 ls.fish: Replace eval with string 2016-09-12 20:20:40 +02:00
Aaron Gyes
90e535f66f Update pager colors, tweak pager.cpp
Adds a color reset thing, to ensure fish tries to use hard colors during
testing.

Also, work on a discrepancy (not introduced by my changes, afaik) when
with some combinations of color settings, and usage of --bold, caused super
flakey color paninting in the pager. Downwards movements that trigger
scrolling vs. upwards movement in the pager would only apply bold to
selections when moving upwards. The bold state of the command completions in
the pager was flipping flops on and off, depending on if there is a description
on the preceding line.

Implement a lame fix by reseting the color to normal and applying a
different style on the rightmost ')' which seems to be what was influencing it.

Makes fish use terminfo for coloring the newline glich char.
2016-09-11 03:04:53 -07:00
Aaron Gyes
af95813514 Merge branch 'master' of https://github.com/fish-shell/fish-shell into colorfix 2016-09-10 15:09:12 -07:00
Aaron Gyes
82b298dcc5 __fish_config_interactive: remove Linux exception
And update colors.
2016-09-10 15:07:58 -07:00
Kurtis Rader
87a532f533 make it hard to use history command incorrectly
Fixes #3307
2016-09-09 19:23:06 -07:00
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