A user reported that fish was dying from a SIGSEGV when launched by the
sjterm terminal app. This was traced to a bug in sjterm passing an empty
argv array to the shell. Which, while technically legal, is very unusual
and a bad practice.
Fixes#3269
Add some debug output like there is for 24bit mode.
I see now there is no need to setup terminal here - we get called early
sometimes for colors to work in config.fish to work but that is not so fatal.
Just check cur_term and trust get called again soon.
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 were effectively inferring 256 color support **only**.
If terminfo reports 256 max_colors for this $TERM but
that is not named xterm or does not contain "256color" in name,
term256_support_is_native()'s result did not affect the recorded
support.
Noticed with Terminal.app set to nsterm, and a newer ncurses
with good terminfo for the terminal on modern OS X:
http://invisible-island.net/ncurses/terminfo.src.html#toc-_Apple__Terminal_app
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.
Attempting to execute something like `exec "$test"` results in a fish internal
token (a Unicode private use char) being printed in the resulting error
message. That's obviously not desirable as well as confusing.
Fixes#3187
Prior to this fix, when performing completions, we would prepend
the wildcard to the resulting files. When doing fuzzy completions,
we would take some wildcard segment, attempt to locate it in the
final completion, and then replace it with our fuzzy-matched directory.
With this fix, we pass along the "resolved so far" path, and prepend
that instead of doing "surgery" on the completion. This simplifies the
logic.
Fixes#3185
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
Make `fish_indent`, `fish_key_reader` and `fish` recognize and assign
the same meaning to the `-d` and `-D` flags. Also, fix some errors and
stylistic issues in the associated man pages.
Fixes#3191
Remove isatty() check for stdout - this was added for both stdout
and stdin because "there is no reason to do that", but there is one:
Leaves only the bind command printed ot stdout, this allows
for one to do `fish_key_reader > bind_command.fish` to capture the bind
command while seeing the rest of the output.
After the colorized syntax output in type -a foo, "foo is /usr/..."
would also be colored. (or 'test' in fish_indent foo.fish; echo test).
Make fish_indent reset the color when it's done.
I did some research and experiments. For good or bad the `bind` command
requires the use of wide char codepoints (e.g., \u1234) for non-ASCII
chars. So don't force the use of the POSIX locale, but do provide it as
an option for people who want to see the individual bytes rather than a
decoded wide char.
Simplify the format of the information displayed for each character. There
really isn't much point in providing decimal, octal, and hexadecimal. Just
print hex and symbolic representations.
Add an example `bind` command that a user can copy/paste.
Closes#3183
Another developer noticed that redirecting stdin of `fish_key_reader`
results in weird behavior. Which is not at all surprising. So add checks
to ensure stdin and stdout are attached to a tty.
Add some rudimentary unit tests for this program.
A discussion on Gitter proposed allowing the user to signal their desire to
exit fish_key_reader by pressing \cC or \cD twice in a row. This implements
that.
I also decided to refactor how signals are handled. Most notably receiving a
signal will no longer print a diagnostic message unless you've enabled
debugging with `-d2` (or higher level).
In addition to fixing the setting of the locale to C/POSIX this also
corrects several problems introduced by the commits made in the past
couple of days. As a consequence of dealing with all of this I decided
to refactor the code to simplify one of the overly long functions I
introduced in my previous change.
Fixes#3168
There is no conceivable way in which timef()'s invocation of gettimeofday()
can fail where it makes sense to continue running. Yes, one such,
legitimate, failure mode is a 32-bit kernel and the date is greater than
2038-01-19 03:14:07. If you're running a fish binary on such a system
it's time to upgrade. Otherwise, either the hardware or OS is broken.
Fixes#3167.