[gnu.bash.bug] non-printing chars in prompt

perf@efd.lth.se (06/13/89)

Facts: bash 0.99
       sun 3/50
       SunOS 4.0.1
       xterm

I tried to use the \<octal> notation to get standout mode in my
prompt. (I suppose thats why the possibility is there?).

Anyway, the shell treats the 7 bytes (4 bytes to turn on and 3 to turn
off standout mode) as printing characters, which means that the cursor
goes to the wrong place sometimes. (When moving around in multiline
commands or using i-search for example).

This is probably not a bug since it is difficult to know which
characters can be printed on a specific terminal. 

My suggestion is this (borrowed from tcsh): add two more special
characters in the prompt to start and stop standout mode. The chars to
use could either be ansi (\033[7m to turn it on and \033[m to turn it
off) or they could be specified in ~/.inputrc. Tcsh uses %S and %s for
this, but 's' is occupied. What about \R and \r (for reverse). These
codes should always be treated as non-printing and not affect the
cursor-position.

If this isn't to hard to hack into bash, I think if would help
tcsh-users to feel at home (and make them switch to bash).

	/Per
 ____________________________________________________________________________
| Per Foreby -- system manager at School | Email: perf@efd.lth.se            |
|   of Electrical Engineering, Computer  | Snail: Tekniska Hogskolan i Lund, |
|   Science and Engineering Physics,     |    Box 118, S-221 00 LUND, Sweden |
|   Lund Institute of Technology, Sweden | Phone: int + 46 46-10 75 98       |
|________________________________________|___________________________________|