Commit Graph

12002 Commits

Author SHA1 Message Date
Alan Somers
3d0581d195 fish_hg_prompt should return 1 when not in a mercurial directory 2020-04-19 04:24:28 +02:00
ridiculousfish
3e8422f472 terminal_maybe_give_to_job to stop returning error on ENOTTY
Prior to this fix, if job control is enabled but stdin is not a tty, we
would return an error from terminal_maybe_give_to_job which would cause us
to avoid waiting for the job. Instead just return notneeded.

Fixes #6573.
2020-04-18 16:26:54 -07:00
Joel Kuhn
a3dfa21737 Change vi-mode tilde to toggle character case
This updates the behavior of tilde to match the behavior found in vim.
In vim, tilde toggles the case of the character under the cursor and
advances one character. In visual mode, the case of each selected
character is toggled, the cursor position moves to the beginning of
the selection, and the mode is changed to normal. In fish, tilde
capitalizes the current letter and advances one word. There is no
current tilde command for visual mode in fish.

This patch adds the readline commands `togglecase-letter` and
`togglecase-selection` to match the behavior of vim more closely. The
only difference is that in visual mode, the cursor is not modified.
Modifying the cursor in visual mode would require either moving it in
`togglecase-selection`, which seems outside its scope or adding
something like a `move-to-selection-start` readline command.
2020-04-18 14:59:37 +02:00
Jouke Witteveen
93b86bbe63 systemctl completions: Use --plain where appropriate
The --plain flag drops the '●'-glyph and generally makes the output more
suitable for automated processing.
2020-04-18 11:11:27 +02:00
exploide
8e418f5205 updated su completions 2020-04-18 10:54:06 +02:00
Jason Nader
85a8deabe9 Run fish_indent on all files 2020-04-18 10:53:11 +02:00
Delapouite
8d20748f4a doc: add section about directory history / stack
This PR also adds "See Also" section in the related commands.
2020-04-18 10:40:48 +02:00
Fabian Homborg
d2cc59dc73 github actions: Disable macOS for now
This just fails left and right. Once we've merged the pexpect stuff
and remove the too-tight tests we can try enabling it again.
2020-04-18 10:31:22 +02:00
Fabian Homborg
157469038f completions/duply: Stringify
This used a hardcoded "/bin/ls" for unknown reasons.

For one that's unnecessary, for another we don't want to parse string.

Use globs instead.
2020-04-18 10:29:18 +02:00
Fabian Homborg
6004d04da6 completions/rmmod: Stop hardcoding lsmod location
No idea what that was supposed to accomplish to begin with.

Fixes #6912
2020-04-18 10:26:55 +02:00
Johannes Altmanninger
be36c96028 alias.fish: unbreak listing aliases without backslashes
The description for an alias which already has escape sequences will
use backslash escapes for quoting; usually `string escape` can simply
quote it.  Use a regex that accepts either escaping style.
2020-04-18 09:35:33 +02:00
Johannes Altmanninger
9eb2b69a51 alias.fish: list aliases that are escaped, not quoted
Fixes #6910
2020-04-17 23:16:43 +02:00
Charles Gould
d3e720a045 docs: Use underscore in argument placeholder 2020-04-17 22:29:12 +02:00
Charles Gould
44976a5d31 docs: Remove extra colon to fix formatting 2020-04-17 22:29:12 +02:00
jeanprey
052d8d3a10 Activate untracked status in hg prompt
Correction of a typo that prevented the display of untracked status on the detailed prompt.
2020-04-16 19:18:22 +02:00
Fabian Homborg
6669240f81 Automatically lock closed issues/prs after 90 days
We've been getting a bunch of comments on old closed issues. Instead
people should create new ones.

This adds a github "workflow" that should lock closed issues/prs after
90 days, except those labelled "question".

Let's see how it works out.
2020-04-16 18:54:38 +02:00
David Adam
021679b17c completions/nc.traditional: add missing fish suffix to file
Noted in
https://github.com/fish-shell/fish-shell/pull/6873#issuecomment-614290625
2020-04-16 23:17:02 +08:00
Johannes Altmanninger
17ed8d25a4 Fix builtin "read" up-arrow search skipping first entry
Fixes #6892
2020-04-14 01:30:54 +02:00
Benjamin Kellermann
de9f4cb252 add completion for netcat
- implement the most common netcat variants on Linux
  - nc.openbsd
  - nc.traditional
  - nc/netcat tries to guess which netcat is currently used
2020-04-13 23:45:40 +02:00
Benjamin Kellermann
0a40a6d551 add completion for nmap 2020-04-13 23:45:40 +02:00
Johannes Altmanninger
1634a3b15c docs: don't quote code snippets
The added single quotes don't look great in HTML, and it's already clear
that the monospaced text is to be interpreted literally.
2020-04-13 22:56:22 +02:00
Johannes Altmanninger
671b941b52 Fix ninja target completions without the -C flag 2020-04-13 22:56:22 +02:00
exploide
82b811281d added completions for groups (coreutils) 2020-04-13 22:56:22 +02:00
Rosen Penev
d9ad5a2627 remove unreachable break statements
Found with clang's -Wunreachable-code-break

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-12 17:02:17 -07:00
Rosen Penev
6ab2da0e25 Fix -Wundef warnings
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-12 17:02:17 -07:00
Rosen Penev
ca57bcbb00 add several noreturn statements
Found with clang's -Wmissing-noreturn

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-12 17:02:17 -07:00
Rosen Penev
202fe39d34 fix unreachable code warning
Found with clang's -Wunreachable-code

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-12 17:02:17 -07:00
Jason Nader
d278ff4e45 Use the new string split --fields feature 2020-04-12 14:01:21 -07:00
Weisi Dai
07fb55d342 fish_indent: Add notes on SPACES_PER_INDENT. 2020-04-12 13:43:45 -07:00
David Adam
3bb374319a debian packaging: recommend python3-distutils for web config
Reported downstream as
https://bugs.launchpad.net/ubuntu/+source/fish/+bug/1867615
2020-04-11 22:18:31 +08:00
exploide
ee180988d1 sftp completions 2020-04-11 13:24:35 +02:00
Shun Sakai
4f60693037 Add completions for Zopfli 2020-04-11 13:13:56 +02:00
Charles Gould
8029f15f1f git prompt: better check for git stashes
When you run "git gc":

 - .git/refs/stash is deleted
 - .git/logs/refs/stash is kept intact
2020-04-10 00:22:16 +02:00
xnumad
af5a9cf88e It's wget --bind-address
Fixes typo
2020-04-09 23:49:27 +08:00
Mahmoud Al-Qudsi
c249b1f2f0 Also catch zero-index errors when indexing into a command substiution
We had previously added a more helpful error message when a literal zero
index was specified when indexing into an array. This patch extends that
coverage to cases indexing into a command substitution, e.g.

```fish
echo (printf "hello\nworld\n")[0]
```
2020-04-07 20:05:50 -05:00
Artur Juraszek
33bc2bc312 Allow unzip versions not patched by Debian to enjoy .{jar,aar} completions
A minor follow-up to #6866 (e658a88ab0).
These file types should be properly handled by other unzip flavors too,
regardless of Debian's/non-Linux Unixes' idiosyncrasies.
2020-04-07 22:47:38 +02:00
exploide
8025e80fdb new function __fish_preview_current_file to open file at the cursor in pager
bound to Alt+O by shared key bindings
created with help from @krobelus
fixes #6838
2020-04-07 22:30:05 +02:00
Johannes Altmanninger
77d33a8eb9 Ignore SIGINT and SIGQUIT in non-interactive background processes
Fixes #6828
2020-04-07 22:18:15 +02:00
Johannes Altmanninger
90f67e4009 fish_test_helper: print only blocked 64 blocked signals
Otherwise it would print "Unknown Signal" on Linux.  I didn't see an
obvious way to check signal validity, plus it hardly matters.

Also mimic the output from BSD strsignal on Linux.
2020-04-07 22:18:15 +02:00
Johannes Altmanninger
c1b2b6b7da Rename comp_empty to complete_did_insert and fix comments 2020-04-06 23:43:29 +02:00
Fabian Homborg
f0f162f07e argparse test: Tighten regex against travis' shenanigans
Travis puts the commit message in an environment variable, so if it
contains the string `_flag` this would match TRAVIS_COMMIT_MESSAGE.

That happened in ca91c201c3, so the
tests failed.

We simply tighten the regex a little more, and make a commit message
that doesn't include the string.
2020-04-06 19:57:22 +02:00
Lior Stern
ca91c201c3 Remove unnecessary string duplication in handle_flag_f.
Prevents a memory leak.
2020-04-06 19:13:48 +02:00
Thom Chiovoloni
39e0fd14eb Allow man completions on catalina if apropos is overridden
It's pretty easy to fix catalina's apropos with a small tweak, so it
would be nice if man completions worked if this is done.
2020-04-06 19:13:12 +02:00
Thom Chiovoloni
e658a88ab0 Support .jar and .aar files in unzip completions
I've been dealing with these a lot recently (android dev...), and it's
pretty annoying that unzip completions don't recognize them (They're
just zip files with a weird file extension).
2020-04-06 19:12:03 +02:00
Fabian Homborg
ff68bdceba Allow file completions for more builtins
- contains
- count (for `count *`)
- echo
- printf
- random (for `random choice`)

Fixes #6520
2020-04-06 18:59:10 +02:00
Fabian Homborg
4eccc0f6d1 true/false: Stop erroring out for arguments
For `true`, this makes uses like the

    : some description of the job &

we used to have impossible, also it's just *wrong* that true can
return something that isn't true.

For false it's not super important but it should generally be
symmetrical with true.
2020-04-06 18:56:19 +02:00
Fabian Homborg
6a721fab63 Let . and : be completed with files
For `.` it's *correct* and for `:` it literally accepts everything
2020-04-06 18:56:10 +02:00
Fabian Homborg
5dfaff4281 Make "." a builtin as well
Yeah, it's not going anywhere. This is one line in builtin.cpp vs 9
lines of script, most of which used to print an error that is never triggered.
2020-04-06 18:55:59 +02:00
Fabian Homborg
be0de5e2de Just define a ":" builtin
It's *less code* to define this as a builtin, and it's not going
anywhere. Plus it makes fish just a little more usable without share/config.fish.
2020-04-06 18:55:59 +02:00
ridiculousfish
3df05af809 Revert "Do not prevent multiple tab-completions with the same command line"
This reverts commit 41dcf84386.

This seems to have broken a lot of interactive scenarios.
2020-04-05 19:05:53 -07:00