Can't apply brightness to terminal's background color
There are eight standard ANSI colors, supported by every terminal emulator. Most terminal emulators also have eight bright variants of the standard ANSI colors.
However, the actual color values that the escape codes map to aren't standardized, and in fact they often slightly vary among terminal emulators. So if you do printf "\e[31;47mTest\n"
to print red text on a white background, the actual hues of red and white you get may be different depending on the terminal emulator you use.
So that partly explains the problem: color values aren't standard, and LXTerminal
may have different defaults for its color palette that you're not used to. If you look around in the settings, usually you can configure the color scheme to be whatever you like.
The other problem you face is that what the bold attribute actually does isn't standardized either. There are three possibilities: it can make the font bold, it can make the foreground color brighter, or it can both make the foreground color brighter and make the font bold.
Again, the default behavior here varies among terminal emulators, and you can usually change it if can you find the right setting. Grep for something mentioning 'bold' or 'bright'.
If you want to use a bright color, then you can use the so-called aixterm color escape codes instead of bold. These aren't standard, but they're supported in every modern terminal emulator I know of. Unlike bold, they always use bright colors, plus they can be used to display bright background colors.
So for example, if you wanted to print bright red text on a bright white background, you would do this: printf "\e[91;107mTest\n"
.
For reference, here's a table of all the color escape codes:
| ANSI | ANSI | ANSI | | Aixterm | Aixterm
| Color | FG Code | BG Code | Bright Color | FG Code | BG Code
+---------+---------+-------- +----------------+---------+--------
| Black | 30 | 40 | Bright Black | 90 | 100
| Red | 31 | 41 | Bright Red | 91 | 101
| Green | 32 | 42 | Bright Green | 92 | 102
| Yellow | 33 | 43 | Bright Yellow | 93 | 103
| Blue | 34 | 44 | Bright Blue | 94 | 104
| Magenta | 35 | 45 | Bright Magenta | 95 | 105
| Cyan | 36 | 46 | Bright Cyan | 96 | 106
| White | 37 | 47 | Bright White | 97 | 107
The 1
attribute at the beginning of 1;31;40
turns on "bold" (aka. "bright") mode, but some terminals only apply this to the foreground color. I have no idea for what reason (and changing the $TERM variable makes no difference), since they do support 16 colors in the foreground.1 0 (from 40
: 4 = background, 0 = the color) is actually black, but "bright black" is gray. Here's two solutions:
Color 7 (white) will probably turn out to be gray, not white (for true white, you need "bright white", meaning the background you actually can't have is white).
You should be able use gnome terminal in LXDE if you want. Just install it and start with
gnome-terminal
(I believe that's its command name). Then you'll have to configure whatever launchers to use that instead of the lx-terminal.
1 Here's my guess: Notice that setting bold applies brightness to the foreground color and adds a bold emphasis. Hence, you can't use a bright foreground color without also applying bold. Presumably back when monochrome terminals were common, just plain setting bold for emphasis, eg: \\033[1mBlah blah\\033[0m
was common -- and in fact this will still work, but it will also make your foreground color bright. If we considered it undesirable for this to also brighten the background (because it is just supposed to be bold), then we'd make sure the implementation didn't do that. Oh well.