Commit Graph

18898 Commits

Author SHA1 Message Date
Mahmoud Al-Qudsi
99c9d6eef6 IoFile: Wrap File instead of OwnedFd 2024-03-23 00:44:27 -05:00
Mahmoud Al-Qudsi
6f9f9ee400 Use bitflags contains() instead of intersects()
`intersects()` is "any of" while `contains()` is "all of" and while it makes no
difference when testing a single bit, I believe `contains()` is less brittle
for future maintenance and updates as its meaning is clearer.

</pedantic>
2024-03-23 00:24:31 -05:00
Mahmoud Al-Qudsi
6ed4d09c93 Switch more to File/BorrowedFd from OwnedFd/RawFd
More work in prep for having wopen_cloexec() return `File` directly.

This eliminates checking for an invalid fd and makes both ownership and
mutability clear (some more operations that involve changes to the underlying
state of the fd now require `&mut File` instead of just a `RawFd`).

Code that clearly does not use non-blocking IO is ported to use
`Write::write_all()` directly instead of our rusty port of the `write_loop()`
function (which handles EAGAIN/EWOULDBLOCK in addition to EINTR, while
`write_all()` only handles the latter).
2024-03-23 00:01:57 -05:00
Mahmoud Al-Qudsi
c0d68084f7 Add AsFd impl for AutoCloseFd
Will be used to remove RawFd usages.
2024-03-22 23:58:12 -05:00
Mahmoud Al-Qudsi
4e50ae34da Add native read_retry() and write_retry() methods
These are equivalent to read_loop() and write_loop() but operate on native Rust
types without libc ffi.
2024-03-22 23:05:56 -05:00
Mahmoud Al-Qudsi
bdde2b2b35 Try to fix OBS tumbleweed builds
Add git as a build requirement. Package name guessed then confirmed by searching
on rpm.pbone.net against openSUSE Tumbleweed.

Log excerpt:

[   14s] CMake Error at /usr/share/cmake/Modules/ExternalProject.cmake:2910 (message):
[   14s]   error: could not find git for clone of corrosion-populate
2024-03-22 22:42:58 -05:00
Fabian Boehm
a5156e9e0e po/de: Fix a format string 2024-03-21 20:17:14 +01:00
David Adam
9105d6a82f fish.spec: better installation of documentation
The %{_docdir} macro is defined, but due to an oversight is not passed
to CMake in some versions of openSUSE where it should be.

