This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

readline on cygwin/xterm/rxvt


CLISP uses readline for terminal i/o.
to decide whether to actually use readline, CLISP checks that the i/o
is a terminal with something like this:

        if (isatty(0) && isatty(1) 
            && (strcmp("/dev/conin", ttyname(0))  == 0) /* cygwin-specific *
            && (strcmp("/dev/conout",ttyname(1)) == 0))
          use_readline = true;

this works just fine on the windows console (when started from a cmd or
bash prompt) but _not_ in a cygwin xterm, where all isatty(0),
isatty(1), ttyname(0), ttyname(1) return 0.

So, how do I check that I am running in a cygwin xterm?

further, if I enable use_readline in gdb, I observe something quite
funny: arrow keys move the cursor all over the xterm window, as if
readline were disabled, but when I hit RET, all the keystrokes are
delivered to readline and the appropriate actions are taken.
E.g., Up-arrow + RET will re-evaluate the previous form,
Up-arrow + Up-arrow + RET will re-evaluate the second previous form &c.

What is going on?
what is so peculiar about cygwin xterm?
clisp+readline work just fine on win32/console, and on all unix xterms!

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com/>
A year spent in artificial intelligence is enough to make one believe in God.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]