public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "jan.kolar" <kolar@math.cas.cz>
To: cygwin@cygwin.com
Subject: Re: pressing ENTER scrambles scrolled MS-DOS-console
Date: Wed, 05 Oct 2011 01:18:00 -0000	[thread overview]
Message-ID: <32593677.post@talk.nabble.com> (raw)
In-Reply-To: <20111004123059.GB27229@calimero.vinschen.de>



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  <enter>  {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

  reply	other threads:[~2011-10-05  1:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-26 20:22 Paul Maier
2011-10-02 22:53 ` jan.kolar
2011-10-04 12:31 ` Corinna Vinschen
2011-10-05  1:18   ` jan.kolar [this message]
2011-10-05  2:32     ` Christopher Faylor
2011-10-12 14:21       ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=32593677.post@talk.nabble.com \
    --to=kolar@math.cas.cz \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).