Commit Graph

14727 Commits

Author SHA1 Message Date
Aaron Gyes
fb32872f6b don't use __has_builtin
GCC doesn't have this until GCC 10. Just assume it exists, as
our compiler requirements mean it should exist.
2021-09-28 23:54:17 -07:00
Aaron Gyes
97bb53e32d Add likely() and unlikely() for our assertions
Allows the compiler to know our bespoke assert functions
are cold paths. This would normally occur somehow for real assert().
Assembly does appear it will save some branches.

Also don't worry about NDEBUG

(This doesn't matter because we rolled our own assert functions.
Thanks @zanchey.)
2021-09-28 23:39:54 -07:00
Aaron Gyes
a5978eade4 funcsave: add missing newlines 2021-09-28 22:22:21 -07:00
Aaron Gyes
3fd2da951e remove unused futimes check 2021-09-28 22:02:14 -07:00
Aaron Gyes
0b3d3de9bf Just add -UNDEBUG to disable NDEBUG. 2021-09-28 22:02:14 -07:00
Aaron Gyes
3a402b19b3 funcsave: delete files for non-existant functions, output actions unless -q
This allows for:

$ functions -e somefunc
$ funcsave somefunc

to work.
2021-09-28 22:01:07 -07:00
Fabian Homborg
69074c1591 fish_config: Remove right prompt in choose and save
If the new theme no longer has any.

Fixes #8314.
2021-09-26 15:34:04 +02:00
ridiculousfish
ecaf455277 sphinx-build to use multiple processes
sphinx-build supports the -j option to use multiple processes. Start using
it. This reduces the time to build the docs on my Linux box from 11 seconds
to about 4.

Note this doesn't work on macOS since -j is ignored there (see sphinx-build
PR 6879).
2021-09-25 12:17:46 -07:00
takeokunn
d2ca6ed564 Add dart completion 2021-09-25 10:36:11 -07:00
ridiculousfish
0c06ca3c3f Mark parser_t::principal as const 2021-09-24 21:09:28 -07:00
ridiculousfish
4f466cb916 broken-symbolic-link test to enter a new directory
This was previously dependent on whatever directory we happened to be
in.
2021-09-24 17:35:45 -07:00
Fabian Homborg
3b74f6e0c6 tests/bind: Disable one flakey test
This one annoys the living fudge out of me, and I've never seen it
fail in earnest.
2021-09-24 20:41:09 +02:00
Fabian Homborg
f4c8dc72a7 docs: Some minor stuff in fish_for_bash_users 2021-09-24 20:32:29 +02:00
Fabian Homborg
615e8b2e8b docs: Expand section on heredocs
This should give a better rationale for why fish doesn't have them.
2021-09-24 20:29:57 +02:00
Aaron Gyes
5fc9a3c31e exec.h: remove unused declaration 2021-09-24 09:30:25 -07:00
Aaron Gyes
c077230b11 .clang_tidy: turn off cert-dcl21-cpp, add some others.
cert-dcl21-cpp is pretty bogus, doing as it says can force a copy.

https://reviews.llvm.org/D33531

Turn on some good ones.
2021-09-24 09:30:25 -07:00
Fabian Homborg
38f20f445b tests/tmux: Do actually loop 25 times 2021-09-24 18:27:14 +02:00
Fabian Homborg
6c8b0a1245 Reapply -F
This was forgotten in a40a35cc52.

Sorry!
2021-09-24 18:25:27 +02:00
Fabian Homborg
113e91ab9a Use a local variable
Otherwise this is annoying on upgrade
2021-09-24 18:17:49 +02:00
Fabian Homborg
5f5bd03911 functions/ls: Work around Terminal.app not setting $COLORTERM
Fixes #8309
2021-09-24 18:15:48 +02:00
ridiculousfish
0562e599a6 isolated-tmux to more reliably initialize and other fixes
Prior to this change, tmux based tests would call 'isolated-tmux' which would
initialize tmux on first call, an admitted "evil hack." Switch to requiring
an explicit call to 'isolated-tmux-start' which then defines 'isolated-tmux'
and other functions. Add some loop-until-prompt logic into
'isolated-tmux-start'. This improves reliability of the tmux tests on systems
under load; at least it makes the tests pass in the background on my Mac.

Remove the '$sleep' variable, to be replaced with 'tmux-sleep'.
2021-09-24 08:07:17 -07:00
ridiculousfish
13fd3f7a76 Pass in variables directly to screen_t::update
This fixes a TODO. No functional change.
2021-09-23 10:32:55 -07:00
ridiculousfish
8878672014 Switch screen.h free functions to member functions on screen_t
Refactoring only, no functional change here.
2021-09-23 10:32:54 -07:00
ridiculousfish
26f3cee86c History variable expansion to use passed-in vars
This eliminates a call to principal_parser.
2021-09-23 10:29:34 -07:00
Fabian Homborg
45714eb29d Add function scope to read as well
Fixes #8295.
2021-09-23 17:12:37 +02:00
Fabian Homborg
8b093e2651 Remove guessed_emoji_width
Just guess anew when it's not set.

(this still uses the value of $fish_emoji_width, but clamped to 1 or 2
- we could also guess if it's an unusable value, but that's a
different issue and tbh this variable is becoming less and less useful
as time moves on and things move to the new widths by default)

