Commit Graph

16044 Commits

Author SHA1 Message Date
Fabian Boehm
0709b796bb CHANGELOG path mtime 2022-07-18 20:47:39 +02:00
Fabian Boehm
407a455cfd realpath: Use physical PWD
This was an inadvertent change from
cc632d6ae9.

Because we used wgetcwd directly before, we always got the "physical"
resolved $PWD.

There's an argument to be made to use the logical $PWD here as well
but I prefer not to make changes lik that in a random commit without
good reason.
2022-07-18 20:45:30 +02:00
Fabian Boehm
5dfb64b547
Add path mtime (#9057)
This can be used to print the modification time, like `stat` with some
options.

The reason is that `stat` has caused us a number of portability
headaches:

1. It's not available everywhere by default
2. The versions are quite different

For instance, with GNU stat it's `stat -c '%Y'`, with macOS it's `stat
-f %m`.

So now checking a cache file can be done just with builtins.
2022-07-18 20:39:01 +02:00
Wilke Schwiedop
d9ee5d3863 fix trailing comments in __fish_print_hostnames
/etc/hosts specifies, that everything after a #-character is to be
treated as a comment. The current __fish_print_hostnames however only
considers #-characters at the beginning of a line.
Thus the comment from following valid hosts-entry would end up in the
completion output:

1.2.3.4  myhost # examplecomment

getent hosts properly handles comments.
2022-07-17 17:39:58 -05:00
Aaron Gyes
e2fda67439 Adjust fish_color_search_match
Make the default more likely to be perceptible.
2022-07-17 15:20:41 -07:00
Aaron Gyes
763240f1af Just remove the dumb comment. 2022-07-17 14:41:35 -07:00
Aaron Gyes
c312d2281b
fixup 2022-07-17 14:38:35 -07:00
Aaron Gyes
198ce73db5
Update CHANGELOG for test extensions 2022-07-17 14:18:18 -07:00
ridiculousfish
fa3ca60111 Add a tmux-sleep to tmux-history-search
This test was failing often on my local Mac; this sleep seems to make it
reliable again.
2022-07-16 17:46:12 -07:00
Aaron Gyes
77f6afa501 Add testcases for [ extensions
Some sanity checks for -ot, -nt, -ef

Try negative mtime values too, there was interesting behavior
there during development.
2022-07-16 12:40:36 -07:00
Aaron Gyes
92eb6024ed Document the three new [ operators
Explain test(1)'s -ef, -nt, -ot features.
2022-07-16 12:40:36 -07:00
Aaron Gyes
a6ed9ace6a Add -ot, -nt, -ef to test completions
also complete filenames in binary cases

e.g. test path -ef path
2022-07-16 12:40:36 -07:00
Aaron Gyes
8f91ee7f6b builtin test: Implement -ot, -nt, -ef
These are non-POSIX extensions other test(1) utilities implement,
which compares the modification time of two files as proposed for
fish in #3589: testing if one file is newer than another file.

-ef is a common extension to test(1) which checks if two paths refer
to the same file, by comparing the dev and inode numbers.
2022-07-16 12:40:36 -07:00
Johannes Altmanninger
7bdc712615 Clean up weird edge-case for escaping unescaped brackets
As explained by the comment, this was dead code.  If it were ever executed,
it would cause very weird behavior because it would make some completions
randomly affect others.

Let's just print a warning (maybe this is better than crashing?).
2022-07-16 16:42:34 +02:00
Johannes Altmanninger
12cf31de96 Remove a redundant comment
Also add an issue reference since the commit message doesn't have one.
Of course a test would be even better.
2022-07-16 16:42:19 +02:00
Moheeb Aljaroudi
d4d0ac95b0 Fixed problem where fish would escape '~' when completing an unescaped
']'
2022-07-16 16:17:51 +02:00
David Adam
0f84b9fafb CHANGELOG: work on 3.5.1 2022-07-16 21:55:28 +08:00
Bagohart
e7e4d8415b added tab completions for choose
(cherry picked from commit ce6b122f7f)
2022-07-16 21:41:37 +08:00
Bagohart
9cdaf1ec72 added tab completions for navi
(cherry picked from commit 824ee5d70b)
2022-07-16 21:40:30 +08:00
Bagohart
ce6b122f7f added tab completions for choose 2022-07-16 21:40:02 +08:00
Bagohart
824ee5d70b added tab completions for navi 2022-07-16 21:36:12 +08:00
David Adam
e8cc3803ca CHANGELOG: work on 3.5.1 2022-07-14 22:25:42 +08:00
Israel Chauca Fuentes
a4f5b9eb54 Add completion for the "expect" command
(cherry picked from commit 9e43e74723)
2022-07-14 13:26:08 +08:00
Alexander M
c5240033df Fix long descriptions in gdb.fish
Work on #6981

(cherry picked from commit 8d57bc6a9a)
2022-07-14 13:26:01 +08:00
Fabian Boehm
303bf2cfcb completions/git: Use __fish_git
That's the one that silences stderr!

(cherry picked from commit 8082f8c056)
2022-07-14 13:25:51 +08:00
Kid
d3f4b829ba file completion nuances on macOS
(cherry picked from commit e6505d1c30)
2022-07-14 13:25:41 +08:00
Fabian Boehm
4c2ce4b931 Add error for EBADARCH
That's apparently errno 86 on macOS, and it's triggered when the
architecture is wrong.

I'll leave other macOS errors to the macOS users.

See #9052.

(cherry picked from commit 60f87ef3be)
2022-07-14 13:25:32 +08:00
Fabian Boehm
98838ac429 Fix special readline functions after and/or
Here we needed to handle self-insert immediately, but we ended up
returning it.

Fixes #9051

(cherry picked from commit d920610f96)
2022-07-14 12:43:12 +08:00
David Adam
62cc498e1c CHANGELOG: remove entries moved to 3.5.1 2022-07-13 23:14:25 +08:00
Fabian Boehm
e67b6c1f00 history: Refuse to merge in private mode
It makes *no* sense.

Fixes #9050.

(cherry picked from commit bd7934ccbf)
2022-07-13 23:13:33 +08:00
Fabian Boehm
1008b729a7 fish_job_summary: Format message better for multiline prompts
This was supposed to be number of lines in the prompt minus 1, but
string repeat added one.

Also it triggered even in case of the stopped job message, which is
already repainted differently.

So we add it when we need to repaint ourselves.

As a bonus add a newline before in that case so the message isn't
awkwardly printed into the commandline.

Fixes #9044.

(cherry picked from commit 80fe0a7fcb)
2022-07-13 23:12:02 +08:00
Rocka
bc30e15774 completions: add qdbus completion
(cherry picked from commit c588bd5c5c)
2022-07-13 23:10:31 +08:00
SeekingBlues
173914af65
Highlight history searches correctly (#9066)
Previously, the search text is used to find out which part of the
updated command line should be highlighted during a history search. This
approach will cause the incorrect part to be highlighted when the line
contains multiple instances of the search text.

To address this, we have to find out exactly where to highlight, i.e.
the offset of the current token in the command line (0 if not a token
search) plus the offset of the search text in the match.
2022-07-13 16:48:04 +02:00
NextAlone
1c3a8e0e11 feat: completion for reflector (#9027)
(cherry picked from commit 5642499dc2)
2022-07-13 22:21:39 +08:00
mhmdanas
970f32d87f Prioritize APKs for adb install
(cherry picked from commit 9f19ab1fba)
2022-07-13 22:20:31 +08:00
exploide
95582ef76b scp completions: added new options
(cherry picked from commit 459bbe208d)
2022-07-13 22:20:17 +08:00
Fabian Boehm
89a30841f2 printf: Print special error for invalid octal numbers
(tbh these were always a mistake)

See #9035

(cherry picked from commit 13a9f6b64e)
2022-07-13 22:18:59 +08:00
ridiculousfish
9397ede963 Clear signals after running initial commands
If you run an initial command via `fish -c`, and that command is
cancelled e.g. via control-C, then ensure that the cancellation signal
is cleared before running config files.

Fixes #9024

(cherry picked from commit 137a4ecdf5)
2022-07-13 22:18:43 +08:00
Fabian Boehm
6e9590b220 Activate fish_vi_cursor for tmux
Discussions with the tmux maintainer show that:

1. We no longer need the passthrough sequence at all (and it's
deactivated by default)
2. Tmux can check if the outer terminal supports cursor shaping

Fixes #8981

(cherry picked from commit b4a3b9982c)
2022-07-13 22:18:12 +08:00
Fabian Boehm
687a16b260 status fish-path: Remove "(deleted)" suffix
Fixes #9018.

(cherry picked from commit 6e0653af93)
2022-07-13 22:17:33 +08:00
David Adam
a396fdc907 CHANGELOG: work on 3.5.1 2022-07-13 21:42:18 +08:00
Fabian Boehm
cc632d6ae9 realpath: Use the parser's working dir
Future proofing, similar to what we do in `path resolve`.
2022-07-12 20:53:57 +02:00
Fabian Boehm
526b7e3b1b readdir_for_dirs: Actually filter out non-dirs
This function is supposed to return "the next directory". Because this
is imperfect, it only tries to.

Except it went to all the trouble of figuring out the type and then
just... returned it anyway.

This has nice speedups in globs with directory components like `*/` or
`**`. I have observed 1.1x to 2.0x.

We could also return when we know it's definitely a directory and then
skip a stat() later, but preliminary testing seemed to show that's not
worth much.
2022-07-12 16:50:00 +02:00
Aaron Gyes
dbb4e05254 Revert "PCRE2.cmake: update minimum system PCRE2 version, use GIT_SHALLOW"
This was in response to a feature we were using that required a
very new PCRE2: that was backed out.

So this reverts commit e63af7d006.
2022-07-10 12:44:35 -07:00
ridiculousfish
a9964cd6d0 Remove usage of PCRE2_SUBSTITUTE_LITERAL
We don't need this flag and this ties us to a newer version of PCRE2
than we would like. Fixes #9061.
2022-07-10 11:17:19 -07:00
Aaron Gyes
cbd0ec568c builtins/path.cpp: remove <glob.h>
I don't believe we use any system glob faciltiies.
2022-07-09 21:11:43 -07:00
Aaron Gyes
3e0f3c9f45 path.cpp: include its actual header with the prototype
path.h: fix that header so it can compile.
2022-07-09 21:04:03 -07:00
Aaron Gyes
e63af7d006 PCRE2.cmake: update minimum system PCRE2 version, use GIT_SHALLOW
GIT_SHALLOW 1 here improves generation speed and _deps in the build
dir like is 6 or 7 MB less according to `du`.

Bump the minimum PCRE2 to 10.35 on account of we use
PCRE2_SUBSTITUTE_LITERAL.
2022-07-09 20:00:53 -07:00
David Adam
c3c8cf1e01 fish.spec: depend on system pcre2 libraries on all platforms
These are now available on all supported platforms, and the download
process tends to break on build workers (where Internet access is
deliberately denied).
2022-07-10 10:43:14 +08:00
ridiculousfish
f7c411d5a5 Further cleanup of builtin_string regex matching
Take advantage of additional cleanup unlocked by this refactoring,
including eliminating unneeded error returns and simplifying some
control flow.

No user-visible behavior change expected here.
2022-07-09 16:44:12 -07:00