zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: "Guillaume Maudoux (Layus)" <layus.on@gmail.com>
Cc: Bart Schaefer <schaefer@brasslantern.com>,
	zsh workers <zsh-workers@zsh.org>
Subject: Re: Race condition when setting TERM{,INFO{,_DIRS}}
Date: Fri, 30 Jun 2017 14:34:46 +0200	[thread overview]
Message-ID: <CAHYJk3Qx=7_-od5ic5UJOEWkHPTXkro8GK+qSGGBW4YoW+Xd9Q@mail.gmail.com> (raw)
In-Reply-To: <45762363-3882-27b8-8433-63ccfdc0b8be@gmail.com>

On Fri, Jun 30, 2017 at 1:49 PM, Guillaume Maudoux (Layus)
<layus.on@gmail.com> 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.

-- 
Mikael Magnusson


  parent reply	other threads:[~2017-06-30 12:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-27 13:52 Guillaume Maudoux (Layus)
2017-06-27 21:30 ` Bart Schaefer
2017-06-30 11:49   ` Guillaume Maudoux (Layus)
2017-06-30 12:05     ` getenv() caching bug Guillaume Maudoux (Layus)
2017-06-30 17:33       ` Thomas Dickey
2017-06-30 12:34     ` Mikael Magnusson [this message]
2017-06-30 13:36       ` Race condition when setting TERM{,INFO{,_DIRS}} Guillaume Maudoux (Layus)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHYJk3Qx=7_-od5ic5UJOEWkHPTXkro8GK+qSGGBW4YoW+Xd9Q@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=layus.on@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).