Commit Graph

11534 Commits

Author SHA1 Message Date
ridiculousfish
9949c39d70 Relnote 3.1.1 fixes for #6624 and #6806 2020-04-26 15:54:18 -07:00
ridiculousfish
ed8e7b934f Merge branch 'cmdsub_inherit_pgroup_3.1.1' into Integration_3.1.1
This merges three fixes around propagating pgroups, and preventing pipe
deadlock. This is equivalent to the merge at
c034c2c99b, but for 3.1.1
2020-04-26 15:41:30 -07:00
ridiculousfish
5fccfd83ec builtin_eval to direct output to its iostreams
Prior to this fix, builtin_eval would direct output to the io_chain of the
job. The problem is with pipes: `builtin_eval` might happily attempt to
write unlimited output to the write end of a pipe, but the corresponding
reading process has not yet been launched. This results in deadlock.

The fix is to buffer all the output from `builtin_eval`. This is not fun
but the best that can be done until we have real concurrent processes.

cherry-pick of a1f1b9c2d9

Fixes #6806
2020-04-26 15:40:22 -07:00
ridiculousfish
de180689e4 Thread pgroups into builtin_eval
Ensure that if eval is invoked as part of a pipeline, any jobs spawned
by eval will have the same pgroup as the parent job.

cherry-pick of 82f2d86718

Partially fixes #6806
2020-04-26 15:40:22 -07:00
ridiculousfish
2d3c914a9d Thread pgroups into command substitutions
Give string expansion an (optional) parent pgroup. This is threaded all
the way into eval(). This ensures that in a mixed pipeline like:

   cmd | begin ; something (cmd2) ; end

that cmd2 and cmd have the same pgroup.

Add a test to ensure that command substitutions inherit pgroups
properly.

cherry-pick of 938b683895

Fixes #6624
2020-04-26 15:40:22 -07:00
Johannes Altmanninger
fe3d7ad002 Changelog nitpicks 2020-04-26 21:31:05 +02:00
Fabian Homborg
6c4cf69110 completions/git: Only use first line of alias as the description
This was a weird one. We split the aliases correctly even with
multiple lines, but then broke it all again when we just printed the
description.

Note that it would be possible to use `string split0` here, but since
anything longer than a line is likely too long for a description
anyway we don't bother.

Fixes #6946.

(cherry picked from commit 1988bd2579)
2020-04-26 23:10:53 +08:00
Jouke Witteveen
1643cf40fb systemctl completions: Use --plain where appropriate
The --plain flag drops the '●'-glyph and generally makes the output more
suitable for automated processing.

(cherry picked from commit 93b86bbe63)
2020-04-25 23:48:10 +08:00
David Adam
0cdf3648f0 CHANGELOG: additional work on 3.1.1 2020-04-25 23:32:57 +08:00
fcd
b37209b235 docs: Fix repeated word in argparse documentation
(cherry picked from commit 3246f736b8)
2020-04-25 23:30:30 +08:00
Weisi Dai
c8caaf5d56 Doc: Fix dead link to POSIX man page "test".
(cherry picked from commit 6ab2d78936)
2020-04-25 23:29:34 +08:00
Fabian Homborg
d9cf1be4b7 fish_clipboard_copy: Stop adding newlines
When this switched over from directly piping commandline to storing
its output and using printf, I inadvertently always added a trailing
newline. That's probably annoying.

Note that this will now always *remove* a trailing newline (because
the command substitution does). That will barely make a
difference (because trailing newlines are quite unusual in the
commandline) and will probably feel better than keeping it - we could
even make a point of removing trailing whitespace in general.

Fixes #6927

