public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* [PATCH] Cygwin: pty: Transfer input for native app only if the stdin is pcon.
@ 2021-03-08 14:55 Takashi Yano
  2021-03-08 15:32 ` Corinna Vinschen
  2021-03-08 15:33 ` Corinna Vinschen
  0 siblings, 2 replies; 7+ messages in thread
From: Takashi Yano @ 2021-03-08 14:55 UTC (permalink / raw)
  To: cygwin-patches

- Currently, transfer input is triggered even if the stdin of native
  app is not a pseudo console. With this patch it is triggered only
  if the stdin is a pseudo console.
---
 winsup/cygwin/fhandler_tty.cc | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 3bfc8c0c8..47d59e8c5 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -3084,14 +3084,16 @@ fhandler_pty_slave::setup_pseudoconsole (bool nopcon)
   if (get_ttyp ()->pcon_pid && get_ttyp ()->pcon_pid != myself->pid
       && !!pinfo (get_ttyp ()->pcon_pid) && get_ttyp ()->pcon_activated)
     {
-      /* Send CSI6n just for requesting transfer input. */
-      DWORD n;
-      WaitForSingleObject (input_mutex, INFINITE);
-      get_ttyp ()->req_xfer_input = true;
-      get_ttyp ()->pcon_start = true;
-      get_ttyp ()->pcon_start_pid = myself->pid;
-      WriteFile (get_output_handle_cyg (), "\033[6n", 4, &n, NULL);
-      ReleaseMutex (input_mutex);
+      if (GetStdHandle (STD_INPUT_HANDLE) == get_handle ())
+	{ /* Send CSI6n just for requesting transfer input. */
+	  DWORD n;
+	  WaitForSingleObject (input_mutex, INFINITE);
+	  get_ttyp ()->req_xfer_input = true;
+	  get_ttyp ()->pcon_start = true;
+	  get_ttyp ()->pcon_start_pid = myself->pid;
+	  WriteFile (get_output_handle_cyg (), "\033[6n", 4, &n, NULL);
+	  ReleaseMutex (input_mutex);
+	}
       /* Attach to the pseudo console which already exits. */
       pinfo p (get_ttyp ()->pcon_pid);
       HANDLE pcon_owner =
-- 
2.30.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Cygwin: pty: Transfer input for native app only if the stdin is pcon.
  2021-03-08 14:55 [PATCH] Cygwin: pty: Transfer input for native app only if the stdin is pcon Takashi Yano
@ 2021-03-08 15:32 ` Corinna Vinschen
  2021-03-08 15:48   ` Takashi Yano
  2021-03-08 15:33 ` Corinna Vinschen
  1 sibling, 1 reply; 7+ messages in thread
From: Corinna Vinschen @ 2021-03-08 15:32 UTC (permalink / raw)
  To: Takashi Yano via Cygwin-patches

Hi Takashi,

On Mar  8 23:55, Takashi Yano via Cygwin-patches wrote:
> - Currently, transfer input is triggered even if the stdin of native
>   app is not a pseudo console. With this patch it is triggered only
>   if the stdin is a pseudo console.

do you have more patches in the loop?  I wonder if I should really start
the test release cycle for 3.2.0 or if I should wait a bit...?


Thanks,
Corinna

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Cygwin: pty: Transfer input for native app only if the stdin is pcon.
  2021-03-08 14:55 [PATCH] Cygwin: pty: Transfer input for native app only if the stdin is pcon Takashi Yano
  2021-03-08 15:32 ` Corinna Vinschen
@ 2021-03-08 15:33 ` Corinna Vinschen
  1 sibling, 0 replies; 7+ messages in thread
From: Corinna Vinschen @ 2021-03-08 15:33 UTC (permalink / raw)
  To: cygwin-patches

On Mar  8 23:55, Takashi Yano via Cygwin-patches wrote:
> - Currently, transfer input is triggered even if the stdin of native
>   app is not a pseudo console. With this patch it is triggered only
>   if the stdin is a pseudo console.
> ---
>  winsup/cygwin/fhandler_tty.cc | 18 ++++++++++--------
>  1 file changed, 10 insertions(+), 8 deletions(-)

Pushed.


Thanks,
Corinna


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Cygwin: pty: Transfer input for native app only if the stdin is pcon.
  2021-03-08 15:32 ` Corinna Vinschen
@ 2021-03-08 15:48   ` Takashi Yano
  2021-03-08 20:52     ` Corinna Vinschen
  0 siblings, 1 reply; 7+ messages in thread
From: Takashi Yano @ 2021-03-08 15:48 UTC (permalink / raw)
  To: cygwin-patches

On Mon, 8 Mar 2021 16:32:16 +0100
Corinna Vinschen wrote:
> Hi Takashi,
> 
> On Mar  8 23:55, Takashi Yano via Cygwin-patches wrote:
> > - Currently, transfer input is triggered even if the stdin of native
> >   app is not a pseudo console. With this patch it is triggered only
> >   if the stdin is a pseudo console.
> 
> do you have more patches in the loop?  I wonder if I should really start
> the test release cycle for 3.2.0 or if I should wait a bit...?

I'm sorry to submit patches one after another. However,
I think this should be the last one. Please go ahead.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Cygwin: pty: Transfer input for native app only if the stdin is pcon.
  2021-03-08 15:48   ` Takashi Yano
@ 2021-03-08 20:52     ` Corinna Vinschen
  2021-03-09  3:22       ` Takashi Yano
  0 siblings, 1 reply; 7+ messages in thread
From: Corinna Vinschen @ 2021-03-08 20:52 UTC (permalink / raw)
  To: cygwin-patches

On Mar  9 00:48, Takashi Yano via Cygwin-patches wrote:
> On Mon, 8 Mar 2021 16:32:16 +0100
> Corinna Vinschen wrote:
> > Hi Takashi,
> > 
> > On Mar  8 23:55, Takashi Yano via Cygwin-patches wrote:
> > > - Currently, transfer input is triggered even if the stdin of native
> > >   app is not a pseudo console. With this patch it is triggered only
> > >   if the stdin is a pseudo console.
> > 
> > do you have more patches in the loop?  I wonder if I should really start
> > the test release cycle for 3.2.0 or if I should wait a bit...?
> 
> I'm sorry to submit patches one after another. However,
> I think this should be the last one. Please go ahead.

Great, thanks!


Corinna

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Cygwin: pty: Transfer input for native app only if the stdin is pcon.
  2021-03-08 20:52     ` Corinna Vinschen
@ 2021-03-09  3:22       ` Takashi Yano
  2021-03-09  9:23         ` Corinna Vinschen
  0 siblings, 1 reply; 7+ messages in thread
From: Takashi Yano @ 2021-03-09  3:22 UTC (permalink / raw)
  To: cygwin-patches

On Mon, 8 Mar 2021 21:52:37 +0100
Corinna Vinschen wrote:
> On Mar  9 00:48, Takashi Yano via Cygwin-patches wrote:
> > On Mon, 8 Mar 2021 16:32:16 +0100
> > Corinna Vinschen wrote:
> > > Hi Takashi,
> > > 
> > > On Mar  8 23:55, Takashi Yano via Cygwin-patches wrote:
> > > > - Currently, transfer input is triggered even if the stdin of native
> > > >   app is not a pseudo console. With this patch it is triggered only
> > > >   if the stdin is a pseudo console.
> > > 
> > > do you have more patches in the loop?  I wonder if I should really start
> > > the test release cycle for 3.2.0 or if I should wait a bit...?
> > 
> > I'm sorry to submit patches one after another. However,
> > I think this should be the last one. Please go ahead.
> 
> Great, thanks!

I am very sorry but I would like to submit just one more patch.
I apologize to overturn the previous statement...

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Cygwin: pty: Transfer input for native app only if the stdin is pcon.
  2021-03-09  3:22       ` Takashi Yano
@ 2021-03-09  9:23         ` Corinna Vinschen
  0 siblings, 0 replies; 7+ messages in thread
From: Corinna Vinschen @ 2021-03-09  9:23 UTC (permalink / raw)
  To: cygwin-patches

On Mar  9 12:22, Takashi Yano via Cygwin-patches wrote:
> On Mon, 8 Mar 2021 21:52:37 +0100
> Corinna Vinschen wrote:
> > On Mar  9 00:48, Takashi Yano via Cygwin-patches wrote:
> > > On Mon, 8 Mar 2021 16:32:16 +0100
> > > Corinna Vinschen wrote:
> > > > Hi Takashi,
> > > > 
> > > > On Mar  8 23:55, Takashi Yano via Cygwin-patches wrote:
> > > > > - Currently, transfer input is triggered even if the stdin of native
> > > > >   app is not a pseudo console. With this patch it is triggered only
> > > > >   if the stdin is a pseudo console.
> > > > 
> > > > do you have more patches in the loop?  I wonder if I should really start
> > > > the test release cycle for 3.2.0 or if I should wait a bit...?
> > > 
> > > I'm sorry to submit patches one after another. However,
> > > I think this should be the last one. Please go ahead.
> > 
> > Great, thanks!
> 
> I am very sorry but I would like to submit just one more patch.
> I apologize to overturn the previous statement...

No worries :)


Corinna

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-09  9:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-08 14:55 [PATCH] Cygwin: pty: Transfer input for native app only if the stdin is pcon Takashi Yano
2021-03-08 15:32 ` Corinna Vinschen
2021-03-08 15:48   ` Takashi Yano
2021-03-08 20:52     ` Corinna Vinschen
2021-03-09  3:22       ` Takashi Yano
2021-03-09  9:23         ` Corinna Vinschen
2021-03-08 15:33 ` Corinna Vinschen

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