From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9606 invoked by alias); 30 Jun 2017 13:36:13 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41381 Received: (qmail 6798 invoked from network); 30 Jun 2017 13:36:13 -0000 X-Qmail-Scanner-Diagnostics: from mail-wm0-f51.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(74.125.82.51):SA:0(0.5/5.0):. Processed in 2.035141 secs); 30 Jun 2017 13:36:13 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_SPAM, SPF_PASS,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: layus.on@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 74.125.82.51 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=JIj2pFjbCgSIYyTTm+4kKBOqVdgOP1AqaaVFSdwL0qY=; b=XRV5iGMwnZ4a5dsrl3pSL7WcLSyDf8H0RekUcg9S3tTWBL/ra9yp4pGr8kTwTm/e7u KMcP/klJIDKbUJRH17ALw55w6XflLnFFTl16pMooc+qDyvv9NnYJ3TIwZAIyZJVYxnro d69AZgk4L60xaErSYEPh5XGE5c5xR01JZd8vd73JsPWvkarfFCR5PZT6o5jcGbMl8O4p 3tl8sfrnRo36TUopMXtW413zILllyqLr2A6e2uuMOFmMuqKZQkQeGZ+fc9BIPZ8I8gQT janvGy7KjEmDYVWFvf0dtHofAwu5wou1RgCIWa7y0qeVvfR99dFcMQSUl1j8lNoSIMI7 8qjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=JIj2pFjbCgSIYyTTm+4kKBOqVdgOP1AqaaVFSdwL0qY=; b=qQs6Hx3VG0ZzKJpm2xc+DF0UsxQJuhKkD/jzYooTSapBBbZcGY/g+/x8/tTeJE18i2 eG9hJynK8VCbxMUyE8c4TL+8dOAkToQ7OytsRaA2cbkGF145j7fIeuaN+rrsfC1LyIfO St4PJBWjmME3yNDn8PCSHPk5/RZcXCkdmbvTfRJRUErH/zAHySs73s+jIaZtgh9Wjyc+ NT3RKV9vSf4zFsiuBMjRiBUF5nJuxAZPH3iuU7lu6Eksmj9MMyaayQoagwm3MvLZircZ AsJu/8VdJCz+wLdPVs6tDXYmSZ2NBt2tJjqkMVglv6E+Jlm5OQ4d9ScCoa3f9c27GPe5 7sYA== X-Gm-Message-State: AIVw1134IXWaxex5EyIxk5fwLX+gFYgShdFz+Al5j4U4Mh6ad8fUY15J wZj2tDk3N0Fs+PEwCsQ= X-Received: by 10.28.130.196 with SMTP id e187mr6376132wmd.24.1498829764212; Fri, 30 Jun 2017 06:36:04 -0700 (PDT) Subject: Re: Race condition when setting TERM{,INFO{,_DIRS}} To: Mikael Magnusson Cc: Bart Schaefer , zsh workers References: <2ad57c3b-f0c4-afd9-4789-ae50571c63e1@gmail.com> <170627143044.ZM8536@torch.brasslantern.com> <45762363-3882-27b8-8433-63ccfdc0b8be@gmail.com> From: "Guillaume Maudoux (Layus)" Message-ID: Date: Fri, 30 Jun 2017 15:36:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US On 30/06/17 14:34, Mikael Magnusson wrote: > On Fri, Jun 30, 2017 at 1:49 PM, Guillaume Maudoux (Layus) > wrote: >> Thanks Bart, >> >> I have found the origin of this issue. >> There are no threads indeed, but there is caching in ncurses for environment >> variables. >> >> Due to a bug in ncurses' code, it failed to detect that the environment var >> changed, >> and so failed to find the terminfo database. >> >> I will send a patch upstream, with this list in cc. >> >> Zsh could avoid that by initializing the term as late as possible. >> Calling init_term before parsing zshrc, while nothing required to write in >> the terminal is premature. >> Fish for example delays initializing the terminal until the first write. >> Well, this would have avoided my issue, but it is not sufficient in the >> general case anyway. > Plenty of people (including me) write to the terminal from zshrc and > other initialization files. > Well, I should have said that differently: "The reason why the same issue did not appear with other shells is because they postpone term initialization for as long as possible"; therefore not triggering the caching issue when used in our setup. It is indeed not a correct nor desirable fix.