Commit Graph

10463 Commits

Author SHA1 Message Date
Peter Stephenson
85bed93092 Rationalise use of forks and pipes.
Ensure we _exit instead of returning from execcmd_exec() if we
have forked.  Before the optimisation code after the fork always ran
to the check at the end, but that code is overkill for the logic
between the early fork and the existing one.

Remove old workaround to fork in caller of execcmd for current shell
constructs as no longer needed with early fork below.

Close input of newly created pipe on fork (destined for RHS of pipe
which we never execute): this replaces a workaround from
zsh-workers/32171, commit 9887fc3d7b.

Set last1 on early fork as needed by some instances of shell
constructs on LHS of pipeline to know they are exiting.
2018-04-20 13:10:14 +01:00
Peter Stephenson
e1048fb2e9 Ensure we _exit if forked in execcmd_exec(). 2018-04-20 11:58:19 +01:00
Peter Stephenson
cbe1c8eff5 Make early fork even earlier.
It was after our preliminary scan of arguments to find
a command.  Actually, in the cases of early fork
we don't need this information before forking.
2018-04-20 11:28:30 +01:00
Peter Stephenson
0d33815047 42693: Fork early for pipelines.
If executing a command not at the end of a pipeline, and
not optimised in the calling code, we can fork before
"prefork" substitutions, at the same point as
for background commands.
2018-04-20 11:17:06 +01:00
Peter Stephenson
9e2afb9298 42684 (with extra comments): Fork early if in bg.
In execcmd the case of running the last command in a pipeline
asynchronously for the purpose of & and &! is easy to work out,
and we can avoid side effects and unnecessary execution time in
the parent shell by forking earlier.
2018-04-20 10:36:39 +01:00
Peter Stephenson
0f29b5148e 42686: Fix previous pgrp patch.
We shouldn't do any fix ups unless the process has actually
exited.
2018-04-19 13:58:10 +01:00
Peter Stephenson
3c74891fcd 42630: Improve process group handling in pipelines.
If process group leader exits, allow a newly forked process to become
process leader.  If a foreground job, reattach the shell to the
terminal until that happens.

