RE: Readline (was Re: state of ghc6 on sparc)

[SimpleLineEditor]
It seems to behave strangely here: I can delete the prompt, and if I move the cursor to the left and delete some characters, the characters to the right of the cursor don't move. Also, the backspace key doesn't work, although C-Backspace does work (backspace works fine with readline). This is in an xterm; in a cygwin shell window different strange things happen.
There were a couple of bugs (now fixed) in the version I posted which account for being able to delete the prompt, and for some strange behaviour when retrieving history whilst in the middle of the line.
But I'm also perfectly well aware that a different terminal environment might completely mess up some assumptions in the keystroke lexer. For instance, in a gnome-terminal, ^H and backspace register as the same single character, but in cbreak mode the former is echoed to screen as two characters, whilst the latter is apparently echoed as one. Or least, that was the case yesterday - today they seem to be the same!
Perhaps the best way to take care of such differences is by turning off terminal echo, but sadly there is no portable Haskell'98 method for that.
Hmm. I'm highly dubious that this can be done portably enough to be worthwhile. The only way to get information about the terminal is by consulting termcap or terminfo, otherwise you're just guessing. Even Xterm itself differs in what keystrokes it generates between versions of XFree86, and even between vendor releases (RedHat IIRC uses its own key mappings in XTerm and has a special termcap entry). Isn't this just a pile of bug reports waiting to happen? Or a neverending maintenance headache? Cheers, Simon

"Simon Marlow"
[SimpleLineEditor]
Hmm. I'm highly dubious that this can be done portably enough to be worthwhile. The only way to get information about the terminal is by consulting termcap or terminfo, otherwise you're just guessing.
I'm pretty sure that even termcap/terminfo does not contain the sort of information we need. There are just too many layers of environment to worry about.
Isn't this just a pile of bug reports waiting to happen? Or a neverending maintenance headache?
Yes, I expect so. But someone did have a plea that even some small editing functionality would be better than nothing. So in the spirit of "worse is better"... Regards, Malcolm
participants (2)
-
Malcolm Wallace
-
Simon Marlow