From: Karel Zak Date: Thu, 11 Feb 2016 11:33:57 +0000 (+0100) Subject: agetty: add support for \e in issue file to print \033 X-Git-Tag: v2.28-rc1~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=583627ef363f0e0bd8a7dac646507c2458accc56;p=thirdparty%2Futil-linux.git agetty: add support for \e in issue file to print \033 Suggested-by: Victor Ananjevsky Signed-off-by: Karel Zak --- diff --git a/term-utils/agetty.8 b/term-utils/agetty.8 index 66f1a03895..bb2feea399 100644 --- a/term-utils/agetty.8 +++ b/term-utils/agetty.8 @@ -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. diff --git a/term-utils/agetty.c b/term-utils/agetty.c index d2260e09f3..d55b2e62a9 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -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;