Commit Graph

5961 Commits

Author SHA1 Message Date
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
Fabian Homborg
7e56d6385e History docs: Move descriptions to the corresponding options
This should clarify `--delete`s behavior without `--prefix` or
`--contains` a bit.

Fixes #3054.
2016-06-20 18:24:56 -07:00
Fahri Cihan Demirci
db0176b884 Add Purge Subcommand Completion for Apt (#3097) 2016-06-20 18:23:12 -07:00
Fabian Homborg
f63f6e54fa Make string match -rnv work
Fixes #3098.
2016-06-20 18:21:45 -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
Kurtis Rader
d8dd718695 remove unset vars from the environment
Remove vars from the environment that are no longer set. Simplify the code by
removing an unnecessary loop. Add some tests.

Fixes #3124
2016-06-20 17:00:36 -07:00
Kurtis Rader
4424909801 simplify, and fix, setting the current locale
Fix test setup bogosities. Specifically, they weren't hermetic with respect to
locale env vars.

Rewrite the handling of locale vars to simplify the code and make it more like
the pattern most programs employ.

Fixes #3110
2016-06-20 16:54:34 -07:00
Kurtis Rader
a243580cfa tty driver ignore lnext (\cV) and werase (\cW)
Configure the tty driver to ignore the lnext (\cV) and werase (\cW) characters
so they can be bound to fish functions.

Correct the `fish_key_bindings` program to initialize the tty in the same
manner as the `fish` program.

Fixes #3064
2016-06-20 14:28:14 -07:00
Aaron Gyes
693d6879d3 Travis: restore clang with trusty & included clang
Upgraded to using Tavis trusty dist (from precise)

Ubuntu's clang is only 3.4 though.

For fancy address, thread-sanitizer stuff, easier to do on OS X.
We can use the clang that comes with xcode 8 beta.
2016-06-20 03:27:32 -07:00
Aaron Gyes
ad7e9a8d56 Travis: clang 3.5.0 on Linux
https://docs.travis-ci.com/user/trusty-ci-environment

all trusty images have sudo, and actually it is required
to use this new Travis environment per docs. This makes
it actually do it. Clang is 3.5 now.
2016-06-20 03:24:23 -07:00
Fabian Homborg
d0fdc82fdf Tests: Add fish_mode_prompt to except_prompt
Without this, the interactive tests fail when they receive a mode_prompt
in vi-mode.
2016-06-20 11:30:10 +02:00
Kurtis Rader
82c56bc64b deal with broken ttys on MS Windows
The tty device timestamps on MS Windows aren't usable because they're always
the current time. So fish can't use them to decide if the entire prompt needs
to be repainted.

Fixes #2859
2016-06-19 22:05:01 -07:00
Kurtis Rader
098f6d01c4 enhance the key_reader program
The original `key_reader` program was useful but didn't do much that `xxd`
or `od -tx1z` didn't do. Furthermore, it wasn't built and installed by
default. This change adds features that make it superior to those programs
for decoding interactive key presses and makes it a first-class citizen
like the `fish_indent` program that is always available.

Fixes #2991
2016-06-19 19:43:45 -07:00
Aaron Gyes
4b0f1cf85b Merge branch 'master' of https://github.com/fish-shell/fish-shell 2016-06-18 22:21:15 -07:00
Aaron Gyes
7ac32e45cb Remove SHLVL check.
Fixes #3154.
2016-06-18 22:20:18 -07:00
Kurtis Rader
8e21d5de92 deal with broken ttys on MS Windows
The tty device timestamps on MS Windows aren't usable because they're always
the current time. So fish can't use them to decide if the entire prompt needs
to be repainted.

Fixes #2859
2016-06-18 19:33:54 -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
7ab65595cb 'jobs.status' change missing from last commit. 2016-06-18 08:33:42 -07:00
Aaron Gyes
2cabcf4ad4 bg had also had wrong exit code for some errors
Stop printing usage information when error isn't a usage problem.
Add simple test for bg and fg
2016-06-18 08:26:07 -07:00
Aaron Gyes
20d36f16d3 fg: fix exit code (was 1 if success else 0)
returning a C boolean for builtin_fg success was backwards
2016-06-18 07:41:27 -07:00
Kurtis Rader
dc58edd521 implement custom cppcheck rules
I recently noticed there were several invocations of `wcwidth()` that should
have been `fish_wcwidth()`. This adds custom cppcheck rules to detect that
mistake.
2016-06-17 20:16:21 -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
Kurtis Rader
0ca103686f remove unset vars from the environment
Remove vars from the environment that are no longer set. Simplify the code by
removing an unnecessary loop. Add some tests.

Fixes #3124
2016-06-15 22:10:11 -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
Kurtis Rader
3cecc1f475 trivial locale cleanups
Clarify the purpose of the `N_()` macro. Remove inconsistent capitalization of
two strings in the parser module.
2016-06-14 19:57:07 -07:00
Aaron Gyes
9f0c31611c Lint Cleanup
This remove some stores that clang assures me are very dead.

And an assert() for an unlikely NULL pointer dereference I can't quite
figure out.
2016-06-14 19:27:00 -07:00
Kurtis Rader
d70be18c42 use fish_wcwidth rather than wcwidth
Minor cleanup related to issue #2199.
2016-06-14 17:17:31 -07:00
Aaron Gyes
1be3fe6633 Travis: clang 3.5.0 on Linux
https://docs.travis-ci.com/user/trusty-ci-environment

all trusty images have sudo, and actually it is required
to use this new Travis environment per docs. This makes
it actually do it. Clang is 3.5 now.
2016-06-14 15:05:50 -07:00
Aaron Gyes
7b17d20099 Travis: restore clang with trusty & included clang
Upgraded to using Tavis trusty dist (from precise)

Ubuntu's clang is only 3.4 though.

For fancy address, thread-sanitizer stuff, easier to do on OS X.
We can use the clang that comes with xcode 8 beta.
2016-06-14 14:42:57 -07: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
David Adam
cd6a9ee522 remove obsolete install targets in Makefile
check-uninstall detects incompatible old installations of fish pre-2006;
it seems unlikely that there are still from-source installations that
will be incompatible in only this way.

install-sh works around a limitation in darcs, the previous VCS, and is
no longer required.

install-force should be refactored at some point.
2016-06-14 09:22:33 +08:00
David Adam
a5e0555e83 make style targets in Makefile phony 2016-06-14 09:22:28 +08:00
Aaron Gyes
1499ade89c Restyle touched .cpp files 2016-06-12 11:34:35 -07:00
Aaron Gyes
0310d3bd8c Improve fish_indent -w error output
Show small usage blurb, add newline to end.
2016-06-12 11:25:38 -07:00
Aaron Gyes
02375982df Hand-build 256, 24-bit color esc strings same way
... using snprintf() for the 256-color function in same manner as the
24-bit function.
2016-06-12 11:22:31 -07:00
Aaron Gyes
5435f60f31 Improve comments, update Doxyfile
Some changes were cribbed from #1317
2016-06-12 11:19:44 -07:00
Aaron Gyes
b72ed1fa8c Fix env_universal_common.cpp filesize comparisons.
* if (result == ULLONG_MAX) is always false, likely a typo as
  result is unsigned long, and the comment says ULONG_MAX.

* use off_t instead of size_t for file size where it can mismatch
  st_size's type in stat.h
2016-06-12 03:52:58 -07:00
ridiculousfish
3a7719015d Don't allow specifying an fd with a caret redirection
For example, an argument 12345^ is a real argument, not a redirection
There's no reason to use ^ here instead of >, and it's annoying to git
users.

Fixes #1873
2016-06-12 02:16:46 -07:00
Aaron Gyes
0ee03cbf98 Error on -w without a path before reading stdin
Oops, `fish_indent -w` just sits there waiting for input if nothing
is pointing at it, only to give user the error afterwards.
2016-06-12 01:07:33 -07:00
Aaron Gyes
67339caa33 Update CONTRIBUTING.md
Mention Coverity
2016-06-11 21:11:55 -07:00
ridiculousfish
d77c20b09a Don't cppcheck the pcre sources 2016-06-11 15:35:52 -07:00
ridiculousfish
d910aa15fe Avoid using chmod --reference in style.fish
chmod --reference is not available on OS X
Instead, we copy the source file into the temporary path, so that
mode bits are preserved
2016-06-11 15:28:40 -07:00
Fabian Homborg
5d20750aaa Merge pull request #3123 from moverest/completion
Extend autocompletion support
2016-06-10 18:47:55 +02:00
Aaron Gyes
c4e322d3ad Fix crash when fish_indent is using stdin with -w
When given no path, the logic was happy to try to use
an unitialized output_location.

  $ fish_indent -w < test.fish
  Opening "(null)" failed: Bad address

Initialize the string, and repair the logic to catch this case
and report the problem correctly.
2016-06-10 08:02:12 -07:00