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

Re: path PATH




On 2023-01-25 20:27, Ray Andrews wrote:

You've copy-pasted wrong somewhere and have $( where you should have ${


     for name in ${(k)parameters}; do
       if [[ -z ${(P)name} ]]; then
         print -r -- $name
       fi
     done

That's what I'm running.  I suspected the same thing but ....

Strange, I fired up the computer today, run exactly the same command and no message.  Fool around for a while and it comes back.  Restart shell ... no change.  Restart terminal and it goes away.  I'll try to figure out exactly what triggers it.  Must be some environment corruption.

Bart:

In your (temporarily name-shortened) describe-params, I'm trying to capture the output to a variable for further processing:

#describe-params ()
dp ()
{
    emulate -L zsh -o extendedglob
ddescribeparams=()
local line=
    set -- ${(ok)parameters[(I)${~${(j.|.)@}}]}
    while ((ARGC))
    do
#        print -rn -- "${parameters[$1]} "
        line+="${parameters[$1]} "
        if [[ -${parameters[$1]}- = *-hideval-* ]]
        then
            # If param is hidden, typeset won't show anything so use this:
#            print -r -- ${(q-)1}
            line+="${(q-)1}"
        else
#            typeset -m -- ${(b)1}
            line+=$( typeset -m -- ${(b)1} )
        fi
ddescribeparams+="$line"
line=
    shift
    done
print -l -- $ddescribeparams
}

...

            line+=$( typeset -m -- ${(b)1} )

... isn't working with eg:

$ typeset -m yellow

yellow=$'\C-[[33;1m'

... the predictable thing is happening and the color code gets applied and my terminal turns yellow.  How can I capture the value of yellow without that problem?  I've run into this before but I can't remember the solution.









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