From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13070 invoked by alias); 5 Oct 2011 01:18:50 -0000 Received: (qmail 13062 invoked by uid 22791); 5 Oct 2011 01:18:49 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from sam.nabble.com (HELO sam.nabble.com) (216.139.236.26) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 05 Oct 2011 01:18:35 +0000 Received: from isper.nabble.com ([192.168.236.156]) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1RBG81-0002z0-Ua for cygwin@cygwin.com; Tue, 04 Oct 2011 18:18:33 -0700 Message-ID: <32593677.post@talk.nabble.com> Date: Wed, 05 Oct 2011 01:18:00 -0000 From: "jan.kolar" To: cygwin@cygwin.com Subject: Re: pressing ENTER scrambles scrolled MS-DOS-console In-Reply-To: <20111004123059.GB27229@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit References: <000c01cc7c46$615cd310$24167930$@de> <20111004123059.GB27229@calimero.vinschen.de> X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2011-10/txt/msg00059.txt.bz2 Corinna Vinschen-2 wrote: > > On Sep 26 14:18, Paul Maier wrote: >> Hi, >> >> scrolling up the console output to review the console history, then >> pressing >> Enter scrambles the console. > > That's a long standing behaviour of the Cygwin console emulation. > I guess it can be fixed, but somebody will have to do it. In the > meantime, try mintty as terminal. > > > Corinna > > -- > Corinna Vinschen Please, send mails regarding Cygwin to > Cygwin Project Co-Leader cygwin AT cygwin DOT com > Red Hat > > The problem is as below. However it needs some thinking, checking and testing, since I have no idea what that line was needed for. diff --git i/fhandler_console.cc w/fhandler_console.cc index 74b5cbd..f29426d 100644 --- i/fhandler_console.cc +++ w/fhandler_console.cc @@ -1089,7 +1127,27 @@ fhandler_console::cursor_set (bool rel_to_top, int x, int y) dev_state->fillin_info (get_output_handle ()); if (y > dev_state->info.winBottom) - y = dev_state->info.winBottom; + y = y; + // certainly not if doing CR: y = dev_state->info.winBottom; + // (What purpose did that serve?) + // There is number of places that assume the following be noop with respect to cursor's position: + // cursor_get( &x, &y) + // cursor_set( x, y) + // For any of them the assignment that I removed is unacceptable. + + // Test case 1: while sleep 0.2; do echo -ne "\r$x"; x=x$x; done + // Now it works correctly when the user attempts to scroll the window. + // Test case 2: sleep 2 {scroll up} + // Now it does not scramble the console even if PS1 (effectively) starts with \n as usual. + + + // There is another problem, not fully manifested in this place: + // Nothing should depend on the window how it is currently scrolled by the user. + // If there is any scrolling sub-window, it should be managed without reference to winBottom/Top. + // If we have to place cursor, it should not depend on winBottom/Top. + // For example srTop / srBottom cannot be computed relative to winBottom/Top. + else if (y < 0) y = 0; else if (rel_to_top) JK -- View this message in context: http://old.nabble.com/pressing-ENTER-scrambles-scrolled-MS-DOS-console-tp32539946p32593677.html Sent from the Cygwin list mailing list archive at Nabble.com. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple