Commit Graph

13329 Commits

Author SHA1 Message Date
David Adam
f396a43280 debian packaging: drop recommendation for distutils
No longer required since 9de809ee98
2020-11-29 20:05:41 +08:00
Johannes Altmanninger
7da93e2617 builtin functions: don't mix up multiple arguments
This regressed in 2e38cf2a which is contained in 2.6.0.

Fixes #7515
2020-11-29 06:35:02 +01:00
Johannes Altmanninger
4ed22246c3 completions/gem: do not execute completion description 2020-11-29 06:07:00 +01:00
Johannes Altmanninger
79df29e8fd Remove some dead functions in the highlighter
These are replaced by "visit" methods.
2020-11-29 05:59:16 +01:00
Johannes Altmanninger
7c7eac1182 fixup! docs: use monospace for inline code snippets more consistently 2020-11-29 05:59:16 +01:00
Fabian Homborg
9de809ee98 webconfig: Remove LooseVersion
This writes super cheesy version checking, but allows us to remove
distutils.

Fixes #7514.

Hat tip @zanchey for the check.
2020-11-28 16:12:21 +01:00
Fabian Homborg
eb517e0bdd webconfig: Determine if we're termux without distutils
Just copy that "find an executable" code we already have,
the one that was commented with "oh, btw, distutils.spawn.find_executable is bad",
and use it here as well.

Work towards #7514.
2020-11-28 16:11:09 +01:00
Mahmoud Al-Qudsi
aa0bfa0eb8 Minor cleanup
clangd needs to respect clang-format files when inserting headers up
top.

[ci skip]
2020-11-28 01:00:27 -06:00
Mahmoud Al-Qudsi
a3cb1e2dcd Fix setting terminal title after fg
The code to override the `(status current-command) was present`, but not
handled in either the default `fish_title` function or the fallback.

Closes #7444.
2020-11-28 00:56:10 -06:00
Fabian Homborg
9bcfa851c1 CHANGELOG math --base
[ci skip]
2020-11-27 19:50:04 +01:00
Fabian Homborg
7e9b1f871b CHANGELOG: Use :issue: role
[ci skip]
2020-11-27 19:48:58 +01:00
Fabian Homborg
27039ed46f docs: Double-up "`"
Otherwise sphinx complains "WARNING: Inline emphasis start-string without end-string"

[ci skip]
2020-11-27 19:46:18 +01:00
Fabian Homborg
5872f4522d math: Add --base option
Currently a bit limited, unfortunately printf's `%a` specifier is
absolutely unreadable.

So we add `hex` and `octal` with `0x` and `0` prefixes respectively,
and also take a number but currently only allow 16 and 8.

The output is truncated to integer, so scale values other than 0 are
invalid and 0 is implied.

The docs mention this may change.
2020-11-27 19:33:27 +01:00
ridiculousfish
30c7a17302 Set tty to shell mode before running fish_prompt
Prior to this change, we would run fish_prompt and then afterwards set
the shell modes. For users with an initially slow prompt, this would
mean that characters would be echoed to the tty until after the prompt
completes.

Reorder these so that we set the tty mode first. This implies we will
run the prompt in shell mode, but this was already the case up until
2a3677b386.

Fixes #7489. Note that the prior commit e0cedd4ad2 is also necessary
here, as that fixed an extra prompt execution.
2020-11-26 16:47:08 -08:00
ridiculousfish
e0cedd4ad2 Remove exec_prompt call from read_push
This prompt execution does not appear to be necessary, and spoils the
upcoming fix for #7489
2020-11-26 16:38:33 -08:00
ridiculousfish
a434ec0e19 Remove '--import' from regex string match tests
The '--import' flag was used for importing named capture groups, but it
was decided to always import them unconditionally. This flag was causing
the tests to fail.
2020-11-26 16:27:57 -08:00
Mahmoud Al-Qudsi
962ff26b92 Add named capture groups to changelog 2020-11-26 14:41:31 -06:00
Mahmoud Al-Qudsi
f172b215cf Add documentation for regex import 2020-11-26 14:41:31 -06:00
Mahmoud Al-Qudsi
edb7897b4d Add tests for regex variable import 2020-11-26 14:41:31 -06:00
Mahmoud Al-Qudsi
5ddafb3b79 Add support for importing named regex matches
The new commandline switch `string match --regex --import` will import
as fish variables any named capture groups with the matched captures as
the value(s).
2020-11-26 14:41:00 -06:00
Mahmoud Al-Qudsi
282fb14dcf Get rid of magic numbers in report_match() result
Replace with a class-local `enum class` instance.
2020-11-26 14:38:04 -06:00
Fabian Homborg
a14e64ed6c math: Don't override errors with "unexpected token"
As always, we want to give the most specific error we can.

