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:
parent
79c101427f
commit
583627ef36
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue