Commit Graph

16903 Commits

Author SHA1 Message Date
Nunzio Cicone
ced76a4576 update entr completions
(cherry picked from commit 85deb76c5f)
2023-12-29 22:32:56 +08:00
NextAlone
83185774db completion(loginctl): fix sessions with ssh or other states (#10038)
Signed-off-by: Next Alone <12210746+NextAlone@users.noreply.github.com>
(cherry picked from commit 7250e6fa6a)
2023-12-29 22:29:07 +08:00
Marcelo Mendes Spessoto Junior
6a7d93d9c5 Shortening node.fish completions
Signed-off-by: Marcelo Mendes Spessoto Junior <marcelospe@shinji.linux.ime.usp.br>
(cherry picked from commit 7534572d99)
2023-12-28 22:46:56 +08:00
Fabian Boehm
2fe8b5d313 Don't replace tilde for error messages if we have no $HOME
This was an issue with "--no-execute", which has no variables and
therefore no $HOME:

```fish
fish --no-execute /path/to/file
```

would say the error is in `~/path/to/file`.

Instead, since this is just for a message, we simply return the
filename without doing the replacement.

Fixes #10171

Port of e318585021
2023-12-28 10:20:28 +01:00
Christian Fersch
7008e0eec2 git completion: Handle aliases referencing other aliases (#9992)
(cherry picked from commit 1980a22522)
2023-12-28 11:06:04 +08:00
David Adam
8707c05b7b CHANGELOG: work on 3.7.0 2023-12-27 22:58:33 +08:00
figurantpp
7c21e9c36e Removed type declarations from node descriptions
(cherry picked from commit 5a934e7ae3)
2023-12-27 22:47:27 +08:00
David Adam
ecf8ac6f66 CHANGELOG: work on 3.7.0 2023-12-26 23:24:00 +08:00
Fabian Boehm
6df2fac132 prompt_pwd: Fix missing --
Fixes #10169

(cherry picked from commit b1a1a3b0a7)
2023-12-26 09:00:26 +08:00
Fabian Boehm
f116a81250 Make default theme use named colors only
This gives us the biggest chance that these are *visible* in the
terminal, which allows people to choose something nicer.

It changes two colors - the autosuggestion and the pager
description (i.e. the completion descriptions in the pager).

In a bunch of terminals I've tested these are pretty similar - for the
most part brblack for the suggestions is a bit brighter than 555, and
yellow for the descriptions is less blue
than the original.

We could also make the descriptions brblack, but that's for later.

Technically we are a bit naughty in having a few foreground and
background pairs that might not be visible,
but there's nothing we can do if someone makes white invisible on brblack.

Fixes #9913
Fixes #3443

(cherry picked from commit ed881bcdd8)
2023-12-25 21:31:45 +08:00
Fabian Boehm
ef43069a06 completions/pactl: Fix matching objects
This didn't work for something like `pactl set-card-profile foo
<TAB>`,
because it didn't allow for the card name, as it would just print the
index again and again.

(cherry picked from commit 5f26c56ed5)
2023-12-25 21:25:55 +08:00
elyashiv
2d1a6561e1 [tests] added test for escaped job summary
(cherry picked from commit 3fbff14e9b)
2023-12-25 19:51:33 +08:00
elyashiv
51d5764fb2 [jobs.cpp] added const to escaped cmd string
(cherry picked from commit 4a2c7e38d0)
2023-12-25 19:51:33 +08:00
elyashiv
1ab24e4048 [jobs.cpp] add escaping for job comamnd
(cherry picked from commit 4ea867bc55)
2023-12-25 19:51:33 +08:00
Fabian Boehm
f7ce49a3a9 docs: Add "Writing your own prompt" doc (#9841)
* docs: Add "Writing your own prompt" doc

* Remove a space from the "output"

* some teensy adjustments

* Address feedback

* envvar one more PWD

* More html warning

(cherry picked from commit c385027eca)
2023-12-25 19:21:16 +08:00
Rocka
8319011f24 completions: fix qdbus Q_NOREPLY method completion
(cherry picked from commit c21e13e62e)
2023-12-24 22:58:39 +08:00
David Adam
b12c36e72d CHANGELOG: work on 3.7.0 2023-12-23 23:24:45 +08:00
Fabian Boehm
c54d48f3f9 history: Allow deleting ranges
This allows giving a range like "5..7".

It works in combination with more (including overlapping) ranges or
single indices.

Fixes #9736

(cherry picked from commit 65769bf8c8)
2023-12-23 23:00:50 +08:00
David Adam
446a41e23a CHANGELOG: work on 3.7.0 2023-12-20 00:23:45 +08:00
Quinten Roets
95c3a4045b fish_vi_cursor: add new variable for external cursor mode (#9565)
* add new variable for external cursor mode

* fix backwards compatibility

* add documentation

* document change in changelog

(cherry picked from commit f5506803d7)
2023-12-20 00:06:56 +08:00
rymrg
6295e32f25 Improve fossil prompt execution time (#9528)
* Improve prompt execution time

* Change status to changes

* Remove grep/awk/sort

* Remove calls to grep/awk/sort
* Don't overwrite user defined colors

* Make look more consistent with git

(cherry picked from commit 43b1be0579)
2023-12-19 23:53:54 +08:00
David Adam
313b2993f5 Merge branch 'Integration_3.6.4' into Integration_3.7.0 2023-12-08 11:49:02 +08:00
David Adam
112178a2ac Release 3.6.4 2023-12-05 22:16:18 +08:00
Fabian Boehm
b2ef44a277 Switch test to using our printf
This test wants to generate a U+FDD2 to see it is not mishandled.

To do so, we tried to use sh, which on my system is bash and can do
`$'\ufdd2'`.

Unfortunately on other systems it might be dash, which won't do that.

Since I don't know of a good no-dependency portable way to generate
this (I dimly remember python3 being a shim on some systems, so I do
not want to invoke it here), we'll just use our own printf.

Which is a worse test, we control both parts, but it'll do.

Fixes #10134
2023-12-04 19:30:31 +01:00
David Adam
4a618f14f1 Release 3.6.3 2023-12-04 23:54:24 +08:00
David Adam
f471810408 tests: fix test for 3.6.2 changes 2023-12-04 23:53:47 +08:00
David Adam
a51437ec83 Release 3.6.2
Fix for CVE-2023-49284.
2023-12-04 23:00:02 +08:00
Fabian Boehm
09986f5563 Encode all ENCODE_DIRECT codepoints with encode_direct 2023-12-04 23:00:01 +08:00
David Adam
c0de5dd804 CHANGELOG: fix date for 3.6.1
(cherry picked from commit e2579a59ba)
2023-12-04 23:00:01 +08:00
Alex Chan
efd5db4a85 Add a missing space after a comma
(cherry picked from commit ccc8308d41)
2023-11-26 22:45:11 +08:00
Fabian Boehm
8d5d0c24aa expand_cmdsubst: Make more errors known
These printed "Unknown error while evaluating command substitution".

Now they print something like

```
fish: for: status: cannot overwrite read-only variable
for status in foo; end
    ^~~~~^
in command substitution
fish: Invalid arguments
echo (for status in foo; end)
     ^~~~~~~~~~~~~~~~~~~~~~~^
```

for `echo (for status in foo; end)`

This is, of course, still not *great*. Mostly the `fish: Invalid
arguments` is basically entirely redundant.

An alternative is to simply skip the error message, but that requires some
more scaffolding (describe_with_prefix adds some error messages on its
own, so we can't simply say "don't add the prefix if we don't have a
message")

(cherry picked from commit 1b5eec2af6)
(cherry picked from commit 67faa107b0)
2023-11-09 17:53:32 +01:00
Fabian Boehm
255653bf32 docs: Make the vendor dirs a nested list
(cherry picked from commit f81c9cba50)
2023-11-07 19:59:32 +01:00
Fabian Boehm
80000ef4d5 Document $__fish_vendor_confdirs and __fish_build_paths
Fixes #10078

(cherry picked from commit ddd9d183e2)
2023-11-07 19:59:32 +01:00
Fabian Boehm
a7b96fc4ab completions/dnf: Remove "offline-upgrade upgrade"
Fixes #10081

(cherry picked from commit 676da369b4)
2023-11-07 19:59:32 +01:00
Fabian Boehm
657c132dee docs: Fix link
(cherry picked from commit 8fea3cb56d)
2023-11-07 19:59:32 +01:00
Nicholas Rodrigues Lordello
f775ab6ef4 Additional checks for -F support
(cherry picked from commit 93b3a0c1f5)
2023-11-07 19:59:32 +01:00
Nicholas Rodrigues Lordello
66401f8575 ls No Longer Sets LS_COLORS
(cherry picked from commit 5cf36bf3f8)
2023-11-07 19:59:29 +01:00
Wadii Hajji
3444e1cbf3 fix(git): add force-if-includes completion
(cherry picked from commit 3f7fdd5693)
2023-11-07 19:58:08 +01:00
Asuka Minato
be75769564 Update find.fish
add -D and -nowarn

(cherry picked from commit 754e81afa3)
2023-11-07 19:58:08 +01:00
Fabian Boehm
572374333d docs: More on key timeout, key chord limitations
(cherry picked from commit 496fc03b98)
2023-10-24 18:27:14 +02:00
Fabian Boehm
c883d73145 Work on 3.7.0 CHANGELOG 2023-10-17 17:49:34 +02:00
Johannes Altmanninger
211a3ceee1 Copy history pager search field to command line on Enter if no match
Closes #9934

(cherry picked from commit b7f7dcf788)
2023-10-17 17:34:40 +02:00
Johannes Altmanninger
64bff1a51c history pager: delete selected history entry with Shift-Delete
After accidentally running a command that includes a pasted password, I want
to delete command from history. Today we need to recall or type (part of)
that command and type "history delete".  Let's maybe add a shortcut to do
this from the history pager.

The current shortcut is Shift+Delete. I don't think that's very discoverable,
maybe we should use Delete instead (but only if the cursor is at the end of
the commandline, otherwise delete a char).

Closes #9454

(cherry picked from commit 052823c120)
2023-10-17 17:25:11 +02:00
Eddie Lebow
e1c2a4e50c Include subsequence matches in history-pager
If a `contains` search yields no results, try again with `contains_subsequence`.

(cherry picked from commit 00692bcdfe)
2023-10-17 17:04:25 +02:00
Fabian Boehm
85c03e4b67 wildcard: Rationalize file/command completions (#10052)
* wildcard: Remove file size from the description

We no longer add descriptions for normal file completions, so this was
only ever reached if this was a command completion, and then it was
only added if the file wasn't a regular file... in which case it can't
be an executable.

So this was dead.

* Make possible_link() a maybe

This gives us the full information, not just "no" or "maybe"

* wildcard: Rationalize file/command completions

This keeps the entry_t as long as possible, and asks it, so especially
on systems with working d_type we can get by without a single stat in
most cases.

Then it guts file_get_desc, because that is only used for command
completions - we have been disabling file descriptions for *years*,
and so this is never called there.

That means we have no need to print descriptions about e.g. broken symlinks, because those are not executable.

Put together, what this means is that we, in most cases, only do
an *access(2)* call instead of a stat, because that might be checking
more permissions.

So we have the following constellations:

- If we have d_type:
  - We need a stat() for every _symlink_ to get the type (e.g. dir or regular)
    (this is for most symlinks, if we want to know if it's a dir or executable)
  - We need an access() for every file for executables
- If we do not have d_type:
  - We need a stat() for every file
  - We need an lstat() for every file if we do descriptions
    (i.e. just for command completion)
  - We need an access() for every file for executables

As opposed to the current way, where every file gets one lstat whether
with d_type or not, and an additional stat() for links, *and* an
access.

So we go from two syscalls to one for executables.

* Some more comments

* rust link option

* rust remove size

* rust accessovaganza

* Check for .dll first for WSL

This saves quite a few checks if e.g. System32 is in $PATH (which it
is if you inherit windows paths, IIRC).

Note: Our WSL check currently fails for WSL2, where this would
be *more* important because of how abysmal the filesystem performance
on that is.
2023-10-14 08:46:14 +02:00
Fabian Boehm
6be5b02231 Test for mktemp completion
Turns out fish isn't in $PATH on the CI systems

(cherry picked from commit 136dc6ce28)
2023-10-08 22:00:57 +02:00
Fabian Boehm
71ef8d317a fish_config: Fix save with variable with multiple values
Your basic quoting problem, regressed in 3.6.0

(cherry picked from commit 098b7093da)
2023-10-08 21:57:08 +02:00
Fabian Boehm
1b98566f3d docs/set: Correct some errors
(cherry picked from commit ad54f07328)
2023-10-08 21:57:08 +02:00
yanshay
8a8c7abb0f added support for fish_sequence_key_delay_ms to set how long to wait between sequence key presses 2023-10-08 21:56:06 +02:00
Fabian Boehm
724b44907e Reduce stat calls for wildcards ending in "/" (#10032)
This makes it so expand_intermediate_segment knows about the case
where it's last, only followed by a "/".

When it is, it can do without the file_id for finding links (we don't
resolve the files we get here), which allows us to remove a stat()
call.

This speeds up the case of `...*/` by quite a bit.

If that last component was a directory with 1000 subdirectories we
could skip 1000 stat calls!

One slight weirdness: We refuse to add links to directories that we already visited, even if they are the last component and we don't actually follow them. That means we can't do the fast path here either, but we do know if something is a link (if we get d_type), so it still works in common cases.

(cherry picked from commit 86803e4442)
2023-10-08 17:15:20 +02:00