vi and "set prompt" question

ebk at iedl02.UUCP ebk at iedl02.UUCP
Thu Apr 26 18:23:32 AEST 1984


> Why does set prompt in .cshrc instead of .login screw up vi.

When a shell is not interactive, such as those forked by vi with input
and output as pipes, it doesn't print prompts (obviously). Not so obvious
is the kludgy way the prompt is prevented: instead of checking a flag
before printing the prompt, the prompt string is set to null at startup.
If you then set prompt=something, the something will be output as well as
the filename that vi is looking for. (Also try :!ls - your prompt will
appear twice as well as the output.) It doesn't hurt anything in .login,
since .login isn't read by secondary shells.

The correct way to set the prompt is in the .cshrc, but in an if:
	if {$?prompt} set prompt=myprompt

John Owens



More information about the Comp.unix.wizards mailing list