Skip to content

Commit

Permalink
direct: no setupterm() for windows #2009
Browse files Browse the repository at this point in the history
  • Loading branch information
dankamongmen committed Aug 2, 2021
1 parent 0d79712 commit 1b9ea6e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/direct.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,13 +860,18 @@ ncdirect* ncdirect_core_init(const char* termtype, FILE* outfp, uint64_t flags){
}
// we don't need a controlling tty for everything we do; allow a failure here
ret->ctermfd = get_tty_fd(ret->ttyfp);
// FIXME factor this out, and share it with rendered mode
#ifndef __MINGW__
const char* shortname_term;
int termerr;
if(setupterm(termtype, ret->ctermfd, &termerr) != OK){
fprintf(stderr, "Terminfo error %d (see terminfo(3ncurses))\n", termerr);
goto err;
}
shortname_term = termname();
#else
shortname_term = "Windows Terminal";
#endif
if(interrogate_terminfo(&ret->tcache, ret->ctermfd, shortname_term, utf8,
1, flags & NCDIRECT_OPTION_INHIBIT_CBREAK,
TERMINAL_UNKNOWN, NULL, NULL, NULL)){
Expand Down

0 comments on commit 1b9ea6e

Please sign in to comment.