X-Recipient: archive-cygwin@delorie.com
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EEAD3385BF92
Authentication-Results: sourceware.org;
 dmarc=none (p=none dis=none) header.from=towo.net
Authentication-Results: sourceware.org; spf=none smtp.mailfrom=towo@towo.net
Subject: Re: Issue with mintty: title not updated when background process
 exists
To: cygwin@cygwin.com, Takashi Yano <takashi.yano@nifty.ne.jp>
References: <c0d8bcc6-5620-dcf8-d462-02083d85c41d@orange.fr>
 <7ea4c66b-5463-dccb-9a19-acd0ffb546c0@towo.net>
 <0f8c0f14-f978-c487-5702-0fc8a6727ce5@towo.net>
 <5df553fb-45cd-f228-c533-69a5db6e81be@orange.fr>
From: Thomas Wolff <towo@towo.net>
X-Tagtoolbar-Keys: D20200401235404712
Message-ID: <d14774f6-31af-0950-553a-adc25d1347aa@towo.net>
Date: Wed, 1 Apr 2020 23:54:04 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101
 Thunderbird/68.6.0
MIME-Version: 1.0
In-Reply-To: <5df553fb-45cd-f228-c533-69a5db6e81be@orange.fr>
X-Provags-ID: V03:K1:cfeEf9gOg95SmM9orutrDRlnql42Dw6xX5HGDoYeN08HfotXVL2
 1TWCjmoNl0z+kVV95+jss61JXf89B2F/cUkDHRiqLEPN7HEM50SfVjExY95AJ37C+/NTmgq
 BNlO+FFLHdYSyJAoGlXBrC6fRLpTLswpZWNNfZqSssndh8ynfkcNmybis3yuuvcbaOlbwj1
 9iX9/WCh9h18v5vkQP2AA==
X-UI-Out-Filterresults: notjunk:1;V03:K0:CmNP4yUyftU=:IiyV4WP2cOUlgh3dAPkSsM
 1meViFhBntdyAOIz9E6FrDPN6id7h/vCeLkaAzmC04A+Sa93FXrLFjDJr6hY/pBeUWAqxJlDH
 2sLDhOwKKmvqTSbMYLgkuuEYRozOrkooN02e0aQ+0ELs6nrcF9Wyc5BHsYcIGgj3S15Xg1lOH
 4tqFgL0vmzZTKpXD6P5hG9ITv8tJXpJM0HbvOkT/jTczm663N/H9hk4dTiyzChlZMQEBDy+T3
 cZsEq3UjhZ/BzGSNSZIu4JvmnyIb/u2C5vRbMxJ/CpVQ0I9kxb+fjGzbIs8WkwZyvag7hBeR/
 JlYESQH3ooit1K0pxIgbpzhMkPAQn7Jwqui0QaQLOBPJxL3lYnWfyi1lpBA59/wZE76kfXsf7
 5tWsLhFNeCClJm5yMncGMSJtHS1lMZdDMhn9s5Kxg/en56rNCq0mEkuXxFNTuE6BA4G+mS7Xg
 PaiAswpoxn3GA9ZTxVKW8OGLPx+D3uLd5cCLwshEajx1s9csnSZu8H525CDhsu0M2F8eygp19
 RUpns6JPQyco0T+uBbeF9h7B4dibi20oA1zbPJglxDeCAwRF3Vam9FKsLI91IVx9atCS3Sv7E
 vFNWBvkj0zh1/OcyzIMsHMbf7ossxFAeI54jOeTtpsAuKwPW5/Aq110H1ANlAF7K989rYh4ok
 lIL4Y+3ybI6qhJipZ8D+Gs55U9/W7l0DNXJm+WryI6mtOMSi2PstBIFLk+MkROyVZR4gwdD4C
 eNXBh6rEE8PQK56C04JVkMYP6jJAGI0tk+nApHPept8NDiKDeiF1Q613byjPXqD2/ed5kmke0
 uI8H/nzAVekLe0tTrBMbIVBx08WqV2bfQqMjPVJ5YeRtjY821w=
X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
 KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE,
 SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2
X-Spam-Level: *
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <http://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <http://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <http://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Errors-To: cygwin-bounces@cygwin.com
Sender: "Cygwin" <cygwin-bounces@cygwin.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 031Lsfp5005554

Am 01.04.2020 um 22:21 schrieb Luc Henninger:
> Le 01/04/2020 à 14:24, Thomas Wolff a écrit :
>> Am 01.04.2020 um 14:20 schrieb Thomas Wolff:
>>> Am 01.04.2020 um 13:07 schrieb Luc Henninger:
>>>> Hello,
>>>>
>>>> I have defined the PS1 variable as follow
>>>> PS1='\[\e]0;\w\a\]\[\e[32m\]\u@\h \[\e[35m\]\w\[\e[0m\]\n\$ '
>>>> so that the cur dir is set as title of the window.
>>>>
>>>> This generally work for both mintty or cmd.
>>>> But after the sequence
>>>>   Luc@Mulan ~
>>>>   $ emacs &
>>>>   [1] 371
>>>>   Luc@Mulan ~
>>>>   $ cd bin
>>>>   Luc@Mulan ~/bin
>>>>   $
>>>> the title of the mintty widow remain to "~".
>>>>
>>>> The same sequence with cmd window change the title to "~/bin"
>>>>
>>>> The title is correctly updated only after I close emacs and push a 
>>>> return to the main window.
>>>>
>>>> Any explanation? Thanks
>>> Noted first, this is in any case not a mintty issue as mintty 
>>> updates the title whenever it receives the respective escape 
>>> sequence. The scenario sounds weird, however. Is the background 
>>> process continuously sending title escape sequences? But 'emacs &' 
>>> looks like you're starting a GUI instance of emacs, right? So why 
>>> should it?
>> Try to isolate the background instance from the terminal:
>> emacs > /dev/null 2>&1 &
>>
> Even if your proposal solve the issue, I have a question of what's 
> append in the two different cases.
>
> I use the same sequence (1/ cd ztry 2/ launch emacs ("emacs &" or 
> "emacs > /dev/null 2>&1 &" 3/ cd .. 4/ exit emacs 5/ newline 6/ ^D) 
> with mintty configure for logs.
>
> The log for the first case (mintty1459.log) is strongly longer that 
> the second one (mintty1470.log). It look like the wall window content 
> is rewritten each time a line is added.
>
> I would appreciate if someone can give me some explanation. It look 
> like that I have the same kind of behavior with other program (i.e. 
> scala repl or sbt)
It seems to be the magic of the ConPTY handling (either on cygwin side 
or on Windows side) to replay the title escape sequence after the 
program has been sent to the background. Your log does not yet reveal 
the whole story, though:
Is it repeatedly only initially (as seen two lines below "emacs &") or 
more often as might be assumed by your symptom description?
--
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

