bug-bash
[Top][All Lists]
Advanced

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

Re: PROMPT_DIRTRIM skips depth n-1 when ~ is n


From: Chet Ramey
Subject: Re: PROMPT_DIRTRIM skips depth n-1 when ~ is n
Date: Sat, 28 Nov 2009 21:54:16 -0500
User-agent: Thunderbird 2.0.0.23 (Macintosh/20090812)

DennisW wrote:
> On Nov 28, 5:25 am, "dennis" <den...@netstrata.com> wrote:
>> Configuration Information [Automatically generated, do not change]:Machine:
>> i486OS: linux-gnuCompiler: gccCompilation CFLAGS:  -DPROGRAM='bash'
>> -DCONF_HOSTTYPE='i486' -DCONF_OSTYPE='lin$uname output: Linux emperor
>> 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:2$Machine Type:
>> i486-pc-linux-gnu
>> Bash Version: 4.0Patch Level: 33Release Status: release
>> Description:
>> If you are in a directory below ~ and you set PROMPT_DIRTRIM to the
>> depthminus 2 it includes the depth minus 1 directory in the prompt as
>> well.
>> Repeat-By:
>> $ mkdir -p /tmp/seven/six/five/four/three/two/one$ cd
>> /tmp/seven/six/five/four/three/two/one$ PS1="\w$
>> "/tmp/seven/six/five/four/three/two/one$
>> PROMPT_DIRTRIM=0/tmp/seven/six/five/four/three/two/one$
>> PROMPT_DIRTRIM=1.../one$ PROMPT_DIRTRIM=2.../two/one$
>> PROMPT_DIRTRIM=3.../three/two/one$ PROMPT_DIRTRIM=4.../four/three/two/one$
>> PROMPT_DIRTRIM=5.../five/four/three/two/one$
>> PROMPT_DIRTRIM=6.../six/five/four/three/two/one$
>> PROMPT_DIRTRIM=7.../seven/six/five/four/three/two/one$
>> PROMPT_DIRTRIM=8/tmp/seven/six/five/four/three/two/one$ cd ~~$ mkdir -p
>> ~/seven/six/five/four/three/two/one~$ cd
>> ~/seven/six/five/four/three/two/one~/seven/six/five/four/three/two/one$
>> PROMPT_DIRTRIM=0~/seven/six/five/four/three/two/one$
>> PROMPT_DIRTRIM=1~/.../one$ PROMPT_DIRTRIM=2~/.../two/one$
>> PROMPT_DIRTRIM=3~/.../three/two/one$
>> PROMPT_DIRTRIM=4~/.../four/three/two/one$
>> PROMPT_DIRTRIM=5~/.../five/four/three/two/one$
>> PROMPT_DIRTRIM=6~/seven/six/five/four/three/two/one$
>>
>> Repeated here without the prompts:
>> mkdir -p /tmp/seven/six/five/four/three/two/onecd
>> /tmp/seven/six/five/four/three/two/onePS1="\w$
>> "PROMPT_DIRTRIM=0PROMPT_DIRTRIM=1PROMPT_DIRTRIM=2PROMPT_DIRTRIM=3PROMPT_DIR T
>> RIM=4PROMPT_DIRTRIM=5PROMPT_DIRTRIM=6PROMPT_DIRTRIM=7PROMPT_DIRTRIM=8cd
>> ~mkdir -p ~/seven/six/five/four/three/two/onecd
>> ~/seven/six/five/four/three/two/onePROMPT_DIRTRIM=0PROMPT_DIRTRIM=1PROMPT_D I
>> RTRIM=2PROMPT_DIRTRIM=3PROMPT_DIRTRIM=4PROMPT_DIRTRIM=5PROMPT_DIRTRIM=6
> 
> Once again, something - probably Linux vs. Windows line endings -
> screwed up my post. Here it is straightened out. Hopefully.
> 
> Configuration Information [Automatically generated, do not change]:
> Machine: i486
> OS: linux-gnu
> Compiler: gcc
> Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' -
> DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' -
> DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -
> DSHELL -DHAVE_CONFIG_H   -I.  -I../bash -I../bash/include -I../bash/
> lib   -g -O2 -Wall
> uname output: Linux emperor 2.6.31-14-generic #48-Ubuntu SMP Fri Oct
> 16 14:04:26 UTC 2009 i686 GNU/Linux
> Machine Type: i486-pc-linux-gnu
> 
> Bash Version: 4.0
> Patch Level: 33
> Release Status: release
> 
> Description:
> 
> If you are in a directory below ~ and you set PROMPT_DIRTRIM to the
> depth
> minus 2 it includes the depth minus 1 directory in the prompt as well.

Thanks for the report.  This will be fixed in bash-4.1.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

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