[banner] display OS in init banner

pull/2292/head
nick black 3 years ago
parent 6411b628a4
commit 1e4ce97750
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -17,6 +17,21 @@ init_banner_warnings(const notcurses* nc, fbuf* f, const char* clreol){
return 0;
}
static inline const char*
osname(void){
#ifdef __MINGW64__
return "Windows";
#elif defined(__APPLE__)
return "macOS";
#elif defined(__gnu_hurd__)
return "GNU Hurd";
#elif defined(BSD)
return "BSD";
#else
return "Linux";
#endif
}
// unless the suppress_banner flag was set, print some version information and
// (if applicable) warnings to ttyfp. we are not yet on the alternate screen.
int init_banner(const notcurses* nc, fbuf* f){
@ -26,10 +41,11 @@ int init_banner(const notcurses* nc, fbuf* f){
}
if(!nc->suppress_banner){
term_fg_palindex(nc, f, 50 % nc->tcache.caps.colors);
fbuf_printf(f, "%snotcurses %s on %s %s" NL,
fbuf_printf(f, "%snotcurses %s on %s %s (%s)" NL,
clreol, notcurses_version(),
nc->tcache.termname ? nc->tcache.termname : "?",
nc->tcache.termversion ? nc->tcache.termversion : "");
nc->tcache.termversion ? nc->tcache.termversion : "",
osname());
term_fg_palindex(nc, f, nc->tcache.caps.colors <= 256 ?
14 % nc->tcache.caps.colors : 0x2080e0);
if(nc->tcache.cellpixy && nc->tcache.cellpixx){

Loading…
Cancel
Save