Subject: Re: Broken stdin?
From: [email-masked] (David Jeffers)

26 Oct 1996 12:20:41 -0700
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
References: <[email-masked]>
Original-To: [email-masked]
In-Reply-To: <[email-masked]>
Original-Sender: [email-masked]

>>>>> "Weiqi" == Weiqi Gao <[email-masked]> writes:

    >> ...... 
    >> The shell script also returns without waiting for a response.
    >> The test.c program, however, does work correctly using the dos
    >> shell. I'd be grateful to learn how these programs perform on
    >> other users machines using bash.
    >> 

    Weiqi> The bash shell (under Windows 95 at least) is broken in
    Weiqi> this respect.  It interprets the enter key at the end of
    Weiqi> the command line as two enter keys.  I posted a similar
    Weiqi> problem with "rm -i foo.bar" a couple of days ago.

    Weiqi> This has to be one of the DOS/UNIX CR-LF vs. LF problems.
    Weiqi> A remedy posted yesterday suggests using "Ctrl-J" key
    Weiqi> instead of "Enter".

    Weiqi> I also seem to remember with "less" in beta 14, when I want
    Weiqi> to leave it, I have to press "q, Enter" which exits the
    Weiqi> program and gives me FOUR prompts afterwards.

    This appears to be the case, although I got slightly better
    results using a c++ program:

test.cc

#include <iostream.h>

int main(void)
{
  int a;
  
  cout << "Enter a value: ";
  cin >> a;
  cout << "The value is" << a;
}
 
This produces the following:

$ Enter a value:   <-----cursor should stop here.
$ 10
$ The value is 10

So for some reason a carriage return is being automatically
appended on the end of lines even when not requested. This
should be easy to fix in the sources. Geoffrey?

   David Jeffers	    
<[email-masked]>

-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".