Red Hat Bugzilla – Bug 478466
ghci does not handle backspace correctly
Last modified: 2009-01-28 20:50:06 EST
Description of problem:
ghci does not handle the backspace key correctly.
Presumably this is because ghc is not (according to ldd) linked with either readline or editline.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
2. Type something
3. Press backspace
I've no idea what's wrong here. I saw the same problem building ghc via koji on x86_64, but it has since vanished with Jens's most recent build. If I use mock to do a build on my laptop, the problem doesn't occur either. It's clearly somehow related to the koji build environment, but it is strenuously resisting debugging.
Hmm, I still see the problem with ghc-6.10.1-6.fc11.i386 here. I don't think I have seen readline or editline working yet with ghci in 6.10.1.
I got the impression that it is an upstream issue since I heard someone else mention it with another distro on irc, but it sounds like certain build environments may trigger it? I agree with Robin that it is strange that ghc is not linked to the line editing lib.
Looking at http://kojipkgs.fedoraproject.org/packages/ghc/6.10.1/6.fc11/data/logs/i386/build.log I see some build errors related to the editline package but I don't if that relates to this. I remember even trying to build with readline locally did not help with this problem.
I'm hitting this bug too (ghc-6.10.1-6.fc11.x86_64).
I'm also seeing this problem. I just compiled GHCi version 6.10.1 using Fedora 8. fwiw/ The previous GHCi version 6.6.1 does not have the problem.
Chris: F-9 had 6.8.3 I believe and also did not have this issue. GHC moved from GNU readline to the BSD replacement library, editline, between 6.8.x and 6.10.x (someone correct me if I am wrong here). This seems to be the source of the problem.
Conrad: You are correct about 6.8.3 on F-9. I just tried building GHC 6.10.1 on my laptop which has F-9, not unsurprisingly GHCi backspace is broken there as well. I'm still quite new to Haskell so a tad hesitant to roll up my sleeves enough to dig in there to fix this. Incidentally, my desire to move to 6.10 was prompted by the fact that I cannot build Takusen in any of the earlier releases. In an email exchange I had from Alistair Bayley last week he said he's currently working on the 6.10 build. So for now I'm sort of dead in the water awaiting community assistance on two issues. Since most my work in Haskell would target Databases and I really wanted to focus on using Takusen. ( I really am excited about Haskell however my optimism over how soon I could become productive is somewhat dampened if these sorts of problems in seemingly key components are so common. )
We just need to get ghc to start linking with editline (I don't know whether that's an upstream bug or something wrong in our build).
The workaround I'm using for the time being is:
1. Install haskell-mode into emacs
2. Run emacs
3. Open a Haskell source file
4. From the Haskell menu choose "Start interpreter"
You now have ghci running inside emacs and can edit lines. The history works differently - to recall a previous line, you click on it with the mouse.
Turns out buildrequiring ncurses-devel helps to get the ghc editline package built and ghci line-editting is back.
Should be fixed in ghc-6.10.1-7.fc11 building now in rawhide. I think we can push it to f10-updates soon.
That is great news, thanks.
Jeff Collie kindly finished libedit so building ghc-6.10.1-8.fc11.
Will wait for libedit f10 update to build new ghc for f10.
(In reply to comment #10)
> Turns out buildrequiring ncurses-devel helps to get the ghc editline package
> built and ghci line-editting is back.
Would you have a suggestion on how to accomplish this using Fedora 8 and building with the ghc-6.10.1 source download? I'm not familiar with how to do this. -- thanks for any advice.