Commit Graph

14919 Commits

Author SHA1 Message Date
Fabian Homborg
a4983af94d docs: Fix section level
Using "=====" makes it an entry in the toc
2021-10-29 17:01:48 +02:00
Fabian Homborg
5c6c405b9e Cache if tracing is enabled
Like the comment said: That var lookup was kind of expensive.

So we simply use variable dispatch like we do for countless other things.
2021-10-28 19:39:30 +02:00
ridiculousfish
e89bd95d58 Mild refactoring of wait handles 2021-10-28 10:37:43 -07:00
ridiculousfish
b9a95a48b4 Test that --on-job-exit functions run even if the job has already exited
If you define a function that you want to be called after a job has
exited, it should run immediately if that job has already exited.
2021-10-28 10:02:48 -07:00
Fabian Homborg
357f49c781 Revert "Use unescape_string_in_place"
This reverts commit 2ef8a9c1af.

This doesn't work everywhere, not sure why.
2021-10-28 18:09:25 +02:00
Fabian Homborg
292c9d5381 Force uselocale if glibc is in use
For some reason on a current glibc 2.33, the configure check fails.
The man page says we'd have to define XOPEN_SOURCE>=700, but I don't
want to do that since it changes a bunch of other things, and it
didn't work in my tests.

So we just force it, since we know it works (since glibc 2.3).

This is a performance difference of ~20% for printf, so it's a
reasonably big deal.
2021-10-28 17:54:35 +02:00
Fabian Homborg
2ef8a9c1af Use unescape_string_in_place
We already get a copy, so we might as well just use it.
2021-10-28 17:32:52 +02:00
Fabian Homborg
8428247f31 docs: Split up the variable docs some more
(also remove some broken or incorrect footnotes)
2021-10-28 16:48:08 +02:00
Fabian Homborg
387904928b docs: Add more on wordsplitting 2021-10-28 16:42:19 +02:00
Fabian Homborg
ae3d5af1ab docs: Correct an example 2021-10-28 16:35:21 +02:00
Fabian Homborg
c3e8f5bc02 CHANGELOG 2021-10-28 16:32:58 +02:00
Fabian Homborg
31d6abb177 Don't fire variable set event before entering a for-loop
Since #4376, for-loops would set the loop variable outside, so it
stays valid.

They did this by doing the equivalent of

```fish
set -l foo $foo
for foo in 1 2 3
```

And that first imaginary `set -l` would also fire a set-event.

Since there's no use for it and the variable isn't actually set, we
remove it.

Fixes #8384.
2021-10-28 16:32:58 +02:00
exploide
1db25c9b31 updated systemd-analyze compltions for systemd 248 2021-10-28 16:12:31 +02:00
Aaron Gyes
575decc35b also not a thread id: nullptr 2021-10-28 02:14:29 -07:00
Aaron Gyes
362319d25f Cleanup on aisle haphazard-everywhere 2021-10-28 01:47:49 -07:00
Fabian Homborg
75d252dadc
CHANGELOG: Move code block where it belongs 2021-10-28 09:10:12 +02:00
ridiculousfish
3848a68e5c Fix a misspeeling 2021-10-27 14:16:32 -07:00
Fabian Homborg
bffb49b38a Explicitly mention function variables don't go out of scope
Fixes #8385.
2021-10-27 16:55:11 +02:00
Fabian Homborg
6941c94c4a
cd: Set var via the string
This was meant to trigger the wcstring_list_t overload by constructing one with `{norm_dir}`. Older gcc can't figure out what to do.

So instead we use the wcstring overload for now.
2021-10-27 10:20:14 +02:00
Aaron Gyes
91a048596b sphinx: enable proper quotes with the smartquotes module
turn off the option for em-dashes.
2021-10-26 10:46:06 -07:00
Fabian Homborg
2b8fe280e0 tests: Switch emoji used
widechar_width no longer classifies U+1F41F as widened-in-9, so the
width no longer changes.

Since we're interested in testing the change here, we need a different
emoji.

Just use 🥁, which was introduced in 9 as wide, and therefore widened
in 9.
2021-10-26 18:30:43 +02:00
Fabian Homborg
f1fe6a5e94 Update widechar_width to Unicode 14
Generated with f438dbf6c4648ec94e154d2e475a3052370ea218
2021-10-26 18:26:25 +02:00
Fabian Homborg
973739e329 Move CHECKS in loop-test to where they are matched 2021-10-26 17:38:40 +02:00
Fabian Homborg
76f3564e2a Remove now unused out_events parameter 2021-10-26 17:38:40 +02:00
Fabian Homborg
0c3c3eaa99 Reuse the variable event for for-loops
This used to construct a vector, which was then passed down and filled
with a new event_t each go around the loop. That's useless - we fire
one event here, and it's simply the variable event.

This reduces the overhead of a for-loop by ~10%:

```fish
for i in (seq 100000)
    true
end
```

runs in about 90% of the time now.
2021-10-26 17:38:35 +02:00
Fabian Homborg
452675d458 Use set_vars_and_fire where possible
This just did the same thing manually.
2021-10-26 17:33:36 +02:00
Fabian Homborg
da201ee8ac Let parser::set_var_and_fire fire the event directly
The vector here gives us *nothing*
2021-10-26 17:33:27 +02:00
Fabian Homborg
d9f094db1a Check if the for variable is invalid before trying to set it 2021-10-26 16:59:03 +02:00
ridiculousfish
e84dad5432 Rationalize null handling in disown_job
disown_job had some extraneous null checks that could not happen in
practice. Simplify this code.
2021-10-25 16:13:00 -07:00
ridiculousfish
ec244c3975 Add tests for dynamically invoked break and continue 2021-10-25 12:43:30 -07:00
ridiculousfish
cb79548c49 Revert "break/continue: Stop checking if it's in a loop again"
This reverts commit 61cd05efb0.

