Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site sequent.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxj!ihnp4!zehntel!tektronix!ogcvax!sequent!richard From: richard@sequent.UUCP Newsgroups: net.misc Subject: Re: Funny prompts Message-ID: <546@sequent.UUCP> Date: Fri, 26-Oct-84 01:15:38 EST Article-I.D.: sequent.546 Posted: Fri Oct 26 01:15:38 1984 Date-Received: Sun, 28-Oct-84 07:16:15 EST References: <6040@mcvax.UUCP> <581@gloria.UUCP> <2511@ucbvax.ARPA> Organization: Sequent Computer Systems, Portland Lines: 43 >> Some of us (UCB) here do really horrible things with our prompts. >> I have, in my .cshrc, the following: >> >> alias promp `set prompt=MachineName ($cwd) <\! > ` >> alias cd 'cd \!*; promp' >> >> and in my .login: >> >> promp >> >> This prints the full path, from the root, on UN*X systems. >> Some machines may not have the cwd variable, so you may need >> to add 'alias setcwd set cwd=`pwd`' to your .cshrc and >> insert setcwd ahead of promp in the cd alias above. >> >> On average my prompt length is about 25 chars, with its peak at close >> to 80. Oh, you can have more fun than that. I use rlogin for concurrent logins on up to three machines from my home machine. So I don't get too confused, I want the machine name and path displayed all the time. I also use the csh history functions, so I want the history number displayed with each prompt. SO: setenv HOST `hostname` set prompt="$HOST(\!): $cwd" alias cd 'chdir \!* ; set prompt="$HOST(\!): $cwd"' alias pd 'pushd \!* ; set prompt="$HOST(\!): $cwd"' alias po 'popd \!* ; set prompt="$HOST(\!): $cwd"' The is the escape sequence necc to start writing in the status line, and the returns to the current line. Note: If you only have one machine, you only need to print out the stat line when you chdir, pushd or popd. But popping back and forth between three background rlogins and my home machine, whenever I get a new prompt, voila. It takes a little longer to cd, but it was fun while my prompt slowly developed. Now I'm on a wyse75; the bottom status line runs a niced sysline, while the top status line has my current working directory. Happy hacking! ...!sequent!richard