Unblock signals when reading output for command subsitution so that
we can do this reattaching immediately.
2018-04-17 17:14:20 +01:00
Peter Stephenson
181f5cfabe unposted: update version to 5.5.1-dev-0 2018-04-17 17:11:39 +01:00
Peter Stephenson
fd4056f4ed unposted: Update for release 5.5.1. zsh-5.5.1 2018-04-16 19:21:52 +01:00
Oliver Kiddle
39f58eb318 42659: various completion option updates 2018-04-16 17:02:56 +02:00
Oliver Kiddle
b69a341619 42658: allow compact form of option arguments to diffstat 2018-04-16 16:53:47 +02:00
Matthew Martin
2cf01b9da8 42643, 42644: new cksum completion 2018-04-16 16:51:16 +02:00
Matthew Martin
637f9809a7 42642 (tweaked for Solaris): OpenBSD chown does not support -f and dragonfly has -x 2018-04-16 16:39:21 +02:00
Barton E. Schaefer
68d9526220 42650: fix 42156 for zero-sized terminals
Also fix harmless no-op typo from hand-applying 42636 for previous commit.
2018-04-15 11:06:43 -07:00
Barton E. Schaefer
517cda3832 42636: fix GLOB_DOTS for !(RM_STAR_SILENT)
Also fix paste-o in older log entry
2018-04-15 10:57:27 -07:00
Daniel Hahler
5bd659352f 42631: _pgrep: pkill: fix completion of signals
This adds the signals after arguments are filtered according to
$optchars.
2018-04-13 11:44:37 +02:00
Oliver Kiddle
65b265f3c0 42624 (plus test): avoid freeing memory that's still needed
This was occurring in a multiple function definition where a
function name is duplicated.
2018-04-12 23:15:29 +02:00
Peter Stephenson
2c4ec9dab0 42623: Add some extra quotes to previous commit 2018-04-11 10:37:23 +01:00
Benedikt Morbach
66f0e5c1ac 42618: support signal names from multiple include files.
Needed for glibc starting with 2.25.
2018-04-10 17:52:35 +01:00
Peter Stephenson
9135097419 unposted: update dev version to 5.5-dev-0 2018-04-10 09:15:34 +01:00
pda
96f393f917 42613: typo fix in _ss 2018-04-09 23:22:25 -04:00
Peter Stephenson
f9e9dce544 unposted: release zsh-5.5 zsh-5.5 2018-04-08 16:52:30 +01:00
Oliver Kiddle
5bd63f4d69 c.f. 42499: tera torn: update twisted completion stub for new twist command 2018-04-08 10:51:35 +02:00
Oliver Kiddle
8e6c1d8b47 42605: properly free the vi registers hash 2018-04-07 18:52:37 +02:00
Oliver Kiddle
d8753f47bb 42601: tidy up code for set -A/+A to not increment a NULL pointer and to be more efficient 2018-04-07 18:48:00 +02:00
Oliver Kiddle
31f7220563 42607, CVE-2018-1100: check bounds on buffer in mail checking 2018-04-07 18:28:38 +02:00
Oliver Kiddle
4044d73706 42600: error paths for _values leaked the exclusion list array 2018-04-07 14:37:46 +02:00
Oliver Kiddle
90afd36922 42597: plug memory leak found by coverity 2018-04-07 14:37:46 +02:00
Oliver Kiddle
bd05c4b2de 42595: remove dead code flagged by coverity 2018-04-07 14:37:46 +02:00
Mikael Magnusson
583419839f 42602: Update _gcc as of GCC 7.3.0 for generic options and x86 2018-04-07 14:08:26 +02:00
Matthew Martin
a2cb9bbed3 42604: new completions for OpenBSD's signify and vmctl 2018-04-07 11:06:24 +02:00
Klas Mellbourn
5e10acca98 github #24: Add completion script for Visual Studio Code 2018-04-07 10:57:59 +02:00
Jun-ichi Takimoto
4b13cda37b 42590: fix detection of OSTYPE in _fmt 2018-04-05 20:31:28 +09:00
Jun-ichi Takimoto
5dc36c40c3 42585: improve completion for libarchive-based tar
Offer all compressed archives if no compression flag is specified
because libarchive can automaticaly recoginize them.
cf. 42574 (Eitan Adler).
2018-04-05 20:27:39 +09:00
Oliver Kiddle
bfff8debf7 42591: complete *.changes and *.dsc files alongside *.deb 2018-04-05 13:00:14 +02:00
Oliver Kiddle
9004b59115 42584: complete options for ssh-keyscan and update options for ssh-copy-id 2018-04-05 11:32:57 +02:00
Oliver Kiddle
10fcc7eaaf 42583: new column completion 2018-04-05 11:30:10 +02:00
Oliver Kiddle
d4c19184fe 42582: updates to options in completions for OpenBSD 6.3 2018-04-05 11:29:07 +02:00
Oliver Kiddle
25da576c29 42575: fix to not complete options in the argument to another option 2018-04-05 11:14:58 +02:00
Jun-ichi Takimoto
35734810d1 42578: _shutdown: add support for macOS 2018-04-05 10:34:12 +09:00
Jun-ichi Takimoto
e9a76d3924 42577: fix macOS support in _strings 2018-04-05 10:27:45 +09:00
Peter Stephenson
f027f1d6e8 unposted: 5.4.2-test-2 zsh-5.4.2-test-2 2018-04-04 18:34:08 +01:00
Peter Stephenson
3517e4a9a5 42581(?): Fix ZLE inline history expansion.
Seen with magic-space.

If there's a parse error in command subtitution we need to complete
reading history to ensure the command line buffer is finished.
2018-04-04 18:33:00 +01:00
Oliver Kiddle
1bd2ecc17d 42572: various completion option updates 2018-03-31 10:12:59 +02:00
Oliver Kiddle
b90c59e9fc 42571: new completion for FreeBSD jail command 2018-03-31 10:04:56 +02:00
Oliver Kiddle
486297520f 42568: new shutdown completion 2018-03-30 16:23:59 +02:00
Oliver Kiddle
286b4c8b0c 42569: improve lsof completion after -i and -s options 2018-03-30 16:17:44 +02:00
Oliver Kiddle
c960cd3c2d 42567: new completion for xmlstarlet 2018-03-30 16:14:34 +02:00
Oliver Kiddle
20a92b857e 42570: new completion for drill and factor out DNS type completion 2018-03-30 16:12:35 +02:00
Oliver Kiddle
bdf09270be 42560: silence sign-compare compiler warnings 2018-03-30 12:13:59 +02:00