Hello Anton!
I cannot reproduce the problem-- the text that you see in blue, I see in red.
But you might look at the -D switch for less. I can change the color with
PAGER=less -Ducw$Ddwr
which tells less to show underlined text as cyan on white and bold text as
white on red. I also use "-R -c" for less, but I don't remember exactly why...
AHA!!! ...thank you for sharing this...I started to look at the colour coding b/c it seemed like nothing else I was trying was making sense and well the MAN page for LESS has a pretty good section on this very topic, so your feedback confirmed that!
...My environment has no mention of termcap and I have no termcap.dat file. Maybe you are using an older version of less? Mine is version 668, dated Feb. 25 2025 and came from the less-668-1.oc00.pentium4 rpm package...
I am not sure (simply do not remember truth be told) why I have TERMCAP set, however seeing as I positioned it within the MAN section of my CONFIG.SYS I can only venture a guess that I deemed it to be needed for that purpose?
...From the CAWFLIB and MANPATH entries in you config.sys, I suspect you are using Alex Taylor's simplified man.cmd. The man.exe I normally use is from the man-db-2.7.6.1-3.oc00.pentium4 rpm package. Try installing it with yum or ANPM.
It probably depends on groff and maybe other packages. Unlike man.cmd, man.exe expects a Unix-style %manpath with a colon as a path separator, like
/@unixroot/usr/local/share/man:/@unixroot/usr/share/man
Years ago I hacked the man.cmd to add a few features. See the attached file...
Couple of things here worth noting:
1) Alex's Simplified MAN, yes, I had installed it and actually stopped using it having deployed the RPM man install, so yes, I am using the same version you are
2) The only strange thing is that in my install the RPM man does not need MANPATH to be set, it simply goes to \etc\man_db.conf and reads those contents automatically
...but as I started troubleshooting this issue I did go back to Alex's work to see if I could debug what it's doing and the specific calls it's making. Not a terribly complex piece of REXX, so that was easy enough to do.
...You can experiment with different settings for the pager and term on the command line without needing to change the environment each time. As in
man.cmd <manpage> -pager="less -R -c -Ducw" -term=ansi-color-3
Note that it also defaults to using groff because groff seems to produce fewer
error messages than cawf. If you want to keep using your existing cawf you will
need to specify it on the command line like
man.cmd <manpage> -troff="cawf -man"
It understands either an OS/2 or Unix-style %manpath, so I can have a Unix
%manpath in my environment and let man.cmd convert it...
Alright, so I downloaded your version and had a go at it. Thank you very much because the changes you implemented were similar to what I've done with my changes, albeit much more sophisticated - as in the various options to use different PAGERs, etc.
Working with your script also allowed me to notice that I actually had TWO different version of LESS present:
1) RPM
less 668 (POSIX regular expressions)
Copyright (C) 1984-2024 Mark Nudelman
2) OTHER
less 458 (Spencer V8 regular expressions)
Copyright (C) 1984-2012 Mark Nudelman
As it turned out, I was playing with the different colour options and for some strange reason running your script from my utilities directory was producing a different colouring output as compared to me running the very same script from elsewhere...and that's when the bells went off: "yikes...I've got something sitting there that shouldn't be!!!" lol
OK, so one problem addressed.
Seeing as we have this hybrid thing on OS/2 I suppose it is to be expected that some of this requires additional work, I just didn't expect that to be the case with MAN as that is such a core element of Unix help system.
Anyways, alright, so here is what my final version of CONFIG.SYS MAN section looks like:
REM ******************************
REM *** MAN PAGES - START ***
REM ******************************
rem The below two lines are part of the Simplified MAN setup by Alex Taylor
SET CAWFLIB=g:\usr\local\cawf
SET MANPATH_SIMPLE=G:\usr\share\man;G:\usr\local\share\man
rem MAN uses \etc\man_db.conf by default, but this allows to append other paths AFTER man_db.conf
SET MANPATH=:G:/usr/share/man:G:/usr/local/share/man
rem LESS options to show the % displayed in MAN pages, applies SYSTEM-WIDE
SET LESS="-M +Gg"
SET TERMCAP=g:\util\misc\termcap.dat
rem set TERM, valid values are: os2, ansi, ansi-color-3, etc.
SET TERM=ansi-color-3
rem Set the pager to OS/2 MORE command, otherwise uses LESS by default
rem SET PAGER=MORE
REM ******************************
REM *** MAN PAGES - END ***
REM ******************************
Appreciate everyone's input on this...what I now have suits me fine, see attached.