How to put something on Status line
PrehnRL
rlp at druwa.ATT.COM
Sat Nov 3 04:02:23 AEST 1990
In article <1990Nov2.144633.10734 at cbnewsl.att.com>, rbr at bonnie.ATT.COM (4197,ATTT) writes:
> Sorry, the text got lost on the last posting. The program is a highly
> stripped verion of "sysline". I wrote this as an exercise to learn some
> curses. I have tried all kinds of shell echo tricks to use the status
> line on my ATT 4425 without success. This program does the job. Putting
> the CWD on the stat line is a good idea, its clumsy on the prompt.
>
> Bob Rager
if you put the following function in a file (e.g. set4d)
#--------------------------
_cd()
{
\cd "$@"
DIR=`pwd`
echo "\033\067\033[25;9H ${DIR} \033\070\c"
}
#--------------------------
and in your .kshrc file:
#--------------------------
alias cd=_cd
. set4d
#--------------------------
You will get the current directory on the status line.
While I'm at it, the following script works for the AT&T ctrm
HP2621 terminal emulator:
#--------------------------
_cd()
{
\cd "$@"
X=`echo " $PWD"\
|cut -c$((${#PWD}/2))-$((40+${#PWD}))`
echo "\033&P10 2$X\000\c"
unset X
}
#--------------------------
Lastly for AT&T 630 terminals
#--------------------------
_cd()
{
\cd "$@"
DIR=`pwd`
SIZE=`expr "${DIR}" : '.*'`
echo "\033[?${SIZE};2v${DIR}\c"
}
#--------------------------
Robert Prehn +-----------------------------------------------------------+
AT&T Bell Labs | ____ _______ _____ _______ |
Room 1F50 | / __ \ |__ __| / _ \ |__ __| |
11900 North Pecos | | <__> | | | \ \ \_\ | | |
Denver, Co 80234 | | __ | | | / \ __ | | THE CHOICE|
| | | | | | | | (\ / / | | |
drutx!rlp | |_| |_| |_| \_____/ |_| |
(303) 538-4554 | |
+-----------------------------------------------------------+
More information about the Comp.unix.shell
mailing list