delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm |
Sender: | cygwin-developers-owner AT sourceware DOT cygnus DOT com |
Delivered-To: | mailing list cygwin-developers AT sourceware DOT cygnus DOT com |
From: | Chris Faylor <cgf AT cygnus DOT com> |
Date: | Mon, 22 Mar 1999 21:34:02 -0500 |
To: | Earnie Boyd <earnie_boyd AT yahoo DOT com> |
Cc: | cygwin developers <cygwin-developers AT cygnus DOT com> |
Subject: | Re: proposed patch: fix console attribute glitching |
Message-ID: | <19990322213402.A6576@cygnus.com> |
References: | <19990323022316 DOT 26697 DOT rocketmail AT send102 DOT yahoomail DOT com> |
Mime-Version: | 1.0 |
X-Mailer: | Mutt 0.95.3i |
In-Reply-To: | <19990323022316.26697.rocketmail@send102.yahoomail.com>; from Earnie Boyd on Mon, Mar 22, 1999 at 06:23:16PM -0800 |
On Mon, Mar 22, 1999 at 06:23:16PM -0800, Earnie Boyd wrote: >---Chris Faylor <cgf AT cygnus DOT com> wrote: >--8<-- > >> An output of "\n" cause the cursor to be moved to the beginning of >> the next line. For binary output this is not right. The above code >> moves the cursor to just below its previous position. > >--8<-- > >I beg to differ with you on this. The \n moves the cursor to the next >line, same column. The \r moves the cursor to the beginning of the >line. This is also true in UNIX but the terminal devices handle >adding the \r to the output to move the cursor to the beginning of the >line when receiving the \n. And even this can usually be turned off. What are you disagreeing with? The code? Cygwin sets ENABLE_PROCESSED_OUTPUT when it opens a console device. That means that "\n" goes to the beginning of the next line. The code that was mentioned above fixes that behavior for the case when binmode is set. On UNIX if you have ONLCR set you get similar behavior. >This also happens currently with cygwin. To test this, modify the cat >program to use binary descriptors in all cases. Try the notty option >and have a file with just \n endings and one with \r\n endings. You >should be able to see the same results with the tty setting if you >turn off the addition of the \r in bash. If the cursor moves down a line and stays in the same column then it's working. If it doesn't then it is not working. cgf
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |