When the pager wants to use the full screen to show many options, it reserves
space at the top to see the command. Previously it pretended the command was a
prompt and engaged the prompt layout mechanism to compute these lines. Instead
let's juts count newlines since escape sequences within commands are very rare.
There were several issues with the way that the include tests for curses.h
were being done that were ultimately causing fish to use the headers from
ncurses but link against curses on platforms that provide an actual
libcurses.so that isn't just a symlink to libncurses.so
In particular, the old code was first testing for curses's cureses.h and then
falling back to libncurses's implementation of the same - but that logic was
reversed when it came to including term.h, in which case it was testing for
the ncurses term.h and falling back to the curses.h header. Long story short,
while cmake will link against libcurses.so if both libcurses.so and
libncurses.so are present (unless CURSES_NEED_NCURSES evaluates to TRUE, but
that makes ncurses a hard requirement), but we were brining in some of the
defines from the ncurses headers, causing SIGSEGV panics when fish ultimately
tried to access variables that weren't exported or were mapped to undefined
areas of memory in the other library.
Additionally it is an error to include termios.h prior to including the plain
Jane curses.h (not ncurses/curses.h), causing errors about unimplemented types
SGTTY/chtype. So far as I can tell, both curses.h and ncurses/curses.h pull in
termios.h themselves so it shouldn't even be necessary to manually include it,
but I have just moved its #include below that of curses.h
The non-ncurses version of term.h requires that curses.h be first
included. Only very recent versions of CMake include a LANGUAGE
option to CHECK_INCLUDE_FILES, so we aren't using it and specifying
CXX here..
This never worked properly (since a branch that only exists locally
would also be offered) and is dog-slow.
When we come up with a better way to do it we can readd it.
When git prints a path like "share/completions/git.fish", that's
relative to the root of the repo. So we need to either remove
everything from the $PWD (if the path is inside the $PWD), or prepend
a ":/", which is git-speak for "relative to the root".
This was removed by mistake in the recent switch to `git status`.
Fixes#4688.
This special cases expansion of $history variables, so that slicing
history no longer needs to construct the entire history array. Speedup
is around 100x in my test.
Fixes#4650
Prior to this fix, if the user typed normal characters while the
completion pager was shown, it would begin searching. This feature was
not well liked, so we are going to instead just append the characters as
normal and disable paging. Control-S can be used to toggle the search
field.
Fixes#2249
CheckFunctionExists checks for C linkage only, and recommends the use of
CheckSymbolExists in the documentation. This improves the detection of
C++ features, as opposed to C features.
try_get_child() was taking the address of a reference; clang was thereby
assuming it could not be null and so was dropping the null check. Ensure
we do not dereference a null pointer.
Fixes#4678
* git completions: Parse git status --porcelain
This is much faster on large repositories, as it allows us to do a lot
more with a single git call.
It also makes it easy to add descriptions to distinguish modified
files from untracked ones.
TBD is if all commands now have the right kinds of files.
[ci skip]
`-v` is a non-standard GNU-only extension to `awk`, its usage in the
generation of the fish.pc script breaks on non-GNU platforms (such as
FreeBSD and presumably macOS).
Using `sed` with only standard posix commands instead.
This was a symbol that represented either an argument or a redirection.
This was only used as part of argument_or_redirection_list.
It's simpler to just have these types be alternatives in the list type.