paleofetch

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 69605e26778c53bba682e6544e4eae26b250b844
parent f1f8a7eab6b4a5dcddb330de2c6e1601b66f9080
Author: sam-barr <samfbarr@outlook.com>
Date:   Fri,  1 May 2020 15:27:23 -0500

Merge pull request #54 from dwzg/tty_name

Make get_terminal get the actual tty name
Diffstat:
Mpaleofetch.c | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/paleofetch.c b/paleofetch.c @@ -326,6 +326,10 @@ static char *get_terminal() { } else { terminal_fallback: strncpy(terminal, getenv("TERM"), BUF_SIZE); /* fallback to old method */ + /* in tty, $TERM is simply returned as "linux"; in this case get actual tty name */ + if (strcmp(terminal, "linux") == 0) { + strncpy(terminal, ttyname(STDIN_FILENO), BUF_SIZE); + } } return terminal;