Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Get cursor position (Was: [bug report] prompt can erase messages written on the terminal by background processes)
On Thu, Dec 8, 2022 at 2:02 AM Stephane Chazelas <stephane@xxxxxxxxxxxx> wrote:
>
> typeset -g "${1-x}=$match[2]" "${2-y}=$match[1]"
>
> Doesn't work either. I guess there's no way to access variables
> by the same name in that parent scope or to unlocal a variable?
trap "typeset -g '${1-x}=$match[2]' '${2-y}=$match[1]'" EXIT
Of course that only works if the assignments are going to be the last
thing in the function. Other quoting games are probably needed to
generalize.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author