Ticket #282 (closed bug: Duplicate)

Opened 8 years ago

Last modified 43 years ago

GHCi stdin buffering strange

Reported by: simonpj Owned by: nobody
Priority: lowest Milestone:
Component: Compiler Version: None
Keywords: Cc:
Operating System: Architecture:
Type of failure: Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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.

Change History

Changed 8 years ago by nobody

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> 

Changed 8 years ago by nobody

Logged In: NO 

I submitted a not-so-good report on the same bug

http://sourceforge.net/tracker/?group_id=8032&atid=108032&func=detail&aid=1329672

the reply blames a bug in windows and says it's as fixed as
it can be in 6.4.1

Changed 8 years ago by simonmar

  • status changed from assigned to closed
Logged In: YES 
user_id=48280

dup of #1329672
Note: See TracTickets for help on using tickets.