actually I have another question, is there a similar way of setting the initial cursor position like I would do setting the CURSOR var in zle widgets? Pier Paolo Grassi Il giorno ven 29 apr 2022 alle ore 16:16 Pier Paolo Grassi < pierpaolog@gmail.com> ha scritto: > perfect, thanks! > > Pier Paolo Grassi > > > Il giorno ven 29 apr 2022 alle ore 15:29 Peter Stephenson < > p.w.stephenson@ntlworld.com> ha scritto: > >> > On 29 April 2022 at 14:21 Pier Paolo Grassi >> wrote: >> > hello, I was wondering if it is possible to prepopulate $BUFFER before >> > rendering the prompt. >> > I tried doing so in preexec, but it didn't work. Is there some other >> > function I can override to do this? >> >> You need "print -z" --- it has all the usual options of print but the >> result >> ends up in the line buffer when the line editor starts. >> >> pws >> >>