aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xdistribute4
-rw-r--r--src/interface-curses.cpp18
2 files changed, 18 insertions, 4 deletions
diff --git a/distribute b/distribute
index 9d4e57e..af05550 100755
--- a/distribute
+++ b/distribute
@@ -73,6 +73,8 @@ ppa : debian-source
# which is required by the glib spawn functions.
# If we ever build a non-console version on Windows,
# we should include gspawn-win32-helper.exe instead.
+MINGW_UI=pdcurses
+
mingw-binary : sciteco-$(SCITECO_VERSION)-win32.zip
sciteco-$(SCITECO_VERSION)-win32.zip : $(SCITECO_SRC)
tar xzf $(SCITECO_SRC)
@@ -83,7 +85,7 @@ sciteco-$(SCITECO_VERSION)-win32.zip : $(SCITECO_SRC)
--prefix=/usr \
--enable-static-executables \
--disable-dependency-tracking \
- --with-interface=pdcurses \
+ --with-interface=$(MINGW_UI) \
--disable-bootstrap \
--enable-html-manual \
CFLAGS="-g -O3" CXXFLAGS="-g -O3"; \
diff --git a/src/interface-curses.cpp b/src/interface-curses.cpp
index 0c08ec9..d12aed4 100644
--- a/src/interface-curses.cpp
+++ b/src/interface-curses.cpp
@@ -63,6 +63,13 @@
#define PDCURSES_WIN32
#endif
+/**
+ * Whether we're on ncurses/win32 console
+ */
+#if defined(NCURSES_VERSION) && defined(G_OS_WIN32)
+#define NCURSES_WIN32
+#endif
+
namespace SciTECO {
extern "C" {
@@ -141,6 +148,11 @@ InterfaceCurses::init_batch(void)
PDC_set_resize_limits(25, 0xFFFF, 80, 0xFFFF);
#endif
+#ifdef NCURSES_WIN32
+ /* $TERM must be unset for the win32 driver to load */
+ g_unsetenv("TERM");
+#endif
+
/*
* PDCurses cannot support terminal redirection
* into files, nor can it support multiple terminals.
@@ -290,7 +302,7 @@ InterfaceCurses::set_window_title(const gchar *title)
PDC_set_title(title);
}
-#elif defined(HAVE_TIGETSTR)
+#elif defined(HAVE_TIGETSTR) && defined(G_OS_UNIX)
void
InterfaceCurses::set_window_title(const gchar *title)
@@ -299,8 +311,8 @@ InterfaceCurses::set_window_title(const gchar *title)
* NOTE: terminfo variables in term.h interfere with
* the rest of our code
*/
- const char *tsl = tigetstr("tsl");
- const char *fsl = tigetstr("fsl");
+ const char *tsl = tigetstr((char *)"tsl");
+ const char *fsl = tigetstr((char *)"fsl");
if (!tsl || !fsl)
return;