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: DennisW
Subject: Re: PROMPT_DIRTRIM skips depth n-1 when ~ is n
Date: Sat, 28 Nov 2009 15:17:35 -0800 (PST)
User-agent: G2/1.0

On Nov 28, 5:25 am, "dennis" <address@hidden> 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.

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$

Without the prompts:

mkdir -p /tmp/seven/six/five/four/three/two/one
cd /tmp/seven/six/five/four/three/two/one
PS1="\w$ "
PROMPT_DIRTRIM=0
PROMPT_DIRTRIM=1
PROMPT_DIRTRIM=2
PROMPT_DIRTRIM=3
PROMPT_DIRTRIM=4
PROMPT_DIRTRIM=5
PROMPT_DIRTRIM=6
PROMPT_DIRTRIM=7
PROMPT_DIRTRIM=8
cd ~
mkdir -p ~/seven/six/five/four/three/two/one
cd ~/seven/six/five/four/three/two/one
PROMPT_DIRTRIM=0
PROMPT_DIRTRIM=1
PROMPT_DIRTRIM=2
PROMPT_DIRTRIM=3
PROMPT_DIRTRIM=4
PROMPT_DIRTRIM=5
PROMPT_DIRTRIM=6


reply via email to

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