summaryrefslogtreecommitdiffstats
path: root/color.c
diff options
context:
space:
mode:
Diffstat (limited to 'color.c')
-rw-r--r--color.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/color.c b/color.c
index 6468b2e3..66bcd8b3 100644
--- a/color.c
+++ b/color.c
@@ -347,7 +347,8 @@ parse_color_name (const char *s, int *col, int *attr, int brite, BUFFER *err)
{
s += 5;
*col = strtol (s, &eptr, 10);
- if (!*s || *eptr || *col < 0 || *col >= COLORS)
+ if (!*s || *eptr || *col < 0 ||
+ (*col >= COLORS && !option(OPTNOCURSES) && has_colors()))
{
snprintf (err->data, err->dsize, "%s: color not supported by term", s);
return (-1);