1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-05-30 11:56:04 +02:00
Commit Graph

9722 Commits

Author SHA1 Message Date
Marc Chantreux 82ba2261ab 48466: correct indentation and remove tabs and trailing spaces 2021-04-11 21:32:18 +02:00
Marc Chantreux 80d5210195 48445: pluralize tags in _surfraw 2021-04-11 21:05:39 +02:00
Marc Chantreux 90352a8278 users/26645: update options in gv completion 2021-04-11 20:49:30 +02:00
brian m. carlson f7a417388c 47794: exec: run final pipeline command in a subshell in sh mode
zsh typically runs the final command in a pipeline in the main shell
instead of a subshell.  However, POSIX specifies that all commands in a
pipeline run in a subshell, but permits zsh's behavior as an extension.
The default /bin/sh implementations on various Linux distros and the
BSDs always use a subshell for all components of a pipeline.

Since zsh may be used as /bin/sh in some cases (such as macOS Catalina),
it makes sense to have the common sh behavior when emulating sh, so do
that by checking for being the final item of a multi-item pipeline and
creating a subshell in that case.

From the comment above execpline(), we know the following:

 last1 is a flag that this command is the last command in a shell that
 is about to exit, so we can exec instead of forking.  It gets passed
 all the way down to execcmd() which actually makes the decision.  A 0
 is always passed if the command is not the last in the pipeline. […]
 If last1 is zero but the command is at the end of a pipeline, we pass
 2 down to execcmd().

So there are three cases to consider in this code:

• last1 is 0, which means we are not at the end of a pipeline, in which
 case we should not change behavior.
• last1 is 1, which means we are effectively running in a subshell,
 because nothing that happens due to the exec is going to affect the
 actual shell, since it will have been replaced.  So there is nothing
 to do here.
• last1 is 2, which means our command is at the end of the pipeline, so
 in sh mode we should create a subshell by forking.

input is nonzero if the input to this process is a pipe that we've
opened.  At the end of a multi-stage pipeline, it will necessarily be
nonzero.

