
Alastair Reid
It would be nice to have those bindings but just having backspace and left-right cursors work would already be a huge improvement over nothing.
OK, here is my contribution. The attached module SimpleLineEditor is API-compatible with readline, and is a slight elaboration of the line editor currently distributed as part of hmake interactive. It does the basic stuff like backspace and left and right arrows. Today's addition was a simple history mechanism using (uggh!) an IORef. Because of the way I chose to implement a separation of keystroke-recognition from interpretation of the associated editing command, it should be reasonably straightforward to extend/change the keystrokes for different terminal types. It should also be fairly easy to add more editing commands (e.g. there are commands for word-movement, and begin/end of line, but no key-binding and no interpretation yet either.) Perhaps we should add something like this to the hierarchical libs, in the readline package? Then we can have some basic line-editing functionality available in a portable fashion, independent of whether any particular machine has the real readline library installed. Regards, Malcolm