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

Re: zsh ignores the arguments on its first command.



Peter,

Thanks for the fix.

I was thinking that, in addition,
the construct ${+NAME}
should never cause "unknown parameter",
not even due to failure to load a module
that provides the parameter as a feature,
so an additional fix in the zsh core might be good.
If a module fails to load, NAME should become an
ordinary unset variable, and ${+NAME} should be 0.

Martin

On Wed, Jun 2, 2010 at 04:19, Peter Stephenson <Peter.Stephenson@xxxxxxx> wrote:
> On Wed, 2 Jun 2010 00:05:20 -0700
> Martin Buchholz <martinrb@xxxxxxxxxx> wrote:
>> Alright, let's try again to report the bug with the terminfo special
>> parameter and the zsh/terminfo module:
>>
>> $ (unset TERM; zsh -fic 'echo $ZSH_VERSION; echo ${+terminfo}')
>> 4.3.10
>> zsh:1: unknown parameter: terminfo
>
> Ah, thanks, unsetting TERM was the key.
>
> I think we're being over eager in reporting that the terminfo module didn't
> load because the terminal wasn't set up.  Setting up the terminal should be
> handled dynamically when the TERM variable changes (which is a completely
> sepearate issue).
>
> Index: Src/Modules/terminfo.c
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Src/Modules/terminfo.c,v
> retrieving revision 1.34
> diff -p -u -r1.34 terminfo.c
> --- Src/Modules/terminfo.c      13 Mar 2008 11:11:05 -0000      1.34
> +++ Src/Modules/terminfo.c      2 Jun 2010 11:17:51 -0000
> @@ -341,8 +341,12 @@ boot_(Module m)
>  # ifdef HAVE_SETUPTERM
>     int errret;
>
> -    if (setupterm((char *)0, 1, &errret) == ERR)
> -       return 1;
> +    /*
> +     * Just because we can't set up the terminal doesn't
> +     * mean the modules hasn't booted---TERM may change,
> +     * and it should be handled dynamically---so ignore errors here.
> +     */
> +    (void)setupterm((char *)0, 1, &errret);
>  # endif
>  #endif
>
> --
> Peter Stephenson <pws@xxxxxxx>            Software Engineer
> Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
> Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK
>
>
> Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
>



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