Commit Graph

398 Commits

Author SHA1 Message Date
Johannes Altmanninger
1b668f5675 Don't use results of quoted command substitution in adjacent variable expansion
Given

    set var a
    echo "$var$(echo b)"

the double-quoted string is expanded right-to-left, so we construct an
intermediate "$varb".  Since the variable "varb" is undefined, this wrongly
expands to the empty string (should be "ab"). Fix this by isolating the
expanded command substitution internally. We do the same when handling
unquoted command substitutions.

Fixes #8849
2022-04-03 11:24:55 +02:00
ridiculousfish
a960a3cde6 Emit an error if time is used past the first command in a pipeline
Fixes #8841
2022-03-31 16:14:59 -07:00
David Adam
fa2450db30 vared: avoid using local variables
The tmp and prompt variables collide with variables used as arguments.
Just avoid them entirely, at the cost of making the internals of the
functions somewhat more complicated.

Closes #8836.
2022-03-27 23:52:49 +08:00
David Adam
31a02c55b7 Merge branch 'Integration_3.4.1' 2022-03-26 00:46:30 +08:00
David Adam
7489ab9d5b Release 3.4.1 2022-03-26 00:22:53 +08:00
Fabian Homborg
27c41ba74a CHANGELOG 3.4.1 2022-03-24 20:19:41 +01:00
David Adam
a7eebff916 ulimit: return a specific error if option is not supported by the OS 2022-03-24 10:23:04 +08:00
David Adam
8c4c526698 ulimit: add new limits from FreeBSD/NetBSD
Short option names are taken from sh for those platforms where possible.
2022-03-24 10:23:04 +08:00
David Adam
2c2b87af07 ulimit: add new limits from Linux
Short options are taken from prlimit(1) where appropriate.

Closes #8786.
2022-03-24 10:23:04 +08:00
Fabian Homborg
f184061c16 CHANGELOG 2022-03-22 22:10:28 +01:00
ridiculousfish
d0d5c62ec7 Fix case-changing autosuggestions generated mid-token
This fixes a bug where a case-changing autosuggestion generated from the
middle of a token would append too much to the end of the token.

Fixes #8820
2022-03-20 20:16:01 -07:00
Fabian Homborg
12862b11cf CHANGELOG: Reword escape sequence thing 2022-03-20 20:23:49 +01:00
Fabian Homborg
166d4846ee CHANGELOG 2022-03-20 17:08:01 +01:00
pagedown
f8163f5d22 CHANGELOG 2022-03-20 16:33:13 +01:00
ridiculousfish
3e5284aaf2 Stop restoring tty modes when run non-interactively
fish reads the tty modes at startup, and tries to restore them to the
original values on exit, to be polite. However this causes problems when
fish is run in a pipeline with another process which also messes with the
tty modes. Example:

    fish -c 'echo foo' | vim -

Here vim's manipulation of the tty would race with fish, and often vim
would end up with broken modes.

Only restore the tty if we are interactive. Fixes #8705.
2022-03-19 14:55:54 -07:00
ridiculousfish
df2cbe321c Refactor tty transfer to be more deliberate
This is a big cleanup to how tty transfer works. Recall that when job
control is active, we transfer the tty to jobs via tcsetpgrp().

Previously, transferring was done "as needed" in continue_job. That is, if
we are running a job, and the job wants the terminal and does not have it,
we will transfer the tty at that point.

This got pretty weird when running mixed pipelines. For example:

    cmd1 | func1 | cmd2

Here we would run `func1` before calling continue_job. Thus the tty
would be transferred by the nested function invocation, and also restored
by that invocation, potentially racing with tty manipulation from cmd1 or
cmd2.

In the new model, migrate the tty transfer responsibility outside of
continue_job. The caller of continue_job is then responsible for setting up
the tty. There's two places where this gets done:

1. In `exec_job`, where we run a job for the first time.

2. In `builtin_fg` where we continue a stopped job in the foreground.

