1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-13 11:21:13 +02:00
Commit graph

191 commits

Author SHA1 Message Date
Bart Schaefer
e4bd6dc818 users/26736: avoid infinite loop in getbyte from exit hook 2021-05-15 13:51:39 -07:00
GammaFunction
5d14b6eb71 47744: Fix vi repeats with hooks in use. 2021-01-27 10:04:40 +00:00
Peter Stephenson
a6a1b28b98 45487: Missing mod_export declarations for AIX 2020-02-24 10:55:48 +00:00
Jens Schleusener
11dbe4c286 45269: Fix misspellings in completions and elsewhere. 2020-01-09 13:42:02 +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
Oliver Kiddle
06e27e940a 44976: fixup describe-key-briefly for visual mode 2019-12-04 22:55:52 +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
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
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
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
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
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
Stephane Chazelas
4d007e269d 41275: Leave stdin open when executing widgets 2017-06-13 21:34:55 -04:00
Peter Stephenson
34656ec2f0 40305: fix some problems redisplaying command line after interrupt.
Back off previous fix as this only covered some subset of problems.

Remaining problems happend after reset-prompt in TRAPINT.

One was in complist and is fixed by not attempting to list after
an error or interrupt.

The other was owing to not resetting clearflag when ZLE
was re-entered.
2017-01-10 19:18:52 +00:00
Bart Schaefer
c0f95d07e7 unposted: clear ERRFLAG_ERROR before invoking immortal widget (cf. 39934)
Updates commit cbb9ca3d
2016-11-23 18:15:17 -08:00
Oliver Kiddle
cb5f100bd3 39986, 39989: improve handling of vi-repeat-change
Save previous vi change and throw away a new change that fails.
Add zle -f vichange to allow shell widget to be a single change.
Fix repeat of command where numeric arguments were multiplied.
2016-11-20 23:59:48 +01:00
Barton E. Schaefer
cbb9ca3dfb 39934: if a widget execution fails, try to execute a corresponding immortal widget instead. 2016-11-13 15:52:09 -08:00
Barton E. Schaefer
7b8f638713 39933: more of zlecallhook() in redrawhook()
add commentary on some of the differences
2016-11-13 11:04:25 -08:00
Barton E. Schaefer
ccc0b6f8a6 39550: reset signal queue in recursiveedit() 2016-10-03 09:40:39 -07:00
Barton E. Schaefer
b71abea40f 39547: handle zero delta in calc_timeout() 2016-10-03 09:35:14 -07:00
Peter Stephenson
4ab3fcc90d 39545: Add some missing unqueue_signals().
All of these are added simply to fit existing logic in other branches.
2016-10-03 13:43:20 +01:00
Mikael Magnusson
5cf2ffb327 Call the pre-redraw hook if there is text in the buffer on init 2016-09-30 10:48:20 +02:00
Daniel Shahaf
8d7b9d013d 38927: zle-line-pre-redraw: Set $WIDGET like other special widgets do. 2016-07-28 18:12:19 +00:00
Oliver Kiddle
c32bb6a11c 38845: reset region_active before entering zle
It was done on exit but before zle-line-finish.
Also reword documentation on region to better cover vi mode.
2016-07-17 12:09:24 +02:00
Peter Stephenson
2b7035d974 38241: ungetkeycmd() needs to unmetafy key string.
Use the new function to simplify memory management in prefix handling.