(cherry picked from commit 6ebbe5a450)
2020-04-25 23:27:14 +08:00
Jason
5f6e43df6a Stringify ssh completions (#6529)
* Stringify ssh completions

* Fix completions for `-b` option

* Fix completions for `-b` option

(cherry picked from commit 2a247c7fe5)
2020-04-25 23:25:51 +08:00
David Adam
3b9edc27c7 CHANGELOG: work on 3.1.1 2020-04-25 23:22:52 +08:00
Johannes Altmanninger
087e9da0a1 Remove test for implicit cd after builtin command
(see commit 0a2eea4cc6 on master)
2020-03-24 22:08:14 +01:00
Johannes Altmanninger
d4462912e6 Restore directory completions for subcommands
Fixes #6798

This re-adds some false positives: functions, builtins and abbreviations
are suggested after commands like sudo but I don't think anyone had
complained about that.

(cherry picked from commit 2a89873e6d686fcff1d26d0914a8b9f90b7cc308)
2020-03-24 20:17:29 +01:00
Johannes Altmanninger
31d6ccfd59 Suppress history autosuggestion for command lines prefixed with a space
Currently we do not add such command lines to the history, so there
won't be a suggestion from history anyway.

Fixes #6763 which occurs because midnight commander feeds fish commands
like this one (note the leading space)

` cd (printf '%b' '\0057home\0057johannes\0057git\0057fish\0055shell\0057build')`

(cherry picked from commit 390647ae34)
2020-03-21 19:08:12 +01:00
Fabian Homborg
8c9b4d9000 completions/systemctl: Remove annoying marker
The output of

systemctl list-units

seems to include a marker of '●' or '*' for some units, even if the
output is not going to a terminal and "--no-legend" and "--no-pager"
are given. This appears
to be a recent development, and there does not appear to be a flag to
disable it.

So we simply filter it out in the completions to once again hopefully
offer the actual units.

Fixes #6740
2020-03-12 18:34:42 +01:00
Fabian Homborg
62525ab6b2 help: Always use xdg-open if available
Even if $DISPLAY is unset, xdg-open can be useful, and on systems that
have xdg-open, "open" is most likely some god awful outdated thing
called "openvt" elsewhere.

Fixes #6739

[ci skip]
2020-03-12 17:29:29 +01:00
Fabian Homborg
1a063fe3c1 Fix output with C locale
If given a prompt that includes a non-ascii char and a C locale, fish
currently fails to properly display it.

So you set `function fish_prompt; echo 😃; end` and it shows empty
space.

While the underlying cause is obviously using a C locale and non-C
characters to begin with, this is an unacceptable failure mode.

Apparently I misunderstood wcstombs, so I inadvertently broke this in
2b0b3d3 while trying to fix 5134949's crash.

Just return the offending bit to pre-5134949 levels, so instead of an
infinite recursion we just call a lame function a couple of times.
2020-03-11 20:37:39 +01:00
ridiculousfish
acad9b05e2 Send events more often for variable sets outside of builtin_set
When changing certain variables programmatically, ensure that events
are sent. Fixes #6653
2020-03-08 23:35:08 -07:00
Johannes Altmanninger
2488152f28 completions/zfs: finish renaming from 05038fc8
(cherry picked from commit 660182cfb3)
2020-03-08 10:02:05 +01:00
ridiculousfish
4c30e5ad44 Merge branch 'self-insert-notfirst-3.1.1' into Integration_3.1.1
This is the 3.1.1 set of changes to improve pasting behavior.

cherry-picked from #6713
2020-03-07 14:21:32 -08:00
ridiculousfish
f851bb709b Pull char_input_style_t into a top-level enum
Review feedback from
https://github.com/fish-shell/fish-shell/pull/6713#pullrequestreview-369853776
2020-03-07 14:10:32 -08:00
ridiculousfish
0ccedfbd09 Teach the reader fast path about self-insert-notfirst
This teaches the reader fast-path to use self-insert-notfirst, allowing
it to handle spaces. This greatly increases the performance of paste by
reducing redraws.

Fixes #6603. Somewhat improves #6704
2020-03-07 14:08:19 -08:00
ridiculousfish
4522f5cacb Use self-insert-notfirst on spaces during paste
This changes a5a643f854 to use the new self-insert-notfirst binding.
It also adds a test.
2020-03-07 14:04:05 -08:00
ridiculousfish
ea2d6a2a91 Implement self-insert-notfirst in reader
This adds basic support for self-insert-notfirst. When we see a
self-insert-nonempty char event, we kick it back to the outer loop,
which only inserts the character if the cursor is not at the beginning.
2020-03-07 14:04:03 -08:00
ridiculousfish
09baecce5d Add self-insert-notfirst readline command
This adds a new readline command self-insert-notfirst, which is
analogous to self-insert, except that it does nothing if the cursor
is at the beginning. This will serve as a higher-performance implementation
for stripping leading spaces on paste.
2020-03-07 13:38:42 -08:00
ridiculousfish
e333f90c07 Place bind.rst readline function docs in more alphabetical order 2020-03-07 13:38:10 -08:00
Johannes Altmanninger
a4c92ecd2e Docs: add missing backticks
(cherry picked from commit 0bb3efb1ad)
2020-03-07 18:39:31 +01:00
Johannes Altmanninger
6d907a9346 Make default hg prompt leaner
The default hg prompt is slow on large repositories (hg status takes
2-3 seconds on mozilla-central) which is unacceptable as a default.

Mimick our git prompt: by default, only show the current branch.
If the new variable $fish_prompt_hg_show_informative_status is set,
then use the old behavior.

[ci skip]

(cherry picked from commit da7b762f4a)
2020-03-07 13:04:43 +01:00
Fabian Homborg
c37a425887 Disable svn prompt by default
This is apparently quite slow on large svn repos (like 40 seconds
slow), and we don't have a good thing to display other than the full
file information.

So we'll have to disable it for now.

Fixes #6681.

[ci skip]
2020-03-05 17:11:51 +01:00
Fabian Homborg
f272d58557 Update CHANGELOG 2020-03-03 18:29:36 +01:00
Fabian Homborg
90a780b57d fish_print_hostnames: Fix multiple host aliases
Fixes #6698.

[ci skip]
2020-03-03 18:28:27 +01:00
Jason Nader
33f55e05d0 Prevent prompt from spewing errors if cwd has disappeared 2020-03-03 18:12:19 +01:00
Sacha Delanoue
e0645c9473 Fix 256 color detection on xterm-like
bbc3fecbe introduced a regression where support for 256 color was not
detected on xterm-like terminals that did not define the TERM_PROGRAM
env variable. Almost no terminal on linux define this variable.
2020-03-03 18:04:44 +01:00
ridiculousfish
f776c4ed88 Fix interactive --on-signal INT handlers
f8ba0ac5bf introduced a bug where INT handlers would themselves be
cancelled, due to the signal. Defer processing handlers until the
parser is ready to execute more fish script.

Fixes the interactive case of #6649.
2020-03-02 12:41:46 -08:00
ridiculousfish
eec90e379e Do not remove jobs that need to print a status message
55e3270 introduced a regression where we would remove all completed
jobs. But jobs that want to print a status message get skipped, so
the status message (and associated event handlers) might not get run.

Fix this by making it explicit which jobs are safe to process, and which
should be skipped.

Fixes #6679.
2020-03-02 12:38:05 -08:00
Johannes Altmanninger
3bf11be491 Fix tests for 0c74ff4209 2020-02-29 10:54:53 +01:00
Johannes Altmanninger
0c74ff4209 Revert "read: discard IFS delimiters before the last token"
See #6650.

This reverts commit 1410f938aa.

(cherry-picked from commmit 91fcb8c42c)
2020-02-29 09:54:46 +01:00
Johannes Altmanninger
e6248cf7be Fix selection going out of bounds
Which happened when starting the selection at the end of the commandline.
In this case, selections still interact weirdly with autosuggestions (the
first character of the suggestion appears to be part of the selection
when it's not).

Fixes #6680

(cherry-picked from commit 99851c09b3)
2020-02-29 09:51:51 +01:00
Delapouite
764420f272 doc(ulimit): add missing backquotes around -H, -S and -a options
(cherry picked from commit a53405a7be)
2020-02-28 21:18:15 +08:00
Fabian Homborg
0cbb130156 Draft releasenotes for 3.1.1 2020-02-26 20:00:56 +01:00
Delapouite
7f3d51da81 doc: fix 404 error for set_color command 2020-02-26 19:31:17 +01:00
Fabian Homborg
3e689f1f58 test: Reject nan/inf instead of crashing
I really don't want to get into the business of explaining to people
how nan != nan.

Fixes #6655.
2020-02-26 16:43:27 +01:00
Fabian Homborg
298f43b62e completions/git: Work around read trimming whitespace
Since #6406, read will trim whitespace before the last variable.

In this case there is only one variable, and the line looks like

 M CHANGELOG.md

so it does indeed start with whitespace, and the whitespace is quite
significant.

Fixes #6650.

[ci skip]
2020-02-25 19:08:07 +01:00
Johannes Altmanninger
1ca529a3d4 fixup test
only works interactively

(cherry picked from commit ccd3ac4f18)
2020-02-24 21:44:23 +08:00
Johannes Altmanninger
6b6dc7ad20 move variable_assignment_equal_pos to tokenizer
we'll need it for tok_command

(cherry picked from commit ebde9a6a44)
2020-02-24 21:14:37 +08:00
Johannes Altmanninger
676a97cf0b Skip variable assignments in status current command
Fixes #6635

(cherry picked from commit aa0e16b1a5)
2020-02-24 20:57:43 +08:00
Johannes Altmanninger
26949fa865 List time as builtin, support time --help
`a=b time foo` will no longer call an external `time` command
(like it does in bash).

Fixes #6598

(cherry picked from commit 7ef7f93a90)
2020-02-24 20:08:44 +08:00