The vi-bindings function would unconditionally erase all bindings,
making it impossible to call it last. This would disable the
mode-indicator (and in future also the cursor).
Make it so any argument to fish_vi_key_bindings stops it from erasing
bindings.
It would also be possible to demand an argument to erase (or to erase as
a separate step). but the usual case seems to be _switching_ to a set of bindings.
This didn't work on platforms where tput exists but can never accept
terminfo names. This includes the current versions of FreeBSD - it
used to do both, now it doesn't. So, fall back to the old termcap names
by (tput smso; or tput so). Add check for the tput program before we
even try.
The extra things `eval` does are all for code that runs
interactively. Because we just define a function, we don't need it.
This improves alias' performance by about 20-25% (0.783608s to 0.585585s
on about 500 aliases) and avoids triggering #3345.
Implementing the --shadow-builtin flag has proven to be highly controversial.
Revert the introduction of that flag to the `function` command. If someone
shoots themselves in the foot by redefining a builtin as a function that's
their problem and not our responsibility to protect them from doing so.
Fixes#3319
It's not ideal since we can't get the real result so we just assume it's
"0". That triggers the easier path, which still might display the wrong
thing, but we have to pick something.
Possible fix for #3321.
The recent change to reconcile the history builtin command and function
broke an undocumented behavior of `history --delete`. This change
reinstates that behavior. It also adds an explicit `--exact` search mode
for the `--search` and `--delete` subcommands.
Fixes#3270
Only on the OS X travis build.
I can't reproduce it but I figure it's something to do
with test -e vs test -x or the echo -n in command substitution.
Oops.
This was erroneously omitted from the previous commit.
Now backspace in insert mode does backward-delete-char, in default mode
backward-char (i.e. no deleting, just moving). This is consistent with vim.
This undoes the inheritance since it shared too much.
The idea here is to share bindings that aren't something the editors we're inspired by do - there's no "execute" in vi.
The basic editing and moving bindings are now vi-style in vi-mode and emacs-style in default mode.
Only one file belonging to fish-shell had DOS/bogus line endings,
with `git add' picking up changes after updating .gitattributes:
hostname.fish.
Unsurprisingly, it has code to support cygwin and was likely
worked on by a user on a Windows machine. This will help
such cases in the future.
Also, in pcre2-10.21/, there was RunTest.bat which was (correctly)
CRLF formatted. We don't use this batch script at all, so rather
than LF it or add an exception, blast it away like the other pcre2
files omitted from the repo.
A common problem for users is that fish doesn't get a locale. This often
happens if systemd is used with getty and fish as login shell.
Fixes#277
Note that I (@krader) made editorial changes before merging this. For
example, running `make style` and otherwise changing long statements to a
series of shorter statements. So if there are any problems it is possible
I introduced them.
This is a regression introduced by 834ebef53c
Bolster with a check for only login sessions too -- hopefully makes it
less annooying on subshells in general.
Fixes#3261
This fixes several problems with how the builtin `history` command handles
arguments. It now complains and refuses to do anything if the user specifies
incompatible actions (e.g., `--search` and `--clear`). It also fixes a
regression introduced by previous changes with regard to invocations that
don't explicitly specify `--search` or a search term.
Enhances the history man page to clarify the behavior of various options.
This change is already far larger than I like so unit tests will be added
in a separate commit.
Fixes#3224.
Note: This fixes only a couple problems with the interactive `history
--delete` command in the `history` function. The main problem will be
dealt with via issue #31.
We don't seem to mention in the documentation that we were forcing
-t for all interactive uses. If we want to do that we should apply
that in the builtin.
history.fish reimplementing every option and doing things kind of
differently is a real pain and it's not clear if the docs are
referring to the or the wrapper script or both.
Someone running fish in an unusual locale reported that an `assert()` was
firing when they typed `pkill c`. I traced it to two bugs. First, the
__fish_make_completion_signals command was producing a weird result. Second,
the builtin `complete` command wasn't adequately verifying its arguments.
Fixes#3129
Doesn't colorize if output is redirected.
This is "fun" and indenting happens to make most of the included
functions display more narrow and fit better into a terminal window.
Doesn't colorize if output is redirected.
This is "fun" and indenting happens to make most of the included
functions display more narrow and fit better into a terminal window.