Commit Graph

10598 Commits

Author SHA1 Message Date
Fabian Homborg
364bc3fd63 test: Fix return type
This just returns a success signifier, not an error code.
2019-05-29 20:50:35 +02:00
Fabian Homborg
a5b633d3a5 env: Correct type
We'd be comparing "int" and "mode_t", and "mode_t" might be unsigned.

Found via GCC warning.
2019-05-29 20:50:35 +02:00
Fabian Homborg
e895cef245 tinyexpr: Correct pi type 2019-05-29 20:50:35 +02:00
David Adam
78d015bd61 string: add tests for empty capture groups
As seen in #5201.
2019-05-29 23:14:19 +08:00
Fabian Homborg
97507a24a2 Increase default read limit to 100MiB
Someone has hit the 10MiB limit (and of course it's the number of
javascript packages), and we don't handle it fantastically currently.

And even though you can't pass a variable of that size in one go, it's
plausible that someone might do it in multiple passes.

See #5267.
2019-05-29 11:01:45 +02:00
Fabian Homborg
d0921489ee fish_git_prompt: Fix changing show_informative_status
If you changed $__fish_git_prompt_show_informative_status, it
triggered a variable handler, which erased the chars, but neglected to
unset $___fish_git_prompt_init, so we just kept chugging along with
empty characters.

What's the hardest thing in CS again? Cache something something?

[ci skip]
2019-05-29 10:36:14 +02:00
Fabian Homborg
66e238fad0 More wide IO for FLOG
This widens the remaining ones that don't take a char
anywhere.

The rest either use a char _variable_ or __FUNCTION__, which from my
reading is narrow and needs to be widened manually. I've been unable
to test it, though.

See #5900.
2019-05-29 08:07:04 +02:00
Fabian Homborg
32949eefbe src/exec: Use wide IO for FLOG
Another step towards #5900.
2019-05-28 23:08:35 +02:00
Fabian Homborg
6d66c47f70 completions/fish: Add FLOG additions
[ci skip]
2019-05-28 22:43:37 +02:00
Fabian Homborg
7c1a40fe86 flog: Use wide literals with wide chars
This solves the main part of (careful linebreak)
issue #5900.

I'm betting all the errors that do use narrow IO are broken, including
a bunch of asserts.
2019-05-28 22:39:47 +02:00
Fabian Homborg
7086ba43c8 CHANGELOG: Arbitrarily reorder notable fixes
This is roughly in order of importance.

Buffering is really quite nice, $pipestatus is a new thing, $PATH was
a big hubhub, people seem to like eval...

[ci skip]
2019-05-28 22:28:45 +02:00
Fabian Homborg
1e9ec8739b CHANGELOG: Clarify message about parser errors, fix commit
3e055f does not exist. I'm assuming it's
b2a1da602f.

Unfortunately, I'm not entirely sure what kind of parser errors
weren't propagated, so this note isn't all that useful.

[ci skip]
2019-05-28 22:24:47 +02:00
David Adam
7fe93c7518 src/expand: update comment for fallthrough to GCC standard
As suggested in 75db3b4ff4 (r33153119)
2019-05-28 23:20:20 +08:00
David Adam
b5cf9e52ca wcsfilecmp: be clearer about sorting "-" after letters 2019-05-28 22:05:23 +08:00
David Adam
c848787107 add extra test for wcsfilecmp
Test changes added for #5634 in 6e525cc5d9.
2019-05-28 22:03:03 +08:00
David Adam
ba4f4bfce2 Convert further debug(0) calls to FLOG
Follow on from ea9d1ad82f.
2019-05-28 21:06:42 +08:00
ridiculousfish
29c627d020 Stop calling principal_parser() inside parse_execution.cpp 2019-05-27 19:56:35 -07:00
ridiculousfish
835c6ffa67 clang-format all files 2019-05-27 19:47:13 -07:00
ridiculousfish
b9ef8797f1 Merge branch 'flog'
This merges support for FLOG, a replacement for debug().

Fixes #5879
2019-05-27 18:20:22 -07:00
ridiculousfish
0150d505de Allow underscores to be treated as dashes in debug categories 2019-05-27 17:38:09 -07:00
ridiculousfish
ea9d1ad82f Convert debug(0) calls to FLOG 2019-05-27 17:31:17 -07:00
ridiculousfish
6282ac5713 Convert locale variable changes from debug to flog 2019-05-27 17:24:52 -07:00
ridiculousfish
46a9da83e8 Convert terminal ownership logging from debug to flog 2019-05-27 17:24:52 -07:00
ridiculousfish
d9676bb2a8 Convert fork events from debug to flog 2019-05-27 17:24:52 -07:00
ridiculousfish
8774860468 Convert job logging from debug to FLOG 2019-05-27 17:24:52 -07:00
ridiculousfish
63a16befd4 Introduce the fish log, a replacement for debug()
This adds a new mechanism for logging, intended to replace debug().

The entry points are FLOG and FLOGF. FLOG can be used to log a sequence of
arguments, FLOGF is for printf-style formatted strings.

Each call to FLOG and FLOGF requires a category. If logging for a category
is not enabled, there is no effect (and arguments are not evaluated).

