public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Takashi Yano <takashi.yano@nifty.ne.jp>
To: cygwin@cygwin.com
Subject: Re: Cygwin-3.1.3: Terminal contents are overwritten by less graphical ones on the start of non-Cygwin programs
Date: Sat, 08 Feb 2020 22:41:00 -0000	[thread overview]
Message-ID: <20200209074105.a75c917c8ea1e85305fc9e50@nifty.ne.jp> (raw)
In-Reply-To: <CAFLRLk9uE=ffMnW6zWpCAGkq4SzhzZpp=h4eiWgeyGaLPsnWOA@mail.gmail.com>

On Sat, 8 Feb 2020 23:29:09 +0800
Koichi Murase wrote:
> > The pseudo console has its own screen buffer behind, and redraws the
> > screen based on the screen buffer at undetermined timing.
> 
> I'm not sure if I correctly understand the situation, but does this
> mean we cannot prevent the pseudo console from redrawing the screen
> (i.e., sending some texts and escape sequences to the terminal
> emulators) based on its background screen buffer?  For that reason do
> we need to keep the terminal contents of both the terminal emulator
> and the background screen consistent with each other?

I think you understand correctly. Due to the reason above, pty
sends data written by slave to both native screen and pseudo
console. However, the interpretation of escapce sequence does
not match perfectly between the real native screen and pseudo
console, therefore, screen is changed when redraw screen is
triggered.

> > > * The problem is not restricted in just clearing graphic styles of
> > >   characters.  For GNU Screen I use Screen-specific terminal sequences
> > > (snip)
> >
> > How can I reproduce this?
> 
> For example, in GNU screen,
> 
>   [user@hostname 0 ~]$ PS1='\[\ek[\u@\h \j \w]$
> $BASH_COMMAND\e\\\][\u@\h \j \W]\$ '
>   [user@hostname 0 ~]$
>   [user@hostname 0 ~]$
>   [user@hostname 0 ~]$
>   [user@hostname 0 ~]$
>   [user@hostname 0 ~]$
>   [user@hostname 0 ~]$
>   [user@hostname 0 ~]$
>   [user@hostname 0 ~]$ ./nocyg
> 
> where ./nocyg is the program in the original mail.  Then it turnes
> into something like:
> 
>   [user@hostname 0 ~]$ PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h
> \[\e[33m\]\w\[\e[[user
>   @hostname 0 ~]$ PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[
>   [user@hostname 0 ~]$ PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[
>   0m\]\n\$ '[user@hostname 0 ~]$
> 
>   [user@hostname 0 ~]$ PS1='\[\ek[\u@\h \j \w]$ $BASH_COMMAND\e\\\][\u@\h \j
>    \W]\$ '[user@hostname 0 ~]$
>   [user@hostname 0 ~]$ PS1='\[\ek[\u@\h \j \w]$ $BASH_COMMAND\e\\\][\u@\h \j
>    \W]\$ '[user@hostname 0 ~]$
>   [user@hostname 0 ~]$ PS1='\[\ek[\u@\h \j \w]$ $BASH_COMMAND\e\\\][\u@\h \j
>    \W]\$ '[user@hostname 0 ~]$
>   [user@hostname 0 ~]$ PS1='\[\ek[\u@\h \j \w]$ $BASH_COMMAND\e\\\][\u@\h \j
>    \W]\$ '[user@hostname 0 ~]$
>   [user@hostname 0 ~]$ PS1='\[\ek[\u@\h \j \w]$ $BASH_COMMAND\e\\\][\u@\h \j
>    \W]\$ '[user@hostname 0 ~]$
>   [user@hostname 0 ~]$ PS1='\[\ek[\u@\h \j \w]$ $BASH_COMMAND\e\\\][\u@\h \j
>    \W]\$ '[user@hostname 0 ~]$ ./nocyg
>   [user@hostname 0 ~]$

Hmmm, this is terrible indeed...
I hope there could be a solution.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

--
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:[~2020-02-08 22:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-08 12:13 Koichi Murase
2020-02-08 14:24 ` Takashi Yano
2020-02-08 15:29   ` Koichi Murase
2020-02-08 22:41     ` Takashi Yano [this message]

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=20200209074105.a75c917c8ea1e85305fc9e50@nifty.ne.jp \
    --to=takashi.yano@nifty.ne.jp \
    --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).