DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 56514fh01586818
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 56514fh01586818
Authentication-Results: delorie.com;
	dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=Tsz3Xfe9
X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB9DE385DDC5
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1751677479;
	bh=4aSE5jBPn9HRZPSxv4++QVO/I/3X8M6UcD8Ycr09t0Y=;
	h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:
	 List-Help:List-Subscribe:From:Reply-To:From;
	b=Tsz3Xfe90Qd1CXMmb+YoXthApsGQM0unuKhOnglVJIvInr0SWbICFi4ixPwQeJP4E
	 ztPgYI/clv1lVcYi18Xs67B0GxnwCzn6UeP6sRNEr/VFq1n+tw1Hi+9IIqqQoxi2Hh
	 5Howz7qx6KTsBGBDSa5xVhjcJOt6jwcZg8+H2NZk=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 137B03854AA5
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 137B03854AA5
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1751677444; cv=none;
 b=gL2xAx20qadjbClYDCA7XYpzCO8KMHP+QaXRDIZnL90pSInohpO/DmR4JetTYMqr18R76qq+t/oE8vXx47oPm8+DP8LOvxKSWK8V/x7EtFggF+nxfwIIZThShrAr8vNcLafXT9nGHky6fhXMo63Sq07Pew6yIOtQuaALgW7NlDo=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
 t=1751677444; c=relaxed/simple;
 bh=j0Pspbz8DxMLe3zHIz8zfSithp48c5aC8CxSTyKEvNU=;
 h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject;
 b=wHvuNE6l0OJuCcPgftyng1uOjCd2sfagkLU162MPG+f0RBxhTbKmMPvN/WXRuVqRO4B7l1qfNLI+iyxuK2mZu4UoRR/Wn1xi3m8TuUYEDcirYdwoKekpVtl8kgKLltEkTqn64llWI+2Mg87IZjLO0unirGS/cQ14ZL6wE7ay7KU=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 137B03854AA5
X-Virus-Scanned: by MailRoute
Message-ID: <3ba4421c-2653-48e7-878f-0d91218ab81e@acm.org>
Date: Fri, 4 Jul 2025 18:04:00 -0700
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: cygwin@cygwin.com
Subject: mintty-bash-ssh weirdness after remote disconnect during vi session
Autocrypt: addr=jhg@acm.org; keydata=
 xsDiBDWEWocRBADfF9Q6lhkW9USReZ96cBC93kq3bblkNslVAZzm9itW7sAEzHbydIZ9hZjm
 e93UxUPzg1zGXX9xrdQy0+lHxkj2wvzgEF50Kqjft6KAd8AqiNmcbu5Q+/SHIP87C/tD/wWO
 TX7I99ekggy+5a6illN/s7MhuPIsMtt3ofFFcuOvswCg/08V11KALulG6u9j1affyHy20UMD
 /A1MRT3YZt6NJE9XbcalVLQzWc+ArCkW0oxNs/wrQ26lYoWuj20nusq9MDkuOL1h1FxeUrgx
 kKP+1zyYaQkB2lbJyvGvIpXgxY4vUnOXwMovTcRST3bWOOSIiYVOzKWJh5fPtoEaU5wFZ6yU
 lu/QGoS8Lt9QOI/XjjRaJjf0T6rKBADTn4xcxNIQNWSxJthmH3ipn39+sizwkZHfmAVHUf6w
 f4cDJ8mA3jl0RWKTnxj+5zEY32VduewHtNUtgwugXaIlLM/ErO+tzxQ4R6QysucgxmJBUvw8
 uDgUAKv8HQF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.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Jim Garrison via Cygwin <cygwin@cygwin.com>
Reply-To: Jim Garrison <jhg@acm.org>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie.com@cygwin.com>

I've recently started seeing weirdness in mintty/bash after a connection 
to a remote system is terminated by the remote.  So far this seems to 
happen only if the remote session was interrupted while vi was running.

After the session is interrupted, here's what happens on the local 
(Windows/cygwin) mintty window:

* Ctrl-D just rings the tty "bell"

* Any change of window focus, in Windows, for the mintty window itself,
   causes the tty bell to ring

I researched this by opening a second terminal session and using that to 
kill various processes in the remote tree: ssh-bash-vi and found that 
just killing the vi process causes the issue.  On the remote system, 
Ctrl-D produces the string "0;5u".  Exiting the remote session (via 
'exit') then leaves the local mintty in the same state.

I guess it's because vi remaps keystrokes and they didn't get reset when 
vi died, but my usual goto 'stty sane' does not fix the problem, neither 
on the remote nor local systems.

Is there a way to reset mintty other than closing and reopening it?

-- 
Jim Garrison
jhg@acm.org


-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
