diff options
Diffstat (limited to 'termo.c')
-rw-r--r-- | termo.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -415,7 +415,7 @@ abort_free_to_utf32: } termo_t * -termo_new (int fd, const char *encoding, int flags) +termo_new (int fd, const char *term, const char *encoding, int flags) { termo_t *tk = termo_alloc (); if (!tk) @@ -424,7 +424,11 @@ termo_new (int fd, const char *encoding, int flags) tk->fd = fd; termo_set_flags (tk, flags); - const char *term = getenv ("TERM"); + // In theory, we might have multiple different terminals open + // simultaneously; I'm not currently sure if it works + if (!term) + term = getenv ("TERM"); + if (termo_init (tk, term, encoding) && termo_start (tk)) return tk; |