|
5 | 5 |
|
6 | 6 | import os |
7 | 7 | import sys |
| 8 | +import platform |
8 | 9 | import logging |
9 | 10 | from wcwidth import wcswidth |
10 | 11 |
|
@@ -199,7 +200,10 @@ def setup_colors(self): |
199 | 200 | # curses.init_pair(10, -1, -1) # Default (white on black) |
200 | 201 | # Colors for xterm (not xterm-256color) |
201 | 202 | # Dark Colors |
202 | | - curses.init_pair(0, curses.COLOR_BLACK, bg) # 0 Black |
| 203 | + |
| 204 | + if platform.system() != 'Windows': |
| 205 | + # it raises an exception on windows, cf https://github.com/zephyrproject-rtos/windows-curses/issues/10 |
| 206 | + curses.init_pair(0, curses.COLOR_BLACK, bg) # 0 Black |
203 | 207 | curses.init_pair(1, curses.COLOR_RED, bg) # 1 Red |
204 | 208 | curses.init_pair(2, curses.COLOR_GREEN, bg) # 2 Green |
205 | 209 | curses.init_pair(3, curses.COLOR_YELLOW, bg) # 3 Yellow |
@@ -230,7 +234,9 @@ def setup_colors(self): |
230 | 234 | # TODO: Define RGB for these to avoid getting |
231 | 235 | # different results in different terminals |
232 | 236 | # xterm-256color chart http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html |
233 | | - curses.init_pair(0, 242, bg) # 0 Black |
| 237 | + if platform.system() != 'Windows': |
| 238 | + # it raises an exception on windows, cf https://github.com/zephyrproject-rtos/windows-curses/issues/10 |
| 239 | + curses.init_pair(0, 242, bg) # 0 Black |
234 | 240 | curses.init_pair(1, 204, bg) # 1 Red |
235 | 241 | curses.init_pair(2, 119, bg) # 2 Green |
236 | 242 | curses.init_pair(3, 221, bg) # 3 Yellow |
|
0 commit comments