Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site ittral.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!talcott!panda!genrad!decvax!ittatc!ittral!malloy From: malloy@ittral.UUCP (William P. Malloy) Newsgroups: net.bugs.4bsd Subject: Re: vi bug(feature?) Message-ID: <190@ittral.UUCP> Date: Tue, 30-Jul-85 12:15:51 EDT Article-I.D.: ittral.190 Posted: Tue Jul 30 12:15:51 1985 Date-Received: Sat, 3-Aug-85 05:24:35 EDT References: <144@peregrine.UUCP> Reply-To: malloy@ittral.UUCP (William P. Malloy) Distribution: net Organization: ITT Telecom B&CC Eng. Group, Raleigh, NC Lines: 34 Keywords: shell, vi, csh > From: mike@peregrine.UUCP (Mike Wexler) > > My standard shell is the /bin/csh. When I try doing a any command > with a name that needs to be shell expanded the editor calls the shell, > but gets confused by the shell prompt and includes that in the file list. > This is a pain when using the n command, but makes things like e ~/.signature > impossible(at lease I don't no how to make it work.). > I do not have source code. I am running on a SUN 2/120 under Unix 4.2BSD(Sun > release 2.00). Your problem is with C Shell and not with vi. The problem comes due to the interaction of resetting shell variables in non-interactive shells. I run into this here every couple of months when someone plays with their .cshrc file. See the reminder I wrote to myself (below) in my .cshrc file [I kept forget- ting about it]. What it means is make sure ALL set's are done inside such an ``if (?prompt) then set var=value endif'' structure and you'll be safe. # # The reason for setting a prompt only if a prompt already exists. # # If it sets a prompt in a non-interactive shell, for instance vi(1) # firing up a sub-shell to expand shell meta-characters, the set prompt # will stomp on alot of shell variables used for the expansion (like ~) # if ( $?prompt ) then set history=500 set mail=/usr/spool/mail/malloy set prompt="`hostname`:$cwd> " set histchars=",;" set cdpath=(~ ~/work /usr/src/local) set path=(. /usr/new /usr/new/mh ~/mybin ~/mycmd /usr/local/staff $path) endif -- Address: William P. Malloy, ITT Telecom, B & CC Engineering Group, Raleigh NC {ihnp4!mcnc, burl, ncsu, decvax!ittvax}!ittral!malloy