startup: if TERM is unset, try falling back to VT220 instead of failing
Curses cannot function if not informed via TERM which type of terminal is being used. As many terminals are mostly compatible with a VT220, falling back to "vt220" when TERM is unset has a good chance of giving the user a usable nano, instead of simply failing. (Falling back to "vt100" is not good as it contains padding delays.) This partially addresses https://bugs.debian.org/991982.
Этот коммит содержится в:
родитель
fdc0b0ac24
Коммит
46cdf8b745
@ -2055,6 +2055,10 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
/* Curses needs TERM; if it is unset, try falling back to a VT220. */
|
||||
if (getenv("TERM") == NULL)
|
||||
setenv("TERM", "vt220", 0);
|
||||
|
||||
/* Enter into curses mode. Abort if this fails. */
|
||||
if (initscr() == NULL)
|
||||
exit(1);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user