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

RE: Some general problems with exporting cariables (Was: TERMCAP problem. )

> I made a new executable from the current CVS, and even without the
> patch it did not
> crash anymore.

That is exactly what I was afraid of :-)

> For some reason, it how uses '-lcurses' instead of '-ltermcap'.

Yes, it is here but I have no idea what was the reason behind:

        * 12239: Fr. Br. George (George V Kouryachy), adapted:
        configure.in: prefer curses to termcap on solaris.

You may look in zsh-workes archive.

> I did some tests with the debugger.
> The crash happened because getenv("TERM") returned 0 during the
> call to tgetent from
> the termcap library.

Well, I am surpsised that it worked at all then, screen or no screen. May be,
the lack of `=' confused getenv.

> Whithout the patch, getenv("TERM") still returns 0, but now tgetent
> from libcursus.a
> is used.
> With the patch, getenv("TERM") returns "dumb" before tgetent is
> called, so I guess it
> will also be fine for tgetent from the termcap library

What do you mean "before""? Zsh itself never calls getenv("TERM").

Anyway, if this -lcurses is terminfo-based, you loose TERMCAP hack that screen
is using (unless newer screen version can cope with TERMINFO as well). I was
about to suggest adding LIBS=-ltermcap, but realised, that zsh is usiing
AC_CHECK_LIB. This macro stinks and should never be used - it does not check,
if function is already available, but blindly adds lib(s) even if not needed.

To all developers - shuld not we better consistenly use AC_SEARCH_LIBS
instead? This has major advantage - it checks first, if function is already
available, so you can easily override library list.

Koen, you can look in configure for a

case "$host_os" in
      termcap_curses_order="curses ncurses termcap" ;;
  *)             termcap_curses_order="termcap curses ncurses" ;;

remove solaris, and reconfigure zsh (probably, make distclean first). It
should give you old behaviour. Then we see if patch really helps :-)))

I'll change configure to use AC_SERCH_LIBS instead to be able to override
library selection.


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