Subject: exec redirect prevents trap
From: [email-masked]
To: [email-masked]
Date: Sat, 16 Apr 2016 00:59:41 -0700
List-Id: Zsh Workers List <zsh-workers.zsh.org>

Dear Zsh Workers,

I have a script like this:

    #!/bin/zsh
    exec > >(tee -a /tmp/foo)
    trap "echo hi" INT TERM EXIT
    sleep 1d;

When I run it and hit ^C, it doesn't print anything. But when I remove
the "exec" line and do the same, it prints "hi". I would have expected
it to print "hi" both times.

- is this a bug?

- is there a way to get the trap to execute, even with the exec line
  present?

Thank you,

Frederick Eaton