Skip to content

Commit

Permalink
no setupterm() on windows #2009
Browse files Browse the repository at this point in the history
  • Loading branch information
dankamongmen committed Aug 2, 2021
1 parent 74f5801 commit 0d79712
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/windows_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
-DCMAKE_BUILD_TYPE=Release \
-DUSE_DOCTEST=off \
-DUSE_PANDOC=off \
-DUSE_READLINE=off \
-DUSE_QRCODEGEN=on
- name: make
Expand Down
6 changes: 6 additions & 0 deletions src/lib/notcurses.c
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,9 @@ notcurses* notcurses_core_init(const notcurses_options* opts, FILE* outfp){
// don't set loglevel until we've acquired the signal handler, lest we
// change the loglevel out from under a running instance
loglevel = opts->loglevel;
#ifndef __MINGW64__
// windows doesn't really have a concept of terminfo. you might ssh into other
// machines, but they'll use the terminfo installed thereon (putty, etc.).
int termerr;
if(setupterm(opts->termtype, ret->ttyfd, &termerr) != OK){
logpanic("Terminfo error %d (see terminfo(3ncurses))\n", termerr);
Expand All @@ -1144,6 +1147,9 @@ notcurses* notcurses_core_init(const notcurses_options* opts, FILE* outfp){
return NULL;
}
const char* shortname_term = termname(); // longname() is also available
#else
const char* shortname_term = "Windows Terminal";
#endif
ret->rstate.logendy = -1;
ret->rstate.logendx = -1;
if(interrogate_terminfo(&ret->tcache, ret->ttyfd, shortname_term, utf8,
Expand Down

0 comments on commit 0d79712

Please sign in to comment.