Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162956812
D37701.id114146.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D37701.id114146.diff
View Options
diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c
--- a/bin/sh/histedit.c
+++ b/bin/sh/histedit.c
@@ -190,7 +190,7 @@
if (el != NULL) {
if (hist)
el_set(el, EL_HIST, history, hist);
- el_set(el, EL_PROMPT, getprompt);
+ el_set(el, EL_PROMPT_ESC, getprompt, '\001');
el_set(el, EL_ADDFN, "sh-complete",
"Filename completion",
sh_complete);
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
--- a/bin/sh/parser.c
+++ b/bin/sh/parser.c
@@ -2060,6 +2060,15 @@
if (*fmt == '\\')
switch (*++fmt) {
+ /*
+ * ESC character.
+ */
+ case 'e':
+ ps[i++] = '\001';
+ ps[i++] = '\033';
+ ps[i] = '\001';
+ break;
+
/*
* Hostname.
*
diff --git a/bin/sh/sh.1 b/bin/sh/sh.1
--- a/bin/sh/sh.1
+++ b/bin/sh/sh.1
@@ -32,7 +32,7 @@
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
.\" $FreeBSD$
.\"
-.Dd May 10, 2021
+.Dd December 14, 2022
.Dt SH 1
.Os
.Sh NAME
@@ -1428,6 +1428,8 @@
may include any of the following formatting sequences,
which are replaced by the given information:
.Bl -tag -width indent
+.It Li \ee
+An ASCII ESCAPE character (decimal 27, octal 033, hexadecimal 0x1b).
.It Li \eH
This system's fully-qualified hostname (FQDN).
.It Li \eh
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jul 19, 4:45 PM (20 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35240587
Default Alt Text
D37701.id114146.diff (1 KB)
Attached To
Mode
D37701: sh: Allow an ASCII ESC in PS
Attached
Detach File
Event Timeline
Log In to Comment