Subject: bug#5255: 23.1.90; Wrong prompt in term

From: Fabian Ezequiel Gallina <[email-masked]>
Date: Tue, 22 Dec 2009 12:25:03 -0300

2009/12/22 Dan Nicolaescu <[email-masked]>:
>  >
>  > I guess I found the problem:
>  >
>  > [fgallina@cuca lisp]$ env | grep PROMPT_COMMAND
>  > PROMPT_COMMAND=echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"
>
> That looks like a bad idea.
> I am guessing that you are trying to set the xterm title to display the
> current directory in the shell, this uses an xterm specific escape sequence.
> So it should only be done for xterm.
>

Yes, it is used just for that, I found this which explains the thing:
http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1

> But you should not need to use PROMPT_COMMAND to do this, it can be done
> by just setting the prompt, search the web for something like: "bash
> prompt xterm title"
>

I didn't set up it myself, I guess xterm sets this automatically.

>  > Now the thing is that executing this in a normal terminal renders
>  > nothing, as opposed to term. My guess would be that term is missing
>  > the \033] escape sequence.
>
> It's actually \033];STUFF\007.
>

Oh yes, actually that is not being taken into account and I guess it
should, at least that's what happens in emacs 23.1.