Bug 478466 - ghci does not handle backspace correctly
ghci does not handle backspace correctly
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: ghc (Show other bugs)
rawhide
i386 Linux
low Severity medium
: ---
: ---
Assigned To: Bryan O'Sullivan
Fedora Extras Quality Assurance
:
Depends On: 481252
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-30 12:13 EST by Robin Green
Modified: 2009-01-28 20:50 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-20 03:10:56 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Robin Green 2008-12-30 12:13:51 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):
ghc-6.10.1-6.fc11.i386

How reproducible:
Always

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 14:34:42 EST
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-05 21:29:11 EST
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-05 21:37:23 EST
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-12 20:22:15 EST
I'm hitting this bug too (ghc-6.10.1-6.fc11.x86_64).
Comment 5 ChrisKalt 2009-01-17 21:52:17 EST
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-17 22:02:58 EST
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 17:27:17 EST
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 17:36:12 EST
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 18:21:13 EST
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 06:01:29 EST
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 06:19:57 EST
That is great news, thanks.
Comment 12 Jens Petersen 2009-01-23 02:48:24 EST
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-28 20:50:06 EST
(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.