public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Koichi Murase <myoga.murase@gmail.com>
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 15:29:00 -0000	[thread overview]
Message-ID: <CAFLRLk9uE=ffMnW6zWpCAGkq4SzhzZpp=h4eiWgeyGaLPsnWOA@mail.gmail.com> (raw)
In-Reply-To: <20200208232500.8d938b55f031316e196a1e84@nifty.ne.jp>

Thank you for your quick response and the explanations and pointers to
related discussions.

2020年2月8日(土) 22:25 Takashi Yano
> From https://www.cygwin.com/ml/cygwin/2019-10/msg00063.html
>
> 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?

> > * 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 ~]$

> > * As well as non-Cygwin programs, also Cygwin programs `ssh', `scp' or
> >   `git push/pull' with SSH connections cause the same results.  I
> >   guess SSH utilities internally use non-Cygwin programs.  (Actually I
> >   originally faced with this problem with these "Cygwin" commands.)
>
> I cannot reproduce this. Cygwin ssh, scp and git does not triggers
> redraw screen in my environment.
>
> Do you surely execute *cygwin* command rather that windows one?

Yes, I'm using those commands from Cygwin (the command "type ssh scp
git" shows /usr/bin/... for all of them).

I'm sorry I found the reason.  I have been specifying a shell script
for the SSH option `ProxyCommand' in my `~/.ssh/config'.  In that
shell script, I was using a Windows system command to retrieve the
current network configuration.


Thank you,

Koichi

--
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 15:29 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 [this message]
2020-02-08 22:41     ` Takashi Yano

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='CAFLRLk9uE=ffMnW6zWpCAGkq4SzhzZpp=h4eiWgeyGaLPsnWOA@mail.gmail.com' \
    --to=myoga.murase@gmail.com \
    --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).