Commit Graph

1690 Commits

Author SHA1 Message Date
ridiculousfish
7af3adc344 Revert "Don't require ./etc to exist in relocatable fish"
This reverts commit e2a3dae58b.

This idea failed because ./share was not complete when bliding via cmake;
it misses critical files such as config.fish.
2018-07-21 20:57:21 -07:00
ridiculousfish
8b83fe1ff7 Simplify yet more memory management in argparse 2018-07-21 19:13:10 -07:00
ridiculousfish
c269ef2c5d Copy strings less in argparse 2018-07-21 18:53:03 -07:00
ridiculousfish
3c4c47f516 Clean up some memory usage in argparse
Clarify some ownership models
2018-07-21 18:52:54 -07:00
ridiculousfish
a374b8ede7 Simplify splitting on commas in argparse 2018-07-21 17:25:16 -07:00
ridiculousfish
e2a3dae58b Don't require ./etc to exist in relocatable fish
fish tries to be relocatable by looking for directories relative to its
executable. These directories are not found when running fish from
within a cmake build because the etc directory is not present. Stop requiring
this directory to be present since it's not critical for running fish.

Fixes #4825
2018-07-21 16:47:00 -07:00
ridiculousfish
57cc3d950d Remove some unnecessary test output 2018-07-21 15:31:14 -07:00
ridiculousfish
dae2809531 Fix a few warnings 2018-07-21 14:35:39 -07:00
ridiculousfish
a11e955c84
Merge pull request #5097 from ridiculousfish/history_read
Don't mmap history files on remote file systems

This merges some changes to history that may help to mitigate the crashes seen in #5088 . These SIGBUS crashes occur when reading a memory mapping whose underlying file was truncated. It's not clear why this should occur more often on NFS (or ever). However memory mapping over NFS is sketchy anyways so this is desirable regardless.
2018-07-21 13:51:49 -07:00
ridiculousfish
c636a455a0 Add locking to try_complete_user
This uses the thread-unsafe getpwent(). Add a lock around the whole section
to avoid the crash identified in #5088
2018-07-15 15:50:56 -07:00
ridiculousfish
4d1eeef3db Stop trying to mmap the history file on remote fs
When the history file is on a remote filesystem, memory mapping is suspicious.
Never mmap in this case.
2018-07-15 15:26:36 -07:00
ridiculousfish
679437d6a9 Implement fd_check_is_remote
This adds a new function fd_check_is_remote() which is designed to determine
if a file lies on a remote (SMB, NFS, etc.) filesystem.
2018-07-15 15:26:36 -07:00
ridiculousfish
a39734cbed Encapsulate history mmap logic
Migrate the mmap() logic into a new class history_file_contents_t which
will serve to encapsulate conditional logic if we choose to use read()
instead of mmap().
2018-07-15 15:26:27 -07:00
ridiculousfish
63e0a3d7c2 Misc cleanup in history_t
Add some C++11
2018-07-15 14:33:38 -07:00
ridiculousfish
2ce0240fc8 Add a time_profiler for reading old history items 2018-07-15 14:33:38 -07:00
ridiculousfish
28455235b1 Migrate to widechar_wcwidth
Adopt the new widechar_wcwidth() function from
https://github.com/ridiculousfish/widecharwidth

Fixes #5081
2018-07-09 20:31:16 -07:00
ridiculousfish
73c747d162 Add string join0
string join0 joins its arguments using NUL byte, which complements
string split0. For example it allows piping a variable through sort -z.
2018-07-01 15:56:34 -07:00
ridiculousfish
d34a300818 Add string split0
This adds a new string command split0, which splits on zero bytes.
split0 has superpowers because its output is not further split on
newlines when used in command substitutions.
2018-07-01 15:56:33 -07:00
ridiculousfish
f998afaa23 Adopt separated_buffer_t in io_buffer_t 2018-07-01 15:56:33 -07:00
ridiculousfish
90a4af5112 Add separated_buffer_t and adopt it in output_stream_t
separated_buffer_t encapsulates the logic around discarding (which
was previously duplicated between output_stream_t and io_buffer_t),
and will also encapsulate the logic around explicitly separated
output.
2018-07-01 15:56:33 -07:00
ridiculousfish
5b9331ade0 Teach io_buffer_t to append from output_stream_t directly
This will simplify logic when we teach output_stream_t about explicitly
split outputs, i.e. for 'string split0'
2018-07-01 15:56:33 -07:00
ridiculousfish
369890cdd9 Clean up io_buffer_t interface 2018-07-01 15:56:33 -07:00
Fabian Homborg
81a987c39c Fix range expansion with negative ends
If just one of the range ends is negative, this now forces direction away from it.

I.e. if the beginning is negative, we go in reverse.
If the end is negative, we go forwards.

This fixes cases like

    $var[2..-1]

if $var only has one element.
2018-06-25 17:52:56 +02:00
ridiculousfish
5692adbdf6 Teach fish_wcwidth about variation selectors
System wcwidth() misreports variation selectors as width 1. Special
case these to width -1 (unprintable).

See #2652
2018-06-23 16:40:25 -07:00
ridiculousfish
44bae29039 Add a debug_escape function
This function for debugging makes it easier to understand what special
characters are present in a string.
2018-06-23 13:15:32 -07:00
Mahmoud Al-Qudsi
cda18be6b4 fixup! Replace \e with \x1B, as the former is a gcc extension 2018-06-18 00:34:31 -05:00
Mahmoud Al-Qudsi
27cd74e16c Fix warning about extra ';' being ignored
It is both present at the end of the #define and explicitly included
after the define is called in the main code, leading to an expansion of
`;;`.
2018-06-18 00:05:31 -05:00
Mahmoud Al-Qudsi
dcced5f1bc Replace \e with \x1B, as the former is a gcc extension
While supported by gcc and clang, \e is a gcc-specific extension and not
formally defined in the C or C++ standards.

See [0] for a list of valid escapes.

[0]: https://stackoverflow.com/a/10220539/17027
2018-06-18 00:01:47 -05:00
Mahmoud Al-Qudsi
d16d463e0d Silence EACCES errors upon setpgid after posix_spawn()
We've tried numerous approaches to mitigate the race condition between
`posix_spawn` and the `setpgid` call, but unfortunately due to the flags
we pass to `posix_spawn`, it (rarely? never?) results in `vfork()` being
used, which means it is never executed atomically. Since it is executed
out-of-band, we must manually call `setpgid` in case `posix_spawn`
hasn't gotten around to doing that yet, but in the event that it has, an
EACCES error can be returned.

Closes #4884. Closes #4715. See also #4778.
2018-06-17 22:32:52 -05:00
Mahmoud Al-Qudsi
8f166cbb2a Prevent fish from crashing if non-essential terminfo strings not found
On systems where the terminfo for TERM does not contain a string for
attributes such as enter_underline_mode, etc. fish was crashing with a
fatal error message and a note to email the developers.

