diff options
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ncal/ncal.1 | 2 | ||||
-rw-r--r-- | usr.bin/ncal/ncal.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/ncal/ncal.1 b/usr.bin/ncal/ncal.1 index 8429906..bd3b71c 100644 --- a/usr.bin/ncal/ncal.1 +++ b/usr.bin/ncal/ncal.1 @@ -171,6 +171,8 @@ that, two after that and the whole year. will warn about these combinations. .Pp A year starts on January 1. +.P +Highlighting of dates is disabled if stdout is not a tty. .Sh SEE ALSO .Xr calendar 3 , .Xr strftime 3 diff --git a/usr.bin/ncal/ncal.c b/usr.bin/ncal/ncal.c index 44e31fe..2ca770a 100644 --- a/usr.bin/ncal/ncal.c +++ b/usr.bin/ncal/ncal.c @@ -822,7 +822,8 @@ mkmonthr(int y, int m, int jd_flag, struct monthlines *mlines) dt.d = j - jan1 + 1; else sdater(j, &dt); - if (j == highlightdate && !flag_nohighlight) + if (j == highlightdate && !flag_nohighlight + && isatty(STDOUT_FILENO)) highlight(mlines->lines[i] + k, ds + dt.d * dw, dw, &l); else |