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

Re: ZSH's way to bind function to a key in a script?



2011/3/9  <nix@xxxxxxxxxxxxxxxx>:
> Can't get it working in a script. Tried both vt100/xterm terminals but nada.
> My purpose is this:
>
> while [ : ] ; do
>
> ...
>
> A user press the space button and he will see the script progress ....
>
> done

Then it's unrelated to bindkey ;-)

Try this:

while [ : ]; do
    read -ks a
    [[ $a = ' ' ]] && foo
done

Have a look at “man zshbuiltins” for more about the “read” builtin.

Best regards,

-- 
Jérémie



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