strange cursor behavior in gnome terminal

Marius Gedminas marius at pov.lt
Wed Sep 20 16:26:21 UTC 2006


On Wed, Sep 20, 2006 at 01:04:49AM +0200, Marco wrote:
> Marius Gedminas wrote:
> 
> > I've seent his problem.  The cause was my $PS1 setting in my ~/.bashrc
> > file: I had some xterm escape sequences to set the window title.  I
> > removed the escapes from $PS1 and instead added a $PROMPT_COMMAND to
> > do the same thing (copy & paste from /etc/skel.bashrc), and the irritating
> > cursor jumping disappeared.
> 
> Thank you Marius, it seems to be the right way. Would you please help me to
> optimize it.
> 
> I like to have a short prompt, e.g. a green $ for a normal user.

    PS1='\[\033[01;32m\]\$ \[\033[00m\]'

> And I would
> like to set the console title to user at machine/path. With the escape
> sequences I had this in Konsole sessions. But I don't know how to achieve
> it with the $PROMPT_COMMAND.

    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}/${PWD}\007"'

If you also want the terminal window title to show you the command that
is currently being executed, check out http://mg.pov.lt/blog/bash-prompt.html

HTH,
Marius Gedminas
-- 
I once asked an older coworker and Solaris guru what happened with the
Unix-haters list. He told me that it stopped being quite so funny once Windows
NT came along.
		-- the gnat at slashdot
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20060920/c2b5f07f/attachment.pgp>


More information about the ubuntu-users mailing list