From 0d797129ef54161d07e1296ebb1c0cde129ce539 Mon Sep 17 00:00:00 2001 From: nick black Date: Mon, 2 Aug 2021 07:42:02 -0400 Subject: [PATCH] no setupterm() on windows #2009 --- .github/workflows/windows_test.yml | 1 + src/lib/notcurses.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/windows_test.yml b/.github/workflows/windows_test.yml index 1547036b4f..b9e993ac57 100644 --- a/.github/workflows/windows_test.yml +++ b/.github/workflows/windows_test.yml @@ -57,6 +57,7 @@ jobs: -DCMAKE_BUILD_TYPE=Release \ -DUSE_DOCTEST=off \ -DUSE_PANDOC=off \ + -DUSE_READLINE=off \ -DUSE_QRCODEGEN=on - name: make diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index 5dd437748d..e506d79dc6 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -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); @@ -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,