Bug #106445 --prompt doesn't recognize \n as newline

Submitted: 12 Feb 2022 8:51 Modified: 12 Feb 2022 15:22
Reporter: Tsubasa Tanaka (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:8.0.28, 5.7.37 OS:CentOS (7.9.2009)
Assigned to: CPU Architecture:x86

[12 Feb 2022 8:51] Tsubasa Tanaka
Description:
Document describes

> The prompt command reconfigures the default mysql> prompt. The string for defining the prompt can contain the following special sequences.
> \n	A newline character

https://dev.mysql.com/doc/refman/8.0/en/mysql-commands.html

But actually, \n is not recognized as newline

How to repeat:
$ mysql --version
mysql  Ver 8.0.28 for Linux on x86_64 (MySQL Community Server - GPL)

$ mysql --no-defaults -uroot -p --prompt="Is\_There\nnewline?> "
Is Therenewline?> /* No newline is there */
Is Therenewline?> prompt "test \n test"
PROMPT set to '"test \n test"'
"test  test" /* Still no newline is there. */
[12 Feb 2022 15:22] MySQL Verification Team
Hello Tanaka-San,

Thank you for the report and feedback.
This is seen even in 5.7.37.

regards,
Umesh

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

Page generated in 0.038 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.