ridiculousfish
aaaca9773a
Unconditionally call set_child_group() after posix_spawn
...
Previously we did this conditionally only if GLIBC is defined, but
it looks harmless to do this unconditionally. Let's do it.
2020-01-30 11:07:28 -08:00
ridiculousfish
10da6df506
Factor out logic about how pgroups are assigned
...
Introduce pgroup_provenance_t, a type which captures "where the pgroup
comes from." This centralizes some logic around how pgroups are
assigned, and it anticipates concurrent execution.
2020-01-30 10:50:16 -08:00
ridiculousfish
d22c6af7a3
clang-format all C++ files
2020-01-30 10:50:11 -08:00
Fabian Homborg
cc7d9cc2ed
flog: Save & restore errno
...
In some cases on some platforms this could clobber errno, so doing something like
aThingThatFailsWithErrno();
FLOG(category, "Some message");
wperror("something");
would print the wrong error (presumably if that category was enabled).
In our case it was our (very) old friend RHEL6 returning ESPIPE instead of EISDIR.
Fixes #6545 .
2020-01-30 17:31:30 +01:00
Johannes Altmanninger
f4d0bafbd4
remove stale typedef
2020-01-30 16:32:47 +01:00
David Adam
696057ab57
Merge branch 'Integration_3.1.0'
2020-01-30 17:31:43 +08:00
David Adam
b313ba555a
iothread: add missing #include
...
Closes #6553 .
2020-01-30 17:21:15 +08:00
ridiculousfish
40ff4215a8
Express the "nested job control" idea directly
...
Prior to this fix, we would infer that nested jobs need job control.
Just pass that along explicitly in the job lineage.
2020-01-29 16:10:28 -08:00
ridiculousfish
28a8d0dbf7
Continued adoption of autoclose_fd_t and exec_close
2020-01-29 14:16:16 -08:00
ridiculousfish
3d47f042ac
Be more consistent about using autoclose_fd_t and exec_close
...
Simplifying and improving file descriptor handling discipline.
2020-01-29 13:55:20 -08:00
ridiculousfish
29af84d733
Migrate get_interpreter into postfork.cpp
...
It's only used after fork.
2020-01-29 13:43:40 -08:00
ridiculousfish
376529a46d
Clean up reader_read
...
Stop having reader_read close the input file descriptor. Make other
modernizations.
2020-01-28 11:39:26 -08:00
ridiculousfish
fc4557c784
Eliminate wopen()
...
It was large and mostly unnecessary. Prefer wopen() followed by
fdopen().
2020-01-28 10:43:37 -08:00
ridiculousfish
af2265b4b0
Migrate create_directory inside path.cpp
...
It is not used outside of path.cpp
2020-01-28 10:30:51 -08:00
ridiculousfish
1bbfb7044b
Remove wopen
...
It was unused
2020-01-28 10:26:31 -08:00
ridiculousfish
f27958ef4d
Clean up the open_cloexec interface
...
Remove the ability to make it non-cloexec - nobody was using it.
2020-01-28 10:25:49 -08:00
David Adam
dd1e526017
tests: remove an outdated comment
...
Code removed in af22d6b732
2020-01-28 16:54:29 +08:00
ridiculousfish
af22d6b732
Stop pretending to be interactive during the cancellation tests
...
Prior to this fix, the cancellation C++ test would mark the parser as
interactive in an effort to install interactive signal handling (so that,
for example, SIGINT would stop the job and return control to the user).
However this flag would also cause fish to attempt to save and restore tty modes
across the job. This would fail since there is no tty, and so the job would fail
with an unexpected error code.
We don't need to mark the parser as interactive, we can just remove that line.
Fixes #6539 .
2020-01-27 12:13:46 -08:00
ridiculousfish
7d486c121a
Revert "Add noexcept to completion_t definitions as well as declarations"
...
This reverts commit 89f5ae3e6a
.
Apparently that broke gcc.
2020-01-26 20:59:58 -08:00
ridiculousfish
7a2a6d76f3
Migrate a test from C++ to littlecheck
...
This eliminates noisy warnings about tcsetpgrp when the tests are run
without a tty, as reported in #6539
2020-01-26 20:59:08 -08:00
ridiculousfish
ae77f1b163
Make locked_consumed_job_ids heap allocated rather than static
...
This prevents its destructor from running during normal exit.
Fixes #6539
2020-01-26 20:33:50 -08:00
ridiculousfish
89f5ae3e6a
Add noexcept to completion_t definitions as well as declarations
...
This is required if we want to compile with exceptions enabled (which we
currently do not).
2020-01-26 20:33:47 -08:00
Fabian Homborg
3bb15defbb
Replace debug() with flog
...
PR #6511
Flog has the advantage of having *categories*, not severities, so it'll be easier to get output for a certain subsystem now.
2020-01-26 14:13:17 +01:00
ridiculousfish
d29bc720cd
Remove some nonsense in exec_close
...
exec_close should assert that the fd is valid, then loop while EINTR.
Nothing else is needed.
2020-01-25 19:08:30 -08:00
ridiculousfish
86897cafd6
Clean up, debug, optimize some command description generation
...
Use some more move semantics to reduce allocations.
Correctly handle the case where the completion is empty. For example, if
you type:
ls<tab>
we get an empty completion (since ls is already a valid command), but we
still want to show its description.
Remove some unsafe statics - these are unsafe today in weird cases where
completions might invoke complete recursively, and also will soon be
unsafe with concurrent execution.
2020-01-25 18:26:31 -08:00
ridiculousfish
38f4330683
Rationalize $status and errors
...
Prior to this fix, fish was rather inconsistent in when $status gets set
in response to an error. For example, a failed expansion like "$foo["
would not modify $status.
This makes the following inter-related changes:
1. String expansion now directly returns the value to set for $status on
error. The value is always used.
2. parser_t::eval() now directly returns the proc_status_t, which cleans
up a lot of call sites.
3. We expose a new function exec_subshell_for_expand() which ignores
$status but returns errors specifically related to subshell expansion.
4. We reify the notion of "expansion breaking" errors. These include
command-not-found, expand syntax errors, and others.
The upshot is we are more consistent about always setting $status on
errors.
2020-01-25 17:28:41 -08:00
ridiculousfish
81e78c78aa
Rename eval_result_t to end_execution_reason_t
...
We're getting ready to stop returning eval_result_t from parser_t::eval
2020-01-25 14:11:32 -08:00
ridiculousfish
e640a01ea5
Express cancellation as a possible result of expand_string
...
This allows us to properly thread control-C signals from command
substitutions into the expanding string.
2020-01-25 14:11:32 -08:00
ridiculousfish
4f205f38b4
Clean up a few bits about discarding buffers
...
We weren't properly propagating the 'discarded' stuff from output
streams to buffers. Fix that.
2020-01-24 16:08:56 -08:00
ridiculousfish
dbbe8a2da5
Clarify expand_result_t comments
2020-01-22 11:51:40 -08:00
ridiculousfish
2af710f7c0
Eliminate expand_result_t::wildcard_match
...
This was an internal implementation detail that all callers had to deal
with. Just get rid of it.
2020-01-22 11:49:59 -08:00
ridiculousfish
e398f66772
Run clang-format
2020-01-21 14:43:17 -08:00
Fabian Homborg
26fa774f44
Add path flog category
2020-01-19 14:55:39 +01:00
Fabian Homborg
f632a9e998
Add env-dispatch flog category
2020-01-19 14:55:39 +01:00
Fabian Homborg
4cb3ce0314
Add a 5 debug to the iothread flog
2020-01-19 14:55:39 +01:00
Fabian Homborg
483018222d
Add complete flog category
2020-01-19 14:55:39 +01:00
Fabian Homborg
246882b52d
Add proc-pgroup flog category
...
I'm not *super*-happy with this, because pgroups and terminal
ownership and such are quite entertwined.
But hey, if all fails just use `proc'*'`
2020-01-19 14:55:24 +01:00
Fabian Homborg
0c49f45028
fish_key_reader: Remove debug messages
...
These are related to *signal handlers* in fish_key_reader, and I don't
think this code needed to be touched since it was added.
2020-01-19 14:55:24 +01:00
Fabian Homborg
fe931aeea7
Add more messages to termowner flog category
2020-01-19 14:55:24 +01:00
Fabian Homborg
8b1ac0912b
Add reader flog category
...
For both input and reader, because the "reader" term is more general
and we don't have enough messages to justify multiple categories
2020-01-19 14:55:08 +01:00
Fabian Homborg
a48926dee5
Add and use "should_flog" macro
...
Useful to figure out if a flog category is enabled.
We only use it in one place, but it seems like the sort of thing that
should exist.
2020-01-19 14:55:08 +01:00
Fabian Homborg
349b9e9dee
Remove commented out debugs
2020-01-19 14:54:53 +01:00
Fabian Homborg
b09ae82ecf
Remove a few less useful debug messages
...
These were level 5, so I'd bet nobody ever saw them
2020-01-19 14:22:50 +01:00
Fabian Homborg
5da4f7e7c5
Add flog category for config reading
2020-01-19 14:22:50 +01:00
Fabian Homborg
123676075f
Add flog category for history *file*
2020-01-19 14:22:50 +01:00
Fabian Homborg
6793d35340
Add flog categories for parse-productions
...
One for usable messages, another for the chatty ones.
Use like `--debug=parse-productions'*'`.
2020-01-19 14:22:50 +01:00
Fabian Homborg
14c2c623b4
Add flog category for uvar file
...
This used debug level 5, which means it was basically unusable.
2020-01-19 14:22:50 +01:00
Fabian Homborg
4e0ec080e3
Add flog category for terminal support
...
This is meant to show messages related to what a terminal supports.
In particular which color or emoji it can handle.
2020-01-19 14:22:50 +01:00
Fabian Homborg
024e03ab1e
Replace debug(1) with FLOGF(warning)
2020-01-19 14:22:39 +01:00
Fabian Homborg
384f18a51c
Remove last remaining debug(0)
...
Replace with FLOGF.
2020-01-19 13:31:25 +01:00