Fixes #8699
2022-03-19 14:48:36 -07:00
Fabian Homborg
7935b7327e CHANGELOG 2022-03-17 18:21:43 +01:00
Fabian Homborg
2f7a73381a CHANGELOG 2022-03-16 20:16:05 +01:00
Fabian Homborg
d34ebe94ca CHANGELOG 2022-03-15 17:39:44 +01:00
Andrey Mishchenko
dc5bdda8e0 Remove underscores-in-math-builtin entry from 3.4 changelog 2022-03-13 19:24:54 +01:00
Fabian Homborg
97127c3e03 CHANGELOG 2022-03-13 11:49:39 +01:00
Fabian Homborg
ffdbc5a1b2 CHANGELOG 2022-03-13 11:41:38 +01:00
Andrey Mishchenko
59e50f77bc
Allow underscores as separators in the math builtin (#8611)
* Implement fish_wcstod_underscores

* Add fish_wcstod_underscores unit tests

* Switch to using fish_wcstod_underscores in tinyexpr

* Add tests for math builtin underscore separator functionality

* Add documentation for underscore separators for math builtin

* Add a changelog entry for underscore numeric separators
2022-03-13 11:23:35 +01:00
David Adam
c7e4350ab6 Release 3.4.0
Fixes #8092.
2022-03-12 22:30:41 +08:00
David Adam
c6d68b4593 CHANGELOG: work on 3.4.0 2022-03-12 22:28:54 +08:00
Ilan Cosman
1edb642abe Ignore own PR 2022-03-12 22:25:33 +08:00
Ilan Cosman
1e714f9d13 Changelog for 3.4 2022-03-12 22:25:33 +08:00
David Adam
895039ea5a CHANGELOG: work on 3.4.0 2022-03-10 23:41:38 +08:00
Fabian Homborg
68ef336683 Logging changes 2022-03-05 20:50:38 +01:00
Fabian Homborg
456359f78d CHANGELOGGE 2022-03-03 12:20:03 +01:00
Ilan Cosman
6c846cc256 Changelog for 3.4 2022-03-03 12:18:45 +01:00
Kevin F. Konrad
707c7a7f1e replace helm completions with autogenerated script
Helm 3 provides an autogenerated completion since version 3.4.0.

The previous implementation is replaced by this because it was specific to the
now-deprecated helm 2.

The completions appear to be fully featured including descriptions and
completion for dynamic arguments such as namespaces and releases.
2022-02-13 16:52:30 +01:00
Johannes Altmanninger
47b0d0c293 Make __fish_is_nth_token and __fish_nth_token private again
Their names are not perfect, so let's keep them as internal functions,
until we figure out how/if we want to expose this.

This reverts 0445126c2 (Undunder __fish_is_nth_token, 2021-06-29) (but I
did it without "git revert").

Closes #8008
2022-02-13 10:45:38 +01:00
Pierrick Guillaume
2164d40b73
Allow better completion for git submodules (#8716)
* Allow better completion for git submodules

* Add change for git completion in changelog

* Fix git submodule absobgitdirs description
2022-02-11 15:56:14 +01:00
Nadav Zingerman
9e0f74eb6c Add --escape option to complete -C
An example use case is an external completion pager:

    bind \cg "commandline -rt (complete -C --escape|fzf|cut -d\t -f1)\ "

Fixes #3469
2022-02-09 08:34:03 +01:00
Mahmoud Al-Qudsi
4ea5a8a5c6 CHANGELOG.rst: Add vim text width override
If you have vim set up to recognize `.editorconfig` files, the 80-char limit
from ours causes vim to keep chopping lines. This makes it ignore that limit
when editing `CHANGELOG.rst`
2022-02-08 14:37:23 -06:00
Mahmoud Al-Qudsi
ddc4d8ba9b Changelog: fish_is_nth_token + fish_nth_token
See re-opened issue #8008 for discussion regarding the name of these functions -
this might need to be revisited pending a decision there.
2022-02-08 14:17:00 -06:00
Mahmoud Al-Qudsi
497cebab64 Changelog: OpenZFS completion improvements 2022-02-08 14:17:00 -06:00
Shay Aviv
2ef12af60e Fix comment parsing inside command substitutions and brackets 2022-02-08 16:20:31 +01:00
ridiculousfish
1bdd629326 Prevent signals from tearing multi-char bindings
Say the user has a multi-char binding (typically an escape sequence), and a
signal arrives partway through the binding. The signal has an event handler
which enques some readline event, for example, `repaint`. Prior to this
change, the readline event would cause the multi-char binding to fail. This
would cause bits of the escape sequence to be printed to the screen.

Fix this by noticing when a sequence was "interrupted" by a non-char event,
and then rotating a sequence of such interruptions to the front of the
queue.

Fixes #8628
2022-02-05 13:18:36 -08:00
Emily Grace Seville
1b12719364 Extend mono completions
Work on mono.fish
- rewrite runtime option completions

Add new mono tools:
- gacutil
- xsp
- mkbundle
- ilasm
- monodis
- ikdasm
- monop
- sqlsharp
- gendarme
- csharp

Closes #8452
2022-02-05 20:09:45 +01:00
David Adam
065b769c1d CHANGELOG: work on 3.4.0 2022-02-03 22:42:24 +08:00
Aaron Gyes
a03e245e13
Update CHANGELOG.rst 2022-02-01 00:47:18 -08:00
ridiculousfish
30216b2d62 CHANGELOG: new Windows command completions
This relnotes completions from #8486
2022-01-26 22:18:20 -08:00
Johannes Altmanninger
df3b0bd89f Fix commandline state for custom completions with variable overrides
Today, a command like "var=val status " has custom completions
because we skip over the var=val variable override when detecting
the command token.
However if the custom completions read the commandline state (via
"commandline -opc") they do see they variable override, which breaks
them, most likely. Try "a=b git ".

For completions of wrapped commands, we already set a transient
commandline. Do the same for commands with  leading variable overrides;
then git completions for "a=b git " will think the commandline is
"git ".
2022-01-27 03:51:32 +01:00
David Adam
640feeee67 CHANGELOG: work on 3.4.0 2022-01-23 22:45:09 +08:00
Aaron Gyes
9c1723863d
Update CHANGELOG.rst 2022-01-21 14:28:49 -08:00
Fabian Homborg
02241d19be CHANGELOG More ignores 2022-01-20 17:15:34 +01:00
Fabian Homborg
f612ade5d9 CHANGELOG for 3.4.0 2022-01-18 18:09:29 +01:00
David Adam
a22779e807 CHANGELOG: work on 3.4.0 2022-01-18 23:34:50 +08:00