Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Add execute-command() widget function (was Re: [RFC][PATCH] Add change-directory() widget function)



On Sat, Apr 24, 2021 at 1:07 PM Marlon Richert <marlon.richert@xxxxxxxxx> wrote:
>
> (Also, I switched from macOS's Mail app back again to Gmail's web app. Let's see how that goes for the line wrapping.

In the gmail web app, you need to pop open the three-dot menu next to
the trash can at bottom right, and select "Plain Text Mode".  Then
gmail will wrap the lines (sometimes where you don't want it to, but
that's why the patch is an attachment).

> On Fri, Apr 23, 2021 at 2:27 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>>
>> Then how about:
>
> I tried a similar approach with `eval` before, but that doesn't play nice with all prompts, as I outlined in workers/48622:

OK, then this:

execute-command () {
  case $CONTEXT in
    (cont|start)
      print -z "$PREBUFFER$BUFFER"
      print -S "${${(q-)@}}"
      eval "${(q-)@}"
      ;;
    (*) return 75 ;;
  esac
  zle .send-break
}




Messages sorted by: Reverse Date, Date, Thread, Author