Path: utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!olivea!decwrl!sgi!shinobu!odin!sundiver.esd.sgi.com!chawley From: chawley@sundiver.esd.sgi.com (Christopher J. Hawley) Newsgroups: comp.sys.sgi Subject: Re: Alternatives to /usr/sbin/bindkey for window pop/push ? Keywords: key bindings bindkey tcsh vi alternatives Message-ID: <1991Jan8.205239.20024@odin.corp.sgi.com> Date: 8 Jan 91 20:52:39 GMT References: <1991Jan8.015407.22178@bhpmrl.oz.au> Sender: news@odin.corp.sgi.com (Net News) Reply-To: chawley@sundiver.esd.sgi.com Organization: Silicon Graphics, Inc. Personal Systems Division Lines: 85 In article <1991Jan8.015407.22178@bhpmrl.oz.au>, tim@bhpmrl.oz.au (Tim Monks) writes: |> Is there any way of popping/pushing windows without touching the mouse ? Yes. From Table A-2 in my (old) copy of the _4Sight Programmer's Guide_ "Using the GL/DGL Interfaces", Appendix A, pg. GA-4: Sequence Semantics ======== ============================================== CSI n {;n...} / y SGI command n = 3: pushes the wsh window n = 4: pops the wsh window So, the commands /bin/echo "\033[3/y\c" >/dev/ttyq4 /bin/echo "\033[4/y\c" >/dev/ttyq4 can be used to (respectively) push and pop a window, in this ttyq4 . |> 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 |> and have become quite accustomed to using the F1/F2 keys to toggle |> overlapping windows. It saves a lot of mousework. Agreed! |> I have just started using tcsh, (tcsh 5.20.02 Cornell, 240GTX, Irix 3.3.1.) and |> love the command line editing. But there is an incompatibility somewhere |> between vi, tcsh and bindkey (the /usr/sbin/bindkey not, tcsh's bindkey). |> 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. In fact, from my understanding of bindkey , it simply generates the appropriate device control string(s) and sends them on to the wsh from which it is invoked; see the continuation of Table A-2. The problem appears when vi needs to use the shell to perform variable expansion, as in your example above, and your .cshrc contains commands which cause output to the tty; I imagine that vi does something like popen("echo $tlib/abort.c", r) and gets the output of bindkey(1) thrown in, which confuses the issue. |> So can anyone suggest alternative ways to bind pop/push facilities to the |> F keys without breaking vi under tcsh ? About all I can recommend is that you move the key binding commands out of .cshrc and into .login (or anyplace where they don't get executed for ***every*** shell forked). Do you really need to set them for each shell? Alternatively, you could specify that vi should use a different shell for subcommands: set sh=/bin/csh if that's an acceptable solution. |> Dr. Tim Monks |> Image Processing & Data Analysis Group | (direct) (+61-3)566-7448 |> BHP Research - Melbourne Laboratories | (switch) (+61-3)560-7066 |> 245 Wellington Rd, Mulgrave, 3170, | (fax) (+61-3)561-6709 |> AUSTRALIA | (EMAIL) tim@bhpmrl.oz.au #include "std_disclaimer.h" --- Christopher J. Hawley / esper chawley@sundiver.esd.sgi.com Silicon Graphics, Inc. 1L-945 phone: 415 / 335-1621 Mountain View, CA 94039-7311 USA 408 / 243-1042 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "Nicht nur wie schnell Sie fahren, sondern _wie_ Sie schnell fahren."