about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/gui/color.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/ranger/gui/color.py b/ranger/gui/color.py
index 2fa68a33..89b58092 100644
--- a/ranger/gui/color.py
+++ b/ranger/gui/color.py
@@ -35,7 +35,12 @@ def get_color(fg, bg):
                 fg = DEFAULT_FOREGROUND
             if bg == -1:  # -1 is the "default" color
                 bg = DEFAULT_BACKGROUND
-            curses.init_pair(size, fg, bg)
+
+            try:
+                curses.init_pair(size, fg, bg)
+            except:
+                # If this fails too, colors are probably not supported
+                pass
         COLOR_PAIRS[key] = size
 
     return COLOR_PAIRS[key]