Bug #79755 No longer able to customize mysql prompt using bash color codes

Submitted: 23 Dec 2015 9:16 Modified: 23 Jan 2018 16:37
Reporter: Sherri Albrecht Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: Options Severity:S4 (Feature request)
Version:5.6.21-enterprise-commercial-advanced OS:Red Hat (Red Hat Enterprise Linux Server release 6.5 (Santiago))
Assigned to: CPU Architecture:Any
Tags: color, prompt

[23 Dec 2015 9:16] Sherri Albrecht
Description:
The following code is placed inside my .bashrc file.  With MySQL version 5.5 my prompt was then colored blue and had various parts bold / inverse.

GTSENV='081'
setblue='\033[38;5;26m'
setbold='\033[1m'
setinvs='\e[1;7m'
unset='\033[00m'

MYSQL_PS1="${setblue}\D \u@${setbold}\h:E${GTSENV}${unset}${setblue}${setinvs}(\d)${unset}\nmysql> "

export MYSQL_PS1=`echo -e "$MYSQL_PS1"`

After upgrading the MySQL Server from 5.5 to 5.6 this code now produces the following prompt:

$ mysql --defaults-group-suffix=_simulation -h prmdbsclu -P 18100
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 632603
Server version: 5.6.21-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

38;5;26mWed Dec 23 10:07:35 2015 albrshe[1mprmdbsclu:E08[00[38;5;26[1;7m((none)[00mysql> 

How to repeat:
Install MySQL 5.6.21-enterprise-commercial-advanced

Place the above code into the .bashrc file, source it, and attempt to enter mysql.

Suggested fix:
Find out why it worked with older versions (5.5) and attempt to make it work again. :)
[23 Jan 2018 16:37] Sherri Albrecht
Sadly I have not heard from anyone, nor have I found a way to make it work.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.040 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.