Note that several of the tests may appear bizarre, since most developers
do not place useless variable assignments directly at the end of a
pipeline.  However, as the function tests demonstrate, there are cases
where assignments may occur when a shell function is used at the end of
a command.  The remaining assignment tests simply test additional cases,
such as the use of local, that would otherwise be untested.
2021-04-10 17:56:39 -05:00
Bart Schaefer 408a830483 47913: implement CASE_PATHS option to make NO_CASE_GLOB more sensible 2021-04-10 14:26:46 -07:00
dana 1bec15a010 unposted: README: Document incompatibility caused by workers/43928 2021-04-10 16:16:26 -05:00
dana 7269bc1ac4 48338: _git: Support case-insensitive path matching 2021-04-10 15:54:26 -05:00
Peter Stephenson 283d2f3c27 48432 and enable test: fix quotiing of zstyle -L for zstyle -e 2021-04-09 21:01:37 +01:00
Oliver Kiddle eaff11c748 48378: complete compadd options for other completion functions 2021-04-09 21:53:41 +02:00
Oliver Kiddle f3caff1536 48437: fix pid completion when cursor is in the middle of the line 2021-04-09 21:51:31 +02:00
Felipe Contreras 69ffb0bf0a 47786: prepare for autoconf 2.70 2021-04-09 21:49:14 +02:00
Felipe Contreras df48cc8404 47785: remove deprecated autoconf functions
STDC_HEADERS and TIME_WITH_SYS_TIME are deprecated.
2021-04-09 21:45:11 +02:00
Jun-ichi Takimoto 62e86515e7 48416: update _gcore for macOS and GNU 2021-04-08 22:24:52 +09:00
Daniel Shahaf e4a8740c78 48410: FAQ, METAFAQ: Mention zsh-security@. 2021-04-08 02:31:58 +00:00
Daniel Shahaf 4ba9008ec7 48379: Make the parameter expansion subscript flags parse error message, "error in flags", identify the location of the parse error. 2021-04-08 02:19:39 +00:00
Daniel Shahaf 295fbc0998 48321 (tweaked per thread): _perl_modules: Don't assume ${words[1]} to be either "perl" or "perldoc"
Also, correct an always-true condition guarding the fallback @INC
codepath.
2021-04-08 02:17:08 +00:00
Daniel Shahaf 608e49ac19 48425: Add an XFail test for a 'zstyle -L' escaping bug (workers/48424). 2021-04-07 17:45:57 +00:00
Jun-ichi Takimoto 9562a1ee7b 48391: fix display problem in menu-complete
Take account of the trailing file type character even when '-d disp'
is given to compadd.
2021-04-06 23:38:52 +09:00
Jun-ichi Takimoto 0f62e07c80 48389: getkeystring() should not return ptr to local var
Now it returns NULL if called with GETKEY_SINGLE_CHAR and next character
is not found. Caller must check the return value.
2021-04-06 23:05:03 +09:00
Marc Chantreux ccc7ff90a4 users/26579: changes from review including parameter expansion to replace awk 2021-04-06 14:42:07 +02:00
Oliver Kiddle 2c000ee7ba 48414: quote closing bracket to adapt for change in 43928 2021-04-06 14:20:32 +02:00
Marlon Richert aaf619cc22 48413: Fix _expand completion test 2021-04-06 13:59:43 +02:00
Oliver Kiddle e3c4c80f3e unposted: add several references to bugs in old list posts 2021-04-06 11:00:53 +02:00
Daniel Shahaf c0034b3c7b unposted: FAQ: Move the 'The mailing lists have moved' notice to a more appropriate place. 2021-04-05 22:38:15 +00:00
Felipe Contreras 94b5446838 47784: silence a compiler waring from pattern.c 2021-04-04 14:48:01 +09:00
Jacob Gelbman 7a81e6344f 48218 (+ 48354): various improvements for _gcc 2021-04-04 13:39:32 +09:00
Oliver Kiddle 0721060f36 47510: drop code that avoided termcap for named colours
The inconsistency caused test failures where TERM is e.g. rxvt-unicode.
This also makes a couple of bits available in zattr by removing flags
indicating whether to use termcap which is not an attribute as such.
2021-04-03 00:58:45 +02:00
Oliver Kiddle 714864a87b 48356: clarify (the intended) behaviour for the two anchor forms of matching control 2021-04-03 00:58:18 +02:00
Daniel Shahaf ad7948611c unposted: BUGS: Add 39319, a named-file process substitution cleanup bug. 2021-04-01 21:17:14 +00:00
Mikael Magnusson ea3351c496 48202 + 48366: Fix handling of NUL bytes in zexpandtabs multibyte version 2021-04-01 09:50:52 +02:00
Caleb Maclennan 3afdfef31c github #74: Drop vcsh completions, maintained upstream
See discussion on upstream project here:

https://github.com/RichiH/vcsh/issues/270
2021-03-31 12:16:34 +02:00
Marlon Richert 07a30613f0 48214: add file types to _expand completions, so they can be colored through complist 2021-03-31 01:20:36 +02:00
Syphdias 5d0bb152ef 48192: Fix _openstack completion for new style clients 2021-03-31 01:16:25 +02:00
Marc Chantreux 7518b20a01 users/26557: add bookmarks support and remove the header from the final list in surfraw completion 2021-03-31 01:16:21 +02:00
Aleksandr Mezin fc82e8193b 47561 (the git and cvs parts) (compare 44919 + 44920): vcs_info internals: cvs, git: Set ${vcs_comm[basedir]} like all other backends do.
That doesn't affect anything, not even other vcs_info internals; it's
just for consistency across backends.
2021-03-29 17:03:40 +00:00
dana 2ffd292833 47737: _zstyle: Fix option completion when positional arguments are already present (regression from workers/39659 (commit ae3b675ce6))
The following case:

    LBUFFER='zstyle -'
    RBUFFER=' foo bar'

Before this patch, completed 'context pattern' (from the first
positional argument).

With this patch, completes options, which is correct.
2021-03-29 13:44:44 +00:00
Daniel Shahaf aebdbfd7ba unposted: ChangeLog: Fix X-Seq numbers for the 39657, 39658, 39659 patch series. 2021-03-29 13:33:46 +00:00
Daniel Shahaf 3d2814072a unposted: docs: _arguments: Fix a typo in the example. 2021-03-29 13:33:45 +00:00
Jacob Gelbman ab166725dd 48166: add completion for ctags language options 2021-03-29 00:50:42 +02:00
Arseny Maslennikov e469b8c4e3 48210: Introduce new completion for setpriv(1) on Linux 2021-03-28 12:47:36 +02:00
Arseny Maslennikov 14709db6d6 48212: Introduce new completion for Linux task capabilities 2021-03-28 12:27:12 +02:00
Štěpán Němec 42de9318f1 48231: add missing git --pretty formats and improve descriptions 2021-03-28 10:49:34 +02:00
Oliver Kiddle d7c8d6826d 48230, 48233 (Jun T): completion of dtrace probes and runtime options 2021-03-28 10:38:13 +02:00
dana d3906d7a2f 48216: Fix broken Y01 test from workers/48180 2021-03-28 00:22:59 -05:00
Daniel Shahaf 2c062e8e69 48131/0004: FAQ: 3.31: Rearrange 2021-03-26 23:20:20 +00:00
Daniel Shahaf 7c201b1b3e 48131/0003: FAQ: 3.31: Move two paragraphs unchanged, reordering them
Factored out from the next patch for readability of the diff.

The answer, as it stands in this commit, doesn't flow correctly.  In
order to keep the diffs small and easy to follow, this commit simply
adds a TODO to record this issue, a TODO which is fixed by the next
commit in this series (the child of this commit).  Thus, a request:

DEAR PEOPLE FROM THE FUTURE: Please don't create new branches off this
commit; create them off the parent commit or off the child commit
instead.  Thank you.
2021-03-26 23:20:20 +00:00
Daniel Shahaf 2ad942b758 48131/0002: FAQ: 3.31: Tweak summary paragraph 2021-03-26 23:20:19 +00:00
Daniel Shahaf a5a093d5fe 48131/0001: FAQ: 3.31: Add a one-sentence summary 2021-03-26 23:20:19 +00:00
dana 78cf455871 unposted: Improve documentation and add regression test for workers/47745 2021-03-23 00:26:21 -05:00
Stephane Chazelas d96c898101 47745: Fix [:IDENT:] vs posixidentifiers
wcsitype(c, IIDENT) should return false for non-ASCII characters
when the POSIX_IDENTIFIERS option is on, not the other way round.
2021-03-23 00:15:09 -05:00
Marlon Richert f4a248f9d3 48180: Start menu selection with select=long-list in menu style 2021-03-17 12:50:57 -05:00
Daniel Shahaf f87b73e677 48147/0002: zmathfunc: Fix bug where the exit code would be non-zero if the expression evaluted to zero. 2021-03-07 21:58:13 +00:00
Daniel Shahaf 6a2a8acf09 48147/0001: tests: Add a unit test for zmathfunc and a regression test for workers/48146 affecting it. 2021-03-07 21:58:12 +00:00
Jacob Gelbman 5ede2c55f1 48105: Update ctags completion with format fix 2021-02-24 09:24:37 +00:00
Jacob Gelbman 055ce78401 48096: New ctags completion 2021-02-23 10:10:34 +00:00
Arseny Maslennikov 8b67c36d92 48094: apply cleanup commands of the current theme on any theme change
* Rename zstyle `cleanup' on the context `:prompt-theme' to `restore'
  everywhere but in prompt_cleanup(). It is only used as a restore
  mechanism now.
* Ensure prompt_cleanup() continues to store its command list in the
  `cleanup' style.
* Clean up before theme switch at the end of set_prompt().
* Prepend every use of prompt_*_setup (which might modify the shell
  state in ways that require cleanup) with a cleanup run.
* Adjust `prompt restore' to do both parts of the newly split restore
  mechanism, cleanup first.
