[comp.unix.questions] about setting that prompt for csh...

nick@aimed.UUCP (Nick Pemberton) (06/15/89)

I have a possibly interesting (but more likely silly :-) problem setting
my prompt for the csh.

In .login, after the TERMCAP entry is set, I have the following lines:

set invs=`tput smso`
set inve=`tput rmso`
alias sp 'set pwd=`pwd`'
alias cd 'cd \!* ; sp ; set prompt = "$invs$home:t: \! $pwd $inve"'
cd

I have to use the slightly inefficient sp alias because I don't have the
built in $cwd variable. Now, I used invs and inve to set the standout
mode and to end it. I 'programmed' this when logged in remotely, on a
wyse50 (using the wy50 termtype). This worked just fine, and I get
a nice standout prompt like

nick: nn /u/nick/mywork 

in reduceded inverse.

But then, when I looked in on the console at work, the variables
invs and inve are empty. (term type = ansi).

I suspected the TERMCAP entry, so I tried

tput smso

at the shell prompt. Worked just fine.

So why doesn't it work as part of .login?

BTW, this is an SCO XENIX 386 (2.3.???), on an Intel 386, if that
helps.

Nick

-- 
Nick Pemberton               uucp: {lsuc, uunet!mnetor}!aimed!nick
AIM, Inc		      bus: 429-1085
 			     home: 690-0647

maart@cs.vu.nl (Maarten Litmaath) (06/16/89)

nick@aimed.UUCP (Nick Pemberton) writes:
\In .login, after the TERMCAP entry is set, I have the following lines:
\
\set invs=`tput smso`
\set inve=`tput rmso`

Try:
	set	invs = "`tput smso`"
	set	inve = "`tput rmso`"

This will avoid csh interpreting the output of `tput'.
For the ANSI terminal:

	so=^[[7m
	se=^[[m

Both strings contain the wildcard character '['. In both cases the
corresponding ']' is missing. Hence csh decides "Missing ]." and the final
output of each backquote command will be empty, whereas the error messages
somehow get lost. Yet another bug.
-- 
"I HATE arbitrary limits, especially when |Maarten Litmaath @ VU Amsterdam:
   they're small."  (Stephen Savitzky)    |maart@cs.vu.nl, mcvax!botter!maart