BASH - Command echo - Cannot echo in bold

Hello.

USER="TOTO"
green='\e[0;32m'
endColor='\e[0m'
undesc='\e[04m'
bold='\e[01m'[INDENT=2]# or '\E[01m'  or  '\E[1m'  or  '\x1b[1m'
[/INDENT]

# Display welcome message
echo -e "Welcome ${green}$USER${endColor} user
"
#Welcome  TOTO  user    # OK in green 

echo -e "Welcome ${bold}$USER${endColor} user
"
#Welcome  TOTO  user     # KO in normal character only 

echo -e "Welcome ${undesc}$USER${endColor} user
"
#Welcome TOTO  user     # OK underlined character


I am unable to echo in bold!

Any help is welcome


NAME=openSUSE
VERSION=“Tumbleweed”
VERSION_ID=“20160121”
PRETTY_NAME=“openSUSE Tumbleweed (20160121) (x86_64)”
ID=opensuse
ANSI_COLOR=“0;32”
CPE_NAME=“cpe:/o:opensuse:opensuse:20160121”
BUG_REPORT_URL=“https://bugs.opensuse.org
HOME_URL=“https://www.opensuse.org/
ID_LIKE=“suse”

Have a look at


man tput

The tput command allows you to position the cursor and amongst other things, to have bold text.

And what terminal emulator are you using? (or is this in text mode?)

Your commands work as expected here in 13.2, and I tried with Konsole 4.14.3 (the KDE4 version), Konsole 15.12.1 (the latest KF5 version), and xterm.

It might be a problem with the used font though, so try to change that as a test (in Konsole: “Edit current profile”, or KDE’s “Configure Desktop”/systemsettings5).

You apparently use ANSI/VT100 terminal Escape sequences. The terminal you send these sequences to must support this. As you do not tell what you use as terminal (emulator), it is a bit difficult te be specific.

Most terminal emulators, like Konsole and xterm do suport this though.

Your script worked as expected, using either “xterm” or “konsole”.

If I use CTRL-ALT-F1, and try it there on the virtual console, the “bold” comes out blue instead of bold.

I am using standard KDE Konsole with initial setup.

I had used tput but does not work.
I shall try tput one more time and give you news.

Ok, I was able to reproduce your problem by switching the font to Oxygen Mono, Plasma5’s default monospace font.

So as I suggested already, this is a font problem.
Configure a different one (either via “Edit current profile” in Konsole, or the general fonts settings in “Configure Desktop”) and it should work.
Or maybe playing with the hinting style/anti-aliasing settings might help too.

Same problem on 13.2

Seems not to depend of the font chosen.

Typing this sequence in a new Konsole

USER="TOTO"
green='\e[0;32m'
endColor='\e[0m'
undesc='\e[04m'
bold='\e[01m'[INDENT=2]# or '\E[01m'  or  '\E[1m'  or  '\x1b[1m'
[/INDENT]

# Display welcome message
echo -e "Welcome ${green}$USER${endColor} user
"
#Welcome  TOTO  user    # OK in green 

echo -e "Welcome ${bold}$USER${endColor} user
"
#Welcome  **TOTO**  user     # OK in normal character only 

echo -e "Welcome ${undesc}$USER${endColor} user
"
#Welcome TOTO  user     # ***KO underlined character***
  

I can set the underlined characters by forcing a redraw event just by opening another apps or by changing the focus.

Hmmmm…

On a LEAP KDE using Konsole,
I can only see the GREEN and the Underlined but
not the BOLD.

Have tried about 4 other various fonts besides Oxygen Mono(No obvious system fonts) without any difference supporting** BOLD**.

TSU