Commit Graph

12445 Commits

Author SHA1 Message Date
Fabian Homborg
7447c8faae Also undo changes to ICRNL and INLCR
These control the disambiguation between ctrl-j and ctrl-m.

This can cause the enter key to send a ctrl-m, which programs might be
unprepared for.

(This is why you need to do `stty sane<ctrl-j>`)
2020-06-20 23:40:37 +02:00
Fabian Homborg
30eb4d8b0d Revert "Optimize lookup of colors by name"
Yeah, there's some weirdness here with ASAN that I can't reproduce locally, so we revert it for now.

This reverts commit a6efe0f0e4.
2020-06-20 22:35:14 +02:00
Fabian Homborg
40de4ef764 Color lookup: Use wcsncmp to avoid looking at garbage
The `reserve` here can, under certain circumstances, reserve more than
strictly needed.

The simple workaround is to just never look at more than we feed in.

(really what we'd *want* is to look at the length of the *color
names*, but those are wchar, so length lookup is crappy NULL-lookup)
2020-06-20 22:13:54 +02:00
Fabian Homborg
63f7f1925e git prompt: Simplify "staged" logic
This had this weird "pass along the sha, then check" logic to it which
is entirely unnecessary.

This function just says when something is staged, nothing more. Why
that is you can figure out for yourself.

This makes it easier to call this function, and it no longer prints an
empty line if nothing is staged.
2020-06-20 21:47:19 +02:00
Mahmoud Al-Qudsi
a6efe0f0e4 Optimize lookup of colors by name
This was profiled to be a hotspot during startup. The usage of
wcscasecmp in a loop caused repeated transforms to lowercase, which is
incredibly slow for wide characters.
2020-06-20 13:57:24 -05:00
Fabian Homborg
d8e5dfbb51 completions/dnf: Only offer the packagename
Removing the extraneous cruft.

Really, this should just be using its database properly.

Fixes #7118.
2020-06-20 19:56:33 +02:00
Fabian Homborg
197d615cc8 git prompt: Minor cleanup 2020-06-20 19:01:27 +02:00
Fabian Homborg
4186d840db git prompt: Simplify some helper functions 2020-06-20 19:01:27 +02:00
Fabian Homborg
73c0fa03b8 git prompt: Also repaint correctly if use_informative_chars is set 2020-06-20 19:01:27 +02:00
Oscar Tin Lai
eb4f86710d
Add support for git-* command auto-completion (#7075)
* add support for git custom command completion

* small fixups

* remove autogenerated path from sourcing git-* completions
2020-06-20 18:35:10 +02:00
wayou
424e658d16 Add completions for deno 2020-06-20 18:31:57 +02:00
Mahmoud Al-Qudsi
f2d5f95396 Merge sigint_checker_t generalizations from #7060
This makes it possible to expand the signals checked by the type. I can't merge
the sigttin fixes for #7060 yet because they introduce new breakage, but this
will make merging any future fix easier.
2020-06-20 11:27:15 -05:00
Daniel Bengtsson
dd1a26588a Fix long description in completion.
Simplify the description, I think it's sufficient like this.

Fixes: #6981
2020-06-20 18:18:45 +02:00
Daniel Bengtsson
b8d0de1b88 Typo.
Replace the tabulation by space.
2020-06-20 18:17:11 +02:00
Fabian Homborg
ee0d13a552 completions/set: Stop "hiding" dunder-prefixed variables
This was intended to stop showing the user "unimportant" variables,
but it just didn't complete them entirely, even if the current token
starts with a dunder (or `fish` of all things!).

Because completions sort `_` last, let's just complete these always
and let the user filter them.
2020-06-20 09:51:29 +02:00
Fabian Homborg
894ec3dfd4 fish_git_prompt: Always allow for displaying stashstate
This wasn't added to the prompt status order, so it was computed and
then not used for the informative prompt.

We still check later if we should compute it, so this is harmless if
showstashstate is unset.

Fixes #7136.
2020-06-20 09:33:04 +02:00
Fabian Homborg
92b987145e Disable macos tests on github again
Yeah, just *much* too slow to not be super flaky.
2020-06-19 23:13:21 +02:00
Fabian Homborg
c5f06cde82 docs/string: Fix match examples
One was just cosmetic (too many \\), one was actually broken because
it had duplicated `{{`, possibly resulting from the doxygen conversion?

[ci skip]
2020-06-19 21:23:51 +02:00
Fabian Homborg
e9e23a8333 Force some terminal modes even for external commands
In #7133, neovim crashing caused "OPOST" to be turned off, which
caused a weird staircase display.

So we just force a set of settings that don't seem useful to change to
avoid breaking the terminal with something like that.

Fixes #7133.
2020-06-19 21:09:08 +02:00
Fabian Homborg
56a9e698d0 Github Actions: Work around macos codesigning
We can't use gettext and we won't use system pcre2.
2020-06-18 17:27:07 +02:00
Fabian Homborg
89622eb6f3 Github actions: Try macos again
This might possibly use pexpect
2020-06-18 17:20:27 +02:00
Fabian Homborg
298073f08c github: Use pexpect 2020-06-18 17:10:09 +02:00
Fabian Homborg
de981aafb7 travis: Remove expect 2020-06-18 17:08:10 +02:00
Fabian Homborg
a121833e88 argparse: Only print stacktrace when it's an error in argparse usage
A broken/missing optspec or `--` is a bug in the script using
argparse, an unknown option or invalid argument is a bug in using that script.

So in the former case print a stacktrace, because the person writing
the `argparse` call is at fault, in the latter don't.

Fixes #6703.
2020-06-17 20:05:48 +02:00
Fabian Homborg
4660be372a Only disable title in emacs "term"
There's more than one emacs terminal (for some reason), and term is
the most broken one and can't even handle a title.

Fixes #7122.
2020-06-17 16:48:13 +02:00
Fabian Homborg
00f7cdae62 tests: Don't send \cA
Breaks the tests in screen.

Fixes #7111.
2020-06-17 15:55:31 +02:00
Fabian Homborg
547f649797 docs: Slight reword of argparse's optional argument section
[ci skip]
2020-06-17 15:36:50 +02:00
David Adam
bc68ada893 fish.spec: drop _docdir entirely
The _docdir and _pkgdocdir macros are too variable between systems, and
the CMake macros do not use them at all; define the path directly.
2020-06-17 20:59:17 +08:00
Gokul
dde7ee9c7d Add completions for github's gh tool 2020-06-17 20:27:20 +08:00
David Adam
897bd62adf fish.spec: use _docdir macro more reliably
_pkgdocdir contains the version on some platforms but not others.
2020-06-16 07:09:39 +08:00
David Adam
b1b5f5f0ba fish.spec: drop fish-internal mandir, already included elsewhere
Fixes "File listed twice" warnings.
2020-06-16 07:09:39 +08:00
Gokul
9b10636824 Make completion descriptions for feh shorter
Strikes off feh in #6981.
2020-06-15 21:55:47 +08:00
David Adam
7838b47e6b docs: formatting fixes in initialization section 2020-06-15 21:46:20 +08:00
David Adam
5dd7944d0b faq: add SSH/SFTP/SCP interactive guard suggestions
See #2160, #2405, #3742, #4432 & #4745, among others.
2020-06-15 21:46:20 +08:00
Fabian Homborg
c88e66199d CHANGELOG: Document pexpect dependency
[ci skip]
2020-06-14 19:30:03 +02:00
Fabian Homborg
52a6574751 tests: Use status dirname 2020-06-14 19:30:03 +02:00
Fabian Homborg
c7efe46e0b README: The gettext command is no longer required
`_` is now a proper builtin, so we don't spuriously call out to gettext.
2020-06-14 19:30:03 +02:00
Fabian Homborg
deb816c91c README: Mention python3 and pexpect for the tests
Technically the script tests could probably be run with 2.7, but the
README doesn't need to be that exhaustive.

[ci skip]
2020-06-14 19:30:03 +02:00
Shun Sakai
ffaf969e6e Add completions for apk-tools
Completion of options for each subcommand is not implemented.
2020-06-14 19:23:49 +02:00
Maciek Borzecki
47200a8abf completions/snap: workaround snap interfaces deprecation notice
The `snap interfaces` command prints out a deprecation notice to stderr. This breaks the completion
support for interfaces, connect and disconnect commands like so:

```
$ snap connect <TAB>error: no interfaces found
error: no interfaces found

...
'snap interfaces' is deprecated; use 'snap connections'.

'snap interfaces' is deprecated; use 'snap connections'.

'snap interfaces' is deprecated; use 'snap connections'.
error: no interfaces found
error: no interfaces found

'snap interfaces' is deprecated; use 'snap connections'.
```

Ultimately, the snap command completion should switch to `snap connections`. However, for now try to
workaround the notice by redirecting stderr.

Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
2020-06-14 19:22:37 +02:00
Shun Sakai
991389603c Add completions for xxHash 2020-06-14 19:22:01 +02:00
Fabian Homborg
e0f5fc2cb4 Remove some leftover test files 2020-06-13 20:43:12 +02:00
Fabian Homborg
cfa2927610 pexpect: Show last 10 lines on failure
This was sometimes slightly annoying in porting.

5 is enough most of the time, 10 should be enough basically always,
without being too annoying if you don't need it.
2020-06-13 19:53:21 +02:00
Fabian Homborg
aa7316b6c6 checks/read: Print maximum if we fail to read it
Debugging here is a bit difficult.
2020-06-13 19:53:21 +02:00
Fabian Homborg
87876f19a7 srht builds: Switch to pexpect
Alpine uses pip, also needs an explicit "python3" now.

FreeBSD requires an explicit "py37" apparently. Blergh.
2020-06-13 19:52:47 +02:00
Fabian Homborg
87a1e4f8b9 Remove expect
This should remove the last bits of expect from the codebase.
2020-06-13 19:28:42 +02:00
Fabian Homborg
c6dffa226f Port history test to pexpect 2020-06-13 19:24:36 +02:00
Fabian Homborg
5478d979a0 pexpect: Consume color sequences in expect_prompt
We typically use TERM=dumb, but in some cases we need actual cursor
and color stuff.
2020-06-13 19:18:12 +02:00
Fabian Homborg
51e3258dbe Port histfile test to pexpect 2020-06-13 18:53:01 +02:00
Fabian Homborg
25a73a77bb Unset X-bit on tests
These files are not expected to be run directly.
2020-06-13 16:18:17 +02:00