These are non-essential text attribute changes and should not trigger
such a failure.
2018-06-17 20:59:34 -05:00
Mahmoud Al-Qudsi
a6d64c1086 Handle odd return codes for waccess(..) in src/path.cpp under Solaris 2018-06-17 19:58:20 -05:00
ridiculousfish
2443ea92c3 Eliminate a common subexpression 2018-06-16 11:43:52 -07:00
ridiculousfish
e6737d5775 Use a std::move in expand_cmdsubst
Save an unnecessary allocation.
2018-06-16 11:40:59 -07:00
Fabian Homborg
8de5af5f9e Fix off-by-one in complete_cmd_desc
The substring constructor (string(str, pos)) includes pos, so we need
to add one. Also be careful not to go over the length again.
2018-06-03 19:17:02 +02:00
Mahmoud Al-Qudsi
56198818b0 Work around compiler warning regarding C++17 name mangling
[9/13] Building CXX object CMakeFiles/fishlib.dir/src/builtin_string.cpp.o
../src/builtin_string.cpp:1221:12: warning: mangled name of 'string_transform' will change in C++17 due to non-throwing exception specification in function signature [-Wc++17-compat-mangling]
static int string_transform(parser_t &parser, io_streams_t &streams, int argc, wchar_t **argv, decltype(std::towlower) func) {
           ^
1 warning generated.
2018-06-01 22:53:33 -05:00
Fabian Homborg
72e9d41dcc [complete] Fix crash with __fish_describe_command
Our completion machinery calls our `__fish_describe_command` function
to describe commands via apropos. Only it trusts the output a bit too
much, so it crashes when any line from that is shorter than the
original string.

Fix this by skipping any string that is shorter than the original,
since it can't be a match anyway.

Also stop doing wcslen so often - std::strings are nice!

Fixes #5014.
2018-06-01 20:16:23 +02:00
Fabian Homborg
93d40f9143 [input] Only timeout if the last character was escape
There really is no need to

- Timeout just because the _first_ character was a control character

- Timeout because of any control character other than escape

The reason to timeout because the '\e' sequence can appear by itself (signifying
pressing the escape key) and still make
sense - e.g. vi-mode has it bound to a rather important function!

But a \c can't appear by itself, so we can just block.

This allows binding sequences like \cx\ce and inputting them at a
leisurely pace rather than the frantic escape_timeout one.

It should also improve sequences that _include_ escape somewhere else.

E.g. something like a\eb ("a, then alt+b") should now time out for the "\eb" part,
allowing users to bind a\e ("a, then escape") to something else. Why you'd want to do
that, I have no idea. But it's more consistent, and that's nice!
2018-05-29 18:40:29 +02:00
Fabian Homborg
88e6930b57 [string] Be explicit about nextstr() type 2018-05-28 12:10:40 +02:00
Fabian Homborg
49c736f407 [string] Move split/repeat to wcstring 2018-05-28 12:10:40 +02:00
Fabian Homborg
e468c767b5 [String] Partially switch match/replace to string
For regex-mode, this should be enough to read NUL-delimited strings to act on, but not
quite patterns and replacements.

Glob-mode requires more work - it uses wcscmp internally, which is unsuitable.
2018-05-28 12:10:40 +02:00
Fabian Homborg
1e2fa80d3e Switch (un)escape to wcstring
Also the various styles have one function each with barely any
difference - mostly passing the corresponding STYLE argument.

Pack them into one function for escape and one for unescape to save
about 100 lines.
2018-05-28 12:10:40 +02:00
Fabian Homborg
0cfe722a93 Switch lower/upper to wcstring
Also, these are different only in that one uses "towlower", the other
"towupper". So just make one function that both call.
2018-05-28 12:10:40 +02:00
Fabian Homborg
191ca21092 Switch trim to wcstring 2018-05-28 12:10:40 +02:00
Fabian Homborg
4cc0c3bfa7 Switch string sub to wcstring 2018-05-28 12:10:40 +02:00
Fabian Homborg
583d771b10 Fix escape_string_var for UTF-16
We're now actually handling wchar_t here, so comparing the 0x80 bit
would break for UTF-16, causing ASCII false-positives.

Also simplifies a bit, since we no longer need a second variable.
2018-05-28 12:10:40 +02:00
Fabian Homborg
b2b4ab4bab constref more things
Thanks @ridiculousfish!
2018-05-28 12:10:40 +02:00
Fabian Homborg
4dc1c6ca39 [string] Allow url/var escaping to handle NULs
Fixes #4605.
2018-05-28 12:10:40 +02:00
Fabian Homborg
485fdbde41 [string] Allow length to handle NULs
printf 'a\0b' | string length

used to print "1". Now it prints "3".

Note that this switches to using C++'s std::string::length, which
might give differing results.
2018-05-28 12:10:40 +02:00
Fabian Homborg
bcd23ff971 [string] Allow join to handle NULs 2018-05-28 12:10:40 +02:00
Fabian Homborg
aedb8dc327 [string] Allow string escape to handle NULs
TODO: This currently only works for the "script" escaping style.

Work towards #4605.
2018-05-28 12:10:40 +02:00
Fabian Homborg
a229f703ae Allow escape_string_url from escape_string with wcstring
This was an oversight.
2018-05-28 12:10:39 +02:00
Fabian Homborg
338b40bb43 Trust the passed size in escape_string_script
This allows it to handle NULs.
2018-05-28 12:10:39 +02:00
ridiculousfish
ba69f8f71d Remove an unused variable 2018-05-27 15:46:30 -07:00
ridiculousfish
5492a16719 Clean up some env.cpp export code
Adopt some modern practices.
2018-05-27 15:45:30 -07:00
Swayam Raina
eb0539af60 Don't update CMD_DURATION if no command is requested
Fixes issue #4926
2018-05-27 11:37:36 -07:00
Fabian Homborg
9de28f6887 Add some more fallback key bindings
DEL (aka backspace) and the arrows.

This makes fish usable without binding functions, though not pleasant.

See #1256.
2018-05-17 11:14:02 +02:00
Mahmoud Al-Qudsi
0dd2607cac Iron out situation with setpgid() calls after posix_spawn()
Closes #4715. Ticks off a box in #4154.
2018-05-16 19:34:56 -05:00
Mahmoud Al-Qudsi
3cda5ac59b Clean up complete.cpp code
Embrace C++11 ranged for loops.
2018-05-12 11:23:43 -05:00
Fabian Homborg
feb6e9c90b Make DEFAULT_PROMPT and DEFAULT_TITLE work without functions
The prompt is a fallback that is overridden via a function file
anyway.

Do that with the title as well, so we can use just builtins.

This removes error messages when $fish_function_path is borked.
2018-05-12 13:53:45 +02:00
Mahmoud Al-Qudsi
b635863509 Fix warnings when compiling under clang
Introduced by #4849 (add wait for processes by name)

../src/builtin_wait.cpp:23:14: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
    while (j = jobs.next()) {
           ~~^~~~~~~~~~~~~
../src/builtin_wait.cpp:23:14: note: place parentheses around the assignment to silence this warning
    while (j = jobs.next()) {
             ^
           (              )
../src/builtin_wait.cpp:23:14: note: use '==' to turn this assignment into an equality comparison
    while (j = jobs.next()) {
             ^
             ==
1 warning generated.
2018-05-11 11:11:53 -05:00
Fabian Homborg
7c5297e785
Merge branch 'master' into issue_4848 2018-05-11 16:06:27 +02:00
Fabian Homborg
e35d248f64 Fix clearing abandoned line with VTE (#4243)
Turns out the segfaults we've been getting in our tests are because we set $TERM to "dumb".

So we only clear the line if the terminal isn't dumb.

This reverts commit 745a88f2f6.

Fixes #2320.
2018-05-08 13:07:47 +02:00
David Adam
21890ccac7 function: restore '%self' functionality for --on-process-exit
One key use of process expansion, used in currently-shipped code, is for running a function on
current shell exit.

Restore the use of %self as a valid argument (and add `self`) and document this change.

(faho: Remove bare "self")
2018-05-08 11:17:07 +02:00
ridiculousfish
98d736f916 Teach fish_indent about escaped newlines
Correctly indents code like:

   alpha | \
     # comment
     beta
2018-05-07 21:40:53 -07:00
ridiculousfish
6f57fef8f8 Teach the tokenizer to report escaped newlines
Add fields and flags so that escaped newlines can be reported, for the
benefit of fish_indent.
2018-05-07 21:39:30 -07:00
ridiculousfish
678fd86107 Minor cleanup of parse_ll_t::accept_tokens 2018-05-07 14:20:45 -07:00
ridiculousfish
5f787cfe55 Correct format string in dump_tree_recursive
This was passing two unused arguments to the format string. Use one
and drop the other.
2018-05-07 13:44:26 -07:00
ridiculousfish
4194b4efee Add a feature_test() function
This is a convenience over fish_features().test()
2018-05-06 11:20:15 -07:00
ridiculousfish
762c31be87 Feature flag support for ? wildcard
This partially reverts 6e56637cf0 and #4520
by bringing back the ? wildcard, guarded by the qmark-noglob feature flag.
2018-05-06 11:20:15 -07:00
ridiculousfish
dc8d603f98 Add a qmark-noglob feature flag
This adds a feature flag for controlling whether question marks are globs.
It is not yet hooked up.
2018-05-06 11:20:15 -07:00
ridiculousfish
d3201ad887 Set features from the environment
This enables users to opt in (or out) of specific features by setting
the fish_features environment variable.

For example `set -U fish_features stderr-nocaret` to opt into removing the
caret redirection.
2018-05-06 11:20:14 -07:00
ridiculousfish
902af26253 Bring back caret redirections under a feature flag
This partially reverts 5b489ca30f, with
carets acting as redirections unless the stderr-nocaret flag is set.
This flag is off by default but may be enabled on the command line:

fish --features stderr-nocaret
2018-05-06 11:20:14 -07:00
ridiculousfish
8a96f283ba Allow setting feature flags on the command line
This introduces a new command line option --features which can be used for
enabling or disabling features for a particular fish session.

Examples:
  fish --features stderr-nocaret
  fish --features 3.0,no-stderr-nocaret
  fish --features all

Note that the feature set cannot be changed in an existing session.
2018-05-06 11:20:14 -07:00
ridiculousfish
782cae2d21 Add status subcomannds: features and test-feature
This teaches the status command to work with features.
'status features' will show a table listing all known features and whether
they are currently on or off.
`status test-feature` will test an individual feature, setting the exit status to
0 if the feature is on, 1 if off, 2 if unknown.
2018-05-06 11:20:14 -07:00
ridiculousfish
14f766b66d Add support for feature flags
This introduces a new type features_t that exposes feature flags. The intent
is to allow a deprecation/incremental adoption path. This is not a general
purpose configuration mechanism, but instead allows for compatibility during
the transition as features are added/removed.

Each feature has a user-presentable short name and a short description. Their
values are tracked in a struct features_t.

We start with one feature stderr_nocaret, but it's not hooked up yet.
2018-05-06 11:20:14 -07:00
Fabian Homborg
1a1ee352ff [commandline] Change "--selection" to "--current-selection"
Plus documentation.

Work towards #4255.
2018-05-05 21:41:03 +02:00
Fabian Homborg
b0368fd85b Set $IFS in C++
This was done in share/config.fish, but leads to surprising results if
that isn't read - e.g. because someone just built fish in the git
directory to test it without installing.

It's also not something that is any more or less complicated.

For compatibility, keep it in config.fish as well for the time being.
2018-05-03 12:49:21 +02:00
Fabian Homborg
baeeef3233 Remove triggerable assert in unescape_string_internal
Fixes #4954 - in a hacky way.
2018-05-02 16:35:56 +02:00
Kevin Ballard
e03db61dac
Merge pull request #4909 from kballard/history_delete_err_msg
Tweak the error message for `history delete --exact foo`
2018-04-18 22:36:18 -07:00
Mahmoud Al-Qudsi
c8af566330 Stop completion skipping in case of valid ./command
complete.cpp strips the path from commands before parsing for
completions, meaning that when we called `path_get_path()` against
`cmd`, if `./cmd` were typed in at the command line but `cmd` does not
exist in the PATH, then the command would incorrectly be flagged as not
present and the completions would be skipped.

This is also faster when an absolute/relative path is used for a
command, as we now search with the original path which skips searching
PATH directories unnecessarily.

Found when debugging why completions for `./configure` wouldn't work.
2018-04-17 21:34:22 -05:00
Mahmoud Al-Qudsi
3742a7827f Support multiple read --line variable outputs
ref #4861. Also closes #4917.
2018-04-17 21:34:22 -05:00
Mahmoud Al-Qudsi
bd8c8ceb59 Add line-delimited read presets with --line and --all-lines
Refer to changes in doc_src/read.txt for more info. Closes #4861.
2018-04-17 21:34:22 -05:00
Mahmoud Al-Qudsi
d00474f0fc Optimize split_about 2018-04-17 21:34:22 -05:00
Kevin Ballard
afc5c0a6e7 Tweak the error message for history delete --exact foo
The old message made it sound like the `--exact` flag wasn't supported.
2018-04-14 21:59:18 -07:00
Mahmoud Al-Qudsi
a9b582d2a8 Block .dll files from completion as potential heads under WSL 2018-04-14 23:56:30 -05:00
Mahmoud Al-Qudsi
1c8bbfdb6d Support job expansion for jobs builtin
This brings back expansion of `%n` where `n` is a job id, but not as a
general parser syntax. This makes `jobs -p %n` work, which can be used
as part of the job control command chain, i.e.

```
cat &
fg (jobs -p %1)
```

fg/bg/wait can either be wrapped in a function to call `jobs -p` for
`%n` arguments, or they can be updated to take `%n` arguments
themselves.
2018-04-14 16:47:05 -05:00
Fabian Homborg
d53750bee6 Let read -s also output to stdout
This was caused by "to_stdout" being automatically enabled if argc was
0 _before_ removing options.

Fixes #4859.
2018-04-10 21:46:43 +02:00
Fabian Homborg
ea49c14c62 Fix read to stdout output appearing first
echo banana (read)

will output whatever read reads _first_ because it uses a direct
write_loop().

This also removes some duplicate code.
2018-04-10 21:45:28 +02:00
Kevin Ballard
f7ba2a6a00 Don't corrupt memory when setting a slice with wrong # of args
Fixes #4881.
2018-04-10 21:09:31 +08:00
Mahmoud Al-Qudsi
d8a1928c24 Convert list of builtins from sorted array to unordered_set
The order of this list does not need to be strictly maintained any
longer.

Benchmarked with `hyperfine` as follows, where `bench1` is the existing
approach of binary search and `bench2` is the new unordered_set code,
(executed under bash because fish would always return non-zero). The
benchmark code checks each argv to see if it is a builtin keyword (both
return the same result):

```
hyperfine './bench1 $(shuf /usr/share/dict/words)' './bench2 $(shuf /usr/share/dict/words)'
Benchmark #1: ./bench1 $(shuf /usr/share/dict/words)

  Time (mean ± σ):      68.4 ms ±   3.0 ms    [User: 28.8 ms, System: 38.9 ms]

  Range (min … max):    60.4 ms …  75.4 ms

Benchmark #2: ./bench2 $(shuf /usr/share/dict/words)

  Time (mean ± σ):      61.4 ms ±   2.3 ms    [User: 23.1 ms, System: 39.8 ms]

  Range (min … max):    58.1 ms …  67.1 ms

Summary

'./bench2 $(shuf /usr/share/dict/words)' ran
    1.11x faster than './bench1 $(shuf /usr/share/dict/words)'
```
2018-04-03 15:47:21 -05:00
Mahmoud Al-Qudsi
cc50103e53 Unblock builtins from completions
The `head_exists` value was being reset after being set to true for most
builtins, causing completions to not trigger.
2018-04-03 14:05:11 -05:00
ridiculousfish
f922875dbc Fix the Linux build 2018-04-01 17:59:42 -07:00
ridiculousfish
a98cc75f9e Reword warning inside fish_universal_variables file
Prior to this fix, the fish universal variables file claimed that
changes to it would be overwritten. This no longer true and has not
been true for a long time. Remove that warning.
2018-04-01 17:51:53 -07:00
ridiculousfish
ff10e504a1 Remove MAC address from universal variables file
This switches the universal variables file from a machine-specific
name to the fixed '.config/fish/fish_universal_variables'. The old file
name is migrated if necessary.

Fixes #1912
2018-04-01 17:43:12 -07:00
ridiculousfish
222a45f07a Add acquire() to maybe_t
Easy way to pull the value out.
2018-04-01 16:10:59 -07:00
Peter Ammon
5b489ca30f Remove caret redirection
This removes the caret as a shorthand for redirecting stderr.

Note that stderr may be redirected to a file via 2>/some/path...
and may be redirected with a pipe via 2>|.

Fixes #4394
2018-04-01 13:48:21 -07:00
Mahmoud Al-Qudsi
01452da5bf Add and use new exit code for env_remove() when var doesn't exist
The previous commit caused the tests to fail since env_remove() was
returning a blanket `!0` when a variable couldn't be unset because it
didn't exist in the first place. This caused the wrong message to be
emitted since the code clashed with a return code for `env_set()`.

Added `ENV_NOT_FOUND` to signify that the variable requested unset
didn't exist in the first place, but _not_ printing the error message
currently so as not to break existing behavior before checking if this
is something we want.
2018-03-31 22:12:52 -05:00
Mahmoud Al-Qudsi
0e0168ef18 Display error message on set -e PROTECTED
Previously unsetting a variable would fail silently. Now sharing error
printing code from regular `set PROTECTED` call.
2018-03-31 21:44:54 -05:00
ridiculousfish
abcc9647da Fix some unused variable warnings 2018-03-31 17:06:13 -07:00
ridiculousfish
6e56637cf0 Remove support for the ? wildcard
Fixes #4520
2018-03-31 16:54:50 -07:00
ridiculousfish
4b079e16e5 Execute the conditions of if and while statements outside of their block
Variables set in if and while conditions are in the enclosing block, not
the if/while statement block. For example:

    if set -l var (somecommand) ; end
    echo $var

will now work as expected.

Fixes #4820. Fixes #1212.
2018-03-31 14:57:24 -07:00
slama
d88866ccf7 deleted no longer necessary codes due to removing process expansion. 2018-03-31 12:12:27 -07:00
Fabian Homborg
535617623b Make pager background cover the entire candidate
Currently, there are two possibilities for holes in the background:

- When there are two candidates with the same meaning (a long and a
  short option or two candidates with the same description)

- When a candidate does not have a description (meaning the color
  won't continue after it)

This changes both so the background just goes on.

In addition, it avoids making the background multiple times.

Fixes #4866.
2018-03-31 13:04:30 +02:00
Mahmoud Al-Qudsi
999728670d Default string split to keeping empty entries with option to remove
The official fish documentation makes no mention of how `string split`
treats empty tokens, e.g. splitting 'key1##key2' on '#' or (more
confusingly) splitting '/path' on '/'. With this commit, `string split`
now has an option to exclude zero-length substrings from the resulting
array with a new `--no-empty/-n`. The default behavior of preserving
empty entries is kept so as to avoid breakage.
2018-03-29 08:12:08 -05:00
Mahmoud Al-Qudsi
412c5aeaa6 Use alternative Unicode glyphs if compiled under Windows/WSL
The two unicode glyphs used to represent missing new lines and redacted
characters for secure entry are both not present in the glyph tables of
the default font under Windows (Consolas and Lucida Console), use an
alternative glyph instead.

The "return" symbol is replaced with a pilcrow (¶) and the "redacted
character" symbol is replaced with a bullet (•). Both of these are
well-defined in almost all fonts as they're very old symbols. This
change only takes place if -DWSL is supplied by the build toolchain.

Note: this means a Windows SSH client connecting to a fish remote
instance on a non-Windows machine will still use the (unavailable)
default glyphs instead.
2018-03-28 14:27:25 -05:00
ridiculousfish
669eafb55f Stop exporting empty variables as ENV_NULL
Localize the encoding of empty variables as ENV_NULL into the universal
variables component, and ensure they are not exported as ENV_NULL.

Fixes #4846
2018-03-24 23:42:09 -07:00
slama
bb1956fd8d fix the problem that wait command doesn't work correctly in fish script. 2018-03-25 14:22:27 +09:00
Aaron Miller
517b77ca74 Fix handling of signals (#4851) 2018-03-24 12:37:15 -07:00
slama
b758f84976 wait for processes by their name
- You can now specify the process name instead of process ids and wait for jobs.
- Refactor the code of wait command
2018-03-25 02:21:15 +09:00
Mahmoud Al-Qudsi
8bbecb66cf Fix accidental rename of --pid parameter to jobs builtin 2018-03-24 12:13:58 -05:00
Mahmoud Al-Qudsi
515fc509ec Deprecate $_ in favor of (status current-command)
Closes #813.
2018-03-24 11:58:19 -05:00
Mahmoud Al-Qudsi
6d80ab8d74 Rename $pid (née %self) to $fish_pid 2018-03-24 11:54:27 -05:00
Mahmoud Al-Qudsi
5a561bcfce Source : function without any C++ hacks
Thanks, @faho
2018-03-15 18:19:08 -05:00
Mahmoud Al-Qudsi
2477a894e7 Drop read + parse of /proc/sys/kernel/osrelease on startup
This has been obviated by the CMake-defined WSL #define.
2018-03-14 18:28:16 -05:00
Mahmoud Al-Qudsi
3996e437b6 Autoload : function on startup.
The newly added `:` command is implemented as a function (to avoid
increasing complexity by making it a builtin), but it is saved to a path
that does not match its filename (since its name is somewhat of a
special character that might cause problems during installation).
Directly probing the `colon` function for autoload causes `:` to be
correctly loaded, so doing just that after function paths are loaded
upon startup.

This is a hack since the CPP code shouldn't really be aware of
individual functions, perhaps there is a better way of doing this.
2018-03-14 18:22:10 -05:00
Amos Bird
06c8440d72 fix compile error on gcc 7.3 2018-03-14 13:13:59 +01:00
Mahmoud Al-Qudsi
3889079f48 Omit debug(0) log message on invalid completion, leftover from debugging 2018-03-13 19:47:51 -05:00
Mahmoud Al-Qudsi
4caf4ec5e5 Fix completions for functions in custom paths
Fixes an issue introduced in 4414d5c888
where functions loaded from custom directories are not detected as being
valid for purposes of determining whether or not completions should be
called.
2018-03-13 19:41:24 -05:00
Mahmoud Al-Qudsi
1441cca9c5 Restore localization to tokenizer error strings
Work around #4810 by retrieving localizations at runtime to avoid issues
possibly caused by inserting into the static unordered_map during static
initialization.

Closes #810.
2018-03-13 13:45:15 -05:00
Mahmoud Al-Qudsi
054bc88b82 Add gettext operator back to strings in tokenizer
This was purposely disabled as it causes a floating point exception immediately on run:

    Program received signal SIGFPE, Arithmetic exception.
    0x000000000056eae8 in std::__detail::_Mod_range_hashing::operator()(unsigned long, unsigned long) const ()
    (gdb) bt
    #0  0x000000000056eae8 in std::__detail::_Mod_range_hashing::operator()(unsigned long, unsigned long) const ()
    #1  0x00000000005bb4f1 in std::__detail::_Hash_code_base<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::pair<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::__detail::_Select1st, std::hash<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, true>::_M_bucket_index(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, unsigned long, unsigned long) const ()
    #2  0x00000000005bb22a in std::_Hashtable<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::pair<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::allocator<std::pair<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::hash<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_bucket_index(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, unsigned long) const ()
    #3  0x00000000005bb115 in std::__detail::_Map_base<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::pair<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::allocator<std::pair<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::hash<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true>, true>::operator[](std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&) ()
    #4  0x00000000005af388 in std::unordered_map<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::hash<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::equal_to<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::allocator<std::pair<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > > >::operator[](std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&) ()
    #5  0x000000000067dc6b in wgettext[abi:cxx11](wchar_t const*) ()
    #6  0x0000000000551df7 in __cxx_global_var_init.1 ()
    #7  0x000000000055225e in _GLOBAL__sub_I_tokenizer.cpp ()
    #8  0x000000000069d45d in __libc_csu_init ()
    #9  0x00007ffffdc907bf in __libc_start_main (main=0x552500 <main>, argc=1, argv=0x7ffffffed298, init=0x69d410 <__libc_csu_init>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffffffed288) at ../csu/libc-start.c:247
    #10 0x0000000000552389 in _start ()
    (gdb)
2018-03-12 12:44:11 -05:00
Mahmoud Al-Qudsi
0f6c763d9e Revert "Restore sanity to line continuations"
This reverts commit 2cdacbdce4.
Our fish scripts need to be audited for compliance before this can be
safely merged. cc @faho
2018-03-12 08:35:09 -05:00
Mahmoud Al-Qudsi
c51abd04ff Clean up $__fish_*dir variable names
Closes #4429
2018-03-12 08:34:20 -05:00
Mahmoud Al-Qudsi
2cdacbdce4 Restore sanity to line continuations
Line continuations (i.e. escaped new lines) now make sense again. With
the smart pipe support (pipes continue on to next line) recently added,
this hack to have continuations ignore comments makes no sense.

This is valid code:

```fish
echo hello |
# comment here
tr -d 'l'
```

this isn't:
```fish
echo hello | \
# comment here
tr -d 'l'
```

Reverts @snnw's 318daaffb2
Closes #2928. Closes #2929.
2018-03-12 08:12:23 -05:00
Mahmoud Al-Qudsi
0b96b516d5 Improve and expand is_whitespace helper functions 2018-03-12 08:06:50 -05:00
Mahmoud Al-Qudsi
857a89e4bd fixup! Fix oob memory access in expand's call to trim() 2018-03-12 07:31:28 -05:00
Mahmoud Al-Qudsi
ee069baf42 Fix oob memory access in expand's call to trim() 2018-03-12 07:22:27 -05:00
Mahmoud Al-Qudsi
4e48b084d7 Remove duplicate trim() call in parameter expansion 2018-03-12 07:20:50 -05:00
Mahmoud Al-Qudsi
d385248cc8 Merge branch 'fix_brace_parsing'
Closes #3802 and improves tokenizer handling of invalid expressions
involving braces, parentheses, and brackets.
2018-03-12 07:05:47 -05:00
Mahmoud Al-Qudsi
24afff1c77 Handle whitespace within parameter expansion tokens
From the discussion in #3802, handling spaces within braces more
gracefully. Leading and trailing whitespace that isn't quoted or escaped
is stripped, whitespace in the middle is preserved. Any whitespace
encountered within expansion tokens is treated as a single space,
similar to how programming languages that don't hard break tokens/quotes
on line endings would.
2018-03-11 22:02:43 -05:00
Mahmoud Al-Qudsi
364115f818 fixup! Properly parse spaces and escaped/quoted spaces in expansion braces 2018-03-11 20:18:21 -05:00
Mahmoud Al-Qudsi
0620cdf711 Fix tokenizer errors for nested, alternating {} and () 2018-03-11 20:18:03 -05:00
Mahmoud Al-Qudsi
1629d339de Properly parse spaces and escaped/quoted spaces in expansion braces 2018-03-11 19:51:54 -05:00
Mahmoud Al-Qudsi
00f95a978e Make { and } valid, first-class tokenizer elements 2018-03-11 19:36:10 -05:00
Mahmoud Al-Qudsi
7447432471 Fix tests for new ) token error 2018-03-11 17:16:53 -05:00
Mahmoud Al-Qudsi
df89d71237 Correct escaping behavior in new tokenizer code 2018-03-11 17:10:16 -05:00
Mahmoud Al-Qudsi
f508a1f274 Reset tokenizer state on start and improve slice error detection 2018-03-11 12:13:55 -05:00
Mahmoud Al-Qudsi
8a7104a0a4 Rename $_/$fish_title to $current_cmd 2018-03-10 21:33:16 -06:00
Mahmoud Al-Qudsi
9ca89fce6a Remove $_ and replace with $fish_title
Not sure about the new name. We've been using $version unprefixed and
now we also have $pid and $last_pid. $title is very generic.
2018-03-10 20:41:47 -06:00
Mahmoud Al-Qudsi
fb1c7a3d68 Simplify token parser 2018-03-10 18:42:56 -06:00
Mahmoud Al-Qudsi
65a03c86cb Rename BRACKET in reference to { to BRACE instead per #3802
This `{` is a curly brace. This `[` is a square bracket.
2018-03-10 13:16:53 -06:00
Mahmoud Al-Qudsi
c98ed6d07a Rename BRACKET to BRACE per #3802 2018-03-10 13:16:07 -06:00
ridiculousfish
9a5afe3913 Clean up and document functions --handlers 2018-03-10 02:27:25 -08:00
Benoit Hamon
3819437e0e add option --handlers to functions to display function hooks 2018-03-10 02:18:46 -08:00
ridiculousfish
7764f27170 Correct failure to set 'filled' flag in maybe_t constructors 2018-03-10 02:17:35 -08:00
Mahmoud Al-Qudsi
d9be55e504 Optimize sort_and_prioritize_completions
Don't continuously shift items in the vector by using std::remove_if
instead, followed by a single call to ->erase().
2018-03-09 21:40:03 -06:00
Mahmoud Al-Qudsi
a756049dac Implement $hostname variable
The value is not electrified or tied and is read-only. It isn't cached
in the get_hostname_identifier() function as the ENV_GLOBAL $hostname
will cache it for its duration.
2018-03-09 15:02:32 -06:00
Mahmoud Al-Qudsi
ed9c0a7f82 Unify gethostname() behavior across different versions of libc
The behavior of `gethostname` in case of an insufficient buffer is
library and version dependent. Work around this by using a big enough
buffer then truncating the output to our desired max length.
2018-03-09 14:52:29 -06:00
Mahmoud Al-Qudsi
a991fd5a1a Add wcstringutil.h truncate function 2018-03-09 14:52:12 -06:00
Mahmoud Al-Qudsi
1fbf810946 Unify ellipsis_str[ing] with common variable set once 2018-03-09 14:40:35 -06:00
Mahmoud Al-Qudsi
3314135cc9 Move fixed test outside of input_mapping_is_match loop
The 0th index of the array was tested inside the loop instead of just
once outside it.

Also explain `input_mapping_is_match` control code behavior and
reasoning and simplify control flow.
2018-03-09 14:11:43 -06:00
Mahmoud Al-Qudsi
86362e72fe Emit deprecation error when read -i is used for --silent 2018-03-09 11:48:51 -06:00
Mahmoud Al-Qudsi
db8ec59ac4 Change read to use -s/--silent and -S/--shell
Closes #4490
2018-03-09 11:48:20 -06:00
Mahmoud Al-Qudsi
0866653a87 Merge branch 'no_percent'
Drops the % notation for process expansion. The existing notation was a
mess and expanded jobs, process ids, and process names via dark magic.
With this change, % is no longer a special character and can be used
unescaped with impunity.

The variables %self and %last, referring to fish's own pid and the pid
of the last backgrounded job respectively, have been replaced with $pid
and $last_pid. These are read-only variables, protected against being
redefined by the user.

Author's note: I would have personally preferred $fish_pid instead of
$pid but since we debated changing $version to $fish_version and then
reverted that change (with much acrimony), it makes no sense to break
with that precedent here. Additionally, $fish_last_pid is quite wordy.

Closes #4230. Closes #1202.
2018-03-09 09:16:31 -06:00
Mahmoud Al-Qudsi
26cc112096 Implement $last_pid, taking the place of %last
Set as a global variable upon the execution of a background job.
2018-03-09 08:56:13 -06:00
Mahmoud Al-Qudsi
f7e0cbc7a4 Drop % test for illegal commands
% is perfectly valid in commands, now :)
2018-03-09 04:02:29 -06:00
Mahmoud Al-Qudsi
b236ab6e5d Update %self references with $pid instead 2018-03-09 03:56:19 -06:00
Mahmoud Al-Qudsi
90d0f91bcd Define read-only $pid as %self replacement 2018-03-09 03:47:32 -06:00
Mahmoud Al-Qudsi
f42f7b7208 Clean up detritus of process expansion 2018-03-09 03:39:53 -06:00
Mahmoud Al-Qudsi
e45e2bf20e Initial removal of '%' syntax for process/job expansion 2018-03-09 03:36:10 -06:00
Fabian Homborg
2d08b5ee8a [math] Add tests for runtime errors
And fix "isinfinite" - it's called "isinf".
2018-03-07 18:13:26 +01:00
Fabian Homborg
9fc3d1215b [math] Check for runtime errors
When number is infinite, not a number, larger than LONG_MAX or smaller
than LONG_MIN, print a corresponding error and return STATUS_CMD_ERROR.

This should fix the worst of the problems, by at least making them clear.

Fixes #4479.
Fixes #4768.
2018-03-07 18:03:44 +01:00
Fabian Homborg
98d29b53de Refresh winsize before printing prompt
This allows prompts to react to $COLUMNS by e.g. omitting some parts.

We still fallback to a ">" prompt if that's still not short enough,
but now the user has a way of making a nicer prompt.

Fixes #904.
Fixes #4381.
2018-03-07 17:46:48 +01:00
Mahmoud Al-Qudsi
4414d5c888 Block custom/user completions for all invalid heads
If the head is not a valid, existent command, do not load and run custom
completion sources. This applies to both the autosuggestion provider and
manual user completions. File-based completions will still be offered.

Supersedes #4782 and #4783. Closes #4783. Closes #4782. Closes #2365.
2018-03-06 12:52:42 -06:00
Mahmoud Al-Qudsi
3c895c2839 Add whitespace helpers to complete.h/cpp 2018-03-06 12:52:42 -06:00
ridiculousfish
3b2de931cd Simplify tokenize_variable_array() 2018-03-05 22:05:05 -08:00
ridiculousfish
37e748ad54 Remove an unused type 2018-03-05 21:58:22 -08:00
ridiculousfish
c7f16439bf Add support for ! as an analog to 'not'
! and not are effectively interchangeable now.
Mark them both as operators for syntax highlighting.
2018-03-05 14:04:49 -08:00
ridiculousfish
f83742d579 Highlight && and || as operators
This also switches 'and' and 'or' to operators as well.
2018-03-05 13:51:05 -08:00
ridiculousfish
357d3b8c6d Rework 'and' and 'or' to be "job decorators"
This promotes "and" and "or" from a type of statement to "job
decorators," as a possible prefix on a job. The point is to rationalize
how they interact with && and ||.

In the new world 'and' and 'or' apply to a entire job conjunction, i.e.
they have "lower precedence." Example:

if [ $age -ge 0 ] && [ $age -le 18 ]
   or [ $age -ge 75 ] && [ $age -le 100 ]
   echo "Child or senior"
end
2018-03-05 13:41:36 -08:00
ridiculousfish
e1dafeab01 Add && and || support to the conditions of if and while
This updates the "boolean tail" feature of the if and while conditions
to know about job_conjunction, thereby respecting && and ||
2018-03-05 13:39:36 -08:00
ridiculousfish
8e9670ccd5 Implement execution of && and ||
This adds support for basic constructs. if and while is not yet
supported.
2018-03-05 12:20:56 -08:00
ridiculousfish
23d4f93556 Add && and || to fish grammar
This teaches the parser about && and ||, implemented via a new
production "job_conjunction".

These do not yet have execution support.
2018-03-05 12:20:56 -08:00
ridiculousfish
8ded041352 Add && and || support to tokenizer 2018-03-05 12:20:56 -08:00
ridiculousfish
a5dd96558f Remove special && and || error detection
Soon these will no longer be errors.
2018-03-05 12:20:56 -08:00
Mahmoud Al-Qudsi
2f2a221c56 Don't spawn keepalive for WSL when only one command
This should speed things up on slower PCs given that the vast majority
of shell commands are simple jobs consisting of a single command without
any pipelines, in which case there's no need for a keepalive process at
all. Applies to WSL only.
2018-03-04 21:54:12 -06:00
Mahmoud Al-Qudsi
000892e315 Use constexpr for is_windows_subsystem_for_linux()
To guarantee that at runtime there will be no branching, using a CMAKE
test/define combined with a constexpr wrapper for code-friendliness.
2018-03-04 21:13:31 -06:00
Mahmoud Al-Qudsi
cf8850a33f Add temporary fix for #4778 (background processes on WSL)
As a temporary workaround for the behavior described in
Microsoft/WSL#2997 wherein WSL does not correctly assign the spawned
child its own PID as its PGID, explicitly set the PGID for the newly
spawned process.
2018-03-04 20:18:38 -06:00
Mahmoud Al-Qudsi
912dbd85d8 Sprinkle in some job control asserts 2018-03-04 20:17:26 -06:00
Mahmoud Al-Qudsi
6814f29cd7 Add a -/--quiet option to jobs for silent evaluation 2018-03-04 15:20:14 -06:00
Fabian Homborg
0da8022081 [math] Fail without arguments
See #4768.
2018-03-01 22:27:24 +01:00
ridiculousfish
b49e1d7703 Minor cleanup
Mark a function as static and use a std::string instead of malloc.
2018-03-01 21:35:49 +01:00
Fabian Homborg
84043e425d [math] Keep LC_NUMERIC=C for output as well
Otherwise, we'd have issues with people putting math's output back
into math because of "," vs ".".
2018-03-01 13:09:35 +01:00
Fabian Homborg
642a1db4fc [math] Add two error strings as fallback 2018-03-01 13:09:35 +01:00
Fabian Homborg
f60e1549a9 [math] Better error for 2 + 2 4
This now reports "TOO_MANY_ARGS" instead of no error (and triggering
an assertion).

We might want to add a new error type or report the missing operator
before, but this is okay for now.
2018-03-01 13:09:35 +01:00
Fabian Homborg
6a38eb4f7d [math] Better error for 2 -
Instead of the catch-all, report too few arguments.
2018-03-01 13:09:35 +01:00
Fabian Homborg
0d9123ec91 [math] Return STATUS_CMD_ERROR when an error occured 2018-03-01 13:09:35 +01:00
Fabian Homborg
d90d0ee08e [tinyexpr] Let specific errors take precedence over generic ones
Fixes the case where `sin()` reported the generic "bogus" error
instead of "too few arguments".

Also rename the constant to "TE_ERROR_UNKNOWN".
2018-03-01 13:09:35 +01:00
Fabian Homborg
4f39cc4d82 [tinyexpr] Remove closures
These are only available as a customization point. Since we don't use
that, it's dead code.
2018-03-01 13:09:35 +01:00
Fabian Homborg
4f56ce6d33 [math] Improve error formatting
This looked like

    math: Error in expression
    'sin(5,4)'
          ^
    Too many arguments

Now it looks like

    math: Too many arguments
    'sin(5,4)'
          ^
2018-03-01 13:09:35 +01:00
Fabian Homborg
0fa0b620b3 [tinyexpr] Remove list()
This just read comma-separated expressions and returned the last of
them, which is useless and confusing.
2018-03-01 13:09:35 +01:00
Fabian Homborg
ea2934e644 [tinyexpr] Make unary functions fail with too many arguments
As it turns out, this was, for some reason, actual wanted behavior.

We _don't_ want it, so just remove the code.
2018-03-01 13:09:35 +01:00
Fabian Homborg
7b9c75094c [tinyexpr] Add error handling
This turns a bunch of ifs on their heads.

We often see this pattern in te:

```c
if (s->type != SOME_TYPE) {
   // error handling
}  else {
   // normal code
}
```

Only, since we want to return the first error, we do

```c
if (s->type == SOME_TYPE) {
    // normal code
} else if (s->type != TOK_ERROR) {
    // Add a new error - if it already has type error
    // this should already be handled.
}
```

One big issue is the comma operator, that means arity-1 functions can
take an arbitrary number of arguments. E.g.

```fish
math "sin(5,9)"
```

will return the value of sin for _9_, since this is read as "5 COMMA
9".
2018-03-01 13:09:35 +01:00
Fabian Homborg
b9a3938a2b [tinyexpr] Add change notice 2018-03-01 13:09:35 +01:00
Fabian Homborg
2ab1466c8f [tinyexpr] Remove #ifdefs
We don't use them, so we don't need them.
2018-03-01 13:09:35 +01:00
Fabian Homborg
ce28891c76 [math] Set LC_NUMERIC to C
This allows us to always use "." as radix character, so e.g.

    math 2.5 - 2

is always valid, regardless of locale.
2018-03-01 13:09:35 +01:00
Fabian Homborg
b75c3b968c Replace muparser with tinyexpr 2018-03-01 13:09:35 +01:00
ridiculousfish
bb7b649132 Wrapping completions to allow injecting arguments
This enables some limited use of arguments for wrapping completions. The
simplest example is that complete gco -w 'git checkout' now works like
you would want: `gco <tab>` now invokes git's completions with the
`checkout` argument prepended.

Fixes #1976
2018-02-27 14:12:44 -08:00
Fabian Homborg
c793570f2c Fix punctuation movement with one char tokens
Previously, in

    ls ^a bcd

(with "^" as the cursor), kill-word would delete the "a" and then go
on, remove the space and the "bcd".

With this, it will only kill the "a".

Fixes #4747.
2018-02-27 22:56:15 +01:00
ridiculousfish
5282d3e711 Add fish_emoji_width variable to control computed emoji width
This is part of an effort to improve fish's Unicode handling. This commit
attempts to grapple with the fact that, certain characters (principally
emoji) were considered to have a wcwidth of 1 in Unicode 8, but a width of
2 in Unicode 9.

The system wcwidth() here cannot be trusted; terminal emulators do not
respect it. iTerm2 even allows this to be set in preferences.

This commit introduces a new function is_width_2_in_Uni9_but_1_in_Uni8() to
detect characters of version-ambiguous width. For these characters, it
returns a width guessed based on the value of TERM_PROGRAM and
TERM_VERSION, defaulting to 1. This value can be overridden by setting the
value of a new variable fish_emoji_width (presumably either to 1 or 2).

Fixes #4539, #2652.
2018-02-25 23:38:10 -08:00
ridiculousfish
7bd4af51a1 Switch to Unicode 9 savvy wcwidth
Previously fish used the venerable wcwidth implementation from Markus Kuhn.
This switches to wcwidth9() from https://github.com/joshuarubin/wcwidth9
2018-02-25 23:12:37 -08:00
Fabian Homborg
69f68d31df Reserve some builtin names
`argparse`, `read`, `set`, `status`, `test` and `[` now can't be used
as function names anymore.

This is because (except for `test` and `[`) there is no way to wrap these properly, so any
function called that will be broken anyway.

For `test` (and `[`), there is nothing that can be added and there
have been confused users who created a function that then broke
everything.

Fixes #3000.
2018-02-25 21:29:24 +01:00
ridiculousfish
99200d3bfb Attempt to fix the Linux Travis build 2018-02-23 21:38:48 -08:00
ridiculousfish
c4d903ff98 Rationalize how the parser reports tokenizer errors
Remove the unnecessary SQUASH_ERROR flag and correctly report errors
generated from the tokenizer.
2018-02-23 17:28:12 -08:00
ridiculousfish
0950c35eb2 Reduce the amount of copying when the parser drives the tokenizer 2018-02-23 15:58:13 -08:00
ridiculousfish
99fb7bb6aa Refactor how redirections are represented by the tokenizer
Prior to this fix, each redirection type was a separate token_type.
Unify these under a single type TOK_REDIRECT and break the redirection
type out into a new sub-type redirection_type_t.
2018-02-23 15:19:58 -08:00
ridiculousfish
6673fe5457 Clean up tokenizer implementation
Rather than storing a bunch of "next_foo" fields, simply populate the
tok_t directly.
2018-02-23 14:31:13 -08:00
ridiculousfish
0f62161b2b Clean up tokenizer error handling. 2018-02-19 16:31:39 -08:00
ridiculousfish
f30bf40300 Clean up comment parsing in tokenizer
Unify the show_comments and non-show_comments path.
2018-02-19 16:20:47 -08:00
ridiculousfish
b13ee818d2 Some early cleanup of tokenizer
Prior to this the tokenizer ran "one ahead", where tokenizer_t::next()
would in fact return the last-parsed token. Switch to parsing on demand
instead of running one ahead; this is simpler and prepares for tokenizer
changes.
2018-02-19 15:10:59 -08:00
Fabian Homborg
b67a614d86 Replace the process-exit event with generic "fish_exit" event
Turns out the process-exit is only ever used in conjunction with
`%self`. Make that explicit by just adding a new "fish_exit" event,
and deprecate the general process-exit machinery.

Fixes #4700.
2018-02-19 20:21:02 +01:00
ridiculousfish
9444c65ee8 Remove an unused variable from expand_cmdsubst 2018-02-18 20:31:35 -08:00
ridiculousfish
137c2559d9 Remove parser_error
It was unused.
2018-02-18 20:29:28 -08:00
ridiculousfish
5c44d897ea Mark overriding virtual functions as override instead of virtual 2018-02-18 19:12:45 -08:00
ridiculousfish
51c9ad1359 Mark trivial constructors/destructors as default 2018-02-18 19:12:45 -08:00
ridiculousfish
da84b38430 Constructors to accept more parameters by value
In cases where the constructor needs to take ownership of parameters,
pass them by value and use std::move.
2018-02-18 19:12:45 -08:00
ridiculousfish
74e6a82849 Remove explicit 'void' parameters. 2018-02-18 19:12:45 -08:00
Mahmoud Al-Qudsi
50541544f2 Distinguish between function and block IO for fork debug log messages 2018-02-18 16:49:27 -06:00
Mahmoud Al-Qudsi
fedce06687 Decrease error level for 'already has control of terminal' messages 2018-02-18 16:49:27 -06:00
ridiculousfish
fd2a0dffa9 Reflect newlines after pipes in fish grammar
The previous attempt to support newlines after pipes changed the lexer to
swallow newlines after encountering a pipe. This has two problems that are
difficult to fix:

1. comments cannot be placed after the pipe
2. fish_indent won't know about the newlines, so it will erase them

Address these problems by removing the lexer behavior, and replacing it
with a new parser symbol "optional_newlines" allowing the newlines to be
reflected directly in the fish grammar.
2018-02-18 14:44:08 -08:00
ridiculousfish
ea4e997dc9 Remove ends_with_pipe from reader
Now that parse_util_detect_errors() can report incomplete pipelines,
we no longer have to detect this in the reader.
2018-02-18 13:17:45 -08:00
ridiculousfish
ddd1afc57c Teach parse_util_detect_errors about unterminated pipelines
Allow it to return PARSER_TEST_INCOMPLETE for code like
`echo | `
2018-02-18 13:13:58 -08:00
slama
38418d6356 Enable multi-line edit when the line ends with a pipe (#1285) 2018-02-18 13:01:38 -08:00
ridiculousfish
cefb9e6d03 Factor our plain statement case of parse_util_detect_errors
Factors out a lot of code into a separate function.
2018-02-18 13:00:46 -08:00
ridiculousfish
81b3baaa9c Correct handling of unescapable entities in quotes
Prior to this fix, if you attempt to complete from inside a quote and the
completion contained an entity that cannot be represented inside quotes
(i.e. \n \r \t \b), the result would be a broken mess of quotes. Rewrite
the implementation so that it exits the quotes, emits the correct unquoted
escape, and then re-enters the quotes.
2018-02-17 15:18:46 -08:00
ridiculousfish
01d87455e1 Teach parse_util_escape_string_with_quote about tildes
Properly escape literal tildes in tab completion results. Currently we
always escape tildes in unquoted arguments; in the future we may escape
only leading tildes.

Fixes #2274
2018-02-17 15:18:43 -08:00
ridiculousfish
a261beef02 Minor cleanup of complete.cpp 2018-02-17 13:27:30 -08:00
ridiculousfish
0b2d8fd37e Switch some loops in handle_completions to C++11 range-based for looops 2018-02-17 13:10:05 -08:00
ridiculousfish
cdfdc994f1 Clean up completion_t constructors
Use some move semantics and default implementations.
2018-02-16 21:28:53 -08:00
ridiculousfish
9cd952588f Reset autoloads in response to variable changes
Prior to this fix, autoloads like function and completion autoloads
would check their path variable (like fish_function_path) on every
autoload request. Switch to invalidating it in response to the variable
changing.

This improves time on a microbenchmark:

    for i in (seq 50000)
      setenv test_env val$i
    end

from ~11 seconds to ~6.5 seconds.
2018-02-15 22:20:57 -08:00
Mahmoud Al-Qudsi
be13ac353b Refactor job control to make functions act like their names imply
The job control functions were a bit messy, in particular
`set_child_group`'s name would imply that all it does is set the child
group, but in reality it used to set the child group (via `setpgid`),
set the job's pgrp if it hasn't been set, and possibly assign control of
the terminal to the newly-created job.

These have been split into separate functions. Now `set_child_group`
does just (and only) that, `maybe_assign_terminal` might assign the
terminal to the new pgrp, and `on_process_created` is used to set the
job properties the first time an external process is created. This might
also speed things up (but probably not noticeably) as there are no more
repeated calls to `getpgrp()` if JOB_CONTROL is not set.

Additionally, this closes #4715 by no longer unconditionally calling
`setpgid` on all new processes, including those created by `posix_spawn`
which does not need this since the child's pgrep is set at in the
arguments to that API call.
2018-02-14 19:08:12 -06:00
ridiculousfish
5b5a3f78e1 Eliminate parse_execution_context_t::get_offset
This was used to find the index given a pointer to a node. It's now unused.
2018-02-12 10:56:08 -08:00
ridiculousfish
d536b152f7 Simplify the parser_t::eval() return type to void
The return value was unused.
2018-02-12 10:55:55 -08:00
ridiculousfish
4eb73862fc Switch parser_t::execution_contexts to only storing one
We only ever need the topmost (currently executing) context. We can
store the stack via the C stack rather than an explicit std::vector.
2018-02-12 10:55:42 -08:00
ridiculousfish
92d5c28730 Move eval_level into parser_t
This avoids the ping-ponging of eval_level through
parse_execution_context. Simply store the global eval level in the
parser_t.
2018-02-12 10:55:31 -08:00
ridiculousfish
8bddce2633 Remove fake_block_t
It was unused.
2018-02-12 10:55:28 -08:00
ridiculousfish
3e063e7c13 Remove node_offset from block_t
It was not used. Also clean up the constructor some.
2018-02-12 10:55:26 -08:00
ridiculousfish
8251d949f1 Switch executing_node_idx to storing a tnode_t
Avoids annoying index<->node conversions.
2018-02-12 10:55:20 -08:00
ridiculousfish
c3f1961e36 Stop copying out function definition when executing a function
This switches function execution from the function's source code to
its stored node and pstree. This means we no longer have to re-parse
the function every time we execute it.
2018-02-12 10:55:00 -08:00
ridiculousfish
976514597d Migrate function getters to use function_get_properties
This replaces some of the teensy function getters with the function
that just returns a shared_ptr to the properties struct.
2018-02-12 10:53:22 -08:00
ridiculousfish
db33ed0fc7 Migrate some function properties into a shared_ptr
The idea is that we can return the shared pointer directly, avoiding
lots of annoying little getter functions that each need to take locks.
It also helps to pull together the data structures used to initialize
functions versus store them.
2018-02-12 10:52:55 -08:00
ridiculousfish
41ba0dfadb Evaluate tnode_t instead of parse_node_t
This concerns block nodes with redirections, like
begin ... end | grep ...
Prior to this fix, we passed in a pointer to the node. Switch to passing
in the tnode and parsed source ref. This improves type safety and better
aligns with the function-node plans.
2018-02-12 10:51:39 -08:00
ridiculousfish
9cd24c042a Migrate function_info_t from header into .cpp file
This struct was not used outside of the .cpp file.
2018-02-12 10:51:31 -08:00
ridiculousfish
2fa705e4b2 Use a for-in loop in function.cpp 2018-02-12 10:51:08 -08:00
ridiculousfish
de23ce6ac1 Functions to store nodes
Prior to this fix, functions stored a string representation of their
contents. Switch them to storing a parsed source reference and the
tnode of the contents. This is part of an effort to avoid reparsing
a function's contents every time it executes.
2018-02-12 10:49:22 -08:00
ridiculousfish
ba7b8a9584 Remove various empty or useless functions
In particular remove init()/destroy() functions that do nothing, or
destroy functions that only free memory.
2018-02-10 17:21:55 -08:00
ridiculousfish
3a45cad12e Introduce fish_mutex_t wrapping std::mutex
Add a fish-specific wrapper around std::mutex that records whether it is
locked in a bool. This is to make ASSERT_IS_LOCKED() simpler (it can just
check the boolean instead of relying on try_lock) which will make Coverity
Scan happier.

Some details: Coverity Scan was complaining about an apparent double-unlock
because it's unaware of the semantics of try_lock(). Specifically fish
asserts that a lock is locked by asserting that try_lock fails; if it
succeeds fish prints an error and then unlocks the lock (so as not to leave
it locked). This unlock is of course correct, but it confused Coverity Scan.
2018-02-08 22:18:59 -08:00
Mahmoud Al-Qudsi
8069939112 fixup! Fix memory leak in term_env 2018-02-08 17:36:29 -06:00
Mahmoud Al-Qudsi
22a67885e1 Fix memory leak in term_env
Use wcstring/string instead of a character array. The variable
`term_env` was not being freed before the function exited.

Fixes defect 7520324 in coverity scan.
2018-02-08 17:17:26 -06:00
Mahmoud Al-Qudsi
6108b1d813 Assert value of tok_begin after call to parse_util_token_extent
We later assign the value of `tok_begin` to a `wcstring` which would
cause a null dereference if `tok_begin` were still null.
2018-02-08 17:10:51 -06:00
Mahmoud Al-Qudsi
fbc6c68f3d Handle error opening /dev/null in redirect_tty_output
This fixes coverity scan defect number 7520299
2018-02-08 17:05:13 -06:00
Mahmoud Al-Qudsi
3083e0ea80 Work around false positive RESOURCE_LEAK in coverity scan
Fixes defect number 7520322
2018-02-08 16:59:38 -06:00
Mahmoud Al-Qudsi
82b7e6de69 Fix unused code (coverity defect #7520283)
Due to the logic above, isz cannot be zero if we take the else branch.
2018-02-08 16:54:28 -06:00
ridiculousfish
cb03be9fe6 Remove unused 'pgrp_set' variable 2018-02-07 12:54:26 -08:00
ridiculousfish
8de266afb4 Improve commenting regarding process groups and builtins. 2018-02-07 12:49:12 -08:00
ridiculousfish
0c18f68cc2 Remove support for blocking children
This removes support for blocking children via signals, which was used
to orchestrate processes on WSL. Now we use the keepalive mechanism
instead.
2018-02-07 12:49:12 -08:00
ridiculousfish
080521071f Teach keepalives to exit when their parent dies
keepalive processes are typically killed by the main shell process.
However if the main shell exits the keepalive may linger. In WSL
keepalives are used more often, and the lingering keepalives are both
leaks and prevent the tests from finishing.

Have keepalives poll for their parent process ID and exit when it
changes, so they can clean themselves up. The polling frequency can be
low.
2018-02-07 12:49:12 -08:00
ridiculousfish
14880ce7d1 Resume setting group ID in both parent and child 2018-02-07 12:49:12 -08:00
ridiculousfish
e9f676a7f4 Provide a way to stop blocking children via s_block_children
This is to investigate alternatives to the existing kill(SIGSTOP)
WSL compatibility thing.
2018-02-07 12:49:11 -08:00
ridiculousfish
1b1fd5ab9b Mark needs_keepalive more often for WSL
Have WSL use a keepalive whenever the first process is external.
This works around the fact that WSL prohibits setting an exited
process as the group leader.
2018-02-07 12:49:11 -08:00
ridiculousfish
cef39cdcc0 Add is_windows_subsystem_for_linux to detect WSL 2018-02-07 12:49:11 -08:00
Mahmoud Al-Qudsi
7fafdee98e
Merge pull request #4704 from fish-shell/curses_ncurses
Fix curses includes on platforms offering real libcurses.
2018-02-06 10:44:29 -06:00
ridiculousfish
72208a9438 Use the layout cache instead of static variables for caching prompts
This correctly reacts to changes in TERM (which might affect prompt
width due to escape code differences), and eliminates some ugly
static variables.
2018-02-04 16:20:55 -08:00
ridiculousfish
1bd5946d23 Add prompt layout caching to layout_cache_t 2018-02-04 16:20:55 -08:00
ridiculousfish
d1436486e2 Rename cached_esc_sequences_t to layout_cache_t
Preparation for migrating the prompt cache into this struct.
2018-02-04 16:20:55 -08:00
ridiculousfish
a87970fbb5 Have the pager use a simple newline count to determine reserved lines
When the pager wants to use the full screen to show many options, it reserves
space at the top to see the command. Previously it pretended the command was a
prompt and engaged the prompt layout mechanism to compute these lines. Instead
let's juts count newlines since escape sequences within commands are very rare.
2018-02-04 14:14:37 -08:00
slama
27c1c06ed4 improve the size of completions page to show the entire prompt 2018-02-04 14:04:08 -08:00
ridiculousfish
9ba6b62791 Remove some ancient "#if 0' code and fix formatting errors 2018-02-04 14:03:08 -08:00
Mahmoud Al-Qudsi
63c8a197e5 [cmake] Clean up curses vs ncurses includes
There were several issues with the way that the include tests for curses.h
were being done that were ultimately causing fish to use the headers from
ncurses but link against curses on platforms that provide an actual
libcurses.so that isn't just a symlink to libncurses.so

In particular, the old code was first testing for curses's cureses.h and then
falling back to libncurses's implementation of the same - but that logic was
reversed when it came to including term.h, in which case it was testing for
the ncurses term.h and falling back to the curses.h header. Long story short,
while cmake will link against libcurses.so if both libcurses.so and
libncurses.so are present (unless CURSES_NEED_NCURSES evaluates to TRUE, but
that makes ncurses a hard requirement), but we were brining in some of the
defines from the ncurses headers, causing SIGSEGV panics when fish ultimately
tried to access variables that weren't exported or were mapped to undefined
areas of memory in the other library.

Additionally it is an error to include termios.h prior to including the plain
Jane curses.h (not ncurses/curses.h), causing errors about unimplemented types
SGTTY/chtype. So far as I can tell, both curses.h and ncurses/curses.h pull in
termios.h themselves so it shouldn't even be necessary to manually include it,
but I have just moved its #include below that of curses.h
2018-02-04 03:11:22 -06:00
ridiculousfish
85fba3a316 Remove HISTORY_SEARCH_TYPE_*_PCRE
These were unused and unimplemented.
2018-02-03 14:41:01 -08:00
ridiculousfish
89709c3a89 Clean up some history search interfaces 2018-02-03 14:41:01 -08:00
Fabian Homborg
5262719995 Don't fire exit events for jobs with pgid == -2
This fixes a hang common on WSL, when fish has PID 2.

Fixes #4582.
2018-02-03 16:22:57 +01:00
David Adam
fb53a96a1c Add configure-time check for std::make_unique
Fixes the build on Clang 6 and closes #4685.
2018-01-31 13:43:05 +08:00
ridiculousfish
54cefeb5b1 Make sliced history (e.g. $history[1]) much faster
This special cases expansion of $history variables, so that slicing
history no longer needs to construct the entire history array. Speedup
is around 100x in my test.

Fixes #4650
2018-01-30 18:34:46 -08:00
ridiculousfish
816d35de43 Clean up expand_variables
Partially rewrite this function to be shorter and easier to follow.
2018-01-30 17:45:34 -08:00
ridiculousfish
3d1975c6a6 Convert variable_is_colon_delimited_var to a const array 2018-01-30 13:32:15 -08:00
ridiculousfish
39a02f8ead Turn the set of read-only variables into a const array 2018-01-30 13:28:49 -08:00
ridiculousfish
f025269195 env_var_t to forget its name
Store properties associated with the name via flags instead
2018-01-30 12:36:50 -08:00
ridiculousfish
5c2e6734c1 Normal text input to disable paging instead of search
Prior to this fix, if the user typed normal characters while the
completion pager was shown, it would begin searching. This feature was
not well liked, so we are going to instead just append the characters as
normal and disable paging. Control-S can be used to toggle the search
field.

Fixes #2249
2018-01-30 09:58:08 -08:00
ridiculousfish
d0d7bb75cd Add new pager-toggle-search input function
This adds a new input binding pager-toggle-search which toggles the
search field on and off when the pager is showing.
2018-01-30 09:58:08 -08:00
ridiculousfish
d03aff8742 Encapsulate input function name and code into a single struct
Reduces the reliance in ugly parallel arrays.
2018-01-29 19:15:16 -08:00
ridiculousfish
43c839ab0e Rename R_MIN and R_MAX to R_BEGIN/END_INPUT_FUNCTIONS
This makes the names more obvious.
We also make the range half-open as is the convention.
2018-01-29 11:53:44 -08:00
ridiculousfish
9ce3ac5b93 Remove R_SENTINAL
It was unused and misspelled.
2018-01-29 11:30:11 -08:00
ridiculousfish
5b3729842c tnode_t::try_get_child() to properly implement null check.
try_get_child() was taking the address of a reference; clang was thereby
assuming it could not be null and so was dropping the null check. Ensure
we do not dereference a null pointer.

Fixes #4678
2018-01-28 15:07:19 -08:00
Fabian Homborg
cddd0d7538 [Pager] Adjust tests for changes in behavior
Since moving west no longer gets stuck in the top row (but instead
wraps around to the bottom row), this needs to have some indices
changed.
2018-01-25 13:26:53 +01:00
Fabian Homborg
dc95bfc1b1 [Pager] Make up without selected contents jump back into the pager
This makes it possible to select the last element of the completions
with just one keypress.

Fixes #3115.
2018-01-25 13:26:53 +01:00
Fabian Homborg
13079911bc [Pager] Wrap cardinal direction movement
Fixes #4669.
2018-01-25 13:26:53 +01:00
ridiculousfish
a39c57c1b6 Report errors for arguments to 'end'
For example, `begin ; end arg` will now report an error.

Fixes #986
2018-01-22 13:31:39 -08:00
ridiculousfish
9d48c68f24 Remove argument_or_redirection type
This was a symbol that represented either an argument or a redirection.
This was only used as part of argument_or_redirection_list.
It's simpler to just have these types be alternatives in the list type.
2018-01-22 13:18:34 -08:00
ridiculousfish
f81eef5ee1 Improve type checking of certain tnode_t interfaces 2018-01-22 13:13:28 -08:00
ridiculousfish
3b64a256b6 Add type checking to find_child()
Ensure that find_child() with impossible child nodes will now error
at compile time.
2018-01-22 11:09:29 -08:00
ridiculousfish
ae9b5871fb Fix a tnode-related crash in syntax highlighting
Adds a new test too.
2018-01-21 02:17:21 -08:00
ridiculousfish
04162b05ea Remove the giant 'Fish grammar' comment
The fish grammar is now captured more precisely in parse_grammar.h
2018-01-20 14:09:40 -08:00
ridiculousfish
852cf183a6 Remove some unused parameters 2018-01-20 14:09:36 -08:00
ridiculousfish
0f8e8d1cea Migrate tnode implementation to tnode.cpp
Also improve commenting.
2018-01-20 13:33:09 -08:00
ridiculousfish
094e853a20 Migrate tnode_t into new header tnode.h 2018-01-20 12:15:28 -08:00
ridiculousfish
1c2943bd8b Make statement_is_in_pipeline a free typesafe function 2018-01-20 11:45:43 -08:00
ridiculousfish
194f7f34d9 Eliminate parse_node_tree::find_nodes 2018-01-20 11:45:43 -08:00
ridiculousfish
242512f0df Migrate argument_list_is_root out of parse_node_tree_t 2018-01-20 11:45:43 -08:00
ridiculousfish
c1b60fa8e1 Remove header_node_for_block_statement 2018-01-20 11:45:43 -08:00
ridiculousfish
d7c28c9316 Eliminate job_should_be_backgrounded 2018-01-20 11:45:43 -08:00