It is true that we detect break and continue errors statically, but they can
still be invoked dynamically, example:

    set sneaky break
    $sneaky # dynamically breaks from the loop

or just `eval break`.

A followup commit will add tests for this.
2021-10-25 12:42:53 -07:00
Fabian Homborg
61cd05efb0 break/continue: Stop checking if it's in a loop again
This is already checked in the parse_util_detect_errors (and might
actually be done in the ast - that's where we check "end")
2021-10-25 18:57:10 +02:00
Fabian Homborg
c444ee2e6a benchmarks: Add globbing 2021-10-25 18:42:18 +02:00
Fabian Homborg
18bb5f1f7e builtin_count: Remove superfluous L'' prefix
(not sure if this broke anything anywhere, but since we're comparing
an actual char* we should use '' without the L)
2021-10-25 18:40:43 +02:00
ridiculousfish
a6a1879481 Remove reader_get_history
It was unused.
2021-10-24 14:17:33 -07:00
Fabian Homborg
d03ec2cc6b docs/interactive: Some rewording. 2021-10-24 21:18:31 +02:00
Fabian Homborg
479c11bc80 FAQ: Remove rarely asked questions 2021-10-24 21:18:31 +02:00
Aaron Gyes
e30b6c47f0 Adjust the GitHub thread locker script.
Set locked thread inactivity count to default 365.

Add 'needs more info' as an obvious on its face exception.

The default seems quite an inconventient, very strict thing t do:
it will lock threads that are closed and quiet because they have
been quiet and closed. This seems to make it hard to talk about
issues after they are closed or contribute. I can as a fish-shell
contributor, but that's not really the point.

Practically, right now to reply to any PR or any issue fixed in
July, well you can't.
2021-10-24 04:50:25 -07:00
Aaron Gyes
a7e62a538e Revert "Swap file size and file type description position in pager"
This reverts commit d8722a3ddf.

I underestimated the value of having the file sizes easier to
eyeball and compair. Back to the drawing board.
2021-10-23 22:17:09 -07:00
Aaron Gyes
d8722a3ddf Swap file size and file type description position in pager
File sizes are are always of variable length, while we there
are just a few different typrs of files. Since we right align,
this makes things look more lined up.

…ocal/bin/afsctool                (Executable, 74.0kB)
…ocal/bin/clang-format        (Executable link, 1.9MB)
…ocal/bin/clone_checker             (Executable, 33kB)
…ocal/bin/cryptest.exe              (Executable, 11MB)
…ocal/bin/cscc                      (Executable, 22kB)
…ocal/bin/cscout                   (Executable, 902kB)
…ocal/bin/csmake                    (Executable, 22kB)
…ocal/bin/cswc                     (Executable, 5.7kB)
…ocal/bin/dirb                      (Executable, 90kB)
…ocal/bin/ethminer-m1              (Executable, 4.8MB)
…ocal/bin/fork                (Executable link, 206kB)

vs

…ocal/bin/afsctool                (74.0kB, Executable)
…ocal/bin/clang-format        (1.9MB, Executable link)
…ocal/bin/clone_checker             (33kB, Executable)
…ocal/bin/cryptest.exe              (11MB, Executable)
…ocal/bin/cscc                      (22kB, Executable)
…ocal/bin/cscout                   (902kB, Executable)
…ocal/bin/csmake                    (22kB, Executable)
…ocal/bin/cswc                     (5.7kB, Executable)
…ocal/bin/dirb                      (90kB, Executable)
…ocal/bin/ethminer-m1              (4.8MB, Executable)
…ocal/bin/fork                (206kB, Executable link)
…ocal/bin/fish                     (2.4MB, Executable)
2021-10-23 15:37:43 -07:00
ridiculousfish
2ed0105692 Use std::move to populate a processes's args
This could save quite a few string copies.
2021-10-23 10:35:05 -07:00
ridiculousfish
4a6d622733 Continue to refactor functions
Now that we have immutable props, we can remove a bunch of 'helper'
functions.
2021-10-23 10:12:52 -07:00
ridiculousfish
7d7b930b08 Rename function_get_properties to function_get_props
We're calling it a lot so let's make it shorter.
2021-10-23 10:12:52 -07:00
ridiculousfish
089da2314d Eliminate function_info_t
function_info_t was the "mutable bits" of a function, like its
description. But we have eliminated all of those, so we can eliminate
the class.

No functional change here.
2021-10-23 10:12:52 -07:00
ridiculousfish
1c5208cf5c Migrate a function's description into its immutable properties
No functional change here.
2021-10-23 10:12:52 -07:00
ridiculousfish
17d9ae16be Migrate the function's is_autoload field into its immutable properties
Continuing to simplify functions. No functional change here.
2021-10-23 10:12:52 -07:00
ridiculousfish
12134c19d9 Migrate the function's definition file into its immutable properties
This never changes once initialized, so we can make it immutable. No
functional change here.
2021-10-23 10:12:52 -07:00
ridiculousfish
d904cc4964 Stop passing null function properties in testing
This allows us to assert that our functions are not null.
2021-10-23 10:12:52 -07:00
ridiculousfish
59b63f3aab Use vec_append when expanding a command into arguments
This saves some lines and some allocations.
2021-10-23 10:10:26 -07:00
ridiculousfish
a634e78633 Remove an extra use of process_type_for_command
This just duplicated a previous call above.
2021-10-23 10:07:24 -07:00