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

Re: zkbd fails: must be run as a function or shell script, not sourced



On 13/03/2008, Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx> wrote:
> Hi workers,
>
>  The zkbd function currently fails to start. In particular, it seems to
>  be the following test (I don't actually understand how that test works
>  at all :-):
>
>  [snip]
>  [[ -o interactive ]] && {
>     local -i ARGC
>     (ARGC=0) 2>/dev/null || {
>         print -u2 ${0}: must be run as a function or shell script, not sourced
>         return 1
>     }
>  }
>  [snap]
>
>  Since this worked before, I git-bisected my way through the younger
>  zsh code history and I was able to find the commit that breaks it for
>  me.

fwiw, with current cvs i get this, which seems to be the intended result:
{21:31:03|~}% zsh .zsh/zkbd
Enter current terminal type: [rxvt-unicode]
{21:31:07|~}% source .zsh/zkbd
.zsh/zkbd: must be run as a function or shell script, not sourced
{21:31:09|~}% .zsh/zkbd
zsh: command not found: .zsh/zkbd
{21:31:12|~}% +x .zsh/zkbd
{21:31:12|~}% .zsh/zkbd
Enter current terminal type: [rxvt-unicode]

-- 
Mikael Magnusson



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