Path: utzoo!attcan!uunet!samsung!brutus.cs.uiuc.edu!apple!mips!ultra!rmg From: rmg@ultra.com (Rich Geiger) Newsgroups: comp.unix.questions Subject: Re^2: Prompt as Current Directory? Keywords: Use a function in your .profile Message-ID: <1989Nov19.180921.20357@ultra.com> Date: 19 Nov 89 18:09:21 GMT References: <2114@sactoh0.UUCP> Organization: Ultra Network Technologies Lines: 36 >In article >broadman@paul.rutgers.edu (Alan Broadman) writes: >> >>I have a (hopefully) simple question. How can you get the UNIX prompt >>to always reflect the path to the current directory. I find it nice to always have the cwd displayed (one less register to keep in my very limited brain-cache), but find that having it appear on the prompt line itself has drawbacks; often, we work with looooong paths to the cwd (up to or over 80 characters!), and somehow /usr/baziotes/projs/releases/source/lint/obj/debug/notes/private % as a prompt is somewhat irritating. Doesn't leave much space for typing a command, either! One approach that has proved useful is to use an area _outside_ of the normal scrolling area of the terminal (or window) to display the cwd. For example, on VT100s (or any good VT100 emulation), there is an escape sequence to set up separate scolling areas; window systems often allow you to fiddle with the title bar; many terminals have independent status lines. The .cshrc (or equivalent) script can be set up to inject the escape sequences needed to put the cwd into the special area, and then put the cursor back to the main scrolling before displaying the prompt line. These go into $prompt or $PS, just as Paul suggests. Setting all of this up can take some time, and you will probably end up with some code in your .cshrc (or .profile, or whatever), to handle different terminal types; on terminals that don't offer a suitable region for the cwd display, you can revert to using pwd. -- - Rich Geiger Disclaimer: I didn't mean it _that_ way... Ultra Network Technologies / 101 Dagget Drive / San Jose CA 95134 rmg@ultra.com ...!ames!ultra!rmg (408) 922-0165 [w] (408) 739-7911 [h]