Alternatives to /usr/sbin/bindkey for window pop/push ?

Michael Gold gold at sgi.com
Tue Jan 15 09:06:34 AEST 1991


In article <1991Jan8.015407.22178 at bhpmrl.oz.au> tim at bhpmrl.oz.au (Tim Monks) writes:
>
>I have been using /usr/sbin/bindkey and the following key-bindings for a
>while  :
>
>    /usr/sbin/bindkey -l f1,push
>    /usr/sbin/bindkey -l f2,pop
>
>If I try any command in vi which requires variable expansion, then I get
>an error message.  For example, under csh the following command in vi :
>
>	:r $tlib/abort.c
>
>works quite happily and reads in the file /ipada/tim/tomography/abort.c
>but under tcsh I get the following message :
>
>    "^[P103;146.ypush^[\^[P103;147.ypop^[\/ipada/tim/tomography/lib/abort" 
>    No such file or directory
>
>The problem is caused by /usr/sbin/bindkey, since if I remove the two lines
>from my .cshrc which bind F1/F2 to window pop/push, vi under tcsh does 
>variable expansion quite happily.
>

The problem is in your .cshrc .  When vi forks a tcsh to expand the
variable, the tcsh runs your .cshrc, which runs bindkey, which sends a
control string to stdout.  To fix this, you need to conditionalize your
.cshrc:

if ($?prompt) then
    /usr/sbin/bindkey -l f1,push
    /usr/sbin/bindkey -l f2,pop
endif

This way, bindkey is only run if you start up a tcsh (or csh) for normal,
interactive use.  Note that if you set your prompt in your .cshrc it should
be done after the `if' (and preferably inside it!).  Most of my .cshrc sits
inside the `if' statement: all but my PATH definition and commands to protect
me from myself (such as "alias rm \rm -i").
--
    Michael I. Gold	 	You go your way, I'll go mine,
    Silicon Graphics Inc.	I don't care if we get there on time,
    Internet: gold at sgi.com	Everybody's searching for something they say,
    Voice: (415) 335-1709	I'll get my kicks on the way...



More information about the Comp.sys.sgi mailing list