diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2016-09-27 23:30:10 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2016-09-27 23:30:10 +0200 |
commit | 991892fff518f59f02bbe1c8a4637843a82bd74e (patch) | |
tree | f8bb934a4481582789c5ecdee92233bd4d183369 /termo.c | |
parent | 9ec09b90c9bb023bb69a6b703ce4df40d397f5e6 (diff) | |
download | termo-term-string.tar.gz termo-term-string.tar.xz termo-term-string.zip |
Allow specifying terminal name in termo_new()term-string
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; |