zsh-workers
 help / color / mirror / code / Atom feed
* Bad effect of error in zle-line-pre-redraw
@ 2016-11-12 17:03 Bart Schaefer
  2016-11-12 17:54 ` Mikael Magnusson
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Schaefer @ 2016-11-12 17:03 UTC (permalink / raw)
  To: zsh-workers

If you happen to introduce an error into zle-line-pre-redraw,
your shell is pretty badly wrecked -- ZLE resets itself after every
character typed.  Stupid minimal example:

torch% zle-line-pre-redraw() { : ${bad_subscript[missing-bracket} }
torch% zle -N zle-line-pre-redraw
torch% e
zle-line-pre-redraw: invalid subscript
torch% e
torch% c
zle-line-pre-redraw: invalid subscript
torch% c
torch% h
zle-line-pre-redraw: invalid subscript
torch% h
torch% o
zle-line-pre-redraw: invalid subscript
torch% o
torch% 

Why the missing bracket isn't a syntax error at parse time rather
than an evaluation error at run time is left as an exercise; e.g. ksh
complains when defining the function.

Other hook functions (zle-history-line-set, etc.) don't have this side-
effect.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-11-14 12:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-12 17:03 Bad effect of error in zle-line-pre-redraw Bart Schaefer
2016-11-12 17:54 ` Mikael Magnusson
2016-11-12 20:41   ` Bart Schaefer
2016-11-13 14:45     ` Mikael Magnusson
2016-11-13 18:55       ` Bart Schaefer
2016-11-14 11:15         ` Mikael Magnusson
2016-11-13 19:16     ` [PATCH] Widget fallbacks (Re: Bad effect of error in zle-line-pre-redraw) Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).