Operating System - HP-UX
1850563 Members
2890 Online
104054 Solutions
New Discussion

Re: setting TERM for login

 
SOLVED
Go to solution
Greg Hale
Advisor

setting TERM for login

We have a non-root user id that whenever that id logs into the server the we get TERM = (hp) . We then normally enter ansi and hit return. How and where can we set this user id up so that it defaults to ansi(or another TERM type) and it does not prompt us?

It should be noted that we use both the windows telnet and a software product entitled KEA-X(uses CDE) to connect to the server.

Any help would be greatly appreciated.

thanks,

Greg
5 REPLIES 5
Alan Riggs
Honored Contributor

Re: setting TERM for login

the prompt for TERM type is almost certainly being executed in /etc/profile if all users see it. In that case, you can insert a test for `logname` to identify the user in question and send him to a code branch that simply sets the TERM type without prompting. i.e.

if [ `logname` = "user" ]
then
export TERM=ansi
else
{ code for TERM prompt }
fi

If only this user is affected, it is probably in his .profile, and you can simply remove the prompting and set the TERM explicitely.
Alex Glennie
Honored Contributor

Re: setting TERM for login

I'd take a look at the tset man page and use in conjuction with setting term type say in the .profile ?

As to CDE check out the resource : *loginShell : True, for hpterm dtterm etc : see there man pages or do a forum search. If you set this say in $HOME/.Xdefaults you'll be sure entriesin .profile are read when a user starts an xterm or dtterm via CDE's front panel etc ...
Bruce Laughlin
Frequent Advisor
Solution

Re: setting TERM for login

Hi Greg,

In the simplest case, assuming that the TERM variable is being set in the user's .profile, you'd make the following changes to force the TERM variable to be set to ansi without being prompted:

From:
eval ` tset -s -Q -m ':?hp' `

To:
eval ` tset -s -Q -m ':ansi' `

Note that the "?" is what causes tset to prompt for the terminal type.

Hope this helps,
Bruce Laughlin
Greg Hale
Advisor

Re: setting TERM for login

I was able to find where the tset was setting the terminal type and make changes per everyone's replies.

Thanks to everyone for their help.

Greg

Re: setting TERM for login

Try insert this lines in your /etc/profile

# /etc/profile


# ...


# Be sure that VUE does not invoke tty commands

if [ ! "$VUE" ]; then

# set term if it's not set

# configura terminal

echo "($TERM)"

case "$TERM" in
vt100|vt100vt100|vt100vt100vt100) TERM=vt100;;
spike|spikespike|spikespikespike) TERM=spike;;

vt125|vt125vt125|vt125vt125vt125) TERM=winCE;;
dec-vt125|dec-vt125dec-vt125|dec-vt125dec-vt125dec-vt125)
TERM=winCE;;

dec-vt100|dec-vt100dec-vt100|dec-vt100dec-vt100dec-vt100)
TERM=win95;;
win95|win95win95|win95win95win95) TERM=win95;;

vt200|vt200vt200|vt200vt200vt200) TERM=vt220;;
vt220|vt220vt220|vt220vt220vt220) TERM=vt220;;

dec-vt220|dec-vt220dec-vt220|dec-vt220dec-vt220dec-vt220)
TERM=dec-vt220;;

vt320|vt320vt320|vt320vt320vt320) TERM=vt320;;

it100|it100it100|it100it100it100) TERM=it100;;

70096|7009670096|700967009670096) TERM=70096;;

sco|scosco|scoscosco) TERM=sco;;

#ansi|ansiansi|ansiansiansi) TERM=ansi;;
ansi|ansiansi|ansiansiansi) TERM=win95;;
iris-ansi-net|iris-ansi-netiris-ansi-net)
TERM=ansi;;

*) TERM="";
unset TERM;;
esac

if [ -z "$TERM" -o "$TERM" = "unknown" ]
then
eval `ttytype -s -a` # Pede identificacao do terminal
#echo "[$TERM]"
fi

if [ -z "$TERM" -o "$TERM" = "unknown" ] # senao Procura etcttytype
then
unset TERM
eval ` tset -s -Q`
#echo "{$TERM}"
fi

# if [ -z "$TERM" -o "$TERM" = "unknown" ] #senao testa se Digibyte
# then
# unset TERM
# echo "033[c"
# eval `ttytype -s -a` # Pede identificacao do terminal
# fi

if [ "$TERM" = "vt200" ]
then
TERM=vt220

# elif [ "$TERM" = "dec-vt100" ]
# then
# TERM=win95

elif [ "$TERM" = "vt125" -o "$TERM" = "dec-vt125" ]
then
TERM=winCE

fi

while [ -z "$TERM" -o "$TERM" = "unknown" ] # senao pede no prompt
do
echo "nnnnNAO FOI POSSIVEL DETERMINAR O TIPO"
echo " DE SEU TERMINAL, INFORME-O POR FAVOR."

echo "n 1. HyperTerm Win95/98 2. Terminal WinCE 80x12"
echo " 3. Spike ADD vt100 4. Terminal Win3.1"
echo " 5. Presentr tnvt220 6. Reflection vt320"
echo " 7. TermIt Psion 8. Freevt Psion"
echo " 9. IT100 10. HP 200LX"
echo "11. ansi 12. Anita VT220"
echo "n99. outros"
echo "n Opcao : c"
read TERM
case "$TERM" in
1|8) TERM=win95;;
2) TERM=winCE;;
3|4|10) TERM=vt100;;
5|12) TERM=vt220;;
6) TERM=vt320;;
7) TERM=termit;;
9) TERM=it100;;
11) TERM=ansi;;
99) echo "nInforme o tipo :c";
read TERM;;
*) echo "nOpcao invalida";
unset TERM;;
esac
done

# if [ -z "$TERM" -o "$TERM" = "unknown" ] # senao pede no prompt
# then
# unset TERM
# echo "nInforme o tipo do terminal ou tecle ENTER para aceitar it100n"
# eval `tset -s -Q -m ':?it100'`
# fi

echo ":$TERM:"
export TERM

#if [ "$COLUMNS" = "1" ]
# then
# COLUMNS=80
# LINES=24
# export COLUMNS LINES
#fi

if [ "$TERM" = "winCE" ]
then
COLUMNS=80
LINES=12
elif [ "$TERM" = "symbol" ]
then
COLUMNS=20
LINES=8
else
COLUMNS=80
LINES=24
fi
export COLUMNS LINES


fi # if !VUE

# ...



#========================== fim ==========================