diff options
Diffstat (limited to 'misc-utils/cal.c')
-rw-r--r-- | misc-utils/cal.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/misc-utils/cal.c b/misc-utils/cal.c index 4dff491fb..bd643f3b4 100644 --- a/misc-utils/cal.c +++ b/misc-utils/cal.c @@ -550,9 +550,21 @@ int main(int argc, char **argv) headers_init(&ctl); - if (!colors_init(ctl.colormode, "cal")) { - ctl.req.day = 0; - ctl.weektype &= ~WEEK_NUM_MASK; + if (colors_init(ctl.colormode, "cal") == 0) { + /* + * If standout mode available (Senter and Sexit are set) and + * user or terminal-colors.d do not disable colors than + * ignore colors_init(). + */ + if (*Senter && *Sexit && colors_mode() != UL_COLORMODE_NEVER) { + /* let use standout mode */ + ; + } else { + /* disable */ + Senter = Sexit = '\0'; + ctl.req.day = 0; + ctl.weektype &= ~WEEK_NUM_MASK; + } } if (yflag || Yflag) { |