This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with Cygwin reading/storing backspace character

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

> If so, is there anyway to make it behave like Linux instead?

Yes.  'stty erase ^H'.  "man stty" for more info.
      |\      _,,,---,,_
ZZZzz /,`.-'`'    -.  ;-;;,_
     |,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:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]