I use tcsh. I'd like to have my prompt formatting (coloring/highlighting) change based on the directory I'm in, or other critical aspects of my environment.
I'm not enough of a shell hacker to know how to do this.
Ownership of Current Directory
------------------------------
If I'm in one of "my" directories (i.e., I am owner of the current working directory), then it should have normal appearance. But if I'm in someone else's directory (I do a lot of support and
cd
to others' working areas), then I want the prompt to look clearly different.
This is to remind me to not type impolite commands in others' directories. (think make clobber
or p4 sync
, etc.)
Critical Environment Variable Setting
-------------------------------------
Another important piece of information for my environment is whether a certain environment variable is set, call it SWDEV. If SWDEV is not set, then my scripts and flows come from their default location. But if this variable is set, then it's taken as a new root location for my scripts and flows, with behaviors changing according to the scripts at that location.
It's important to be reminded of the setting of this variable, lest I expect "normal" behavior but instead absentmindedly run code from the new location.
Asked by Winston Smith
(838 rep)
May 15, 2013, 12:08 AM
Last activity: May 26, 2025, 02:09 PM
Last activity: May 26, 2025, 02:09 PM