Use doc directives to avoid mucking around with cp.
2024-03-21 22:45:57 +08:00
David Adam
b64c210ade fish.spec: fix documentation path on OpenSUSE
(It's a shame the _docdir macro is unusuable, but even downstream
doesn't use it.)
2024-03-20 23:45:51 +08:00
Fabian Boehm
46cde6cc55 Github Actions: Remove CXXFLAGS for ASAN
The only C++ we have left is fish_test_helper
2024-03-19 16:54:33 +01:00
Fabian Boehm
0ff1e50a33 rustc: Protect against lines starting with -
Fixes #10379
2024-03-19 16:49:46 +01:00
Fabian Boehm
ce62b284b1 test_helper: Give self-signalling a chance to trigger
This abort()ed right after the signal, so it's possible to crash
before the signal is delivered. This could trigger under ASAN on
Github Actions.
2024-03-19 16:41:25 +01:00
Fabian Boehm
c759a98b37 docs: Clarify that disowned jobs won't fire on-process/job-exit
Fixes #10381
2024-03-19 16:39:37 +01:00
David Adam
a551432f5c Merge branch 'Integration_3.7.1' 2024-03-19 20:14:40 +08:00
David Adam
80394ea4e3 Release 3.7.1 2024-03-19 11:40:45 +08:00
David Adam
445fba4464 CHANGELOG: work on 3.7.1 2024-03-18 22:53:13 +08:00
fortifiedhill
9cebf5c9b6 Update htop completions
Added and updated completions and updated htop link.

(cherry picked from commit 8678ad8ca0)
2024-03-18 22:34:55 +08:00
Xiretza
119d76bc0f Add completions for dmidecode
(cherry picked from commit 8271021fb6)
2024-03-18 22:34:55 +08:00
Felix Luciano Salomon
cc6df6d17f Added completion for ollama
Closes #10327

(cherry picked from commit 90b9bce174)
2024-03-18 22:34:55 +08:00
Mathis Chenuet
77e2fa343d Add completion for pstree (#10317)
* Add completion for pstree.fish

* use fish functions, much better

(cherry picked from commit 73d760560b)
2024-03-18 22:34:55 +08:00
QianChenglong
b864074288 add completion for mycli
Closes #10309

(cherry picked from commit b3c610feff)
2024-03-18 22:34:55 +08:00
Emily Grace Seville
c6f3b24dc5 feat: cobra-cli support (#10293)
* feat: cobra-cli support

* fix: cobra-cli completion

(cherry picked from commit 623f3463a5)
2024-03-18 22:34:55 +08:00
Daniel Kahn Gillmor
d24b1ef229 tab completions: avoid completing gpg --use-embedded-filename
gpg's --use-embedded-filename is a dangerous option that can cause gpg
to write arbitrary content to arbitrary files.

According to the GnuPG maintainer, this is not an option recommended
for use (https://dev.gnupg.org/T4500).  Fish shouldn't encourage users
to supply it.

I've offered https://dev.gnupg.org/T6972 to upstream to make it even
more clear that this option is a bad idea.

While removing it, we might as well also remove
--no-use-embedded-filename, since it is effectively a no-op.

(cherry picked from commit b265152fba)
2024-03-18 22:34:55 +08:00
Jason Nader
d655f40d43 completions: fix wg-quick interface completions
wg outputs space separated list

(cherry picked from commit 28d9f1878d)
2024-03-18 22:34:55 +08:00
Mark Huang
baf5102797 completions for apt and apt-get
(cherry picked from commit 65cf6ada56)
2024-03-18 22:34:55 +08:00
Ikko Eltociear Ashimine
7b595b2e2e Update iwctl.fish
colum -> column

(cherry picked from commit 1e925857f0)
2024-03-18 22:34:55 +08:00
Asuka Minato
f82e29d320 add more strace completion (#10227)
* Update strace.fish

* Update strace.fish

* upper case

(cherry picked from commit 0f97111290)
2024-03-18 22:34:55 +08:00
Damien Picard
d2e1ffc192 Completions: fix Blender completions when it prints to stderr
Some of the completions recently introduced called Blender itself to query some
arguments, and Blender sometimes prints messages to stderr. This output was not
filtered, resulting in the shell printing irrelevant messages during completion.

(cherry picked from commit 4f3e7ddef0)
2024-03-18 22:34:55 +08:00
mhmdanas
a6c00ee637 completions/xbps-query: complete package name after -X
(cherry picked from commit a67b089c89)
2024-03-18 22:34:55 +08:00
NextAlone
e2599545f2 completions/fastboot: fix flash completion
Signed-off-by: NextAlone <12210746+NextAlone@users.noreply.github.com>
(cherry picked from commit c587b2ffcc)
2024-03-18 22:34:55 +08:00
David Adam
98662ae076 CHANGELOG: work on 3.7.1 2024-03-18 22:26:49 +08:00
Mahmoud Al-Qudsi
decf99f71b
Use File instead of OwnedFd in a few places (#10355)
This is a step towards converting `wopen_cloexec()` to return `File` instead of
`OwnedFd`/`AutocloseFd`.¹

In addition to letting us use native standard library functions instead of
unsafe libc calls, we gain additional semantic safety because `File` operations
that manipulate the state of the fd (e.g. `File::seek()`) require a `&mut`
reference to the `File`, whereas using `RawFd` or `OwnedFd` everywhere leaves us
in a position where it's not clear whether or not other references to the same
fd will manipulate its underlying state.

¹ We actually wouldn't even need `wopen_cloexec()` at all (just a widechar
wrapper) as Rust's native `File::open()`/`File::create()` functionality uses
`FD_CLOEXEC` internally.
2024-03-17 11:20:44 -05:00
Johannes Altmanninger
bc246d87b2 Add closed issues and PRs to 3.8 changelog
I used below script to list all GitHub issues and PRs that are not yet
mentioned in the changelog. It's almost empty now.

While at it, curate the "notable" section and move some entries around,
notably from "interactive improvements"  to "bindings".

```shell
ms="fish next-3.x"
{
    gh issue list --state closed --milestone "$ms" -L 500
    gh pr list --state all --search "milestone:\"$ms\"" -L 500
} | sort -n | while IFS='
' read line; do
    set -- $line
    grep -qE '\W'$1 CHANGELOG.rst ||
    echo https://github.com/fish-shell/fish-shell/issues/$1 "$line"
done
```
2024-03-17 11:41:32 +01:00
Johannes Altmanninger
cd71359c42 completions/git: complete files iff last token is not a fixupish
Closes #10371
2024-03-16 10:45:57 +01:00
Simon Junod
60ef93b85b Fixed typo in French translations
Closes #10372
2024-03-16 10:45:57 +01:00
Johannes Altmanninger
068f92ce7e Changelog update 2024-03-16 10:31:01 +01:00
Johannes Altmanninger
2972407b9e builtin read: minor code cleanup 2024-03-16 10:31:01 +01:00
Johannes Altmanninger
62d1720605 completions/htop: fix --sort-key completions 2024-03-16 10:31:01 +01:00
fortifiedhill
8678ad8ca0 Update htop completions
Added and updated completions and updated htop link.
2024-03-16 09:00:42 +01:00
Xiretza
8271021fb6 Add completions for dmidecode 2024-03-16 08:57:43 +01:00
The0x539
b8d1dc93d6 ast: Replace can_parse with static dispatch 2024-03-16 08:39:27 +01:00
Andrew Neth
08220c2189
builtin/test: refactor the Token enum to be more granular (#10357)
* builtin/test: Split Token enum into 2-level hierarchy

* builtin/test: Rearrange the Token enum hierarchy

* builtin/test: Separate Token into Unary and Binary

* builtin/test: import IsOkAnd polyfill

* builtin/test: Rename enum variants one more time
2024-03-15 23:24:44 -05:00
Mahmoud Al-Qudsi
72d372cca1 Fix unnecessary move warning 2024-03-14 17:05:58 -05:00
Mahmoud Al-Qudsi
e2df29447f Silence warning about unused variable 2024-03-14 17:04:56 -05:00
Fabian Boehm
9b9cfc207f CHANGELOG for 3.7.1 2024-03-13 18:24:01 +01:00
Mahmoud Al-Qudsi
b7b20e9fac Always source file after funced (#10318)
... even if the file hasn't changed. This addresses an oddity in the following
case:

* Shell is started,
* function `foo` is sourced from foo.fish
* foo.fish is *externally* edited and saved
* <Loaded definition of `foo` is now stale, but fish is unaware>
* `funced foo` loads `type -p foo` showing changed definition, user exits
  $EDITOR saving no changes (or with $status 0, more generally).
* Stale definition of `foo` remains

(cherry picked from commit 2c2ab0c1fa)
2024-03-13 18:16:34 +01:00
Jason Nader
fada4f2e01 completions: add ssh -D option
(cherry picked from commit fc58b9c68f)
2024-03-13 18:15:24 +01:00
Paul Gier
2655d9a3fa functions: handle hostname starting with dash
If a hostname starts with a dash `-` character, the prompt_hostname function
fails because the `string` function interprets it as an option instead
of an argument.

(cherry picked from commit 6c9c033126)
2024-03-13 18:15:24 +01:00
Jason Nader
c3aefc581f completions: update 'echo'
(cherry picked from commit 2f332f0019)
2024-03-13 18:15:24 +01:00
Fabian Boehm
36c8746870 docs/argparse: Add some more examples, something on -x
Fixes #10284

(cherry picked from commit 94d3307469)
2024-03-13 18:15:24 +01:00