This is the mail archive of the cygwin-developers@sourceware.cygnus.com mailing list for the Cygwin project. See the Cygwin home page for more information.
[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: proposed patch: fix console attribute glitching



---Chris Faylor <cgf@cygnus.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.

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.

==
-                        \\||//
-------------------o0O0--Earnie--0O0o-------------------
--                earnie_boyd@yahoo.com               --
-- http://www.freeyellow.com/members5/gw32/index.html --
----------------------ooo0O--O0ooo----------------------

PS: Newbie's, you should visit my page.
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com