Commit graph

1184 commits

Author SHA1 Message Date
Peter Stephenson
c557cee1a6 24581: Fix array assignments in shell word splitting and completion.
Assignments after the first were not recognised as such as without
the full parser the state didn't return to command position.
Fix this in bufferwords() and the completion miniparser.
2019-12-31 18:35:06 +00:00
Daniel Shahaf
8bc4400762 45058: internal: Add symbolic names to possible values of zexit()'s "from_where" parameter. No functional change. 2019-12-17 05:12:36 +00:00
Peter Stephenson
ae58388619 44997: GLOB_COMPLETE fix for compctl file completion.
Dashes could cause problems in directory prefixes.
2019-12-10 10:32:48 +00:00
Oliver Kiddle
06e27e940a 44976: fixup describe-key-briefly for visual mode 2019-12-04 22:55:52 +01:00
romkatv
6c6200520a unposted: fix indentation (whitespace-only change)
Indentatin in moveto was broken by 3eea35d0 (my bad), making it
difficult to read. This commit reverts it to what it used ot be.
While at it, fix indentation in a few other places in the same
file.
2019-10-28 12:00:55 +01:00
romkatv
243e46998e bug fix: infinite loop when tty disappears
When TTY disappears and there is at least one fd watcher, raw_getbyte() can
enter an infinite loop where it keeps calling poll() over and over again.

To reproduce, open a terminal, start zsh and type this:

  rm -f /tmp/fifo
  mkfifo /tmp/fifo
  exec 3<>/tmp/fifo
  do-nothing() {}
  zle -F 3 do-nothing

Then make TTY disappear. For example, kill the parent with `kill -9 $PPID`
and close the terminal window if it's still there. Observe that zsh is
consiming 100% CPU. Note that do-nothing() never gets called.

This patch makes the poll() loop in raw_getbyte() terminate when TTY is
signalling POLLHUP. This makes the behavior consistent with the case where
TTY disappears while no fd watchers are installed.
2019-10-04 14:18:18 +02:00
Kamil Dudka
d6a9e222ec 44582: Fix foregoing commit to use DPUTS() better 2019-07-26 16:36:14 +01:00
Kamil Dudka
f9cd218787 44566: make sure Zle doesn't crash if history entry not found 2019-07-24 17:14:06 +01:00
Peter Stephenson
b8dc5a7f6d 44435: Handling digita arguments for :h and :t.
Pick number of leading or trailing path components to substitute.
Active in history, brace parameters, glob qualifiers.

Add tests for all three environments.
2019-06-20 11:13:05 +01:00
romkatv
3eea35d085 fix cursor position with ZLE_RPROMPT_INDENT=0 2019-05-28 09:39:22 +01:00
dana
c1a33575b4 44275: Fix compset -p/-s multibyte inconsistency and documentation 2019-05-08 16:35:08 -05:00
Oliver Kiddle
cd6fd2b0a3 44274: allow finer control of completion match soring with compadd's -o option 2019-05-07 23:24:49 +02:00
Peter Stephenson
5e11082349 44168 (tweaked to remove change to errflag): Fix interrupt handling of zle -F.
If interrupted by irrelevant interrupt (EINTR only is set), don't set
the local error flag, just retry.
2019-04-10 20:56:53 +01:00
Roman Perepelitsa
c551937280 44215: Maintain LASTWIDGET across reset-prompt.
This avoids side effects of asynchronous notifications.
2019-04-10 09:41:04 +01:00
Peter Stephenson
fe228c5984 44202: Rewrite to use memmove() for possibly overlapping copy 2019-04-10 09:31:41 +01:00
Peter Stephenson
e25de2de74 c.f. 44062: Back off clearflag change to ZLE line init.
This causes problems with failed ZLE reads that printed a message
in the display area, in particular ignoreEOF warnings.

It appears it's not needed for the overall effect of the fixes in
zsh-workers/40302, commit 34656ec2.
2019-02-14 11:41:19 +00:00
Peter Stephenson
232b43571f 43969: untokenize Dash for compctl with GLOB_SUBST set 2019-01-03 13:51:19 +00:00
Kamil Dudka
031afe4207 43793: computil could overrun buffer 2018-11-09 10:57:09 +00:00
Oliver Kiddle
50597692e0 43759: add support for true colour terminals 2018-11-05 22:24:12 +01:00
Daniel Shahaf
d756c4d5cb 43531: Completion: Fix some false positives in the logic for "are these two candidates completions equivalent". 2018-09-30 22:18:46 +00:00
Peter Stephenson
3ad2ca3305 Don't handle ZLE functions for single key.
For read -k and read -q where we use ZLE, we just want a single
key and not full ZLE processing.  So don't handle timed
ZLE functions when preforming the read.
2018-09-03 10:09:22 +01:00
Peter Stephenson
3c93497eb7 43294: Add ZLE_RECURSIVE parameter. 2018-08-17 19:43:17 +01:00
Jun-ichi Takimoto
baedd62f0d 43219 (except term{cap,info}.c): fix several memory leaks 2018-07-31 22:15:58 +09:00
Peter Stephenson
e6f2d776d3 43225: Recalculate ZLE timeout.
Needed when looping owing to having handled a special fd.
2018-07-30 15:39:51 +01:00
Peter Stephenson
0a6cb5078d 43084: Variable warning suppression enhancements.
Add vared -g option along the lines of typeset -g.

