Commit Graph

17190 Commits

Author SHA1 Message Date
David Adam
9c8c7f9251 make_tarball: correct a comment 2023-03-30 12:12:09 +08:00
David Adam
1c978f7ec5 cmake: add support for vendored cmake
Use a "cmake-vendored" directory if it exists, to avoid accessing the
network if it's available, and a target to create an appropriate tarball
to create that directory.
2023-03-30 12:01:25 +08:00
Clemens Wasser
3ae16a5b95 trace: Port trace to Rust 2023-03-28 20:11:42 -07:00
Fabian Boehm
bc04abe3ec completions/git: Don't take options for --{force-,}create
We do the same for checkout -b.

Fixes #9692
2023-03-28 17:20:45 +02:00
ridiculousfish
9f7e6a6cd1 Revert "Implement builtin_printf in Rust"
This reverts PR #9666. This had outstanding review comments and should
not have been committed.
2023-03-27 22:03:30 -07:00
Fabian Boehm
c39780fefb __fish_complete_directories: Remove --foo= from token
Otherwise this would complete

`git --exec-path=foo`, by running `complete -C"'' --exec-path=foo"`,

which would print "--exec-path=foo", and so it would end as

`git --exec-path=--exec-path=foo` because the "replaces token" bit was
lost.

I'm not sure how to solve it cleanly - maybe an additional option to
`complete`?

Anyway, for now this
Fixes #9538.
2023-03-27 22:57:34 +02:00
Fabian Boehm
563b4d2372 completions/git: Complete branches for --set-upstream-to
See #9538
2023-03-27 22:57:34 +02:00
ridiculousfish
b0a3e14832 Collapse duplicate ENCODE_DIRECT_BASE and ENCODE_DIRECT_END
Credit to @Xiretza for spotting this.
2023-03-27 13:42:38 -07:00
Emily Grace Seville
ba7785856e Add md-to-clip completion
- https://github.com/command-line-interface-pages/v2-tooling/tree/main/md-to-clip
2023-03-27 17:29:53 +02:00
Chris Wendt
3a72d098e2
Use stack's dynamic completions (#9681)
* Use dynamic completions for stack

* Pass the plain command
2023-03-27 17:29:14 +02:00
Fabian Boehm
ca02e88ef1 docs: Prevent overflow for narrow screens
Regression from #9003, this is visible on mobile mainly.

Fixes #9690
2023-03-27 17:21:09 +02:00
ridiculousfish
f096841e4d Remove C++ printf bits
This removes the builtin printf C++ implementation, as it is now in
Rust.
2023-03-26 17:40:24 -07:00
ridiculousfish
3eb6f2ac74 Implement builtin_printf in Rust
This implements builtin_printf in Rust.
2023-03-26 17:40:24 -07:00
ridiculousfish
558baf4957 Implement some locale pieces
This adds locale.rs, which maintains a locale struct sufficient to
support printf.
2023-03-26 17:40:24 -07:00
ridiculousfish
dad1290337 Replace the printf implementation
The existing printf implementation is too buggy to back the printf
builtin. Switch to the new implementation based on printf-compat.
2023-03-26 14:07:29 -07:00
ridiculousfish
389d25e30f Allow sprintf! to work with literal format strings
Now sprintf! has two modes:

- Literal format string
- Widechar runtime-format string
2023-03-26 13:39:23 -07:00
ridiculousfish
aa46e7b27c Correct wcstoi for "leading zeros"
Prior to this change, wcstoi("0x") would fail with missing digits.
However strtoul will "backtrack" to return just the 0 and leave the x as
the remainder. Implement this behavior.
2023-03-26 13:39:23 -07:00
ridiculousfish
f4fa0171f2 wcstoi to match strtoul for unsigned types and negative input
Prior to this change, wcstoi() would return an error if the requested
type were unsigned, and the input had a leading minus sign. However this
causes problems for printf, which expects strtoul behavior.

Add "modulo base" behavior which wraps the negative value to positive.
Factor this into an option; the default is False (but code which
previously used strtoull directly should set it to true).
2023-03-26 13:39:23 -07:00
ridiculousfish
dc8aab3f52 Introduce fish_wcstoi_partial
fish_wcstoi_partial is like fish_wcstoi: it converts from a string to an
int optionally inferring the radix. fish_wcstoi_partial also returns the
number of characters consumed.
2023-03-26 13:39:22 -07:00
ridiculousfish
7729d3206a Implement wcstod() in Rust
This is built around fast-float.

