]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
curses: Fix background transparency in terminal 93/head
authorNarthorn <narthorn@gmail.com>
Mon, 12 Oct 2015 11:24:57 +0000 (13:24 +0200)
committerNarthorn <narthorn@gmail.com>
Mon, 12 Oct 2015 11:47:23 +0000 (13:47 +0200)
Patch comes from, and closes traviscross/mtr#72.

curses.c

index 02b79376c680fbbd30f0a4ce673741f2e08ea76c..f95f5d16795c91464fdbc5d97d4bc34607620573 100644 (file)
--- a/curses.c
+++ b/curses.c
@@ -700,13 +700,15 @@ void mtr_curses_open(void)
   initscr();
   raw();
   noecho(); 
+  int bg_col = 0;
   start_color();
 #ifdef HAVE_USE_DEFAULT_COLORS
-  use_default_colors();
+  if (use_default_colors() == OK)
+    bg_col = -1;
 #endif
   int i;
   for (i = 0; i < 8; i++)
-      init_pair(i+1, i, 0);
+      init_pair(i+1, i, bg_col);
 
   mtr_curses_init();
   mtr_curses_redraw();