public inbox for cygwin-developers@cygwin.com
 help / color / mirror / Atom feed
From: Thomas Wolff <towo@towo.net>
To: cygwin-developers@cygwin.com
Subject: Re: [PATCH v2 0/1] Pseudo console support in PTY (v2)
Date: Thu, 04 Apr 2019 08:17:00 -0000	[thread overview]
Message-ID: <c4fbe623-74fd-1aae-7609-c8f380d237cd@towo.net> (raw)
In-Reply-To: <20190404142723.ef8c4bfb329671b60a9a2739@nifty.ne.jp>

Hi
> Without patched cygwin-console-helper.exe, mintty will not start.
I was meanwhile able to build the patch (v1) on a Windows 7 system and 
try it on a Windows 10 system.

Takashi Yano wrote:
> Hi Corinna,
>
> On Wed, 3 Apr 2019 18:50:29 +0200 Corinna Vinschen wrote:
>> I will, but can you please outline the changes between v1 and v2 of your
>> patch?  I'd like to understand the code and what the challenges are to
>> get this working.
> Major changes are as follows.
>
> (1) Pseudo console setup code in pty master is moved into the function
>      setup_pseudoconsole().
In my test, character attributes (colour) were sometimes only reproduced 
when running the test program for the first time. Maybe v2 fixes that.
> (2) The code for pushing slave output into pseudo console screen buffer,
>      which is for synchronization between real terminal and pseudo console
>      screen buffer, is moved into the function push_to_pcon_screenbuffer().
> (3) In push_to_pcon_screenbuffer(), add code which attach to pseudo
>      console temporally if slave is not attached yet.
> (4) Call fhandler_console::need_invisible() in stdio_init() in dtable.cc
>      instead of just returning from function when progname is "mintty".
What's the specific handling for mintty? Puzzled, I think all pty-based 
terminals need the same handling.
> (5) Pushing slave output into pseudo console screen buffer is disabled
>      when alternate screen buffer is used.
Confused. What does console handling have to do with the alternate 
screen? It's purely a client-side concept with respect to the pty. If 
the terminal is in alternate screen mode, console output is directed to 
that screen buffer and should be handled the same way, right?
> (6) Change code page to 65001 (UTF-8) at startup of pty slave.
What about other codepages, depending on the locale?
> (7) Remove "\033[6n" and "\033[0c", which generate report result in
>      console input buffer, in the data to be pushed into pseudo console
>      screen buffer.
Why's that? If a Windows console app really sends those, it will do so 
on purpose (e.g. because it detects the %TERM% variable to conclude it's 
running in a terminal), so it will also expect the respective response.

I wasn't able to test raw keyboard input and terminal resize so far 
(looking for a suitable test app, some command-line Windows editor 
perhaps...)

There is one other interoperabililty problem I'm concerned about but it 
may not be related and perhaps not fixable via ConPTY:  If I start a 
Windows GUI program, e.g. notepad, and enter ^Z in the terminal, notepad 
is terminated rather than suspended. Maybe Cygwin should just ignore 
suspend signals towards Windows programs.

Kind regards
Thomas

