logo       

[ ghc-Bugs-1078231 ] GHCi stdin buffering strange: msg#00026

lang.haskell.glasgow.bugs

Subject: [ ghc-Bugs-1078231 ] GHCi stdin buffering strange

Bugs item #1078231, was opened at 2004-12-03 02:46
Message generated for change (Comment added) made by nobody
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1078231&group_id=8032

Category: Compiler
Group: None
Status: Open
Resolution: None
Priority: 2
Submitted By: Simon Peyton Jones (simonpj)
Assigned to: Nobody/Anonymous (nobody)
Summary: GHCi stdin buffering strange

Initial Comment:
Ben Rudiak-Gould reports

This is a bizarre problem that's been randomly biting me
for ages, but I
just recently figured out how to reliably reproduce it.

Steps to reproduce:

1. Install GHC 6.2.2 for Win32 from the MSI file at
haskell.org.
(Older versions also exhibit the bug.)
2. Start GHCi from the command line with no options.
While it's
loading (before the Prelude> prompt appears), press the
letter 'p' on
the keyboard.
3. After the prompt appears, press the 'i' and Enter
keys.
4. Instead of "3.141592653589793", GHCi
reports "Variable not in
scope: `gi'".

The character that gets munged is always the first
character of the
input line, and it always gets replaced with the letter g,
regardless of
what it was initially. It's not visibly munged: that is, the
interaction
looks like

Prelude> pi

<interactive>:1: Variable not in scope: `gi'

The same problem appears if I press both 'p' and 'i'
before the prompt
appears, and Enter after. But it does not appear if I
press all three
keys before the prompt appears, or all three after. (I
told you it was
weird.)

I seem to remember that using :r or :l also triggers the
bug on the next
input, but I haven't tested that recently.

I've encountered this problem on at least two different
machines, at
least two versions of NT (Win2K and WinXP), and many
versions of GHC.


----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2005-02-08 22:13

Message:
Logged In: NO

Hmm, doesn't affect Mac OS-X 10.2.2, ghci v6.0.1:

xxxx@xxxx ~$ghci
pi
___ ___ _
/ _ \ /\ /\/ __(_)
/ /_\// /_/ / / | | GHC Interactive, version 6.0.1,
for Haskell 98.
/ /_\/ __ / /___| | http://www.haskell.org/ghc/
\____/\/ /_/\____/|_| Type :? for help.

Loading package base ... linking ... done.
Prelude> pi
3.141592653589793
Prelude>


----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1078231&group_id=8032


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise