Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Fri, 15 Oct 2004 11:45:14 -0400 (EDT) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: Maria Green cc: cygwin AT cygwin DOT com Subject: Re: Problem with Cygwin reading/storing backspace character In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.39 On Fri, 15 Oct 2004, Maria Green wrote: > Hi, > > I program in C++ and have a problem while reading characters from the > stdin. Cygwin doesn't behave the same way as my Linux do and I don't > know if it's supposed to or not. I've searched the web for several hours > but I can't find any informtion about this so I will be very thankful > for some help. > > My problem > I use readline istream::readline, to be exact. There's also a library called 'readline' that lets you do input editing -- you're obviously not using that. > to read one line and store the characters in an array. If I write > something wrong and removes it with backspace, both the character > deleted and the backspace character is stored in the array as well. This > does not happen when you use Linux. This is not Cygwin-specific, BTW. > My questions > Is Cygwin supposed to behave like this? Yes, but it's not Cygwin that's causing this behavior, it's your terminal settings. > If so, is there anyway to make it behave like Linux instead? Yes. 'stty erase ^H'. "man stty" for more info. Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "Happiness lies in being privileged to work hard for long hours in doing whatever you think is worth doing." -- Dr. Jubal Harshaw -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/