Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!swrinde!ucsd!pacbell.com!att!att!drutx!druwa!rlp From: rlp@druwa.ATT.COM (PrehnRL) Newsgroups: comp.unix.shell Subject: Re: How to put something on Status line Summary: ATT4425 cwd on prompt is easy. Keywords: csh,status,VT100 Message-ID: <6517@drutx.ATT.COM> Date: 2 Nov 90 17:02:23 GMT References: <152961@felix.UUCP> <1990Nov1.180501.3226@cbnewsl.att.com> <1990Nov2.144633.10734@cbnewsl.att.com> Sender: news@drutx.ATT.COM Reply-To: rlp@druwa.ATT.COM Distribution: na Organization: AT&T Bell Laboratories, Denver Lines: 60 In article <1990Nov2.144633.10734@cbnewsl.att.com>, rbr@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 | | +-----------------------------------------------------------+