[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to show path with backslash '\' in it in the prompt?

From: Peng Yu
Subject: Re: How to show path with backslash '\' in it in the prompt?
Date: Sat, 10 Jul 2010 22:07:18 -0500

On Sat, Jul 10, 2010 at 10:00 PM, Peng Yu <address@hidden> wrote:
> On Sat, Jul 10, 2010 at 9:52 PM, Chet Ramey <address@hidden> wrote:
>> On 7/10/10 9:57 PM, Peng Yu wrote:
>>> Hi,
>>> I have a directory named '\E' (two letters, rather than a single
>>> special character). I have the following $PS1 variable.
>>> $ echo $PS1
>>> ${debian_chroot:+($debian_chroot)address@hidden:\w\$
>>> When my current directory is '\E', the prompt shows a special
>>> character (I think that it should be the special character '\E'). I'm
>>> wondering if there is a way to change $PS1 to show two characters '\'
>>> and 'E'.
>> I don't get this behavior with bash-4.1.  It may be PROMPT_COMMAND
>> that is messing up your display.
> No. I don't think that it is because of PROMPT_COMMAND. I set
> PROMPT_COMMAND to the following command. But the prompt doens't
> change. It only print an additional line whenever I run a command.
> export PROMPT_COMMAND=echo

I think that the problem is the combination of bash and the
gnome-terminal. While I'm in the directory '\E', I open a
gnome-terminal (by Ctrl+Shift+N). The new terminal will have the mess
up path in the prompt.

However, if I start with a directory that is not '\E' and then cd to
'\E' in the existing gnome-terminal, the path doesn't mess up.

I tried some other name '\L'. But it doesn't cause the problem. I'm
puzzled what the cause might be.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]