Factor the error type from this and wcstoi() together into a shared
type.
2023-03-26 13:38:58 -07:00
ridiculousfish
0e68405ccd Add our fast-float crate
This adds a dependency on https://github.com/fish-shell/fast-float-rust
which is our forked fast-float crate for parsing.
2023-03-26 13:38:09 -07:00
ridiculousfish
8bb1bb8ae1 Add link-asan to RUSTFLAGS in CI
This fixes our CI for the new crates we're about to add.
2023-03-26 11:07:15 -07:00
Johannes Altmanninger
76145145fd global_safety: port RelaxedAtomicBool 2023-03-26 19:35:57 +02:00
Johannes Altmanninger
a0eed3760e Cargo.toml: sort dependencies 2023-03-26 17:24:45 +02:00
Johannes Altmanninger
eb377d3c65 common.rs: implement Default for EscapeFlags 2023-03-26 17:17:37 +02:00
Johannes Altmanninger
981e470a2e common.rs: use bitflags for escape flags
See this discussion:
https://github.com/fish-shell/fish-shell/pull/9636#discussion_r1125640395
2023-03-26 17:17:37 +02:00
Johannes Altmanninger
312ae36a34 common.h: remove unused declaration 2023-03-26 17:17:37 +02:00
Johannes Altmanninger
b64c3eb79b termsize.rs: export Termsize 2023-03-26 17:17:37 +02:00
Johannes Altmanninger
d073b7140b lib.rs: sort modules 2023-03-26 17:17:37 +02:00
Johannes Altmanninger
16fa942074 parse_constants.rs: stop decoding UTF-8 when parsing keywords
Unfortunately we cannot use wide string literals in match statements
(not sure if there's an easy fix).
Because of this, I converted the input to UTF-8 so we could use the match
statement. This conversion is confusing, let's skip it.
2023-03-26 17:17:37 +02:00
ridiculousfish
b8189da011 Use the rust-pcre2 crate for regex
This adds support for our (forked) rust-pcre2 crate.
2023-03-25 17:01:50 -07:00
Fabian Boehm
aa268696bf reader: Skip FreeBSD directory hack for stdin
This can be triggered on linux with:

```js
import { spawn } from 'child_process';
const shell = spawn('/home/alfa/dev/fish-shell/build-c++/fish', []);
```

Under node 19.8.1.

*No clue* how that happens, but since this is a workaround we shall
skip it.
2023-03-25 20:47:38 +01:00
David Adam
e2579a59ba CHANGELOG: fix date for 3.6.1 2023-03-25 22:57:24 +08:00
David Adam
83a9555b47 Merge branch 'Integration_3.6.1' 2023-03-25 17:19:33 +08:00
David Adam
f39bc9317d Release 3.6.1 2023-03-25 14:50:41 +08:00
David Adam
2f47f7d9c0 CHANGELOG: work on 3.6.1 2023-03-25 11:31:12 +08:00
NextAlone
37e7e90bff completion/ssh-copy-id: add completion (#9675)
Add completions for ssh-copy-id.

Refactored __ssh_history_completions into its own file for autoloading across
completions.

(cherry picked from commit 45b6622986)

Conflicts:
	CHANGELOG.rst
2023-03-22 12:30:01 -05:00
NextAlone
45b6622986
completion/ssh-copy-id: add completion (#9675)
Add completions for ssh-copy-id.

Refactored __ssh_history_completions into its own file for autoloading across completions.
2023-03-22 12:24:18 -05:00
NextAlone
7f867298e7 completion/git: complete tags for force option (#9678)
(cherry picked from commit ff34c1a573)
2023-03-22 11:07:33 -05:00
NextAlone
ff34c1a573
completion/git: complete tags for force option (#9678) 2023-03-22 11:07:18 -05:00
Mahmoud Al-Qudsi
80b31e87ec Merge deno completions update from #9676
(Can't cherry-pick because GitHub tricked me into rebasing instead of
squashing.)
2023-03-22 11:04:41 -05:00
sigmaSd
860de8aa8f minor cleanup 2023-03-22 11:00:59 -05:00
sigmaSd
b95085609e deno task take one argument max 2023-03-22 11:00:59 -05:00
sigmaSd
93bf4e1187 Update deno task completions to handle deno.jsonc and package.json 2023-03-22 11:00:59 -05:00
NextAlone
e00f63b9e9 completion/adb: add execout and complete props
Signed-off-by: NextAlone <12210746+NextAlone@users.noreply.github.com>
(cherry picked from commit da3323bbc2)
2023-03-21 22:20:57 -05:00
NextAlone
da3323bbc2 completion/adb: add execout and complete props
Signed-off-by: NextAlone <12210746+NextAlone@users.noreply.github.com>
2023-03-21 22:20:36 -05:00
Fabian Boehm
693595a6c0 Silence fstatat errors
These just keep happening, people run haunted computers.

Fixes #9674.

(cherry picked from commit cd7e8c00e1)
2023-03-21 17:17:55 +01:00
Fabian Boehm
cd7e8c00e1 Silence fstatat errors
These just keep happening, people run haunted computers.

Fixes #9674.
2023-03-21 17:10:23 +01:00
Mahmoud Al-Qudsi
fb74f77c86 Use bsd feature for signals
Signals present in 4.4BSD can be assumed present on all modern BSD derivatives.
2023-03-20 20:28:25 -05:00
Mahmoud Al-Qudsi
f2cf54608d Migrate existing rust code to Signal type
Everything but signal handlers has been changed to use `Signal` instead of
`c_int` or `i32` signal values.

Event handlers are using `usize` to match C++, at least for now.
2023-03-20 16:17:28 -05:00