Carriage return in prompt (tcsh)

Tom White white at convexs.uucp
Fri Jan 6 10:43:10 AEST 1989


In article <11581 at dartvax.Dartmouth.EDU> jim at libdev.dartmouth.edu (Jim Shain) writes:
>	Does anyone know how I can get a carriage return in my prompt
>under tcsh?  A few months ago someone posted the way to do it in csh but
>everything I've tried in tcsh gives me the actual control character.  For
>instance, it will give me a "^M" instead of a carriage return.  

Jim, the only way that I've been able to figure out how to get a multiple
line prompt under tcsh is to use the 'set precmd' enviroment variable.  I
wasn't able to spend a lot of time experimenting so there may be a better
way to do this.  However, heres a copy of the lines in my .cshrc file that
I use:

	set hostname	= `hostname`
	alias	cd	'set old=$cwd; chdir \!*'
	if ($?tcsh) then
		alias precmd 'echo "";echo "${hostname}:${cwd}"'
		set prompt = "> "
	endif

This gives me a prompt that looks like:

	convexs:/mnt/white
	>

The only problem that I've had with this is that a keyboard interrupt
(^C, DEL, whatever) when tcsh is executing the precmd will cause the
precmd to be removed (you can get it back by justing sourcing your
.cshrc file).
Tom White
Convex Computer Corporation - 701 N. Plano Rd. - Richardson, TX  75083

UUCP:      ...!{uiucdcs,sun,uunet,harvard,killer,usenix}!convex!white



More information about the Comp.unix.questions mailing list