I'm trying to get a program I'm running to display a bright colored background, but the program won't apply the brightness increase, it instead shows a 'normal' colored background.

Let me add some details:

  • I log into a server running Debian, through PuTTY, with the TERM variable set to putty (or manually do this using export TERM=putty).
  • I first try whether bright backgrounds show up correctly at all, using

    echo -e "\e[43mHello\e[0m \e[103mWorld\e[0m"

    You see that \e[43m is the code for setting the background to yellow and \e[103m is the code for setting the background color to bright yellow. The image below shows that it actually works:

    Both normal and bright yellow background work

  • Then I run the program I want to display such bright backgrounds. The program is the ACUCOBOL runtime. The manual says that it tries to read the TERM value and reads /etc/a_termcap by this value, selecting the (hopefully) proper terminal capabilities, if used on a *nix OS. The Windows client doesn't use any terminal capability info.

    The entry within the a_termcap file looks like this:

    putty|/PuTTY Colors:\

    The problem is that I can barely read these values, but the codes C1C8 and B1B8 refer to the foreground and background colors respectively, I think.

My guess is that the runtime is not aware of the codes \e[100m\e[107m. How can I fix this?


It seems that I can somehow can get black and white to be bright. Below a screenshot which allows both the bright and normal variants of black and white.

black and white bright


I have changed the terminal emulator name to putty and set the TERM variable accordingly. I don't think, however, that it matters.

  • The image is not from Linux's built-in terminal emulator, which does not produce the effect claimed in response to those control sequences. That is some other terminal emulator, not the Linux built-in one.
    – JdeBP
    Mar 15, 2018 at 5:27
  • 1
    Linux's built-in terminal emulator does not have scroll bars, either. Are you going to tell us what terminal emulator you are actually using?
    – JdeBP
    Mar 15, 2018 at 9:02
  • It doesn't matter - almost all of the available terminal emulators copied xterm's behavior. The actual question is whether ACUCOBOL can manage more than 8 colors (it cannot). Mar 15, 2018 at 9:23
  • @downvoter Care to explain the downvote?
    – MC Emperor
    Mar 15, 2018 at 9:31
  • By the way, I'm using the PuTTY client. putty was not a valid entry within the a_termcap file, so I changed it to something the ACUCOBOL runtime would even understand.
    – MC Emperor
    Mar 15, 2018 at 9:38

1 Answer 1


short: you can't

long: The ACUCOBOL support page explains what the termcap fields are. It knows about 8 colors, while your example expects to use the aixterm 16-color controls. Handling all 16 colors is beyond the ability of a termcap application (unless it cheats and formats its own strings rather than using tgoto).

You could make all of the backgrounds use bright colors, but you can't make some scenarios bright and some not. The places to modify would be B1 to B8 (colors 0-7 in the usual numbering convention):


replacing 40 by 100, 41 by 101, etc.

By the way, TERM=linux is inconsistent with the example of an escape sequence which you gave (since Linux console's 16 colors are achieved by combining bold with colors 0-7, i.e., replacing 40 by 40;1, etc). You could copy that entry and change the name in the first line

linux|/Linux system console:\

to something more suitable, e.g.,


A termcap description cannot produce values in two ranges (40-47, 100-107 for example) since it doesn't support expressions. A terminfo description (not supported by ACUCOBOL, apparently) can do this. For example, ncurses has a 16-color Linux description. There are similar descriptions for other terminals, including whatever terminal you are actually using.

  • The GT Users' Guide has a more complete description than the Runtime Manual.
    – JdeBP
    Mar 15, 2018 at 5:23
  • Its documentation of color is no better. Mar 15, 2018 at 8:02
  • Thanks for the explanation, it (now) makes sense to me. Leaves me with one last question (see question edit): why can the brightness still be applied to black and white? That should be impossible, isn't it?
    – MC Emperor
    Mar 15, 2018 at 9:36
  • It looks like you ran a script which sent codes 100-107. You can modify a termcap to do that, but can't make it choose from both 40-47 and 100-107. Mar 15, 2018 at 21:07
  • Its documentation of colour gives the answer. It is not actually "you can't", and it's one of several reasons that correctly stating the output device in the question is important.
    – JdeBP
    Mar 16, 2018 at 7:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .