Commit graph

6260 commits

Author SHA1 Message Date
Aaron Gyes
22558f9e7b fix null pointer deref clang's static analyzer believes in
Check cur_term before exit_attribute_mode.
2016-10-07 15:43:59 -07:00
Aaron Gyes
b71aa8f9e8 wrealpath: fix compiler warning
unsigned long -> int conversion
2016-10-07 15:42:05 -07:00
Aaron Gyes
8b9102d9fe Update osx/config.h
Regenerated with current autoconf tests on macOS Sierra.
2016-10-07 15:26:34 -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
7fd3079bb6 remove one of the wrealpath() definitions
It is believed there are no longer any platforms we support that do not
support passing NULL as the second argument to realpath(). So rather
than duplicating the logic to get reasonable behavior from our
wrealpath() wrapper simply remove the redundant implementation.
2016-10-04 20:20:11 -07: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
Kurtis Rader
d389b22afc make style-all C++ style cleanup
It's time once again to run `make style-all` to fix some style bogosities
that have crept in.
2016-10-04 20:06:14 -07:00
Kurtis Rader
17f5727e7e do not restyle all fish scripts
For now don't restyle all the fish scripts. That's because there
are still problems with the `fish_indent` output that require manual
intervention. Not to mention that very few of the fish scripts even
conform to `fish_indent` output at this time.
2016-10-04 19:48:40 -07:00
Branislav Šott
61388cff02 Add completions for ninja build system 2016-10-04 12:32:28 +02:00
Aaron Gyes
d2739f10e1 Fix typo. 2016-10-03 15:28:36 -07:00
Aaron Gyes
a863f74fc4 Fix term_supports_color_natively() off-by-one
When max_colors is 16, we support up to color 15.
2016-10-03 15:25:44 -07:00
Aaron Gyes
41bf002049 Use bools in set_color()
This usage of ints is pretty common in pre-C++ fish code, which did
not use (c99) bool often.
2016-10-03 14:39:39 -07:00
Aaron Gyes
632a209685 Don't show all the help input files on build
It's too much!
2016-10-03 14:35:14 -07:00
Aaron Gyes
ce6e9b52ce screen.cpp: fix omitted newline char color on VCs
It's the ninth color - on virtual consoles this was likely to
try a color that doesn't work because we checked if max_colors >= 8.

Add another way to reach that color on terminals with only 8 colors
by using bold mode to get a bright.

This has potential to fail by simply rendering as black which can cause
it to be invisible on a white-on-black terminal. Not bad as it's just
making this bell/whistle invisible:

We *really* want to set the omitted newline character apart by having
it appear grey. On (FreeBSD consoles, at least) VCs it's not uncommon
for it to render as a "?". It's particularly confusing if it doesn't
render in a darker color as it cannot be discerned from actual program
output.
2016-10-03 12:51:21 -07:00
Aaron Gyes
0c23b5652a color 8 wasn't white, it's brblack
Fixes wrong comment.

Pick a better grey shade.
2016-10-03 08:48:09 -07:00
Aaron Gyes
40a83e4018 screen.cpp: try grey for the newline character.
what we really were using before was color 8 (white).
2016-10-03 05:57:49 -07:00
David Adam
53f1ebaf6b don't check for CPP in the configure script
The preprocessor never gets called directly.
2016-10-02 18:52:21 +08:00
David Adam
386f2bdcf4 debian packaging: unbreak build 2016-10-02 18:35:23 +08: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
David Adam
ce1c9f3a65 debian packaging: update copyright 2016-10-02 17:13:30 +08:00
David Adam
45ae726d4f Debian packaging: break into architecture-{,in}dependent packages
Closes #3053
2016-10-02 17:13:23 +08:00
ridiculousfish
cd84587c3a Fix a "loop will execute at most once" warning 2016-10-01 18:03:44 -07:00
ridiculousfish
c0c2e1d4fa Don't modify valid directory segments in fuzzy completions
When performing fuzzy completion, if a directory segment is
valid, then don't consider it for a fuzzy match even if
the literal match produces no results.

Fixes #3211
2016-10-01 17:58:15 -07:00
ridiculousfish
d17f2585fa Revert "Tighten up empty string checks."
The use of wcstoimax causes certain out-of-range values
to be silently truncated (e.g. when converted to a pid),
and is incompatible with FreeBSD (see #626)

This reverts commit 6faa2f9866.
2016-10-01 17:21:40 -07:00
ridiculousfish
b05c09429d Revert "Add a template to parse integers easily/correctly (#3405)"
The template has different behavior around interpreting
non-decimal sequences. This doesn't seem to have been intended.

This reverts commit f843eb3d31.
2016-10-01 17:15:31 -07:00
ridiculousfish
7ec205d59c Remove some over-commenting for builtin_count_args
These comments were throwing warnings in Xcode
2016-10-01 16:55:33 -07:00
ridiculousfish
b485d95808 Update Xcode project version to 0800 2016-10-01 16:53:53 -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
Kurtis Rader
92dd6de73c deal with broken unicode implementations
Both GNU and BSD have bugs regarding the classification of
non-characters and private use area characters. Provide wrappers around
iswalnum(), iswalpha(), and isgraph() to provide a consistent
experience. We don't bother to autoconf the use of these wrappers for
several reasons. Including the fact that a binary built for one distro
release should behave correctly on another release (e.g., FreeBSD 10
does the right thing while FreeBSD 11 and 12 do not with respect to
iswalnum() of code points in the range 0xFDD0..0xFDFF).

Also move a few functions from common.* to wutil.* because they are wide
char specific and really belong in the latter module.

Fixes #3050
2016-09-27 21:34:02 -07: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
Aaron Gyes
f843eb3d31 Add a template to parse integers easily/correctly (#3405)
* Adds a template to parse integers easily.

It's not enough to use intmax_t and check for empty strings: there are
limits. Adds a template to make it easy to parse an integer of any type.

Adds a compiler flag to flag existing dangers.

* nix warning, include <limits>, fix namespace error.

on MacOS `xcodebuild -quiet` will flag these intmax_t -> * conversions,
just use that if you want to find them.
2016-09-25 21:50:55 -07: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
c2a8de4873 Make fish find config directories in source tree
If one does a make fish; ./fish - don't use the make-installed paths.

Also, remove huge chunk of nearly duplicated code #ifdef'd __APPLE__
for relocatable dirs in fish.app: the directories under Resources
in the bundle followed by the changes I made around here a few months
ago now are not different enough that they require a special case.
This works fine for fish.app.
2016-09-23 11:52:51 -07:00
Aaron Gyes
503edf2d49 Report exec_path and the final config paths via debug()
I was surprised fish_indent was running from /usr/local/bin
instead of the git checkout when I ran ./fish
after building fish there. This was more easily noticable after my last
commit. I added some debug lines which probably fish could have been
doing already when looking into that.

This is a pretty major thing during fish initialization, commit it for
everyone.
2016-09-23 08:55:26 -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
98470ab608 Something got caught in my sed net: $(b) -> $(bo)
Oops. Fixes #3394
2016-09-20 12:04:46 -07:00
Kurtis Rader
93bea5b321 make unit tests more hermetic regarding env vars
Specifically, the `TERM` and `ITERM_PROFILE` env vars. If we don't set
them to known values the unit tests can fail in unexpected ways.

Fixes #3395
2016-09-19 22:13:55 -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
Aaron Gyes
8b1625be2b Fix "libraryn" typo 2016-09-19 17:18:43 -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
02ba7933e0 Fix syntax errors breaking make doc 2016-09-18 04:24:43 -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