When performing wildcard expansion with a literal path segment,
instead of enumerating the files in the directory, simply apply the
path segment as if we found the directory and continue on. This
enables us to expand strings that contain unreadable directory
components (common with $HOME) and also improves performance, since
we don't waste time enumerating directories unnecessarily. Adds
a test too.
Fixes#2099
1. When run with no arguments, make abbr do the equivalent
of `abbr --show`
2. Enable "implicit add", e.g. `abbr gco git checkout`
3. Teach `abbr --show` to not use quotes for simple cases
4. Teach abbr to output -- when the abbreviation has
leading dashes
Add some basic tests to abbr too.
Add a new function fish_mode_prompt which (if it is defined) has its output
prepended to the left prompt. Rather than replacing the prompt wholesale, make
fish_vi_mode enable this function by setting a variable __fish_vi_mode. This
enables vi mode to interoperate nicely with custom prompts. Users who want
to change how the mode is reported can either redefine this function or
erase it entirely. Fixes#1988.
Prior to this fix, if you exported a variable in one scope
and then unexported it in the next, it would remain exported.
Example:
set -gx VAR 1
function foo; set -l VAR; env; end
foo
Here 'VAR' would be exported to 'env' because we failed to
notice that the env var is shadowed by an unexported variable.
This occurred at env var computation time, not in env_set!
Fixes#2132
su does not reset XDG_RUNTIME_DIR, which means that XDG_RUNTIME_DIR
may point to directories that the user does not have permission
to access. Similarly there is no guarantee that XDG_RUNTIME_DIR
points to a directory that actually exists. Rather than try to
handle these issues, we simply ignore them, effectively disabling
realtime uvar notifications. Fixes#1955.
In FAQ:
> I'm seeing weird output before each prompt when using screen. What's wrong?
The command provided is
echo 'function fish_title;end' > ~/.config/fish/config.fish
Using `>` will overwrite current config.fish.
We should use `>>` instead.
With the fix for #365, fish_command_not_found event handlers
receive the command and all of its arguments. But commands
like /usr/lib/command-not-found expect only the command name.
So when invoking an external command, just pass the command
name, not all of the arguments.
Before running a command, we add the command to history, so
that if the command causes us to exit it's still captured in
history. But that command should not be considered part of
history when expanding the history within the command itself.
For example, `echo $history[1]` should be the previously
run command, not `echo $history[1]` itself.
Fixes#2028
For the case
```
bind \et "commandline -i 1" "commandline -i 2"
```
the order of execution of the commands is now in-order.
Note that functions codes are prepended to the queue in reverse order, so they
will be executed in-order. This should allow all bindings of the form
```
bind \et beginning-of-line force-repaint
```
to remain unchanged.
Using builtin `commandline -f`, one would expect to have commands executed in
the order that they were given. This motivates the change to a queue.
Unfortunately, fish internals still need lookahead_list to act as a stack. Add
and rename functions to support both cases and have lookahead_list as
a std::deque internally.
This code is delicate, and we should probably dog-food this in nightly for
a while before the next-minor release.
Fixes#1567
Examples that work as expected (even completions don't get confused):
$ begin true; end;
$ begin if true; end; end
$ begin if true; echo hi; end
The last example correctly expects another 'end' to match 'begin'.
Fixes#1248.