Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Bad effect of error in zle-line-pre-redraw



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.



Messages sorted by: Reverse Date, Date, Thread, Author