Fixes #7508
2020-11-26 12:41:19 +01:00
Fabian Homborg
903a9fbf0c math: Don't match longer function names
The comparison here is a bit naive, so "n" matches "ncr", so
technically

   math 'n(2, 3)'

is equivalent to

   math 'ncr(2, 3)'

Work towards #7508.
2020-11-26 12:37:09 +01:00
Fabian Homborg
6d98939445 Fix Littlecheck's diff-matcher
Unfortunately the previous solution was too naive and misidentified
some errors.

In essence, passing regex-source couldn't work, because those could
not match any other line, so we have to inject regex-matching into the
SequenceMatcher.

Through awful hackery, this is possible.

Updates littlecheck to 0f6841bbc1674e89f512b5f19d1ad4e0227d2934.
2020-11-25 17:23:29 +01:00
Marcel Hellwig
c7dc2c5a58 add completion for icdiff
icdiff is a diff command that uses colors by default and is an advances
version of the original diff command

https://github.com/jeffkaufman/icdiff
2020-11-24 19:25:51 +01:00
Milan Zink
f1a5fa82a0 Adding 'dnf versionlock' completions 2020-11-23 21:34:07 -08:00
ridiculousfish
58e74aa38b Add 'bionic-tsan-clang' Dockerfile test
This more closely matches the 'ubuntu-threadsan' environment on GitHub CI.
2020-11-23 21:00:15 -08:00
ridiculousfish
a6383002c3 Introduce Docker-based build and test environments
This is the start of an effort to make it easier to build and run tests in
various Linux environments. The idea is to reduce our reliance on CI and
also allow an easy to way capture tricky environments like musl or gcc 5.

This adds two initial Dockerfiles corresponding to Ubuntu Bionic, and
Ubuntu Bionic with Thread Sanitizer enabled. It also adds a new script
`docker/docker_run_tests.sh`. An example of usage:

    docker/docker_run_tests.sh docker/bionic-tsan.Dockerfile

When run, this builds a Docker image (which is cached after the first
build) and sets its entry point to a new script `fish_run_tests.sh`. It
then launches a container with that image, with a directory `/fish-source`
bound to the fish-shell source directory on the host. Note it is a bind
mount, not a copy, so changes to host files are instantly visible inside
the container. It then configures with CMake and runs the tests.

The Docker user is `fishuser` with password `fish`.

The script also supports two arguments `--shell-before` and
`--shell-after`. These drop the user into a bash shell before (or after)
the tests are run, to aid in debugging.

Note there's no automation for invoking this script yet; it must be run
manually. But it runs on both Mac and Linux!
2020-11-23 20:08:36 -08:00
ridiculousfish
d129ee00a1 Don't compile fish_test_helper with thread sanitizer
Certain TSan versions will modify the blocked signal mask on startup, which
breaks fish's test that it correctly blocks certain signals on nohup.
2020-11-23 19:38:03 -08:00
ridiculousfish
1d2dd3975a Add fix for #7483 to changelog 2020-11-23 19:38:03 -08:00
ridiculousfish
7c4891407f Remove restore_attrs from terminal_return_from_job_group function
Previously this parameter was used to more-eagerly restore the terminal
mode. This was the basis for #2214. However now we restore the mode
from the reader instead, so we can remove this unused parameter.
2020-11-23 19:36:55 -08:00
ridiculousfish
5f16a299a7 Use external mode for term when running key bindings
Prior to this fix, when key binding is a script command (i.e. not a
readline command), fish would run that key binding using fish's shell
tty modes. Switch to using the external tty modes. This re-fixes
issue #2214.
2020-11-23 19:36:39 -08:00
ridiculousfish
21e2b39fa8 Add a sleep to bind.py
With the upcoming fix to place the tty in external-proc mode, add a sleep
which resolves a race between emitting a newline and restoring it to shell
mode.
2020-11-23 19:36:39 -08:00
ridiculousfish
db514df95b Stop setting tty back to shell mode when a fg proc completes
Prior to this change, when a process resumes because it is brought back
to the foreground, we would reset the terminal attributes to shell mode.
This fixed #2114 but subtly introduced #7483.

