zsh/zpty process makes iTerm2 ask for confimation when closing a tab

Hello! I am using the pure ZSH-Prompt theme which uses the zsh-built-in module zpty to make asynchronous calls to git. zpty:

is useful for running commands non-interactively which expect an interactive environment.

While Apple’s Terminal.app ignores the second zsh process started by zpty when closing the window iTerm2 asks me if I really want to close that tab.

This tab is running the following jobs: cat and zsh.

I think iTerm2 should ignore that process as well.


Detailed steps to reproduce the problem:

  1. Open a new terminal with zsh as default shell in iTerm2 and Terminal.app
  2. Run: zmodload zsh/zpty; zpty -b test cat
  3. Hit CMD+W

What happened: iTerm2 prompts This tab is running the following jobs: cat and zsh. Terminal.app just closes.

What should have happened: iTerm2 should just silently close the window as teh Terminal.app does.

zpty is not running as a child-job to the current shell, it's simply a child process, and maybe this is where iTerm errs from Terminal? At the end of the day zpty is a module of zsh (the current shell) and shouldn't be considered an independent process.