Path: utzoo!utgpu!water!watmath!clyde!rutgers!mit-eddie!ll-xn!ames!ucbcad!ucbvax!hplabs!hpda!hpdslab!hpiacla!marki From: marki@hpiacla.HP.COM (Mark Ikemoto) Newsgroups: comp.unix.wizards Subject: Re: Re: How to have PS1 evaluated after each "cd" Message-ID: <4070008@hpiacla.HP.COM> Date: 8 Jan 88 04:11:11 GMT References: <551@leah.Albany.Edu> Organization: HP Indus. Appl. Center, Sunnyvale, CA Lines: 32 Russell wrote up that nice summary and, of course, someone like me has to come along and offer his/her two cent's worth. Here it is... One annoyance to me in having the current working directory in the prompt is that depending on how long the working directory pathname is in the prompt, the starting point for my command could be in any position on the screen. If you changed directories often or hate your commands to hit the right side of the screen or don't like zig-zagging your eyes across a screen looking for the format of a command previously entered, you may want to think about implementing a two-line prompt. I alias cd to a set of commands that sets up my show-current-directory prompt. Within this set, I also insert terminal-specific control characters that manipulate the cursor to display a two-line prompt. So when I cd anywhere, I get a blank line followed by the current working directory pathname on the next line followed by a line containing my system's node name, my user name, and C-shell history number, e.g., CWD: /usr/spool/lp/interface ZEIT:mark:[34]: ...your command goes here... If you have access to a color terminal, it's even better since you can also add terminal control chars, for example, to make your CWD line a different color from your command line. In any case, your command always starts at the same character position on the line no matter how long the working directory pathname. Mark