freebsd-src/bin
Juraj Lutter 3cf65f8a7f sh(1): Allow non-printing characters in prompt strings
Introduce new prompt format characters:

- '\[' starts the sequence of non-printing chatacters
- '\]' ends the sequence of non-printing characters

Within these sequences, the following characters are now supported:

- '\a' emits ASCII BEL (0x07, 007) character
- '\e' emits ASCII ESC (0x1b, 033) character
- '\r' emits ASCII CR (0x0d, 015) character
- '\n' emits ASCII CRLF sequence

These can be used to embed ANSI sequences into prompt strings.

Example in .shrc:

PS1="\[\e[7m\]\u@\h\[\e[0m\]:\w \\$ "

This tries to maintain some degree of compatibility with GNU bash,
that uses GNU readline library (which behaves slightly different from
BSD editline): It has two "non-printing boundary" characters:

- RL_PROMPT_START_IGNORE (\001)
- RL_PROMPT_END_IGNORE (\002)

while BSD editline only has one (when using EL_PROMPT_ESC setting), so
for this purpose, ASCII \001 was chosen and both \[ and \] emits
this character.

And while here, enlarge PROMPTLEN from 128 to 192 characters.

Reviewed by:		jilles
Approved by:		jilles
Differential Revision:	https://reviews.freebsd.org/D37701
2022-12-22 19:10:48 +01:00
..
cat
chflags
chio chio: Mark some arguments as unused. 2022-10-25 10:57:29 -06:00
chmod
cp cp: Fix build without VM_AND_BUFFER_CACHE_SYNCHRONIZED. 2022-08-30 10:51:21 -04:00
csh csh: install hard link with same mode as target 2022-11-29 16:04:05 -05:00
date date: remove some ambiguity in tzdata references 2022-07-28 10:14:18 -05:00
dd
df df: do not report a 100% full inode usage on fs without inodes 2022-03-11 08:49:44 +01:00
domainname
echo
ed
expr
freebsd-version
getfacl
hostname
kenv
kill
ln
ls ls(1): add a -v flag to sort naturally 2022-10-31 00:00:42 +01:00
mkdir
mv
pax pax: update date parsing code (from OpenBSD) 2022-10-19 17:02:45 +00:00
pkill
ps ps(1): Use calloc instead of malloc and memset. 2022-03-11 10:36:00 +01:00
pwait
pwd
realpath
rm
rmail
rmdir
setfacl
sh sh(1): Allow non-printing characters in prompt strings 2022-12-22 19:10:48 +01:00
sleep sleep.1: Fix mdoc style 2022-05-25 10:11:33 +02:00
stty stty(1): provide details about interaction with job control 2022-10-02 20:29:53 +03:00
sync
test
tests
uuidgen bin/uuidgen: add support for v4 uuids 2022-12-17 10:03:38 +01:00
Makefile
Makefile.inc