2021-02-22 20:29:55 -08:00
Arseny Maslennikov 5c60ec46ec 47867: Fix RPROMPT typo in prompinit 2021-02-19 18:39:22 -06:00
Peter Stephenson 6bef719302 users/26509: fix for r -L
fc with the -L option should ignore remote entires, rather than
reading them and treating them as an error.
2021-02-18 21:37:08 +00:00
Martijn Dekker 9c0533931c 48073: Add fc -s as POSIX way of rerunning command without starting editor 2021-02-17 10:21:08 +00:00
Justine Tunney 326d9c203b Allow more scripts without #!
This change modifies the zsh binary safety check surrounding execve() so
it can run shell scripts having concatenated binary content. We're using
the same safety check as FreeBSD /bin/sh [1]. POSIX was recently revised
to require this behavior:

    "The input file may be of any type, but the initial portion of the
     file intended to be parsed according to the shell grammar (XREF to
     XSH 2.10.2 Shell Grammar Rules) shall consist of characters and
     shall not contain the NUL character. The shell shall not enforce
     any line length limits."

    "Earlier versions of this standard required that input files to the
     shell be text files except that line lengths were unlimited.
     However, that was overly restrictive in relation to the fact that
     shells can parse a script without a trailing newline, and in
     relation to a common practice of concatenating a shell script
     ending with an 'exit' or 'exec $command' with a binary data payload
     to form a single-file self-extracting archive." [2] [3]

One example use case of such scripts, is the Cosmopolitan C Library [4]
which configuse the GNU Linker to output a polyglot shell+binary format
that runs on Linux / Mac / Windows / FreeBSD / OpenBSD.

[1] 9a1cd36331
[2] http://austingroupbugs.net/view.php?id=1250
[3] http://austingroupbugs.net/view.php?id=1226#c4394
[4] https://justine.lol/cosmopolitan/index.html
2021-02-16 09:16:20 +00:00
Lawrence Velázquez 83cc7c6bf0 47830: Fix some documentation typos 2021-02-16 00:59:14 +00:00
Oliver Kiddle d909dc7323 unposted (Daniel): add exclusion list missed in recent OpenBSD update to locale completion 2021-02-13 01:15:10 +01:00
taiyu 3714ee0b58 github #68: support section suffix completion for man pages
Support prepend and suffix values for insert-sections
Add values for insert-sections for zstyle completion
2021-02-13 01:01:40 +01:00
Joshua Krusell 3d6e5b6231 47905: Add leading '-' to zparseopts option parsing errors 2021-02-13 00:54:59 +01:00
Bart Schaefer 2cf6032a30 47997: Disable XTRACE around user-defined completion widgets. 2021-02-11 19:13:47 -08:00
Oliver Kiddle 073092f89d 47944: update completions for NetBSD 9 2021-02-08 00:40:10 +01:00
Oliver Kiddle 25d69da85c 47943: update completions for DragonflyBSD 5.8.3 2021-02-08 00:06:57 +01:00
Oliver Kiddle 2edac834a8 47932: update completions for procps 3.3.16 2021-02-07 02:54:21 +01:00
Oliver Kiddle b17449352e 47931: update completions for OpenBSD base up to 6.8 2021-02-07 02:37:45 +01:00
Oliver Kiddle 509e84ef44 47930: update completions for FreeBSD base up to 12.2 2021-02-07 02:13:10 +01:00
Oliver Kiddle ceb25d9495 47929: complete newer possible values for the sort style 2021-02-07 01:52:40 +01:00
oxiedi 2b2353fc8f based on github #62: return proper exit status 2021-02-07 01:27:23 +01:00
DCsunset f59b6f6df3 github #66: Add more commands to _todo.sh 2021-02-07 01:02:10 +01:00
oxiedi df7fd1322c github #63: fix regression caused by 44274, with sort style -o could break _values 2021-02-07 00:51:41 +01:00
Semnodime ed160f268a github #72: Fix unix command lldb tab-completion
The --arguments are space (` `) separated, not equal-sign (`=`) separated.
lldb --correct c_arg --wrong=w_arg
2021-02-07 00:25:24 +01:00
aaaz 645c89af6d gitlab !16: Allow spaces between short options and their parameters in _transmission
This matches the summary listed in the `transmission-remote` man page and the program's actual behavior.
2021-02-07 00:10:41 +01:00
Oliver Kiddle 4bea58d0c4 47919: use common function for completing BSD login classes
also update for options to env on FreeBSD and Dragonfly
2021-02-06 00:23:20 +01:00
Oliver Kiddle ba48357315 47918: new util-linux completions for nsenter and unshare 2021-02-06 00:05:48 +01:00
Bart Schaefer b8ec0ddba5 unposted: Add cindex entries for some subsections 2021-02-05 13:50:58 -08:00
Bart Schaefer 465738fc25 47895: Remove trailing spaces from "print -ac" output lines. 2021-02-04 17:52:22 -08:00
Bart Schaefer b803fbaa14 47865: More tests for globbing in restricted directories 2021-02-04 17:03:46 -08:00
Bart Schaefer 6db45b94d8 47889: Update csh aliasing equivalences 2021-02-04 17:01:07 -08:00
Joshua Krusell 9120d1e841 47899: Improve error message from zparseopts. 2021-02-03 11:33:47 +00:00
Jun-ichi Takimoto 93c4cc0d8f 47883: _awk: support gawk ver.5 2021-02-01 09:40:34 +09:00
Peter Stephenson 8f42ecd8ee 47873: Improve completion within dynamic directory names 2021-01-27 11:16:55 +00:00
GammaFunction 5d14b6eb71 47744: Fix vi repeats with hooks in use. 2021-01-27 10:04:40 +00:00
Daniel Shahaf e15dce8ced unposted: Etc/FAQ.yo: Fix a typo in the front matter. 2021-01-26 20:51:19 +00:00
Paul Seyfert 07765d5901 github #71: _xrandr: Complete providers
* complete `xrandr --setprovideroutputsource` by calling `xrandr
   --listproviders`
