Bug 478466 - ghci does not handle backspace correctly
Summary: ghci does not handle backspace correctly
Alias: None
Product: Fedora
Classification: Fedora
Component: ghc
Version: rawhide
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Bryan O'Sullivan
QA Contact: Fedora Extras Quality Assurance
Depends On: 481252
TreeView+ depends on / blocked
Reported: 2008-12-30 17:13 UTC by Robin Green
Modified: 2009-01-29 01:50 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2009-01-20 08:10:56 UTC
Type: ---

Attachments (Terms of Use)

Description Robin Green 2008-12-30 17:13:51 UTC
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):

How reproducible:

Steps to Reproduce:
1. ghci
2. Type something
3. Press backspace
Actual results:
^? appears

Expected results:
character deleted

Comment 1 Bryan O'Sullivan 2008-12-30 19:34:42 UTC
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.

Comment 2 Jens Petersen 2009-01-06 02:29:11 UTC
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.

Comment 3 Jens Petersen 2009-01-06 02:37:23 UTC
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.

Comment 4 Conrad Meyer 2009-01-13 01:22:15 UTC
I'm hitting this bug too (ghc-6.10.1-6.fc11.x86_64).

Comment 5 ChrisKalt 2009-01-18 02:52:17 UTC
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.

Comment 6 Conrad Meyer 2009-01-18 03:02:58 UTC
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.

Comment 7 ChrisKalt 2009-01-18 22:27:17 UTC
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. )

Comment 8 Conrad Meyer 2009-01-18 22:36:12 UTC
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).

Comment 9 Robin Green 2009-01-18 23:21:13 UTC
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.

Comment 10 Jens Petersen 2009-01-19 11:01:29 UTC
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.

Comment 11 Conrad Meyer 2009-01-19 11:19:57 UTC
That is great news, thanks.

Comment 12 Jens Petersen 2009-01-23 07:48:24 UTC
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.

Comment 13 ChrisKalt 2009-01-29 01:50:06 UTC
(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.

Note You need to log in before you can comment on or make changes to this bug.