[Openmcl-devel] CCL, ncurses, and raw mode

Ron Garret ron at flownet.com
Tue Mar 13 10:03:48 PDT 2018

Thanks to Robert and Matt for useful pointers in figuring this out.  The problem turned out to be:

1.  Ncurses does not play nicely with rlwrap.  This is not, if you think about it, entirely unexpected, but the *way* in which it fails is surprising (at least it was to me).  When running ncurses under rlwrap and you try to put it into raw mode, it actually works, but only after you have read one character from the keyboard.  After that, everything works properly.  But if the first character you type is ctrl-C or ctrl-Z then it will generate a signal rather than deliver the character to the input stream.  I still don’t have a good model of what is actually going on under the hood here.

2.  halfdelay and raw mode are incompatible.  Figuring this out was absolutely infuriating because the tutorial I was following was not clear about this, and there is no reason for the API call that sets an input timeout to *also* muck with the signal delivery settings, but that’s the way it is.  AFAICT it is not possible under ncurses to have both ctrl-C/ctrl-Z delivered as input characters rather than signals, and an input call that times out.  Madness.

Now I remember why I absolutely despise front-end programming.  How is it possible that in 2018 there is not (AFAICT) a single sane UI library in the world?


More information about the Openmcl-devel mailing list