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
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.
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.
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.