Commit Graph

14983 Commits

Author SHA1 Message Date
Fabian Homborg
29fa8b776c themes/coolbeans: Make quotes less red
This was awkward to tell from the error color, which we want to keep red.
2021-11-28 12:50:00 +01:00
Fabian Homborg
2a1d59107f prompts/disco: Remove superfluous space from git prompt 2021-11-28 12:39:22 +01:00
Aaron Gyes
605c048fc7 add dscacheutil completions
this is the thing you use on macos to reset the DNS cache.
2021-11-27 15:23:12 -08:00
ridiculousfish
54a844b08e Clean up wildcard_has
wildcard_has was a "conservative" function which would sometimes falsely
report wildcards. Make it exact and add some tests.
2021-11-27 12:48:04 -08:00
ridiculousfish
954d0fb042 Output more information in read --nchars test
To try to track down a test failure, improve the error message.
2021-11-27 11:02:03 -08:00
Collin Styles
4a3e55f69c Don't escape tildes that come from custom completions
A completion entry like «complete -a '\\~'» results in completions
that insert \~ into the command line.  However we usually want to
insert ~, but there is no way to do that.

There are a couple of longstanding issues about completion escaping
[1].  Until we fix those in a general way, fix the common case by
never escaping tildes when applying custom completions to the command
line. This is a hack but will probably work out fine because we don't
expect literal tildes in arguments.

The tilde is included in completions for cdh, or
__fish_complete_suffix, which simply forwards results from "complete
-C". Revert a workaround to cdh that expanded ~, because we can now
render that without escaping.

Closes #4570, #8441

[ja: tweak patch and commit message]

