ridiculousfish
c0c7b0f86f
Make tsan detection gcc compatible
2019-05-04 16:13:55 -07:00
ridiculousfish
ec45f31ad1
Make debug_level an atomic
...
Fixes a tsan warning
2019-05-04 15:28:44 -07:00
ridiculousfish
0dd9f64bd9
Make topic monitor compatible with tsan
...
tsan does funny things to signals, preventing signals from being delivered
in a blocking read. Switch the topic monitor to non-blocking reads under
tsan.
2019-05-04 13:06:06 -07:00
Fabian Homborg
e91eb85949
argparse: Fix --
regression
...
I was a tad overzealous there with not appending the remaining
arguments.
Weird that we didn't test it, though.
Fixes #5857 .
2019-05-03 16:20:40 +02:00
ridiculousfish
649d3ac101
Simplify reporting of invalid config paths
...
Do this at a well defined point, instead of randomly the first time they're
queried.
2019-05-01 17:51:51 -07:00
ridiculousfish
72e43a514b
Correct the warning for invalid directories
...
This was inadvertently broken.
2019-05-01 17:47:50 -07:00
ridiculousfish
55e3270ac4
Remove erase_list from process_clean_after_marking
...
We don't need to maintain an erase_list in this function any more.
Simply remove jobs that are completed.
2019-05-01 16:32:14 -07:00
ridiculousfish
3dfaa192da
Put back process and job exit events
...
These were removed in f8b2e818ed
under a
belief that they were unused. But they are documented and supported.
2019-05-01 16:32:14 -07:00
ridiculousfish
43d668bdc8
Continue to refactor internal loop of process_clean_after_marking
...
Factor our logic around when to print a message.
2019-05-01 16:32:14 -07:00
ridiculousfish
b5d3fadf44
Factor out the individual process handling in process_clean_after_marking
...
Helps break up this monolith.
2019-05-01 16:32:14 -07:00
ridiculousfish
b8170ec1ce
Clarify return value of job_reap and process_clean_after_marking
2019-05-01 16:32:14 -07:00
ridiculousfish
9700800ecf
Factor disowned job removal into its own function
...
This helps break up process_clean_after_marking.
2019-05-01 16:31:21 -07:00
ridiculousfish
c05e72749a
Rename PENDING_REMOVAL to DISOWN_REQUESTED
...
A commend implied that PENDING_REMOVAL was broader than it was. In practice
only disown() sets this flag. Rename the flag for clarity.
2019-05-01 15:37:53 -07:00
David Adam
665ae3787a
Switch to runtime check for /proc/self/stat
...
Removes a compile-time check that may have affected cross-compilation.
Work on #1067 .
2019-04-30 16:23:28 +08:00
Fabian Homborg
43929ced90
src/builtin_argparse: Work around wgetopt crash
...
If on the last argument, and it was an unrecognized option, we can't
call `wgetopt_long()` again, or it'll crash.
2019-04-29 16:55:55 +02:00
Fabian Homborg
8c9359fdd4
src/builtin_argparse: Add --ignore-unknown flag
...
This keeps all unknown options in $argv, so
```fish
argparse -i a/alpha -- -a banana -o val -w
```
results in $_flag_a set to banana, and $argv set to `-o val -w`.
This allows users to use multiple argparse passes, or to simply avoid
specifying all options e.g. in completions - `systemctl` has 46 of
them, most not having any effect on the completions.
Fixes #5367 .
2019-04-29 15:57:56 +02:00
ridiculousfish
d8ac051f89
Move selection_direction_t to pager.h and make it a class enum
2019-04-28 14:06:03 -07:00
ridiculousfish
2507162f80
Revert "Add a test for autoload_t"
...
This reverts commit 51c62d6cc6
.
Back out the test while I attempt to fix it
2019-04-27 20:14:06 -07:00
ridiculousfish
51c62d6cc6
Add a test for autoload_t
2019-04-27 16:16:48 -07:00
ridiculousfish
4ff50eba41
Remove autoload_t, rename autoloader_t to autoload_t
...
Now that there are no more clients of autoload_t, delete it and
rename autoloader_t to autoload_t. Also clean up the headers.
2019-04-27 15:47:08 -07:00
ridiculousfish
68a28106b2
Reimplement completion autoloading via autoloader_t
...
This switches the completion autoloading machinery to autoloader_t.
2019-04-27 15:37:24 -07:00
ridiculousfish
960266fe24
Reimplement the function store and autoloading
...
This cleans up how functions are stored and autoloaded. It eliminates the
recursive lock. Instead there is a single normal owning_lock that protects
the entirety of the function data. Autoloading is re-implemented via the
new autoloader_t.
2019-04-27 15:30:11 -07:00
ridiculousfish
3950dab9ff
Add autoloader_t
...
autoloader_t will be the reimplementation of autoloading. Crucically it no
longer manages any locking or loading itself; instead all locking and loading
is performed by clients. This makes it easier to test and helps limit its
responsibilities.
2019-04-27 15:26:18 -07:00
ridiculousfish
b7ad6b5bdc
Add autoload_file_cache_t
...
This will provide the "backing store" for autoloading.
2019-04-27 15:09:24 -07:00
ridiculousfish
6ec7c50ace
Stop removing functions and completions in autoload
...
autoloading has a "feature" where functions are removed in an LRU-fashion.
But there's hardly any benefit in removing autoloaded functions. Just stop
doing it.
2019-04-27 14:49:05 -07:00
ridiculousfish
7b44b5ef15
Titlecase LRU template parameters
2019-04-27 12:07:16 -07:00
ridiculousfish
f297543ca1
Make owning_lock's template parameter titlecase instead of uppercase
2019-04-27 12:04:36 -07:00
Fabian Homborg
af0e08e9f1
argparse: Use the current function name by default
...
This makes the `--name` option usually unnecessary.
See #5835 .
2019-04-27 15:55:49 +02:00
ridiculousfish
9bc5d60eaf
Clean up enum_set.h header
...
Include a missing array header, and switch to idiomatic include guards.
2019-04-26 16:08:19 -07:00
Fabian Homborg
009ecfd7e6
src/tokenizer: Add ":@" to the list of non-path-component chars
...
This makes kill-path-component stop there.
Fixes #5841 .
2019-04-26 19:16:21 +02:00
David Gowers
38cadc9d4f
Variables as commands are in fact supported, eval docs should not claim otherwise. ( #5819 )
...
Provide an example that somewhat justifies eval's existence in light of this change.
Also correct similar misinformation found in a comment.
2019-04-26 15:30:13 +02:00
Fabian Homborg
22ce8c23c6
builtin_complete: Allow complete -C something
...
This is a long-standing issue with how `complete --do-complete` does
its argument parsing: It takes an optional argument, so it has to be
attached to the token like `complete --do-complete=foo` or (worse)
`complete -Cfoo`.
But since `complete` doesn't take any bare arguments otherwise (it
would error with "too many arguments" if you did `complete -C foo`) we
can just take one free argument as the argument to `--do-complete`.
It's more of a command than an option anyway, since it entirely
changes what the `complete` call _does_.
2019-04-26 15:02:29 +02:00
ridiculousfish
cd86c0ee88
Remove the COMPLETE_SEP define
...
It was unused.
2019-04-25 14:23:37 -07:00
ridiculousfish
96bc8a14ca
Promote completion_mode_t to a real type
...
Eliminate big #defines like NO_COMMON.
2019-04-25 14:21:06 -07:00
ridiculousfish
d962668aa0
Remove PATH and COMMAND defines
...
Also clean up a bit of builtin_complete
2019-04-25 13:26:43 -07:00
ridiculousfish
496529b20a
Remove EXPAND prefix from expand_flags and lowercase them
2019-04-25 11:34:49 -07:00
ridiculousfish
d8ab6290e8
Switch expand_flags_t to enum_set
2019-04-25 11:23:03 -07:00
ridiculousfish
dcaac58f45
Rename expand_error_t to expand_result_t and make it class enum
...
Also lowercase it all.
2019-04-25 10:47:28 -07:00
ridiculousfish
b54c44f2f6
Migrate expansion stages to a new type expander_t
...
This avoids having to pass around so many parameters during expansion.
2019-04-25 10:47:28 -07:00
Aaron Gyes
f309ae05b6
is_visual_escape_seq: whittle down the escape sequences attempted
...
Some of these we do not need to worry about actually being used
in a prompt.
2019-04-20 17:03:27 -07:00
ridiculousfish
fe75a3a650
Migrate autoload file checks to file_id_t
2019-04-19 18:47:07 -07:00
ridiculousfish
6dd2766a15
Remove file_access_attempt_t::stale
...
It was unused.
2019-04-19 18:26:29 -07:00
Per Bothner
2edfab685a
Some comment fixes and renaming of is_iterm2_escape_seq. ( #5827 )
...
* Some comment fixes and renaming of is_iterm2_escape_seq.
The comment for is_iterm2_escape_seq incorrectly says "CSI followed by ]".
This is wrong, because CSI is ESC followed by [ (or the seldom-used 0x9b).
The procedure actually matches Operating System Command (OSC) escape codes.
Since there is nothing iterm2-specific about OSC, is_osc_escape_seq
would be a better name.
Also s_desired_append_char documents a non-existent parameter.
* Update broken iterm2 url in comment.
2019-04-19 09:29:35 -07:00
Mahmoud Al-Qudsi
8ca2641857
Revert overzealous !parent_job is_visible()
condition
...
This was added in 04a96f6
but not strictly required to fix #5803
(verified), with the intention of hiding invisible background jobs
(created by invoking a function within a pipeline) from the user, but
that also broke intentionally created jobs from displaying as well.
I'm thinking it can't be done without keeping track of caller context vs
job context.
Closes #5824 .
2019-04-17 22:47:41 -05:00
ridiculousfish
a173c079d5
expand_abbreviation to always accept an environment_t
...
Now that snapshotting is fixed, we don't need to get the principal
environment stack any more.
2019-04-16 22:45:58 -07:00
ridiculousfish
2e119813e1
get_abbreviations to accept an environment_t
...
Now that we don't have dorky snapshotting, thread an dnvironment_t through
get_abbreviations. Removes a usage of env_stack_t::principal().
2019-04-16 22:27:01 -07:00
Aaron Gyes
7e514d2aa5
expand_abbreviation(): escape when looking up abbreviation vars
...
This was doing exactly the opposite: unescaping and not hitting
the encoded _fish_abbr_X variables when looking up.
Fixes #5573
2019-04-16 21:33:09 -07:00
ridiculousfish
6b52b0994c
Attempt to fix the travis build
2019-04-14 17:43:02 -07:00
ridiculousfish
2fac0f0b39
Correctly lock around umask
...
umask can only be set, never just queried. Thus we need to lock around
calls to it.
Also guess the value; if we guess right we don't need to reset it.
2019-04-14 16:08:29 -07:00
ridiculousfish
020d4a2848
Adopt env_scoped_t::snapshot() and remove env_var_snapshot_t
...
Remove the env_var_snapshot_t class and switch everything to the new snapshot
function of env_scoped_t.
Fixes #5658 . Fixes #5571 .
2019-04-14 15:50:38 -07:00