diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-28 21:03:43 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-28 21:03:43 +0000 |
commit | 78ff8197cc5ff8a9b207b0c27a96a292d1f492cc (patch) | |
tree | 3eda1bf954284ae8daaa51b836e62b831e117a2e /libbb/lineedit.c | |
parent | 86d88c09909b1089bd2b43e896895c48ce33f1b2 (diff) | |
download | busybox-w32-78ff8197cc5ff8a9b207b0c27a96a292d1f492cc.tar.gz busybox-w32-78ff8197cc5ff8a9b207b0c27a96a292d1f492cc.tar.bz2 busybox-w32-78ff8197cc5ff8a9b207b0c27a96a292d1f492cc.zip |
lineedit: document prompt handling
Diffstat (limited to 'libbb/lineedit.c')
-rw-r--r-- | libbb/lineedit.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 42f372fb9..3ef47ba71 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -15,17 +15,23 @@ | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | /* | 17 | /* |
18 | Usage and known bugs: | 18 | * Usage and known bugs: |
19 | Terminal key codes are not extensive, and more will probably | 19 | * Terminal key codes are not extensive, and more will probably |
20 | need to be added. This version was created on Debian GNU/Linux 2.x. | 20 | * need to be added. This version was created on Debian GNU/Linux 2.x. |
21 | Delete, Backspace, Home, End, and the arrow keys were tested | 21 | * Delete, Backspace, Home, End, and the arrow keys were tested |
22 | to work in an Xterm and console. Ctrl-A also works as Home. | 22 | * to work in an Xterm and console. Ctrl-A also works as Home. |
23 | Ctrl-E also works as End. | 23 | * Ctrl-E also works as End. |
24 | 24 | * | |
25 | Small bugs (simple effect): | 25 | * lineedit does not know that the terminal escape sequences do not |
26 | - not true viewing if terminal size (x*y symbols) less | 26 | * take up space on the screen. The redisplay code assumes, unless |
27 | size (prompt + editor's line + 2 symbols) | 27 | * told otherwise, that each character in the prompt is a printable |
28 | - not true viewing if length prompt less terminal width | 28 | * character that takes up one character position on the screen. |
29 | * You need to tell lineedit that some sequences of characters | ||
30 | * in the prompt take up no screen space. Compatibly with readline, | ||
31 | * use the \[ escape to begin a sequence of non-printing characters, | ||
32 | * and the \] escape to signal the end of such a sequence. Example: | ||
33 | * | ||
34 | * PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] ' | ||
29 | */ | 35 | */ |
30 | 36 | ||
31 | #include "libbb.h" | 37 | #include "libbb.h" |