root%paul.ARPA%uscacsc.UUCP@USC-CSE.USC.EDU.UUCP (03/05/87)
It was suggested to me by Paul Asente to use the Xtty library for input and output to a window (text I/O). After looking over the library however I didn't see anything that would help me with cursor movement. Did I just miss it or will it be necessary for me to use curses? It seems redundant to have to use curses on an X window. Paul Nahi
asente@figaro.STANFORD.EDU (Paul Asente) (03/05/87)
In article <8703042256.AA02507@paul.UUCP> root%paul.ARPA%uscacsc.UUCP@USC-CSE.USC.EDU (Paul Nahi) writes: > >It was suggested to me by Paul Asente to use the Xtty library for input >and output to a window (text I/O). After looking over the library however >I didn't see anything that would help me with cursor movement. Did I just >miss it or will it be necessary for me to use curses? It seems redundant >to have to use curses on an X window. Yes, you have to use curses, yes it is redundant, and yes, it really does work (I use it every day). It seems absurd to have to take some idea like "move the cursor to x,y", have curses encode it into a byte stream, send it to the emulator, and have the emulator decode it and call a "mve the cursor to x,y" routine, but, until someone writes a terminal emulator subroutine package, it's the only way to do it. I think the ideal way to do this is to take the xterm code and heavily #ifdef it so that you could compile it into either xterm or into a terminal emulator library. I suspect that I have one of the most convoluted process stuctures of any X application: I use Xtty to start up a subfork of xterm, ask it to keep the slave end of the pty open (undocumented feature!), and fork off an emacs process that uses the pty, so it runs in the terminal. But I still keep a copy of the slave end of the pty open myself, so emacs receives commands both from my program and the user. The amazing thing is that it all seems to work perfectly... -paul asente asente@cascade.stanford.edu decwrl!labrea!cascade!asente