lineedit: document prompt handling
This commit is contained in:
parent
86d88c0990
commit
78ff8197cc
@ -15,17 +15,23 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Usage and known bugs:
|
* Usage and known bugs:
|
||||||
Terminal key codes are not extensive, and more will probably
|
* Terminal key codes are not extensive, and more will probably
|
||||||
need to be added. This version was created on Debian GNU/Linux 2.x.
|
* need to be added. This version was created on Debian GNU/Linux 2.x.
|
||||||
Delete, Backspace, Home, End, and the arrow keys were tested
|
* Delete, Backspace, Home, End, and the arrow keys were tested
|
||||||
to work in an Xterm and console. Ctrl-A also works as Home.
|
* to work in an Xterm and console. Ctrl-A also works as Home.
|
||||||
Ctrl-E also works as End.
|
* Ctrl-E also works as End.
|
||||||
|
*
|
||||||
Small bugs (simple effect):
|
* lineedit does not know that the terminal escape sequences do not
|
||||||
- not true viewing if terminal size (x*y symbols) less
|
* take up space on the screen. The redisplay code assumes, unless
|
||||||
size (prompt + editor's line + 2 symbols)
|
* told otherwise, that each character in the prompt is a printable
|
||||||
- not true viewing if length prompt less terminal width
|
* character that takes up one character position on the screen.
|
||||||
|
* You need to tell lineedit that some sequences of characters
|
||||||
|
* in the prompt take up no screen space. Compatibly with readline,
|
||||||
|
* use the \[ escape to begin a sequence of non-printing characters,
|
||||||
|
* and the \] escape to signal the end of such a sequence. Example:
|
||||||
|
*
|
||||||
|
* PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "libbb.h"
|
#include "libbb.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user