Thanks. This is OK, 0 Fri 0:08:54 DaveBook yost /Users/yost 215 Z% print -z echo foo 0 Fri 0:09:33 DaveBook yost /Users/yost 216 Z% echo foo but there must be a way to replace the current command line rather than setting the contents of the next one, yes? On Thu 2014-06-12, at 11:40 PM, Bart Schaefer wrote: > On Jun 12, 4:07pm, Dave Yost wrote: > } Subject: shell script that replaces the command line > } > } Can a shell function replace the command line contents? I know a > } widget can do it, but I can't see a way for a shell function to do > } that. > > The "print -z ..." command loads the buffer stack, which is then popped > into the editor buffer at the next prompt (e.g., after the calling > function/script exits).