slang-users mailing list

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

Re: Half-baked initialization for TERM=linuxfoo


> I believe that this is still something that MC is going to have to
> cope with.  That is, there is nothing that prevents the user from doing:
>
>     # stty rows 0 columns 0
>     # mc

Correct. A serious program should not be fooled by this. Not every screw
up is caused by users, especially on old unices, so the usual "don't do
it" argument doesn't always apply. Usually it's safe to assume that the
terminal is 80x25.

> The easiest method for dealing with this is to exit if the number of
> rows and colums is 0.

That's the actual code:

    SLtt_get_terminfo ();

   /*
    * If the terminal in not in terminfo but begins with a well-known
    * string such as "linux" or "xterm" S-Lang will go on, but the
    * terminal size and several other variables won't be initialized
    * (as of S-Lang 1.4.4). Detect it and abort. Also detect extremely
    * small, large and negative screen dimensions.
    */
    if ((COLS < 10) || (LINES < 5) || (COLS > 1024) || (LINES > 1024)) {
        fprintf (stderr,
                 _("Screen size %dx%d is not supported.\n"
                   "Check the TERM environment variable.\n"),
                 COLS, LINES);
        exit (1);
    }

-- 
Regards,
Pavel Roskin


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