agetty: add support for \e in issue file to print \033

Suggested-by: Victor Ananjevsky <ananasik@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2016-02-11 12:33:57 +01:00
parent 79c101427f
commit 583627ef36
2 changed files with 6 additions and 0 deletions

View File

@ -333,6 +333,9 @@ Insert the baudrate of the current line.
d
Insert the current date.
.TP
e
Insert \\033 to handle esc sequences, for example "\\e[31m RED \\e[0m" prints red text.
.TP
s
Insert the system name, the name of the operating system. Same as `uname \-s'.
See also \\S escape code.

View File

@ -2339,6 +2339,9 @@ static void output_special_char(unsigned char c, struct options *op,
uname(&uts);
switch (c) {
case 'e':
fputs("\033", stdout);
break;
case 's':
printf("%s", uts.sysname);
break;