shell prompt SOLVED
On Sat, Jan 04, 2003 at 02:18:20AM +1100, Cameron Hutchison wrote:
> Once upon a time will trillich said...
> > - my prompt includes escape sequences to hilite user@host:path
> > and gnome-terminal gets all confused on cursor positioning,
> > particularly when using word-delete to edit the command line.
> > (i'd expect the linux console tohave similar conniptions, but
> > it doesn't!)
>
> This could be bash getting confused. Make sure you put the control
> sequences within a \[ \] pair so that bash knows not to count the number
> of chars in the escape sequence as visible characters.
ah. it was indeed my shell! once you actually read the
documentation (man tcsh /prompt) things tend to work more
predictably.
thanks for the nudge!
# ^O = ctl-O (chr15), ^[ = esc (chr27), ^G = ctl-G (chr7)
# whoami, whereami
set prompt="%{^O^[[$COLOR;37;1m%}%n: %{^[[37;40m%}%~%{^[[0m%}%# "
# set xterm titlebar, show time
set rprompt="%{^O^[]0;%n: %~^G%}%p"
in tcsh it's %{ and %} that bracket a "don't move the cursor"
chunk. i had put them in the wrong places. feeling much better
now!
--
I use Debian/GNU Linux version 3.0;
Linux server 2.2.17 #1 Sun Jun 25 09:24:41 EST 2000 i586 unknown
DEBIAN NEWBIE TIP #99 from Greg Wiley <greg@orthogony.com>
:
Wondering WHERE TO SPECIFY BASH DEFAULTS? In case you are in X
and launching a term, .bashrc is automatically loaded (instead
of .bash_profile, .profile, .login) when bash is not a login
shell.
Also see http://newbieDoc.sourceForge.net/ ...
Reply to: