Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Bad effect of error in zle-line-pre-redraw
- X-seq: zsh-workers 39926
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Bad effect of error in zle-line-pre-redraw
- Date: Sat, 12 Nov 2016 09:03:15 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:to:subject:mime-version; bh=QJfBhZHK9r4PLYUgTMzaWikdYfWe7YJGRiJlAhKYJmY=; b=N/G8hmUKZJ+utDAXbDMgCT+aT+ZxujdD0ve6Rl3SUPM0VgEULq6+hyTUVui7wzXSq1 RJK9FBzt+RNlsw9cJxMf7OMbkmdDH3xpK6+HFBsvewR5UP9QUD7vjBRfFFLCRuNq+xm0 L1qsbadtOiUuKdVjXdlysqmaztKsi9DZFALblo333oAnaaus+Q0iU8VURagxss5x6Jw1 0iHybLUyuG/20zhx+0BK0Y0bASnTdhH6wwAXMnbEGvg4gsyV1BFPSQVnn1WQFUOueFxl VRIhvNZr7VJSHncNCVtJGAaYhm/wDJ+ZlXfm2S5v1KoKAf5wHS6C56EjQCvEMAQTmAAl D4Pg==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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