This is the mail archive of the 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 <> wrote:
> 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.


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.

-                        \\||//
--                     --
-- --

PS: Newbie's, you should visit my page.
Get your free address at