public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Koichi Murase <myoga.murase@gmail.com>
To: cygwin@cygwin.com
Subject: Cygwin-3.1.3: Terminal contents are overwritten by less graphical ones on the start of non-Cygwin programs
Date: Sat, 08 Feb 2020 12:13:00 -0000	[thread overview]
Message-ID: <CAFLRLk-GK_kCL6Wdf=TSR-fNwsuf3BDv-C465S6RFX0hNRqQFw@mail.gmail.com> (raw)

Hi, this is another report related to the pseudo console.

Description:

  When a non-Cygwin program is started for the first time in that PTY
  in terminal emulators such as Mintty, Xterm, Urxvt and GNU Screen,
  the terminal contents are overwritten by less graphical ones.  I
  guess that the contents of the internal pseudo console (which is
  constructed in the background) is somehow output and overwrites the
  original contents of those functional terminal emulators.

  This is reproduced with the latest snapshot and also with the latest
  commit 3a71c4638.

Repeat-By:

  Open Mintty or Xterm and run the following commands (with Bash):

  $ x86_64-w64-mingw32-gcc -xc - -o nocyg.exe <<< 'main(){}'
  $ printf '\e[%smhello\e[m\n' {0..9}
  $ ./nocyg.exe

  With the first line, the simplest non-Cygwin program is compiled.
  With the second line, "hello" is printed with various graphic
  styles.  However, when one runs a non-Cygwin command in the third
  line, those graphic styles are reset (i.e., overwritten by contents
  of a less functional terminal).

Details:

* If I start Mintty or Xterm with the environment variable
  `CYGWIN=disable_pcon', the problem does not occur.

* Before the commit `e38f2dc9b' (Cygwin: pty: Revise code waiting for
  forwarding again.), this occured every time a non-Cygwin command is
  executed.  But after the commit, this only occurs for the first
  execution of any non-Cygwin program in that PTY session.

* The problem is not restricted in just clearing graphic styles of
  characters.  For GNU Screen I use Screen-specific terminal sequences
  "ESC k ... ST" in my shell prompt to set the title of each window.
  But the overwriting contents seem to be constructed by another
  terminal which does not recognize this terminal sequence.  As a
  results, the layout of terminal contents after the non-Cygwin
  program is completely broken.  The problem should occur with any
  other functionalities which are supported by modern terminal
  emulators but not by pseudo console.

* 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.)


Best regards,

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 12:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-08 12:13 Koichi Murase [this message]
2020-02-08 14:24 ` Takashi Yano
2020-02-08 15:29   ` Koichi Murase
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='CAFLRLk-GK_kCL6Wdf=TSR-fNwsuf3BDv-C465S6RFX0hNRqQFw@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).