Per discussion in PR#3998 to review adding a `--filter` flag to `string
replace` rename the same flag in the `string match` subcommand to avoid
confusion about the meaning of the flag.
Discussion in issue #3295 resulted in a decisions to rename the
functions --metadata flag to --details.
This also fixes a bug in the definition of the short flags for the
`functions` command. The `-e` flag does not take an argument and
therefore should not be defined as `e:`. Notice that the long form,
`--erase`, specifies `no_argument`. This discrepency happened to work
due to a quirk of how the flag parsing loop was written.
0 is not a good default PGID, because it's possible for a kernel process
to have the PGID of 0 under Linux.
This meant that job_get_from_pid could return incorrect jobs, as the PGID
for internal, non-forked jobs was the same as kernel processes.
Avoid this by using an invalid PGID as the initial PGID.
It is possible for fish to not be the process group leader; avoid
signalling the process group containing the current process by checking
with getpgrp() rather than assuming that getpid() is enough.
If fish is not the first process in a pipeline, and jobs are started
from the fish process, it is possible for fish and the OS to have
different ideas about what the process group of the jobs are.
This change confirms the current PGID, rather than assuming that it is
the same as the PID.
Defining aliases for existing symbols serves only to obscure the code.
So remove the following symbols and replace them with the primary
symbols:
enum { BUILTIN_TEST_SUCCESS = STATUS_BUILTIN_OK, BUILTIN_TEST_FAIL =
STATUS_BUILTIN_ERROR };
See issue #3985.
The bind mode names can be, and are, used in the construction of fish
variable names. So don't allow users to use names that are not legal as
a variable name. This should not break anything since, AFAICT, no
existing fish scripts, including those provided by Oh-My-Fish and
Fisherman define bind modes that would not be legal with this change.
Fixes#3965
This is the first step in addressing issue #3965. It renames some of the
functions involved in validating variable and function names to clarify
their purpose. It also augments the documentation to make the rules for
such identifiers clearly documented.
The recent change to improve the behavior of the `bg` command (commit
3edb7d538) resulted in the `send_to_bg()` no longer using the `name`
parameter it was given. This rectifies that lint warning by removing
that parameter as it never served a useful purpose.
Switch from null terminated arrays to `wcstring_list_t` for lists of
special env var names. Rename `list_contains_string` to `contains` and
modify the latter interface to not rely on a `#define`.
Rename `list_contains_string()` to `contains()` and eliminate the
current variadic implementation. Update all callers of the removed
version to use the string list version.
There are at least three env vars describing a sequence of paths to be
searched where an empty path element is implicitly equivalent to ".".
This change converts the implicit "." to explicit whenever the variable
is imported or set. This makes the variable much easier to use in fish
scripts.
Fixes#3914
- Error out if anything that is not a PID is given
- Otherwise background all matching existing jobs, even if not all
PIDs exist (but print a message for the non-existing ones)
Fixes#3909.
A call to default_vars_path() takes the environment variable
lock while the uvars lock is held. Ensure that doesn't happen by
deferring the uvars lock to later in the function.
cached_esc_sequences_t::find_entry was constructing a wcstring
from a c string, using lengths longer than the length of the cstring.
Detected with asan.
In the process of fixing the issue I decided it didn't make sense to
have two, incompatible, ways of converting variable strings to arrays.
Especially since the one I'm removing does not return empty array elements.
Fixes#2106