Take the 2-minute tour ×  Is it possible to use zsh's built-in
line editor (zle) to feed input to a subprocess? That is, I
would like to run zlewrap mycommand where zlewrap is a zsh
function and mycommand is any program that just reads lines from
stdin; zlewrap would effectively provide zle's line-editing
capabilities to mycommand. This is on the model of rlwrap which
does just this, but with readline and not zle for line editing.
share|improve this question This looks helpful:
zsh.org/mla/users/2004/msg00917.html . It's not as easy as a
single command, but you can adapt this script to your program
(read the follow-ups for corrections). –  imgx64 Jan 7 '11 at
7:58 One problem I have when I think of solutions is how do you
indicate when you want to be 'editing' in the ZLE and when you
want to be waiting for the 'mycommand' to return? Does it only
ever return one line? –  polynomial Aug 27 '11 at 2:42
@polynomial wrappers like this return one line at a time to the
process behind them. Use of rlwrap is quite wi