Third time lucky.
2016-04-04 14:54:54 +01:00
Barton E. Schaefer
21202e7b95 38191: additional re-entrancy checks in reexpandprompt()
Do not free global pointers until after promptexpand() in case they are
referenced from signal handlers, and check for window size changes during
promptexpand().
2016-03-21 15:46:59 -07:00
Daniel Shahaf
5cf6ae0056 37590: Invoke zle-line-pre-redraw during isearch. 2016-01-14 00:04:12 +00:00
Mikael Magnusson
c3ea3ffa73 36650: Add zle-line-pre-redraw hook for highlighting 2015-12-19 13:21:12 +01:00
Peter Stephenson
0c2d823a79 37337: Delay freeing widget until not in use. 2015-12-07 14:32:52 +00:00
Peter Stephenson
ae4cf7b743 37186: a couple more WARN_CREATE_GLOBAL fixes 2015-11-22 16:06:20 +00:00
Mikael Magnusson
a855d7bd24 36709: zle -f from inside widget to set flags and make yank start/end zle params writable 2015-10-01 03:51:44 +02:00
Peter Stephenson
e1c0a947cc Read full multibyte string early for self-insert 2015-09-11 21:40:45 +01:00
Barton E. Schaefer
3bca11c35c 36470: Auxiliary to 36468, return an empty buffer from zleread() if a widget exits 2015-09-10 09:10:08 -07:00
Oliver Kiddle
aee8aebd67 35814: POSTEDIT needs to be unmetafied 2015-07-23 05:22:46 +02:00
Oliver Kiddle
acb05d1616 35674: make an undo event for initial buffer contents 2015-07-03 22:56:03 +02:00
Oliver Kiddle
6e57de8ee2 35637: remove the now unused module hook for reverse-menu-complete 2015-06-29 01:59:43 +02:00
Oliver Kiddle
98687fa1de 35474, 35492: support the bracketed paste mode of newer terminal emulators 2015-06-19 00:15:38 +02:00
Peter Stephenson
2f3547689c 34653: move aborted vared lines to ZLE_VARED_ABORTED 2015-03-06 09:51:16 +00:00
Peter Stephenson
d067ebcacd 33876: etc.: Separate errors and keyboards interrupts
Combination of 12 commits from interrupt_abort branch.

Basic strategy is to introduce bits to errflag and to set and
reset them separately.

Remove interrupt status on return to main keymap.

Turn off ERRFLAG_INT for always block.

Restore bit thereafter: we probably need a new variable in order
to allow user interrupts to be reset in the always block.

Add TRY_BLOCK_INTERRUPT

This works the same as TRY_BLOCK_ERROR, but for a SIGINT, too.

Ensure propagation of SIGINT from exited job.

If received by foreground job, shell uses ERRFLAG_INT, not
ERRFLAG_ERROR, to set the new state.

Reset errflag before precmd()

Add always block in _main_completion to fix ZLS_COLORS

Ensures we get the right state of $ZLS_COLORS at the end of _main_complete
even if there's an interrupt.  However, the "right state" is a bit messy
as it depends on styles.
2014-12-11 09:41:17 +00:00
Oliver Kiddle
40c5e00de0 33800: remove old workaround for ancient systems to
consume typeahead before setting up the terminal
2014-11-30 23:29:25 +01:00
Oliver Kiddle
feda07c641 33770: avoid calling identical FIONREAD ioctl twice in succession 2014-11-25 22:14:50 +01:00
Oliver Kiddle
15fc2cd4f0 33632: use viopp and visual local keymaps if they exist 2014-11-17 00:49:31 +01:00
Oliver Kiddle
a39c3adece 33512: add support for "0 vi buffer and yank to it 2014-10-23 17:00:31 +02:00
Barton E. Schaefer
7e04c1a53d 32427: avoid busy loop on closed descriptors for "zle -F" handlers
Also assure the handlers are called on error conditions and document the
extra argument that is passed in the error case.
2014-02-23 18:14:12 -08:00
Oliver Kiddle
e1bc9d0a44 32342: fix overstrike for vi mode and use varying vi commands at line start 2014-02-05 21:55:18 +01:00
Oliver Kiddle
2cd3b9ab74 32334 (modified so KEEPSUFFIX is unchanged for vi-cmd-mode; based on
Jun T: 32324, 32330), 32347, Jun T: 32344, 32349:
add split-undo zle widget for configurable breaks in undo sequence
2014-02-05 21:45:19 +01:00
Oliver Kiddle
a8c4ed64ee 32314: merge undo events corresponding to vi change in the vi-cmd-mode widget so undo from insert mode is useful again 2014-01-31 14:03:47 +01:00