]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
agetty: add support for \e in issue file to print \033
authorKarel Zak <kzak@redhat.com>
Thu, 11 Feb 2016 11:33:57 +0000 (12:33 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 11 Feb 2016 11:33:57 +0000 (12:33 +0100)
Suggested-by: Victor Ananjevsky <ananasik@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/agetty.8
term-utils/agetty.c

index 66f1a038959f2e0167c46ae8627d3258b49ab655..bb2feea399c1728a016db52c5d30ad8f67d0edd5 100644 (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.
index d2260e09f3abd3d34a441932f5ef2eb53df5fcad..d55b2e62a9093cbbe32da67015e035352d8005b5 100644 (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;