delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/10/15/11:45:27

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Maria Green <marigren AT kau DOT se>
cc: cygwin AT cygwin DOT com
Subject: Re: Problem with Cygwin reading/storing backspace character
In-Reply-To: <WorldClient-F200410150944.AA44490090@kau.se>
Message-ID: <Pine.GSO.4.61.0410151142190.20921@slinky.cs.nyu.edu>
References: <WorldClient-F200410150944 DOT AA44490090 AT kau DOT se>
MIME-Version: 1.0
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019