Less (the pager) colors strange behaviour

This is only cosmetics, but it is strange. Sometimes, when pause coding, take a coffee and read this forum or adventuring in stupid things. Today it's less turn.

Before this adventure I had this configuration for less:

$HOME/.cshrc
Code:
setenv    LESS        "-c -R -S -J -I -M -q -Q --no-vbell -g -x 4 -# 6 -~ --mouse"
setenv    LESSEDIT    "mcedit %f"
setenv    LESSOPEN    "|pygmentize -O 'style=nord,full' -f 256 -g %s"
in addition MANPAGER, PAGER and VIEW are set to less.

Today I added colors to less interface (prompt, line numbers, underline text, standout text, etc.) using the -D options ad modified LESS env var as follow:

$HOME/.cshrc
Code:
setenv    LESS        "-c -R -S -J -I -M -q -Q --no-vbell -g -x 4 -# 6 -~ --mouse  --use-color -DPWg -DNwK -Dd+r -Du+b"

The -DPWg set bright white foreground on green background for prompt.
The -DNwK set white foreground on bright black background for line numbers.
The -Dd+r set red foreground + bold text for bold text.
The -Du+r set red foreground + underline text for underlined text.

Running less it give error
Code:
Invalid color string "Wg -DNwK -Dd+r -Du+b"
Press RETURN to continue

Then I addedd one by one. With
Code:
-DPWg
works.

shot-01.jpg


with
Code:
-DPWg -DNwK
only the first (prompt) worked, line numbers stay at default color (light cyan, same as picture above)

with
Code:
-DPWg -DNwK -Dd+r
got the error
Code:
Invalid color string "Wg -DNwK -Dd+r"
Press RETURN to continue
and took no color (defaults)

shot-02.jpg


The strange thing is this: if i remove LESS env var and put them on command line it works (bold is not present in the viewed file, but line numbers got the right color
Code:
setenv | sort | less -c -R -S -J -I -M -q -Q --no-vbell -g -x 4 -# 6 -~ --mouse --use-color -DPWg -DNwK -Dd+r

shot-03.jpg

Is this a bug or tcsh setenv set the wrong value to variable?
 
Back
Top