This makes the following changes:
1. Events in background threads are executed in those threads, instead of
being silently dropped
2. Blocked events are now per-parser instead of global
3. Events are posted in builtin_set instead of within the environment stack
The last one means that we no longer support event handlers for implicit
sets like (example) argv. Instead only the `set` builtin (and also `cd`)
post variable-change events.
Events from universal variable changes are still not fully rationalized.
This adds a new mechanism for logging, intended to replace debug().
The entry points are FLOG and FLOGF. FLOG can be used to log a sequence of
arguments, FLOGF is for printf-style formatted strings.
Each call to FLOG and FLOGF requires a category. If logging for a category
is not enabled, there is no effect (and arguments are not evaluated).
Categories may be enabled on the command line via the -d option.
This just sets some special characters that we use in the reader, so
it only needs to be done before the reader is set up.
Which, as it stands, is in env_init().
This runs build_tools/style.fish, which runs clang-format on C++, fish_indent on fish and (new) black on python.
If anything is wrong with the formatting, we should fix the tools, but automated formatting is worth it.
This adds an option --print-rusage-self to the fish executable. When set,
this option prints some getrusage stats to the console in a human-readable
way. This will be used by upcoming benchmarking support.
This reverts commit 1cb8b2a87b.
argv[0] has the full path in it for a user when he executes it
out of $PATH. This is really annoying in the title which uses $_.
OCLINT was ignoring this, but we can just not do the bad thing.
Declare argc and argv const. These are in the stack, they can
be modified, but we won't.
Fix a typo
... rather than hard code it to "fish". This affects
what is found in $_ and improves the errors:
For example, if fish was ran with ./fish, instead of
something like:
fish: Expected 3 surprises, only got 2 surprises
we'll see:
./fish: Expected 3 surprises, only got 2 surprises
like most other shell utilities. It's just a tiny bit
of detail that can avoid confusion.
This was causing problems if "fish" wasn't in exec_path, like
if the binary had been renamed.
I also noticed that even with 'fish' not renamed, only paths.data
was made relative to my source tree. paths.sysconf, paths.doc, and
paths.bin were all relative to /usr/local.
In private mode, access to previous history is blocked and new history
does not persist and is only available for the duration of the current
session.
This mode can be used when it is not desirable for commandline history
to leak into a session, e.g. via autocomplete or when it is desirable to
test the behavior of fish in the absence of history items without
permanently clearing the history.
I'm sure there are a lot more features that can be incorporated into
private mode, such as restricting access to certain user-specific
configuration files, etc.
This addresses a lot of the concerns raised in #1363 (which was later
changed to track mosh-specific problems). See also #102.
Load fish docs and configuration out of the source and/or build
directories rather from the installed paths when running directly out
of the cmake build directory.
Closes#5255.
Retrieves the fully resolved path to the currently executing fish binary
(regardless of PATH). Can be used to ensure that the same fish is
launched again from a script.
`get_executable_path()` moved from fish binary to libfish, also cleaned
up some duplicated (but differing!) definitions of PATH_MAX (which was
used by that function) in the process.
Remove dependency on the Linux compatibility layer's procfs being
installed and mounted when running under FreeBSD by directly querying
the MIB for the path to the running fish executable
(KERN_PROC_PATHNAME). Tested under FreeBSD 11.2-RELEASE.
This reverts commit 8c14f0f30f.
This list is not reliable - there are many ways for fish to quit that does not
invoke these functions. It's also not necessary since the history is correctly
saved on exec.
This reverts commit e2a3dae58b.
This idea failed because ./share was not complete when bliding via cmake;
it misses critical files such as config.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
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.
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.
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.