Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Race condition when setting TERM{,INFO{,_DIRS}}

On 30/06/17 14:34, Mikael Magnusson wrote:
On Fri, Jun 30, 2017 at 1:49 PM, Guillaume Maudoux (Layus)
<layus.on@xxxxxxxxx> wrote:
Thanks Bart,

I have found the origin of this issue.
There are no threads indeed, but there is caching in ncurses for environment

Due to a bug in ncurses' code, it failed to detect that the environment var
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.

Messages sorted by: Reverse Date, Date, Thread, Author