Commit graph

9333 commits

Author SHA1 Message Date
David Adam
d6e315d25d cmake: define _GNU_SOURCE
Fixes the build on Cygwin. Analogous to AC_USE_SYSTEM_EXTENSIONS under Autoconf.

Closes #5423.
2018-12-20 21:36:01 +08:00
Fabian Homborg
50fbc36b73 sample_prompts/sorin: Correct git_action function name
We renamed this, and apparently missed it.

[ci skip]
2018-12-19 09:35:26 +01:00
Leonard Hecker
082450b1e7 Severely extended the sorin theme (#5411)
* Severely extended the sorin theme

This theme should now mostly match the original.

* Removed superfluous whitespace

* Inlined external links as ASCII art

* Made myself the author of the sorin theme

* Removed superfluous read delemiter

* Renamed __fish_git_action to fish_print_git_action

* Adde a minor comment
2018-12-18 15:01:38 +01:00
Fabian Homborg
14ee19cc1b Use HAVE_WCSTOD_L also in header 2018-12-18 11:03:33 +01:00
Aaron Gyes
57d6124e6e builtin_test: don't exit 1 for eval errors, add tests for big args
Return STATUS_INVALID_ARGS when failing due to evaluation errors,
so we can tell the difference between an error and falseness.

Add a test for the ERANGE error
2018-12-16 14:51:26 -08:00
Aaron Gyes
cf2b40040a STATUS_INVALID_ARGS = 2
The rest of the high-numbered exit codes are not values used by scripts
or builtins, they are internal to fish and come out of
the parser for example.

Prior to adding STATUS_INVALID_ARGS, builtins were usually exiting 2
if they had a special exit status for the situation of bad arguments.

Set it to 2.
2018-12-16 14:51:18 -08:00
Aaron Gyes
b404b9392c builtin_test.cpp: split a long line, add braces 2018-12-16 14:51:10 -08:00
Aaron Gyes
1f871c4d0c builtin_test.cpp: check for ERANGE and special fish_wcstoll errno
We were not parsing an in-range number when we claimed we were,
and were thus failing to error with invalid numbers and returned
a wrong test result. Fixed #5414

Also, provide the detail we can for the other error cases.
2018-12-16 14:51:02 -08:00
Aaron Gyes
1adcd2d591 builtin_test: don't exit 1 for eval errors, add tests for big args
Return STATUS_INVALID_ARGS when failing due to evaluation errors,
so we can tell the difference between an error and falseness.

Add a test for the ERANGE error
2018-12-15 22:05:19 -08:00
Aaron Gyes
b8113f8e97 STATUS_INVALID_ARGS = 2
The rest of the high-numbered exit codes are not values used by scripts
or builtins, they are internal to fish and come out of
the parser for example.

Prior to adding STATUS_INVALID_ARGS, builtins were usually exiting 2
if they had a special exit status for the situation of bad arguments.

Set it to 2.
2018-12-15 21:05:27 -08:00
Fabian Homborg
e07b45f447 Revert "completions/git: Allow aliases with whitespace in the command"
This reverts commit 081e14fd21, which was bogus.
2018-12-15 11:13:38 +01:00
Mahmoud Al-Qudsi
3855c2217f Remove scripted XDG_CONFIG_HOME uses
Cleaned up the code to no longer replicate in fishscript what fish
already does (and caches to boot) in C++ in setting up the paths to the
user configuration directory.

Also introduced a `$__fish_user_data_dir` instead of the sporadic
definitions of `$userdatadir` that may or may not go through
`XDG_DATA_HOME`.
2018-12-14 22:09:29 -06:00
Aaron Gyes
1634c0fa49 builtin_test.cpp: split a long line, add braces 2018-12-14 12:43:18 -08:00
Aaron Gyes
4aa069a8ff builtin_test.cpp: check for ERANGE and special fish_wcstoll errno
We were not parsing an in-range number when we claimed we were,
and were thus failing to error with invalid numbers and returned
a wrong test result. Fixed #5414

Also, provide the detail we can for the other error cases.
2018-12-14 11:42:23 -08:00
Aaron Gyes
c1be3284c1 __fish_config_interactive: inline combinational logic
Boost readability of this long, logic-heavy script with the new
&& and || syntax added to fish 3.
2018-12-14 05:49:08 -08:00
Aaron Gyes
ba9c387590 __fish_config_interactive: tighten up checks for OSC 7 feature
I spent some time figuring out $TERM_PROGRAM_VERSION and Terminal.app's
capabilities over time. [1]

Only use OSC 7 if running on the version of Terminal.app that added it
or newer. In the past this would have been harder because `test` couldn't
do float comparisons.

cleanup:
Don't bother setting a local $TERM_PROGRAM if it's unset: quoting
is enough to keep test happy. For the version numbers, 0"$var" is safe
against unset variables for numerical comparisons.

[1]: https://github.com/fish-shell/fish-shell/wiki/Terminal.app-characteristics
2018-12-14 05:00:55 -08:00
David Adam
f8338d63ed Merge branch 'Integration_3.0.0'
Post-3.0b1 fixes merge.
2018-12-14 13:09:39 +08:00
David Adam
5959114103 Revert "history.fish: colorize with fish_indent -d0"
This reverts commit 7ebef0a396 in order to
make merging the changes that drop fish_indent easier and history more
understandable.
2018-12-14 13:09:00 +08:00
Fabian Homborg
081e14fd21 completions/git: Allow aliases with whitespace in the command
Fixes #5412.
2018-12-13 22:49:12 +01:00
Fabian Homborg
99ba07354a fish_vi_key_bindings: Remove weird argv handling
Instead of maybe adding "-s" and "-M" if "-s" hasn't already been
given, just add "-s" to _every_ bind invocation, and "-M" to those who
need it.

Fixes #5028.
2018-12-13 17:33:48 +01:00
David Adam
79d53a32dc history: drop use of fish_indent
Largely reverts 007d794b6e.

fish_indent is extremely resource-intensive on large inputs and can crash; it also does not handle
invalid characters gracefully.

Work on #5402.
2018-12-13 21:57:24 +08:00
Fabian Homborg
ffab420e43 Add fallback wcstod_l for musl
Just sets locale to "C" (because that's the only one we need), does
wcstod and resets the locale.

No idea why uselocale(loc) failed for me, but it did.

Fixes #5407.
2018-12-12 15:12:12 +01:00
Aaron Gyes
40de04cc6c input.cpp: remove impossible switch case
R_BEGIN_INPUT_FUNCTIONS <= c < R_END_INPUT_FUNCTIONS, so c cannot be
R_EOF.
2018-12-11 10:02:25 -08:00
Fabian Homborg
4cf3e62643 Move bare source test to expect
This previously used /dev/tty to make sure we have `source` connected
to a terminal. Only as it turns out, FreeBSD doesn't have that (https://builds.sr.ht/~faho/job/15308).

So instead, let's just use the expect tests since stdin there is by
definition a terminal.
2018-12-11 18:23:37 +01:00
Fabian Homborg
cf16d39872 Explicitly mark fallthrough
Silences a compiler warning (that is otherwise a good thing!)
2018-12-11 18:23:37 +01:00
Aaron Gyes
7ebef0a396 history.fish: colorize with fish_indent -d0
We don't need to alert the user about stripped sequences here.
2018-12-11 06:47:49 -08:00
Aaron Gyes
d080182686 fish_indent: skip past illegal byte sequences
garbage input, indented garbage output.
We print a warning, and will eventually exit 1
2018-12-11 06:45:07 -08:00
David Adam
355cb88e38 Bump version for 3.0b1 2018-12-11 22:04:20 +08:00
David Adam
e0d7f0bc96 osx/config.h: update to match current configure output on 10.11 2018-12-11 21:59:45 +08:00
David Adam
83fbd881e7 osx/config.h: mirror changes in f2a829aa23
[ci skip]
2018-12-11 21:46:43 +08:00
David Adam
87721049db README: small text improvement
[ci skip]
2018-12-11 21:37:41 +08:00
David Adam
566aa6e78f CHANGELOG: final edits to 3.0b1
Up to 99d56ea2f9
2018-12-11 21:37:12 +08:00
Aaron Gyes
99d56ea2f9 Colorful Ninja error output with Apple's clang
CMake detects the clang that comes with Xcode as AppleClang.
6.0 corresponds to upstream LLVM 3.5svn
2018-12-11 03:53:12 -08:00
Aaron Gyes
0b45b474f3 Update bugreport()
I left this out of the last commit accidentally.
2018-12-11 02:50:03 -08:00
Aaron Gyes
f2a829aa23 Direct people to github to report bugs. 2018-12-11 02:47:34 -08:00
David Adam
f022b4b721 CHANGELOG: further updates toward 3.0b1
Up to eb0539af60.
2018-12-09 21:37:19 +08:00
Fabian Homborg
6d4eb96509 completions/git: Don't use status --ignored=something
Fixes it for git < 2.16.

Fixes #5396.

[ci skip]
2018-12-08 20:51:49 +01:00
Fabian Homborg
88f7d50633 Acquire terminal even if our pgroup is 0
`tcsetpgrp` still works.

[ci skip]

(This isn't tested)
2018-12-08 16:21:52 +01:00
Fabian Homborg
0a0060481f Guard against pgid == 0
This happens in firejail, and it means that we can't use it as an
argument to most pgid-taking functions.

E.g. `wait(0)` means to wait for the _current_ process group,
`tcsetpgrp(0)` doesn't work etc.

So we just stop doing this stuff and hope it works.

Fixes #5295.
2018-12-08 16:21:52 +01:00
Phuurl
46db332be5 Basic umask completion, and minor change to ulimit completion 2018-12-07 17:50:48 +01:00
Fabian Homborg
9cfb1394bf sample_prompts/sorin: Add a safe way to determine merge status
Based on what __fish_git_prompt is doing.

See #5388.

[ci skip]
2018-12-06 16:15:11 +01:00
Leonard Hecker
0b63c1f46d Don't run git merge quietly
This can and will mess up git rebases and force pushes.
2018-12-06 15:53:34 +01:00
David Adam
d40a07436a CHANGELOG: further updates toward 3.0b1 2018-12-06 22:41:22 +08:00
Aaron Gyes
04795eb8ea webconfig: should know about italics, reverse, dim. 2018-12-05 01:05:33 -08:00
Fabian Homborg
03bca5f7dd webconfig: Fall back onto the default colorscheme
The solarized themes now define pager colors, while other schemes
don't.

So if a user picks one of them, and then another, they'd keep the
pager colors.

Instead, since the default theme is now complete, any theme that does
not define its own pager colors will always get the default ones.

[ci skip]
2018-12-05 09:54:31 +01:00
Fabian Homborg
fa5f3fe9a0 webconfig: Update default colorscheme
This was missing a bunch of variables from __fish_config_interactive.

Ideally we wouldn't have to duplicate this info, but I don't have a
great solution either.
2018-12-05 09:54:31 +01:00
ridiculousfish
6f33c0ccb5 Clean up some language and fix bogus escape in complete.fish 2018-12-03 23:14:01 -08:00
ridiculousfish
8521ce4cd2 Clean up complete completions
Closes #5381

Squashed commit of the following:

commit d70e3451ac
Author: TJ Rana <tj.rana@icloud.com>
Date:   Mon Dec 3 14:31:51 2018 -0500

    Update heading

commit ec44e8ed35
Author: TJ Rana <tj.rana@icloud.com>
Date:   Mon Dec 3 14:29:16 2018 -0500

    Update complete.fish

commit a7178ab163
Author: TJ Rana <tj.rana@icloud.com>
Date:   Mon Dec 3 00:46:42 2018 -0500

    Clean up completion descriptions

commit e6134ceeaa
Author: TJ Rana <tj.rana@icloud.com>
Date:   Mon Dec 3 00:26:42 2018 -0500

    Fix grammar

commit 0a805b1016
Author: TJ Rana <tj.rana@icloud.com>
Date:   Mon Dec 3 00:25:34 2018 -0500

    Add option descriptors

commit 608bb02e41
Author: TJ Rana <tj.rana@icloud.com>
Date:   Sun Dec 2 22:47:17 2018 -0500

    Fix spelling

commit 375593fef4
Author: TJ Rana <tj.rana@icloud.com>
Date:   Sun Dec 2 22:46:19 2018 -0500

    Add heading
2018-12-03 23:12:54 -08:00
ridiculousfish
df4a41ff81 Fix a crash with -d5 and block processes 2018-12-02 14:53:26 -08:00
Fabian Homborg
335c41f097 math: Document round
[ci skip]
2018-12-01 23:06:13 +01:00