> (8) Add some comments.
>
> (1) and (2) are not essential changes.
>
> (3) fixes the issue:
> On Thu,  4 Apr 2019 01:36:20 +0900 Takashi Yano wrote:
>> On Sat, 30 Mar 2019 22:08:04 +0900 Takashi Yano wrote:
>>> Known problems:
>>> * mintty fails to start if it is started in console cygwin
>>>    session.
>> This has been resolved in the new version.
> (3) also makes it unnecessary the code returning from function
> stdio_init() in dtable.cc when progname is "mintty".
>
> (4) is for:
> On Tue, 2 Apr 2019 13:02:48 +0200 Corinna Vinschen wrote:
>> I found another weird effect which I can't explain off the top
>> of my head:  system_printf() debug output does not show up
>> in a mintty anymore with this patch.  Any idea why?
> howver, I am not sure why this solves the issue.
>
> (5) makes vim screen drawing speed up a little.
> (6) avoids garbled characters.
> (7) avoids the garbage in the input buffer for native console apps
> after vim is used.
>

  reply	other threads:[~2019-04-04  8:17 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-30 13:08 Pseudo console support in PTY Takashi Yano
2019-03-30 19:47 ` Corinna Vinschen
2019-03-30 19:59   ` Corinna Vinschen
2019-03-30 23:07 ` Thomas Wolff
2019-03-31 14:38   ` Corinna Vinschen
2019-03-31 15:00   ` Takashi Yano
2019-04-02 11:02 ` Corinna Vinschen
2019-04-02 17:16   ` Thomas Wolff
2019-04-02 17:51     ` Corinna Vinschen
2019-04-03  7:18       ` Thomas Wolff
2019-04-03  7:28         ` Corinna Vinschen
2019-04-03  7:55           ` Thomas Wolff
2019-04-03  8:02             ` Corinna Vinschen
2019-04-03 11:33               ` Thomas Wolff
2019-04-03 12:17                 ` Corinna Vinschen
2019-04-04  4:17                   ` Takashi Yano
2019-04-04  8:06                     ` Corinna Vinschen
2019-04-04  4:15             ` Takashi Yano
2019-04-03 16:36   ` [PATCH v2 0/1] Pseudo console support in PTY (v2) Takashi Yano
2019-04-03 16:37     ` [PATCH v2 1/1] Cygwin: pty: add pseudo console support Takashi Yano
2019-04-03 16:50     ` [PATCH v2 0/1] Pseudo console support in PTY (v2) Corinna Vinschen
2019-04-04  5:27       ` Takashi Yano
2019-04-04  8:17         ` Thomas Wolff [this message]
2019-04-04  9:34           ` Takashi Yano
2019-04-03 17:11     ` Corinna Vinschen
2019-04-04  8:59       ` Takashi Yano
2019-04-04 10:46         ` Corinna Vinschen
2019-04-06 11:13           ` [PATCH v3 0/1] Pseudo console support in PTY (v3) Takashi Yano
2019-04-06 11:14             ` [PATCH v3 1/1] Cygwin: pty: add pseudo console support Takashi Yano
2019-04-06 17:43             ` [PATCH v3 0/1] Pseudo console support in PTY (v3) Corinna Vinschen
2019-04-12 10:22               ` [PATCH v4 0/1] Pseudo console support in PTY (v4) Takashi Yano
2019-04-12 10:23                 ` [PATCH v4 1/1] Cygwin: pty: add pseudo console support Takashi Yano
2019-04-12 12:29                 ` [PATCH v4 0/1] Pseudo console support in PTY (v4) Corinna Vinschen
2019-04-15  8:18                   ` Corinna Vinschen
2019-04-15 23:17                     ` Takashi Yano
2019-04-14 15:23                 ` [PATCH v5 0/1] Pseudo console support in PTY (v5) Takashi Yano
2019-04-14 15:23                   ` [PATCH v5 1/1] Cygwin: pty: add pseudo console support Takashi Yano
2019-04-15  8:38                     ` Corinna Vinschen
2019-04-16  0:41                       ` Takashi Yano
2019-04-16  9:16                         ` Corinna Vinschen
2019-06-24 10:53                           ` Corinna Vinschen
2019-07-25 14:31                             ` Corinna Vinschen
2019-08-08 19:24                               ` Corinna Vinschen
2019-08-12 12:07                             ` Takashi Yano
2019-08-12 12:50                               ` Corinna Vinschen
2019-08-12 14:36                                 ` Takashi Yano
2019-04-14 16:06                   ` [PATCH v5 0/1] Pseudo console support in PTY (v5) Takashi Yano
2019-04-16  1:49                     ` Takashi Yano
2019-04-16  1:51                       ` Takashi Yano
2019-04-06 21:33             ` [PATCH v3 0/1] Pseudo console support in PTY (v3) Thomas Wolff
2019-04-07  5:05               ` Takashi Yano
2019-04-07 12:02                 ` Takashi Yano
2019-04-07 21:21                 ` Thomas Wolff

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=c4fbe623-74fd-1aae-7609-c8f380d237cd@towo.net \
    --to=towo@towo.net \
    --cc=cygwin-developers@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).