#!/bin/ksh
export TERMINFO=$HOME/lib/terminfo
#------------------------------------------------------------------------#
# Setting up TERM type by prompting at login #
#------------------------------------------------------------------------#
#term_def=xterm
term_def=dtterm
term_string=`echo $term_def | awk '{ b = length($1); printf("%s", $1); for( i =0; i < b; i++) { printf("\b") } } '`
read TERM?"TERM = ${term_string}"
TERM=${TERM:-$term_def}
#------------------------------------------------------------------------#
# set title
#------------------------------------------------------------------------#
tit_def="$GENERIC $tit_def"
read Sel_title?"Set title (default ${tit_def}): "
Sel_title=${Sel_title:-$tit_def}
case "$TERM" in
sun-cmd|sun)
echo "\033]l${Sel_title}^[\\";;
vt100|xterm|dtterm)
echo "\033]0;${Sel_title}^G\c";;
730)
echo "\033[?${#1};1v$Sel_title";;
*)
echo "Don't recognize TERM type";;
esac
阅读(1667) | 评论(0) | 转发(0) |