Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Loops and pipes
- X-seq: zsh-workers 55059
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Philippe Altherr <philippe.altherr@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Loops and pipes
- Date: Mon, 3 Aug 2026 15:51:28 -0700
- 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-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=vgFCyP6KuT9xoTSjVI310jJyLNrjuZ4wyYdPlughM+o=; fh=RngAOd9wlRc8Glv1v2GOfDUnq2FsyrczungEY8JNfXY=; b=ESxF29KI+FhUFCiRCVWH6m/zGL0Km3O+Hq7nUn91fcA1MDbRL6GzufBETuKcT6b4/l xkIfVh1DlW/VQnlkUZFF4sqgv1SfM/oWMN2MMpwhAJaEqpsj7F0dNSjQ9As87AZJ6wNL Bsy4XxExmpmy8lvmKWPTF74fjvLMJoX8egizKf+f86vGr7zxrON8y2qfKtfA7f9VRFu7 emfwzShCvpMas5r7tdboXwx0/4UGh7AoRT7QQ6Jw/ESuH+atVmJyHgl9lkyXoi5IrWzh uKZUFZyvSGrCW/rNErwa724ZRgRhV7fb6BnTJgobyjHcmhF2U71Ae047Mx65HXDZ2Fkx 4DKA==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1785797500; cv=none; d=google.com; s=arc-20260327; b=OQu8dYnD1PbBGP8NcqMZYu4MgYlS0RYcSvzsvQOWFeK6RjRNpzvyV2TsxkxtE7+Lwl iGX9AJBkAEB3fo9PM545Zthoq+SOXHgXOtdoCmtxUcF8OyL5QnrODwEDh5w1JZniYbxg GahYT0hVYriJ/0U+2KKYR4nUwNdhFcUsBSPG2ZLOi/Brlb7Mn0PctC7mjvLSUUuW5LeO SodvYWkepQdzZY6hf+sDsIBqZuX/tFAiFH3P/0dOavlOQ1Qyh3VbdcLJBOrer4pos+uz pQYgEXYsdOPDRPCmqMxRceYrmXDK3uf3jEwo0GPqUe0Qcytj+D972pTx5uJ4PvlEMdEK msCw==
- Archived-at: <https://zsh.org/workers/55059>
- In-reply-to: <CAGdYchsAhEE5jRd3o9Kc=KBL4qdCbGs4N3n4bHH1wDnoaQrhEQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7aqY8wsSSczg_79gPzeA2zfQA=hLhKhXXnLLgNKK_0GKQ@mail.gmail.com> <CAH+w=7bj2yiU_o5jv9Q=J5FHxoCX9j3fn5OKTCBQhvk2qsr7pw@mail.gmail.com> <CAGdYchsAhEE5jRd3o9Kc=KBL4qdCbGs4N3n4bHH1wDnoaQrhEQ@mail.gmail.com>
On Mon, Aug 3, 2026 at 3:37 PM Philippe Altherr
<philippe.altherr@xxxxxxxxx> wrote:
>
> I don't think that trying to make "break" and "continue" work in such a context would be a good idea.
>
> ksh works like Zsh ("break" triggers no error and has the same effect as "return") but bash signals an error
Making it an error is quite simple:
diff --git a/Src/exec.c b/Src/exec.c
index 5f849db63..2e6684c96 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1258,6 +1258,7 @@ entersubsh(int flags, struct entersubsh_ret *retp)
clearjobtab(monitor);
get_usage();
forklevel = locallevel;
+ loops = 0;
}
/* execute a string */
Messages sorted by:
Reverse Date,
Date,
Thread,
Author