mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-18 03:25:55 +00:00
[banner] display OS in init banner
This commit is contained in:
parent
6411b628a4
commit
1e4ce97750
@ -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…
Reference in New Issue
Block a user