From: utzoo!decvax!wivax!linus!smk Newsgroups: net.unix-wizards Title: Re: small bug in "vi" Article-I.D.: linus.19604 Posted: Tue Apr 5 15:11:08 1983 Received: Wed Apr 6 03:03:42 1983 References: sri-arpa.793 wjh12.194 wjh12^sob brings up the point about getting the prompt while not in an interactive shell. Let me repeat what has been said before. Your .cshrc should look like: if ($?prompt) then ... endif so that it is only executed when in an interactive shell (when the prompt var is defined). Also, this has the benefit that all the aliasing and setting aren't done for shell scripts (where they are a waste at a minimum and trouble for strange aliasing) that don't have the -f at the top. Also, for emacs users, you shouldn't use the `tty` command in your .cshrc or .login. This is because while in emacs (and running a subshell), you aren't really connected to a tty, but rather a MPX file (in 4.1bsd of course). The tty, write, and other commands that use isatty(2) won't work. It's better to check on the TERM variable to check on terminals (although this isn't always helpful) for cases like hardwaired or full screen. Keep in mind .login is executed in the login shell after .cshrc, so the initial .cshrc doesn't have the real TERM from tset. In the login shell, you have to have extra code in .login for that. --steve