Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: make the W02 test not take a full minute on linux
- X-seq: zsh-workers 54757
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: PATCH: make the W02 test not take a full minute on linux
- Date: Thu, 11 Jun 2026 22:24:14 +0200
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=d3/7Ismjj2+nf7uWjgr7xwriv6mHoQc6CXz8kxn1R7k=; fh=QgfxxE0gysBJ7evxa0WZY5Olv+ibLYueRkqhtBdu00I=; b=IKwwJKvrjFOUpRzLEOl1yPEa2Zy32+0e6YDndRCC7eUP+bup/O6Bo8EdU48ruFJipL tnvUUSRgzA8q2paDwT/EFhTKb4ShCaVe30FBfBBA6PhWrZA1gyfSDXw/1GVp24uR/xbw fz8FrKiivVKAvKqn26GcbZYyP3TA+aLmDrx/CO7PIZtq1SKKIpawC+ZAz3mhSNikWcW7 av+cZf+vP+rLihTFyerUkRtGuykq3n7Fqkewh/LN9MiTWxL85M9QlDYInaLyRSqx4BFl E7G20fe+erpPfKlm/VoMl82Ieh0OZxEFdKLbIqyyLFGqB+eAu2IkjPjK//Ve0Iw96Gpo 8iwg==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1781209467; cv=none; d=google.com; s=arc-20240605; b=M6ru6Nb6mHaMnRFND0k4HHZ3rU5k5RO43Ud9XAiddOdPCZ6sublautbmHJKZR2UJMN YkZQngtaTnZjV84HCkaSYZpj1DyD36EjP7WLrQwaR5EuhTvpEMC1XkTgfKdGV7F9VDci dThFIgd+QLJob4RuhrnwtoH9RHfhhixgPNhewvjsmJqWalWHoy5DMkwILOwFrjWLeqhU p9AU5t/a4JDkYo9pocTIPT/EFSODfAebdkkP2uRxSXzy6znbsdBVDFP2HYILI2j36i88 WzKgeiRfGTE32Yh9i0ShBj5wBLQLQs9omZGqFo923LhzOZtEsc6hZ2Fzfhoq5EItbvB/ 98lA==
- Archived-at: <https://zsh.org/workers/54757>
- In-reply-to: <CAH+w=7Z_1ViF6Sz=nr+G4St6SM7nGxWfqvL8k=6Pr_K4euKnkg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <20260611040700.26558-1-mikachu@gmail.com> <CAH+w=7afyu9Og92J6ew77B0ZmuZvZFeBcf_wUBpZ_A-ZuY6H6w@mail.gmail.com> <CAHYJk3SRjzpY-p3V2NWt+vpjJMgv8+aspf8zt8K6nr-0-c+sow@mail.gmail.com> <CAH+w=7Zr+5RsmPrCdJtdwCgJabdAN+WeRcjzbpgOe-C2VnqWtQ@mail.gmail.com> <CAH+w=7Z_1ViF6Sz=nr+G4St6SM7nGxWfqvL8k=6Pr_K4euKnkg@mail.gmail.com>
On Thu, Jun 11, 2026 at 10:00 PM Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Thu, Jun 11, 2026 at 11:05 AM Bart Schaefer
> <schaefer@xxxxxxxxxxxxxxxx> wrote:
> >
> > % { [[ -t 0 ]] & print -u2 terminal } <>/dev/null
>
> Obviously a second & got dropped there somehow, so for completeness:
>
> % { [[ -t 0 ]] && print -u2 terminal } >/dev/null
> terminal
> % { [[ -t 0 ]] && print -u2 terminal } <>/dev/null
> %
<> just means open as read/write, it still only opens fd 0. My earlier
statement was slightly incorrect though because I had assumed it
opened only fd 1 and changed it to just a >, and added the </dev/null.
But in fact what I would have needed is <>/dev/null and >/dev/null. It
is much clearer to just use > 2> and <, since nobody is reading or
writing anyway. We need to close all three fds to have the test go
fast, so we need three redirection operators.
{ [[ -t 1 ]] && print -u2 terminal } <>/dev/null
terminal
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author