Set reply safely in zsh_directory_name_cdr.
2018-06-25 09:31:40 +01:00
Eitan Adler
6a3b23e9cc 42939: pm argument to set_registers is not unused 2018-06-06 09:33:28 +01:00
Jun-ichi Takimoto
1a97dcbed1 42870: another improvement of 'compset -q'
zlemetall need not count the 'x' added at the cursor in set_comp_sep()
2018-05-31 21:07:53 +09:00
Jun-ichi Takimoto
e5f356a95e 42809: slightly improve 'compset -q' 2018-05-25 21:11:20 +09:00
Oliver Kiddle
f0c2cf8607 42760: move stack variable outside while loop scope as it is accessed in the while condition 2018-05-13 09:51:05 +02:00
dana
eeeba19c96 42185: safety when removing separators in completion 2018-05-11 09:33:05 +01:00
Peter Stephenson
c8ceb66ba3 42751: Protect shell status in ZLE timed function handler.
Otherwise status from sched and other asynchronous functions
could escape back to the main shell.
2018-05-08 10:18:19 +01:00
Oliver Kiddle
8e6c1d8b47 42605: properly free the vi registers hash 2018-04-07 18:52:37 +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
25da576c29 42575: fix to not complete options in the argument to another option 2018-04-05 11:14:58 +02:00
Oliver Kiddle
259ac472ea 42519, CVE-2018-1083: check bounds on PATH_MAX-sized buffer used for file completion candidates 2018-03-24 15:04:39 +01:00
Jun-ichi Takimoto
e4a8069b32 42501: avoid out of bound pointer (as 42487) 2018-03-24 15:22:10 +09:00
Peter Stephenson
bc349023aa 42487: Fix pointer problems in compctl.
Pointing off the front of a string caused warnings with
gcc 7.3.0 and is somewhat murky C anyway.
2018-03-21 10:29:22 +00:00
Peter Stephenson
1d6954bd2f 23180: Fix expand-or-complete with ~[...].
The square brackets shouldn't be treated as wildcards.
2018-02-26 21:43:12 +00:00
dana
1af28cbfd7 42164: fix digits in format escapes in completion listings 2018-01-04 17:16:18 +00:00
dana
932ed86483 dana: 42145: Fix additional completion cases with option arguments. 2017-12-20 09:07:28 +00:00
Jun-ichi Takimoto
dae5d1d5ba 42412: fix a bug in 42116
Also fix a few widgets which were calling wrong function when negative
numeric argument was given.
2017-12-18 23:49:31 +09:00
Jun-ichi Takimoto
5f33a93afb 42116: multibyte support for ZLE vi-mode word motion 2017-12-18 12:48:25 +09:00
Oliver Kiddle
1bfcff129d 41983: fix exclusion of long options with (-) on a normal argument 2017-11-04 00:57:48 +01:00
Oliver Kiddle
233c0e8903 41835: handle multibyte characters with compset -p and -s 2017-10-11 01:23:42 +02:00
Oliver Kiddle
12902206b7 41824: fix to not complete rest args from an _arguments set alongside the argument to and option in a separate set 2017-10-07 22:35:59 +02:00
Oliver Kiddle
80a02c10aa 41772: fix bug in handling of long options with _arguments' -A option 2017-09-28 09:31:35 +02:00
Peter Stephenson
85b0dd7133 Updates for ksh array element syntax.
Move detection of key/value pairs down into prefork().

Detect normal array assignment and [key]=val array assignemnt
separately.  Mark key / value pairs with Marker and pass up flag.  Deal
with marked triads specially later on.
2017-09-24 17:33:07 +01:00
Maxime de Roucy
cdd9402224 Avoid invalid access with isearch in completion list 2017-07-04 09:38:23 +01:00
Peter Stephenson
e19955614f 41368: Add missing unqueue_signals() to compctl. 2017-06-27 10:12:55 +01:00
Barton E. Schaefer
efae75f648 41242: zstrbcmp(...) removed in favor of zstrcmp(..., SORTIT_IGNORING_BACKSLASHES)
This should make sorting consistent in completion listings vs. elsewhere.
2017-06-17 10:25:43 -07:00