On 21 Apr 2021, at 00:32, Bart Schaefer wrote: > My only remark about this as-is, is that it would have potentially > dangerous side-effects if invoked at a PS2 or PS3 prompt. > > Potential fixes - begin the widget function with: > [[ ${(%):-%_} = select ]] && return 1 > [[ -n "$PREBUFFER$BUFFER" ]] && zle push-input On 21 Apr 2021, at 06:46, Bart Schaefer wrote: > Oh, I missed this: > >> On Tue, Apr 20, 2021 at 1:13 PM Marlon Richert wrote: >>> @@ -0,0 +1,29 @@ >>> +zle .push-line-or-edit > > That's still wrong, because in the event there's a PS2 prompt, you'll > never get past this line. You need .push-input here. My suggested > test for $PREBUFFER is probably not actually needed. Thank you both (Bart & Daniel) for your input. I added better safeguards against the non-PS1 cases, rewrote the function to be more generic and added comments. New patch attached.