summaryrefslogtreecommitdiffstats
path: root/term-utils/agetty.c
diff options
context:
space:
mode:
authorKarel Zak2016-02-17 12:53:20 +0100
committerKarel Zak2016-02-17 12:53:20 +0100
commitd689166b11c5ee89a754d46cc1ce09f27bde0a31 (patch)
tree2deff8a314a2479ab8fd68974d96b86c8ddf3eee /term-utils/agetty.c
parentlib/color: add more ESC seq. (diff)
downloadkernel-qcow2-util-linux-d689166b11c5ee89a754d46cc1ce09f27bde0a31.tar.gz
kernel-qcow2-util-linux-d689166b11c5ee89a754d46cc1ce09f27bde0a31.tar.xz
kernel-qcow2-util-linux-d689166b11c5ee89a754d46cc1ce09f27bde0a31.zip
agetty: support \e{name} for issue file
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'term-utils/agetty.c')
-rw-r--r--term-utils/agetty.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index d55b2e62a..d88cdc1c0 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -44,6 +44,7 @@
#include "c.h"
#include "widechar.h"
#include "ttyutils.h"
+#include "color-names.h"
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
@@ -2340,8 +2341,17 @@ static void output_special_char(unsigned char c, struct options *op,
switch (c) {
case 'e':
- fputs("\033", stdout);
+ {
+ char escname[UL_COLORNAME_MAXSZ];
+
+ if (get_escape_argument(fp, escname, sizeof(escname))) {
+ const char *esc = color_sequence_from_colorname(escname);
+ if (esc)
+ fputs(esc, stdout);
+ } else
+ fputs("\033", stdout);
break;
+ }
case 's':
printf("%s", uts.sysname);
break;