Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Race condition when setting TERM{,INFO{,_DIRS}}
- X-seq: zsh-workers 41370
- From: "Guillaume Maudoux (Layus)" <layus.on@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Race condition when setting TERM{,INFO{,_DIRS}}
- Date: Tue, 27 Jun 2017 15:52:30 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=5so5/5TUKFjZ0Ox0km8lC9XPo5mqZ7vqyZ4TgA77W2g=; b=i1uQ7ifdfkaN6rheOKVM4uO8J5kwd06sTbwV7cjyCpL7WpTfHIPYmKtoBmEs4fL3qo 0qNeET7GFp4FQexbJ4nHs5vsidiZqmXR+RZ3sP5gBObctMz9XvdnRhIil7QBYrMpkCqh f4HoYEaliyr60SEvsovR3y0672WdJKpfIJs7NeztHBu4f/wdBbnFtPwnkjVcHoZJEAX4 9GNXEpAxrSq/jcTT2rn/kXneya5FGUvq3z5xbgGRe5wtY2dN3Zd4K3sVo1gNbQJ4gWHT VDxbKBO5X8h5X7xB4f/XBoKWU+EQfCUvro6p/uikIa8oW5Bja4iwij+90deL8AKuz/Uy 0G7w==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Hi,
Half a year after submitting a patch to treat TERMINFO_DIRS like
TERMINFO and TERM, I now see a race condition in handling these vars.
Zsh handles these variables specially because ncurses looks for them in
the environment of the current process.
To make changes to these variables apply to zsh itself, they are
exported to the process environment, where ncurses can find them.
But there is a possible race condition between exporting these vars
(setenv) and refreshing the ncurses handle (getent).
In my case, when TERMINFO_DIRS is set from /etc/zshenv, the new value is
ignored by ncurses.
The same applies to the subsequent TERM=$TERM in /etc/zshenv.
However, if I add a delay before TERM=$TERM, then the TERMINFO_DIRS
update is seen, and the terminal is properly detected.
Could it be that there are threads involved in zsh ?
This seems really weird because the code looks sequential.
Any hint welcome.
-- Layus
Messages sorted by:
Reverse Date,
Date,
Thread,
Author