Cargo subcommand extensions don't provide a description in `cargo --list`,
the regex used to filter this list ignored lines without a description.
This change fixes that.
If you make a script called `foo` somewhere in $PATH, and did not give
it a shebang, this would end up calling
sh foo
instead of
sh /usr/bin/foo
which might not match up.
Especially if the path is e.g. `--version` or `-` that would end up
being misinterpreted *by sh*.
So instead we simply pass the actual_cmd to sh, because we need it
anyway to get it to fail to execute before.
For some reason, the window dimension parameters are ignored by tmux.
Not even an extra "resize-pane -x 80 -y 10" helps. So let's just drop
that assumption from our tests.
I think the auto-all-the-things here was a making this a little
hard to follow, so replace these things that will be used in printf
with what they really are. And change the * lengths to ints.
should clear up the alerts.
When the completion pager fills up all lines of the screen, we subtract
from the pager size the number of lines occupied by the prompt +
command line buffer (typically 1), so the command line is always
visible. However, we only subtract the number of lines *before* the
cursor, so on some multiline commandlines we draw a pager that is
too large for our screen, clobbering the commandline rendering.
Fix this by counting all lines.
Fixes#8509
Possibly fixes#8405
Stackoverflow's fish tag suffers from inconsistent moderation and an
annoying policy on what is allowed and what isn't.
Given that fish straddles the line between "programming" and "usage",
some fish questions would be allowed and some wouldn't, and it is
awkward for users to tell which.
So stop recommending a site that, in practice, closes user's questions
for unclear reasons.
This needs to be done for fish-site as well.
We've had at least two issues where people put their text into the
comment, making it look like they filled out nothing.
The alternative is to use Github's new YAML-based system, but tbh I'm
not feeling it.
As seen in
https://stackoverflow.com/questions/70139844/how-to-execute-custom-fish-scripts-in-custom-path-folder,
making a shebang like
#!usr/bin/fish
won't work, and will error with the default "file does not exist"
error *pointing to the file, not the interpreter*.
Detect that interpreter properly.
We might want to make this an even more specific error, but now it
says
```
exec: Failed to execute process '/home/alfa/.local/bin/borken.fish': The file specified the interpreter 'usr/bin/fish', which is not an executable command.
```
Which is okay.
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
* Rename pabcnetcclear complete
* Code clean-up
* Debug values support
* Change /Debug description
* Standardize help
* Use single quotes for --arguments
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
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.
* 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
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.
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