[1]: https://github.com/fish-shell/fish-shell/pull/8441#discussion_r748803338
2021-11-27 17:05:46 +01:00
Johannes Altmanninger
ef3ded1091 Changelog expanding command tokens for custom completion #8442
Not strictly an interactive feature but fits better here?
2021-11-27 17:05:46 +01:00
Fabian Homborg
772427d788 Coolbeans theme: Pick an option color
We should do this more
2021-11-27 13:36:22 +01:00
Emily Grace Seville
d7c62fa7d1
pabcnetcclear command completion update (#8480)
* Rename pabcnetcclear complete

* Code clean-up

* Debug values support

* Change /Debug description

* Standardize help

* Use single quotes for --arguments
2021-11-27 11:06:08 +01:00
Johannes Altmanninger
d1683958cf Expand tildes and variables in command for custom completions
A «complete -C '~/fish-shell/build/fish '» fails to load custom
completions because we do not expand the ~, so
complete_param_for_command() thinks that this command is invalid.
Expand command tokens before loading custom completions.

Fixes #8442
2021-11-27 10:14:13 +01:00
Fabian Homborg
5a71d02d32 Webconfig: Don't outright abort if curses can't be imported
We only need the curses module to look up sgr0, bold and underline
sequences.

Since those are going to be the xterm versions 90% of the time, we can
simply use those if this fails.

Fixes #8487.
2021-11-27 09:54:08 +01:00
EmilySeville7cfg
6f7b80e5b4 Use single quotes where possible 2021-11-26 17:42:34 -08:00
EmilySeville7cfg
4a696c1cc9 color command completion 2021-11-26 17:42:34 -08:00
Ilan Cosman
30400f3ced Use test command instead of bracket command 2021-11-26 16:55:50 -08:00
Kid
d28ddb9dc8 Call deno for completions 2021-11-26 16:16:55 -08:00
ridiculousfish
15ac74d233 Use new fish_run_tests target in Dockerfiles
This fixes the Xenial Dockerfile and perhaps others.
2021-11-26 13:19:59 -08:00
ridiculousfish
fecc022030 Rename the top-level test target to fish_run_tests
This keeps 'test' as an alias target. The reason is for compatibility
with CMake 3.10  and earlier, where one cannot make a target named
'test'.
2021-11-26 13:13:42 -08:00
Emily Grace Seville
8a3b5ca007
Add findstr completion (#8481)
* Add findstr completion

* Standardize completion

* Show completion only on Windows

* Use single quotes where possible

* Remove quotes where possible

* Remove OS check

* Use single quotes for --arguments
2021-11-26 19:30:43 +01:00
Emily Grace Seville
0697e09f14
Fix --shell option for adduser (#8479)
* Fix --shell option

* Fix

* Replace sed with string match

* Change regex pattern
2021-11-26 19:27:58 +01:00
Emily Grace Seville
f87395f5e9
fish_opt completion (#8433)
* Basic fish_opt completion

* Condition for -o and -r fish_opt options

* Change -g to --local

* Enhance readability

* Add  --require-parameter

* Add --no-files for -s|-l options
2021-11-26 19:26:35 +01:00
Fabian Homborg
47e45704b1
Allow set --query to check for pathvarness (#8494)
Currently,

    set -q --unpath PATH

simply ignores the "--unpath" bit (and same for "--path").

This changes it, so just like exportedness you can check pathness.
2021-11-26 18:29:10 +01:00
Johannes Altmanninger
41be9fa9fd Clarify that optional option arguments must have no separating space
Unless we use "complete --require-parameter", we must say "-w32",
not "-w 32", because the second "32" is a positional argument.

Notably, old options do not have this behavior, which is a bit weird,
see #8465

Taken from a discussion in #8459
2021-11-26 18:05:29 +01:00
Fabian Homborg
0d309b0d9e docs/for-bash-users: Some cosmetic changes 2021-11-25 21:52:03 +01:00
Fabian Homborg
5ecdcebf8d Fix help thinking some docs are commands
This looked at __fish_print_commands, which goes via our man pages to
find the commands (it shouldn't, buuut), and exludes a hard-coded list
of pages.

So we do two thigns:

1. We add the other doc pages to the list
2. We check commands *later* - if we listed something explicitly it
should be used
2021-11-25 21:25:46 +01:00
Fabian Homborg
c964edcd68 Use cat instead of ls to skip colorls
We don't really care *which*, we just want to generate some error so
we can see that the redirection worked.

Fixes #8492
2021-11-25 18:46:31 +01:00
Fabian Homborg
c71a2e573f Fix __fish_seen_argument
Fixes #8478
2021-11-23 18:12:51 +01:00
Ilan Cosman
566a673e4f Run fish_indent on all non-test .fish files 2021-11-23 09:49:45 +01:00
Johannes Altmanninger
37f385b193 completions/npm: offer package completions for "npm add" and "npm i"
Closes #8472
2021-11-23 01:13:27 +01:00
EmilySeville7cfg
7f86794881 __fish_seen_argument update:
- -p option use
- quoting simplify
- description add
2021-11-22 19:00:44 +01:00
Fabian Homborg
294ed27590 Changelog 2021-11-22 17:23:32 +01:00
Fabian Homborg
f2fd30df03
Make fish_key_reader's output simpler (#8467)
* fish_key_reader: Simplify default output

It now only prints the bind statement. Timing information and such is
relegated to a separate "verbose" mode.

* Adjust fish_key_reader docs

* Adjust tests
2021-11-22 17:22:22 +01:00
Johannes Altmanninger
084458bc47 Minor changelog updates 2021-11-21 12:03:12 +01:00
Fabian Homborg
ef33ec2f62 Keep narrow directory name around some more
What this did was

1. Find directory
2. Turn name into wcstring and return it
3. Turn name back into string for some operations

Instead, let's unglue the wcstringing from this, return the narrow
string and then widen it when we need.
2021-11-20 20:10:18 +01:00
Fabian Homborg
91ce41a2b4 Make script file error a bit more obvious
This didn't even mention that it was a script file, it was just

filename: File not found

Which would be rather confusing if e.g. someone forgot that
`--profile` requires an argument.
2021-11-20 17:44:06 +01:00
Fabian Homborg
707f042fc4 printf: Explain what couldn't be converted 2021-11-20 17:44:05 +01:00
Fabian Homborg
8391f94081 Improve error for redirections to invalid paths
This finds the first broken component, to help people figure out where
they misspelt something.

E.g.

```
echo foo >/usr/lob/systemd/system/machines.target.wants/var-lib-machines.mount
```

will now show:

```
warning: Path '/usr/lob' does not exist
```

which would help with seeing that it should be "/usr/lib".
2021-11-20 17:44:05 +01:00
Fabian Homborg
c82ce5132b Rename "rotten" to "broken" symlinks in completions as well
Now consistent again with cd - eae9ee7f35.
2021-11-20 17:44:05 +01:00
ridiculousfish
c78b7b07e7 cmake: move builtins to their own list
This separates the list of builtin sources from the list of other
sources, since it seems like a natural cleavage point. The library
structure is unchanged, it's all just one big fishlib.a.
2021-11-19 19:12:29 -08:00
Johannes Altmanninger
4657ac0a7c builtin complete: document that old-style option args can be given after =
Fixes #8457
2021-11-19 05:59:17 +01:00
Fabian Homborg
c6caa06dbe Don't use removed complete options
This was "--authoritative" (and unauthoritative). It was meant to make
fish mark everything that couldn't be generated via the completions as
an error, it was removed years ago and has been a no-op since then.
2021-11-18 19:28:57 +01:00
exploide
3a56c97087 slightly improved ansible-galaxy completions 2021-11-18 10:13:25 -08:00
Johannes Altmanninger
4c598b504f Follow include-what-you-use for our custom iswdigit()
Commit fe63c8ad3 (Shadow/override iswdigit instead of changing it at
individual call sites, 2021-10-04) added our own implementation of
iswdigit() to common.h. The "include-what-you-use" rule means that
files that use iswdigit() should now include common.h. Do that.
2021-11-18 15:06:12 +01:00
Johannes Altmanninger
9d38553384 fish_tests: format elapsed seconds with two decimal places, that's enough 2021-11-18 15:06:12 +01:00
Johannes Altmanninger
0d3d84a39c Fix typos in documentation 2021-11-18 15:06:12 +01:00
Johannes Altmanninger
0acbbfe2ca Document that a for-loop passes through any exit status
Unlike in other shells, for-loops do not set $status if
1. the loop count is zero, or if
2. the loop body consists of only commands like "set" that don't
   set $status.

POSIX for-loops always set an exit status (they set 0 if no loop
iterations). Following that would be awkward because it would add a
lot of complexity in combination with the 2 special cases above.

Document that "for" behaves the same as "set": it will pass through
existing $status, and also the last child's $status.

See the discussion in #8409
2021-11-18 15:06:12 +01:00
Emily Seville
3c4969fc38 Change "while" command title to match "for" one
Closes #8409
2021-11-18 14:54:46 +01:00
Kid
1e84164e4e Skip leading command in __fish_man_page 2021-11-17 12:50:57 -08:00
David Adam
e066715127 README: improve note on colorls 2021-11-16 21:42:07 +08:00
Kid
03f9c3d2e6 Give tests a more generic name 2021-11-16 12:06:55 +01:00
ridiculousfish
a47f498516 Correct syntax highlighting for variables spanning multiple lines
A variable may be broken across multiple lines with a backslash, for
example:

     > echo $FISH_\
       VERSION

Teach syntax highlighting about this line breaking. Fixes #8444
2021-11-15 23:04:45 -08:00