Fixes #8274.
2021-09-23 15:31:05 +02:00
Fabian Homborg
07e512ecd8 completions/git: Treat T files same as modified
This is weirdly undocumented (as of git 2.33.0), but `git status` prints a "T" state if
the file has its "T"ype changed, e.g. from a regular file to a symlink.

For our purposes that's just another kind of modification.

Fixes #8311.
2021-09-23 15:23:43 +02:00
Fabian Homborg
bb115c847e Handle backspaces for visible width
This makes it so we treat backspaces as width -1, but never go below a
0 total width when talking about *lines*, like in screen or string
length --visible.

Fixes #8277.
2021-09-23 12:58:35 +02:00
Max Nordlund
85ea9bf781
Hide whatis database building from the user (#8310)
* Hide whatis database building from the user

It's really an internal detail, but shows up in prompts that display how many
background jobs are running.

By disowning it keeps running but won't show up in `jobs` or get killed if the user
exits the shell.

* Update __fish_apropos.fish
2021-09-23 10:59:44 +02:00
Fabian Homborg
82a809e2db Check for tputs type via cmake
Instead of testing for ncurses and netbsd.

Fixes #8087.
2021-09-23 10:41:54 +02:00
Aaron Gyes
5a685c16c5 Fix build 2021-09-21 18:33:14 -07:00
Aaron Gyes
933bb96983 remove accidental change 2021-09-21 18:26:44 -07:00
Aaron Gyes
db72a05e89 Tighten up includes, some typedefs -> using
clangd was unable to resolve some symbols
2021-09-21 18:05:53 -07:00
Aaron Gyes
b4b84f6847 builtin.cpp: don't check exit code if not a normal exit
Fixes #8308
2021-09-21 17:49:08 -07:00
Aaron Gyes
cedf9c4d90 builtin_read.cpp: include <termios.h> not "termios.h" 2021-09-21 17:49:08 -07:00
Pascal Huber
3099d7bdeb Fix man completion for BSD's mandoc 2021-09-21 12:34:21 +02:00
ridiculousfish
0a277bf8c3 cmake: Group test targets into tests folder in IDEs
This simplifies fish project as shown in IDEs. No change to command line
build systems.
2021-09-20 12:53:12 -07:00
Lia Lenckowski
1d7036d19f Add completions for cpupower 2021-09-20 17:46:15 +02:00
ridiculousfish
dc3e5a233b Generate Xcode schemes in CMake
This makes Xcode a little more pleasant, since we suppress generating a
bunch of schemes for tests.
2021-09-18 22:09:31 -07:00
ridiculousfish
971073d429 Disable posix_spawn on OpenBSD
OpenBSD has a posix_spawn implementation which fails to return ENOEXEC
on a shebangless script, causing us to fail the shebangless tests.
Disable posix_spawn on OpenBSD.
2021-09-18 14:08:18 -07:00
ridiculousfish
3ed8a57bc5 Don't use mmap for history files on OpenBSD
OpenBSD's mmap is famously unsychronized with file IO. In theory fsync
and msync can be used to synchronize but I was unable to get it to work.
Just don't use mmap for history on OpenBSD. This fixes the history merge
tests.
2021-09-18 14:08:08 -07:00
ridiculousfish
881b987934 Explicitly error when reading directories
FreeBSD will allow read() on arbitrary directories, causing fish to
produce a nonsense error. Use fstat() to check for directories before
reading.
2021-09-17 20:48:58 -07:00
ridiculousfish
9a2482557d get_hostname_identifier to not return empty hostnames
When getting the hostname to construct the legacy uvar path, if the
hostname is empty, we will create a path pointing at a directory. On
BSDs this path can be successfully open'd and we will produce errors
about invalid uvar files.
2021-09-17 11:18:39 -07:00
ridiculousfish
6db631ae88 Fix test driver on BSDs
FreeBSD at least has `realpath` without `--no-symlinks`, so the tests
cannot start. Fix this by  using the `pwd -P` trick.
2021-09-17 11:18:39 -07:00
Kid
0d8ffa8f87 Make less version check compatible with older Fish 2021-09-17 17:32:03 +02:00
David Adam
2debc68ee9 Debian packaging: drop debug package
The build hosts generate -dbgsym packages automatically with newer
versions of debhelper.
2021-09-17 21:03:24 +08:00
David Adam
64311b279d Debian packaging: drop blank postrm script 2021-09-17 21:03:24 +08:00
David Adam
e2aa254722 Debian packaging: update debhelper compat level 2021-09-17 21:03:24 +08:00
David Adam
f35b343852 Debian packaging: drop fish-common package
Splitting fish into multiple packages was what the downstream Debian
packaging does, but it provides minimal benefit to end-users installing
from the fish repositories and in some cases made it harder. The only
benefit was a slightly reduced size on disk for download repositories.

Closes #7845.

Reverts 45ae726d4f and solves #3053
through a Conflict with fish-common.
2021-09-17 21:03:24 +08:00
ridiculousfish
05fdee1be7 Continue passing -X / --no-init for less < v530
The less -F / --quit-if-one-screen option is buggy before v530. To work
around this, pass --no-init less versions older than 530.

The --no-init option was previously passed; it was removed in d15a51897d
for mouse support. Unfortunately it looks like we can't have mouse
support and --quit-if-one-screen on macOS shipped less (version 487).

It's worth fixing this because otherwise history and help is just not
printed on stock macOS.

Relevant is https://unix.stackexchange.com/questions/107315/less-quit-if-one-screen-without-no-init

Fixes #8157.
2021-09-16 18:03:03 -07:00