summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpgen <p.gen.progs@gmail.com>2018-09-28 21:18:54 +0200
committerpgen <p.gen.progs@gmail.com>2018-10-01 19:36:56 +0200
commitc9bace854a649abeeb2e395d0150bbd90ff63359 (patch)
tree6355c728f3da249156064cc8efc3551fd75408df
parent535a392b90d450da1ea19a50f5ff1f8c6c11420c (diff)
Assume a vt100 terminal if TERM is unset
-rw-r--r--smenu.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/smenu.c b/smenu.c
index 1c94ebd..b4a2ef5 100644
--- a/smenu.c
+++ b/smenu.c
@@ -5718,9 +5718,13 @@ main(int argc, char * argv[])
else
my_isprint = isprint7;
- /* Set terminal in noncanonical, noecho mode */
- /* """"""""""""""""""""""""""""""""""""""""" */
- setupterm((char *)0, 1, (int *)0);
+ /* Set terminal in noncanonical, noecho mode and */
+ /* if TERM is unset or unknown, vt100 is assumed. */
+ /* """""""""""""""""""""""""""""""""""""""""""""" */
+ if (getenv("TERM") == NULL)
+ setupterm("vt100", 1, (int *)0);
+ else
+ setupterm((char *)0, 1, (int *)0);
/* Get some terminal capabilities */
/* """""""""""""""""""""""""""""" */