2021-01-24 13:32:05 -06:00
Bart Schaefer b374f7b318 users/26406: preserve caller setopts in zargs 2021-01-23 13:25:24 -08:00
Jun-ichi Takimoto 6e20f0e3d1 47849: do not skip tests requiring zpty on Cygwin 2021-01-20 13:49:42 +09:00
Peiyuan Song bf8ca5f019 47840: make zpty module work on Cygwin 2021-01-20 13:33:52 +09:00
dana ce0660b7ba NEWS: Catch up on new features 2020-12-12 21:45:19 -06:00
Jun-ichi Takimoto 34eae73490 47731 (+unposted): add run-help assistant for btrfs
also fix format errors in contrib.yo
2020-12-11 17:27:47 +09:00
Samir Benmendil f493b438fd 43946: call run-help for the command given to sudo 2020-12-11 17:20:45 +09:00
Bart Schaefer 5a9e632638 unposted: index compprefuncs and comppostfuncs 2020-12-05 13:29:25 -08:00
Daniel Shahaf 74f4cbfcb6 47716: Etc/BUGS: Add Alekxandr's vcs_info patch. 2020-12-04 15:54:16 +00:00
Bart Schaefer 3499a676fa 47704: fix scope for "private -p" 2020-12-02 20:14:45 -08:00
Bart Schaefer d394bb2277 unposted: missed update from users/26150 commit 2020-12-02 20:10:59 -08:00
ivan tkachenko 038f537a2a 47547: docs: Specify the exact kind of quoting which is assumed when parsing arithmetic expressions 2020-11-16 18:07:53 +00:00
Jun-ichi Takimoto bd647c1565 47560: add includes/prototypes for tests in configure
On macOS 11.0 it is now an error to use a function without prototype.
2020-11-16 20:59:51 +09:00