1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
From: Adam Borowski <kilobyte@angband.pl>
Date: Sat, 28 Jun 2014 06:29:56 +0200
Subject: Support \e in "echo" and "printf" builtins
Signed-off-by: Adam Borowski <kilobyte@angband.pl>
---
src/bltin/printf.c | 1 +
src/dash.1 | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/src/bltin/printf.c b/src/bltin/printf.c
index 7785735..9b878da 100644
--- a/src/bltin/printf.c
+++ b/src/bltin/printf.c
@@ -340,6 +340,7 @@ conv_escape(char *str, int *conv_ch)
case '\\': value = '\\'; break; /* backslash */
case 'a': value = '\a'; break; /* alert */
case 'b': value = '\b'; break; /* backspace */
+ case 'e': value = '\e'; break; /* escape */
case 'f': value = '\f'; break; /* form-feed */
case 'n': value = '\n'; break; /* newline */
case 'r': value = '\r'; break; /* carriage-return */
diff --git a/src/dash.1 b/src/dash.1
index 32f6ac0..b286f79 100644
--- a/src/dash.1
+++ b/src/dash.1
@@ -1201,6 +1201,8 @@ Subsequent output is suppressed. This is normally used at the end of the
last argument to suppress the trailing newline that
.Ic echo
would otherwise output.
+.It Li \ee
+Outputs an escape character (ESC).
.It Li \ef
Output a form feed.
.It Li \en
@@ -1570,6 +1572,8 @@ The characters and their meanings are as follows:
Write a \*[Lt]bell\*[Gt] character.
.It Cm \eb
Write a \*[Lt]backspace\*[Gt] character.
+.It Cm \ee
+Write an \*[Lt]escape\*[Gt] (ESC) character.
.It Cm \ef
Write a \*[Lt]form-feed\*[Gt] character.
.It Cm \en
|