This backs out 9fd9f70346, re-introducing #2114 and re-fixing #7483.
A followup fix will re-fix #2114; these are broken out separately for
bisecting purposes.

Fixes #7483.
2020-11-23 19:36:39 -08:00
ridiculousfish
e9b683dee1 Refactor how inputter handles script commands
Prior to this change, for bindings which have script commands, the
inputter would execute them directly. However an upcoming fix for #7483
will require more integration with the reader. Switch to a new model where
the reader passes in a function to use for executing script commands.
2020-11-23 19:36:39 -08:00
ridiculousfish
994f95b845 Move inputter_t private bits to the bottom of the class
Just a reorganization to clarify what parts are the interface.
2020-11-23 19:36:39 -08:00
ridiculousfish
050a211838 Clarify the role of the 'in' param in inputter_t constructor 2020-11-23 19:36:39 -08:00
ridiculousfish
48c50d202b Save a string allocation in expand_arguments_from_nodes
This function is called a lot; we can save a little bit of memory here.
2020-11-23 19:36:39 -08:00
Fabian Homborg
9b3f4faa5a CHANGELOG: Use :issue: role 2020-11-22 16:47:44 +01:00
Fabian Homborg
f8289d69d8 docs: Add a :issue: role and use it in the CHANGELOG
This allows us to write the changelog reasonably simply.

The biggest downside is that pandoc won't be able to handle it anymore
when converting to markdown, but
sphinx-markdown-builder (https://github.com/codejamninja/sphinx-markdown-builder)
should be able to handle it.
2020-11-22 16:47:44 +01:00
Fabian Homborg
2e55e34544 Reformat 2020-11-22 14:39:48 +01:00
Fabian Homborg
e30f661867 CONTRIBUTING: Simplify a bit
Add a "General" section and a short summary at the beginning.

[ci skip]
2020-11-22 14:35:56 +01:00
Fabian Homborg
47ddb6d516 Update littlecheck
This lets littlecheck "diff" the given output with the checks, leading
to easier to understand errors.

E.g. changing some random lines in andandoror.fish yields error output
like:

```
Testing file checks/andandoror.fish ... Failure:

  The CHECK on line 36 wants:
    if test 4 ok

  which failed to match line stdout:9:
    if test 3 ok

  Context:
    [...] from line 17 (stdout:6):
    true && false || true: 0
    if test 1 ok
    if test 2 ok
    if test 3 ok <= no check matches this, previous check on line 35
    if test 4 ok
    0 0 0
    1 1 1
    2 2 2
    3 3 3 <= does not match CHECK '3 5 3' on line 55
    4 4 4
    0
    1
    [...] from line 126 (stdout:33):
    0
    0
    0
     <= nothing to match CHECK 'banana' on line 135

  when running command:
    ../test/root/bin/fish checks/andandoror.fish
```

This updates littlecheck to b9c24a3.
2020-11-22 11:28:12 +01:00
Mahmoud Al-Qudsi
6c8c8bf819 [zfs] Dynamically complete possible zfs property values
Use the man pages to dynamically generate possible completions for `zfs
set property=` payloads.

[ci skip] // Does that even work for GitHub actions?
2020-11-21 11:05:00 -06:00
Akatsuki Rui
df4114fb93 homectl.fish: fix Expected argument for option a
And a mistake space in description

[ci skip]
2020-11-20 23:08:50 +01:00
Mahmoud Al-Qudsi
3699e50e00 Explicitly check for KERN_PROC_PATHNAME
While FreeBSD, DragonflyBSD, and NetBSD have KERN_PROC_PATHNAME,
OpenBSD does not.
2020-11-20 15:49:57 -06:00
Mahmoud Al-Qudsi
01f239188d [zfs] Limit snapshots to spelled-out dataset
Use the `-d` parameter to `zfs list` to limit snapshots to the dataset
named in the current token being completed. Thanks to @Debilski for the
tip.

Closes #7472
2020-11-20 15:28:19 -06:00
Mahmoud Al-Qudsi
be78e9dc28 fixup! Unify handling of BSD systems where applicable 2020-11-20 15:06:19 -06:00
Mahmoud Al-Qudsi
06f1b34553 Correct reporting of setpgid (parent vs child)
Previously, it always said "own process" (e.g. child error).
2020-11-20 14:22:42 -06:00
Mahmoud Al-Qudsi
e4c052330f Handle ESRCH from setpgid(2) on FreeBSD 2020-11-20 14:18:02 -06:00