RE: state of ghc6 on sparc

| > often...). The problem around this is in my opinion to make a | > Haskell98 | > compliant trimmed down readline library which doesn't depend on the c | > library. It shouldn't be too difficult. I don't expect that people are | > using the full power of readline anyway. | | Making a working readline isn't that simple - you need to know something | about the terminal properties for one, which means being able to use | termcap or terminfo.
But if someone produced an adequate one that did the job, and that we could distribute with GHC, we'd surely use it, right? To avoid these perpetual readline problems.
That would probably be a good idea, yes. Cheers, Simon

"Simon Marlow"
| Making a working readline isn't that simple - you need to know something | about the terminal properties for one, which means being able to use | termcap or terminfo.
I expect that one can avoid termcap/terminfo by sticking to ANSI terminal control codes for moving the cursor. It isn't as powerful, but probably adequate.
But if someone produced an adequate one that did the job, and that we could distribute with GHC, we'd surely use it, right? To avoid these perpetual readline problems.
That would probably be a good idea, yes.
As I see it, the main problem is reproducing all the keybindings. I'm certain that every user of readline has their own habitual set of emacs keystrokes that differs slightly from everyone elses, so inevitably the full complement will need to be supported. Then there is parsing of the .inputrc file which can /re/bind any keystroke. And of course, just to be awkward, there are vi-mode users like me, where the keystroke set is entirely different anyway. Regards, Malcolm

On Thursday 19 June 2003 11:06 am, Malcolm Wallace wrote:
As I see it, the main problem is reproducing all the keybindings. I'm certain that every user of readline has their own habitual set of emacs keystrokes that differs slightly from everyone elses, so inevitably the full complement will need to be supported. Then there is parsing of the .inputrc file which can /re/bind any keystroke. And of course, just to be awkward, there are vi-mode users like me, where the keystroke set is entirely different anyway.
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. -- Alastair

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

Hi Malcolm.
I tried this on both a Cygwin (environment variable TERM=cygwin) and a
Windows XP console with GHC 6.0.
Under Cygwin, these problems occurred:
1. ^K and ^L both appear as themselves, rather than causing deletion:
prompt> abc^Kefg
2. When editing an item in the history buffer, if I delete a one or more
characters and then move to the end of the line with the cursor, it "runs
off the end" with the same number of characters added at the end. Those
characters are taken from the characters at what was previously the end of
the line eg:
prompt> hello
delete 'l'
prompt> helo
move to end of line:
prompt> heloo
(This does not happen with a new item, only with history items.)
This happens with a normal Windows XP command prompt too (that is, without
any Haskell program running) so I suspect that it is an overprinting of the
Windows terminal handling on your test program's terminal handling.
The interesting result of that is that successive invocations of the same
executable retain the command line history of previous runs.
I would expect substantially different results running under a Win98 command
line as console line editing is not provided on those older versions of the
OS.
Under the Windows XP command line prompt:
1. The stty system call is redundant:
C:\lang\source\ghc\lineedit>le
'stty' is not recognized as an internal or external command,
operable program or batch file.
prompt>
Checking that the preprocessor symbol "i386_unknown_mingw32_TARGET" is not
defined fixed that.
2. - See points 1 and 2 of the Cygwin problems above and the conclusions
drawn there.
Cheers
Mike Thomas.
| -----Original Message-----
| From: glasgow-haskell-users-admin@haskell.org
| [mailto:glasgow-haskell-users-admin@haskell.org]On Behalf Of Malcolm
| Wallace
| Sent: Friday, June 20, 2003 2:39 AM
| To: glasgow-haskell-users@haskell.org
| Cc: libraries@haskell.org
| Subject: Readline (was Re: state of ghc6 on sparc)
|
|
| Alastair Reid

'editline' is a (BSD style) free readline clone. it works quite well. of course a haskell clone might be more convienient. a google search will turn up various references to it. John On Thu, Jun 19, 2003 at 11:46:43AM +0100, Alastair Reid wrote:
On Thursday 19 June 2003 11:06 am, Malcolm Wallace wrote:
As I see it, the main problem is reproducing all the keybindings. I'm certain that every user of readline has their own habitual set of emacs keystrokes that differs slightly from everyone elses, so inevitably the full complement will need to be supported. Then there is parsing of the .inputrc file which can /re/bind any keystroke. And of course, just to be awkward, there are vi-mode users like me, where the keystroke set is entirely different anyway.
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.
-- Alastair
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
-- --------------------------------------------------------------------------- John Meacham - California Institute of Technology, Alum. - john@foo.net ---------------------------------------------------------------------------
participants (5)
-
Alastair Reid
-
John Meacham
-
Malcolm Wallace
-
Mike Thomas
-
Simon Marlow