Commit Graph

1808 Commits

Author SHA1 Message Date
Kurtis Rader
043725cdd5 fix the style of fish_default_key_bindings.fish 2016-11-13 13:39:55 -08:00
Kurtis Rader
209a2576cd fix using external realpath command
Fixes #3489
2016-11-13 13:34:19 -08:00
Aaron Gyes
bd03c3fbc5 vared.fish don't use undocumented 'reset' color
... there is no practical difference in behavior using this here
and it is not documented.
2016-11-11 14:08:28 -08:00
Kurtis Rader
20bcbcc252 fix webconfig.py lint issues 2016-11-10 16:23:08 -08:00
Kurtis Rader
47a9f99523 more robust fish_config IPv6 detection
Fixes #3530
2016-11-10 15:43:59 -08:00
Kurtis Rader
9e922a6e02 make status saner vis-a-vis arg parsing
The `status` command currently silently allows incompatible flags (i.e.,
subcommands). Too, using flags to specify subcommands misleads the user
into thinking they can specify multiple subcommands.

We recently modified the `history` command to deprecate using flags for
subcommands. This change does the same for the `status` command.

Fixes #3509
2016-11-07 12:11:08 -08:00
Colin Marquardt
a275618589 Typofix: shoe -> show 2016-11-07 09:46:07 -08:00
Fabian Weisshaar
7a1146ebb5 add caffeinate completion, see #3525 2016-11-06 05:43:45 -08:00
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