slang-users mailing list

[2001 Date Index] [2001 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Half-baked initialization for TERM=linuxfoo


Hello!

I've been investigating why "TERM=linuxfoo mc" dumps the core. I've found
some interesting code in SLtt_initialize() (file sldisply.c, S-Lang
1.4.4).

For some obscure reason SLtt_initialize() accepts any terminal names
beginning with "linux", "xterm", "rxvt", "Eterm" and in some cases "vt"
_regardless_ of whether _SLtt_tigetent() succeeded or not.

What is worse, if _SLtt_tigetent() fails only some minimal initialization
is performed. Notably, SLtt_get_screen_size() doesn't get called, which
means that the user program has to deal with SLtt_Screen_Cols=0 and
SLtt_Screen_Rows=0, something that Midnight Commander isn't prepared to.

I actually don't like the idea of adding SLtt_get_screen_size() for the
case when _SLtt_tigetent() fails but S-Lang "knows" the terminal. There is
still a lot of code skipped. MC is still pretty useless after such "half
baked" initialization, since the cursor movement keys don't work. Next
version of MC will abort if the screen size has not been set.

If this kind of workaround is needed for some other programs it would be
nice to have some way to alert the calling program.

-- 
Regards,
Pavel Roskin


[2001 date index] [2001 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]