Dan Nicolaescu wrote:
Dan Nicolaescu <d...@ics.uci.edu> writes:
> In tcsh %c can be used to only show the last few directory names in a
> path (also see the ellipsis variable).
>
> For example for this directory:
>
> /lib/modules/2.6.21-1.3194.fc7/kernel/drivers/char/hw_random/
>
> the prompt can look like this:
>
> u...@machine:...drivers/char/hw_random>
>
> when using: set prompt = "%...@%m:%c03%# "
>
> Given the tendency of directory hierarchies to get deeper, it is very
> useful to be able to see some more context, so it would be great if
> bash also supported something similar.
> Sure, this can be implemented by using shell commands to set the
> prompt, but it would be much nicer if it was built in.
>
> Thanks
Any comments on this old posting?
This is why my prompts are tending to migrate to having a \n between the
directory and the end of the prompt :-).
Actually, a feature that would be REALLY helpful is a way to specify
certain directory strings that should be abbreviated. For example, I
build KDE from sources, with source in /usr/local/src/kde/svn/trunk and
build objects in /var/local/build/kde/svn/trunk. It would be great if
bash could abbreviate these as, say, "$src$' and '$build$',
respectively. (That is, I would somehow tell bash that I want the
leading directory component "/foo/whatever/" abbreviated as "bar", where
both of those are arbitrary strings. As another example, abbreviate
"/net/remote2/corp/home3/" as "~" :-). Yes the slash should be stripped;
the idea being that "/net/remote2/corp/home3/dan" would become "~dan".)
--
Matthew
Please do not quote my e-mail address unobfuscated in message bodies.
--
"Ah, yes. Control the media and you control the world."
-- from a story by Raven Blackmane