Categories may be enabled on the command line via the -d option.
2019-05-27 17:24:52 -07:00
ridiculousfish
b405b979ec Eliminate the CHECK() macro
This thing was pretty useless.
2019-05-27 17:24:19 -07:00
Fabian Homborg
8c76bb49a4 Turns out order in the tests matters
This is a bit embarassing, sorry!
2019-05-27 23:22:28 +02:00
Fabian Homborg
4710df37d1 tests: Add two new directories
These are now matched because we now use fuzzy matching.
2019-05-27 23:20:28 +02:00
Fabian Homborg
d46dacdfee Stop abusing __fish_complete_suffix to complete dirs
[ci skip]
2019-05-27 19:37:28 +02:00
Fabian Homborg
dcf017ff57 fish_complete_directories: Use complete -C
This way we use our core file completion code, which is much more
flexible than we can easily achieve directly in script (which would
require e.g. an `expand` builtin, and case-insensitive globs).

Fixes #5896.
2019-05-27 19:33:52 +02:00
Fabian Homborg
9ae3b345c8 Handle empty strings in compare_completions_by_tilde
Fixes #5895.
2019-05-27 08:17:05 +02:00
ridiculousfish
d5f2d472d0 Thread a parser into reader
Eliminates uses of principal_parser
2019-05-26 18:51:47 -07:00
ridiculousfish
7ed1022cf4 Latch signal handlers
Now that our interactive signal handlers are a strict superset of
non-interactive ones, there is no reason to "reset" signals or take action
when becoming non-interactive. Clean up how signal handlers get installed.
2019-05-26 18:04:03 -07:00
ridiculousfish
ead7f28026 Unify the SIGQUIT handlers and remove set_non_interactive_handlers
Interactive signal handlers are now a strict superset of non-interactive
ones. Remove set_non_interactive_handlers()
2019-05-26 13:18:06 -07:00
ridiculousfish
d729d57d94 Unify the interactive and non-interactive signal handlers
The signal handlers for interactive and non-interactive SIGINT were distinct
and talked to the reader. This wasn't really justified and will complicate
having multiple threads. Unify these into a single signal handler.
2019-05-26 00:32:11 -07:00
ridiculousfish
5a4df9dd3a Use sigint_checker_t in debug_thread_error 2019-05-25 19:19:03 -07:00
ridiculousfish
ea3ad0c099 Introduce sigint_checker_t and use it in wait
Allow a simpler way to check for sigint via sigint_checker_t.
Adopt it in builtin_wait, instead of hooking into the reader.
2019-05-25 19:08:04 -07:00
ridiculousfish
f8ba0ac5bf Remove is_interactive_read
is_interactive_read is a suspicious flag which prevents a call to
parser_t::skip_all_blocks from a ^C signal handler. However we end
up skipping the blocks later when we exit the read loop.

This flag seems unnecessary. Bravely remove it.
2019-05-25 18:46:03 -07:00
ridiculousfish
2924751488 Correct priority of universal and global variable setting
When setting a variable without a specified scope, we should give priority
to an existing local or global above an existing universal variable with
the same name.

In 16fd780484 there was a regression that
made universal variables have priority.

Fixes #5883
2019-05-25 17:35:19 -07:00
Fabian Homborg
cf9b2ff1e5 docs/tutorial: Fix prompt display
This displays a colored prompt, which we emulate by adding explicit
roles that are translated to css classes.

For other things, like "eror" this might not be enough because those
often need the rest of the line to still be styled, and I've not found
a way to add some explicit styling to a code block.

See #5696.

[ci skip]
2019-05-25 11:47:44 +02:00
Fabian Homborg
e339e0f389 fish_indent: Fix pygments 2019-05-25 11:38:05 +02:00
Fabian Homborg
6c0ae7477e reader: Only abort history search on cancel
Otherwise we'd undo the history search when you press e.g. execute,
which means you'd execute the search term.

Only `cancel` should walk it back, like it previously did hardcoded to
escape.

Fixes #5891.
2019-05-25 08:32:50 +02:00
ridiculousfish
a5a5ccb73d Revert "exec: If a job includes a builtin, it stays in our pgroup"
This reverts commit 711260593c.

This ended up breaking the tests; moreover it may have other problems
like preventing backgrounding.

Reopens #5855
2019-05-24 18:00:31 -07:00
ridiculousfish
c79c92eb47 Fix fish_indent tests 2019-05-24 17:00:56 -07:00
ridiculousfish
43e3d3bcf2 Fix the argparse tests 2019-05-24 16:51:40 -07:00
ridiculousfish
a379e9ffeb Make the expect tests run again
These were inadvertently disabled by a bug which was introduced in
cd7e8f4103 . Fix the bug so the tests run
again.

They don't all pass yet; they regressed during the period they were
disabled.
2019-05-24 16:10:44 -07:00
Fabian Homborg
fae15535db docs/tutorial: Don't accidentally make a multiline prompt
Fixes #5890.

[ci skip]
2019-05-24 20:58:43 +02:00
Fabian Homborg
1fd627ebd3 reader: Don't handle escape specially
Escape is just another ordinary character that you can bind, or not.
2019-05-24 19:02:53 +02:00
Fabian Homborg
dd4e0a3b6d Actually end history search
Fixes #5818.
2019-05-24 19:01:24 +02:00