public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Repeated input in PTY with SSH when a native process runs a Cygwin process that consumes input
@ 2020-05-30 14:46 Andrew Ng
  2020-05-30 16:06 ` Takashi Yano
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Ng @ 2020-05-30 14:46 UTC (permalink / raw)
  To: cygwin

Hi,

There appears to be an issue with repeated input in PTY (with pcon enabled)
when using SSH. If I run MinGW git from the bash shell via ssh, and git
then executes Cygwin less, e.g. for git log, then any input to less is
repeated as input after git exits. So typically, you will end up with some
number of space characters and 'q' in your terminal.

I have also seen this same behaviour in MSYS2 with pcon enabled.

Both Cygwin and MSYS2 are running 3.1.4.

Thank you,
Andrew Ng

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

* Re: Repeated input in PTY with SSH when a native process runs a Cygwin process that consumes input
  2020-05-30 14:46 Repeated input in PTY with SSH when a native process runs a Cygwin process that consumes input Andrew Ng
@ 2020-05-30 16:06 ` Takashi Yano
  2020-05-31  9:04   ` Takashi Yano
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Yano @ 2020-05-30 16:06 UTC (permalink / raw)
  To: cygwin; +Cc: Andrew Ng

On Sat, 30 May 2020 15:46:39 +0100
Andrew Ng via Cygwin <cygwin@cygwin.com> wrote:
> Hi,
> 
> There appears to be an issue with repeated input in PTY (with pcon enabled)
> when using SSH. If I run MinGW git from the bash shell via ssh, and git
> then executes Cygwin less, e.g. for git log, then any input to less is
> repeated as input after git exits. So typically, you will end up with some
> number of space characters and 'q' in your terminal.
> 
> I have also seen this same behaviour in MSYS2 with pcon enabled.
> 
> Both Cygwin and MSYS2 are running 3.1.4.

Thanks for the report. I looked into this problem and found
the cause. Let me consider how to fix.

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

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

* Re: Repeated input in PTY with SSH when a native process runs a Cygwin process that consumes input
  2020-05-30 16:06 ` Takashi Yano
@ 2020-05-31  9:04   ` Takashi Yano
  2020-05-31 12:00     ` Andrew Ng
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Yano @ 2020-05-31  9:04 UTC (permalink / raw)
  To: cygwin; +Cc: Andrew Ng

Hi Andrew,

On Sun, 31 May 2020 01:06:28 +0900
Takashi Yano via Cygwin <cygwin@cygwin.com> wrote:
> On Sat, 30 May 2020 15:46:39 +0100
> Andrew Ng via Cygwin <cygwin@cygwin.com> wrote:
> > Hi,
> > 
> > There appears to be an issue with repeated input in PTY (with pcon enabled)
> > when using SSH. If I run MinGW git from the bash shell via ssh, and git
> > then executes Cygwin less, e.g. for git log, then any input to less is
> > repeated as input after git exits. So typically, you will end up with some
> > number of space characters and 'q' in your terminal.
> > 
> > I have also seen this same behaviour in MSYS2 with pcon enabled.
> > 
> > Both Cygwin and MSYS2 are running 3.1.4.
> 
> Thanks for the report. I looked into this problem and found
> the cause. Let me consider how to fix.

The developers snapshot, in which the issue has been fixed,
is ready. Could you please test?

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

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

* Re: Repeated input in PTY with SSH when a native process runs a Cygwin process that consumes input
  2020-05-31  9:04   ` Takashi Yano
@ 2020-05-31 12:00     ` Andrew Ng
  2020-06-01 10:47       ` Takashi Yano
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Ng @ 2020-05-31 12:00 UTC (permalink / raw)
  To: Takashi Yano; +Cc: cygwin

Hi Takashi,

> The developers snapshot, in which the issue has been fixed,
> is ready. Could you please test?

Thanks for the fast response.

I have tested the snapshot and can confirm that it fixes the issue. I
have also applied the same fix to MSYS2 and confirmed the issue is
fixed there too.

I did take a look at the code when I came across this issue and I
noticed a few things that looked a bit odd. I noticed that the
following functions appear to make use of rabuf () without
consideration for raixget ():

  fhandler_termios::eat_readahead
  fhandler_pty_master::accept_input
  fhandler_pty_master::transfer_input_to_pcon

Also fhandler_pty_slave::eat_readahead does 'eols' processing without
any guard on is_line_input (), which seems to differ from the code
pattern seen elsewhere.

I don't know if these are important, but thought I should mention
them, just in case.

Thanks,
Andrew

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

* Re: Repeated input in PTY with SSH when a native process runs a Cygwin process that consumes input
  2020-05-31 12:00     ` Andrew Ng
@ 2020-06-01 10:47       ` Takashi Yano
  0 siblings, 0 replies; 5+ messages in thread
From: Takashi Yano @ 2020-06-01 10:47 UTC (permalink / raw)
  To: cygwin; +Cc: Andrew Ng

On Sun, 31 May 2020 13:00:51 +0100
Andrew Ng <anng.sw@gmail.com> wrote:
> > The developers snapshot, in which the issue has been fixed,
> > is ready. Could you please test?
> 
> Thanks for the fast response.
> 
> I have tested the snapshot and can confirm that it fixes the issue. I
> have also applied the same fix to MSYS2 and confirmed the issue is
> fixed there too.

Thanks for testing.

> I did take a look at the code when I came across this issue and I
> noticed a few things that looked a bit odd. I noticed that the
> following functions appear to make use of rabuf () without
> consideration for raixget ():
> 
>   fhandler_termios::eat_readahead
>   fhandler_pty_master::accept_input
>   fhandler_pty_master::transfer_input_to_pcon
> 
> Also fhandler_pty_slave::eat_readahead does 'eols' processing without
> any guard on is_line_input (), which seems to differ from the code
> pattern seen elsewhere.
> 
> I don't know if these are important, but thought I should mention
> them, just in case.

Thank you for your advice. I will check if these can cause any
problem.

As for pty master, get_readahead() is not used at all, so raixget()
is always 0. So pty master code does not cause problem.

However, it is certainly dangerous. I will consider how these
should be.

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

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

end of thread, other threads:[~2020-06-01 10:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-30 14:46 Repeated input in PTY with SSH when a native process runs a Cygwin process that consumes input Andrew Ng
2020-05-30 16:06 ` Takashi Yano
2020-05-31  9:04   ` Takashi Yano
2020-05-31 12:00     ` Andrew Ng
2020-06-01 10:47       ` Takashi Yano

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