aboutsummaryrefslogtreecommitdiff
path: root/termo.c
diff options
context:
space:
mode:
Diffstat (limited to 'termo.c')
-rw-r--r--termo.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/termo.c b/termo.c
index 953bc88..8a92821 100644
--- a/termo.c
+++ b/termo.c
@@ -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;