From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23363 invoked from network); 23 May 2022 17:52:49 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 23 May 2022 17:52:49 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1653328369; b=LXM9jPY90AYugOQ0FJEowMDh57/PmJFFpVaLw6RYmSv39tpB8rb0uyGdfRx1NCFnEan380c1rv iKYWTOfC9nxFXHR/2dW5Nc+HABNWpZyS6w4e8qvj9RMtbM2z7GRUqsUMAeZOyLpBcJ2q82nx5n unDcPRV8VATXRQKD/rrFvgTXvzRk434wplgeOUae6imTgY2HOMQh4RhUudi6jul0LtKa0vgeDO ykh8aUmRksNTFrDvhoOZixn3efCOnOlz5Wkp79UvwqyBzkVGG6zsXDP5K8jl8y6lsPYwtFv++k N3GnIEqzpjc7euK/kzxkqBlisK+yIcaC5YCpK41EnWSzRQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta-p5.oit.umn.edu) smtp.remote-ip=134.84.196.205; dkim=pass header.d=d.umn.edu header.s=google header.a=rsa-sha256; dmarc=pass header.from=d.umn.edu; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1653328369; bh=N9kc+S+BxG+qiKOu3CP2h0EGR9dpZK9M3g1V0djN/og=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=ha2wPRm5u7U2IHBg02WFrYtB37Sh3Lunr8ldq/vR1gBVl+lc4hvJgLDsa1DC8i7d5LjNUYmMCi XHyBMdpoavgYaKunzl/avrvhViWapVPIHhL+tKYLjxX80du+T17/Ur1g9Y+uSNkOufupv8SwnY 777BNGkqYzSq/5oFXnJc3Bj6FDhp5DUk8r5TQo6RNp3ZCHqBYeWw3VukywDlSTqSeD9OkjXrq1 +B0E5xpgWSApetzA9//GlMBPj5AylzxK/Df9d8FnQVuj2XXfzkZUdXwXNzbuizv7y9Iz68PuyW yN5Kk0o7OD/Sa5zinIqH/vuUZIa8JuFYsR1xP0DyofemGw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=K+L8EddAVUy8O4esZl7WI5DrXAUXha1lZkJgEjxyDyQ=; b=lxr7O8DH84csYvbBTY+SDxIBBp u6sfMyqKz6/qcMmdgUMKg/dRya/LhEjYpkx1o6NMNyYrq724eEASfoMXaN/kRpESpOInYwqUMVbEn 878ieJFC87iu0sj+EaG74Un/Mb4tSsX6CQZcbbKtOhHpML3Eo+3rNakzzEPGzn/J5s4lp9A+q3tIR gUYYOaq/tbrEtqvtpkpqA4UwtGIUxcOqUq+28BRTKgwh2SPJB463i0croJPWzzGH9elDAfmhrYFEr j1N8/UzOqSeaI0TQzdcTH1CNsY4HQAkKmBIp+rB1zjEg1FvPqOGewAiIqTMGeFUNMcLKLw9F1DbEw 0yKrZRVw==; Received: from authenticated user by zero.zsh.org with local id 1ntCEb-000CyS-FO; Mon, 23 May 2022 17:52:49 +0000 Authentication-Results: zsh.org; iprev=pass (mta-p5.oit.umn.edu) smtp.remote-ip=134.84.196.205; dkim=pass header.d=d.umn.edu header.s=google header.a=rsa-sha256; dmarc=pass header.from=d.umn.edu; arc=none Received: from mta-p5.oit.umn.edu ([134.84.196.205]:50112) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1ntCDm-000CDz-Sh; Mon, 23 May 2022 17:52:00 +0000 Received: from localhost (unknown [127.0.0.1]) by mta-p5.oit.umn.edu (Postfix) with ESMTP id 4L6PzK2z8xz9vHdf for ; Mon, 23 May 2022 17:51:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at umn.edu Received: from mta-p5.oit.umn.edu ([127.0.0.1]) by localhost (mta-p5.oit.umn.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E7qSNebxO0Kf for ; Mon, 23 May 2022 12:51:57 -0500 (CDT) Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mta-p5.oit.umn.edu (Postfix) with ESMTPS id 4L6PzK0cbZz9vHdY for ; Mon, 23 May 2022 12:51:57 -0500 (CDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mta-p5.oit.umn.edu 4L6PzK0cbZz9vHdY DKIM-Filter: OpenDKIM Filter v2.11.0 mta-p5.oit.umn.edu 4L6PzK0cbZz9vHdY Received: by mail-pl1-f199.google.com with SMTP id i16-20020a170902cf1000b001540b6a09e3so8359815plg.0 for ; Mon, 23 May 2022 10:51:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=d.umn.edu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=K+L8EddAVUy8O4esZl7WI5DrXAUXha1lZkJgEjxyDyQ=; b=GTDmHCid5cTeQwASTXfSX1l+D1H1t2zZyXmvQVkGDq0oqS3XZZQ+e4nA/+MehAyH15 nOVtlDw/UTyKwVWgp+EdpMhRQGEZndikmtVBa189Yfca/OlACp5YV5h6WUV4XL/Kua35 ZH3TQMec05WxXDWKCdx6YCvP5gUmB+T+kwed2xpwm9OA0fnGqOBdnNP/fgA9M+Kj6GVQ QccwKaBD2JdPLUpILDZ+lWO6UCDYVNjd4InmQ4/JPjk1M+ASHt2EY6gEAGvr7PnkP7Wu Y0k0Y6Dbi7/btDdTEMM4Wb5ZdXbKei8YyKk7x1Ck6G9Duv2RjVUdwD+Q2bwGPfzBESut aL4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=K+L8EddAVUy8O4esZl7WI5DrXAUXha1lZkJgEjxyDyQ=; b=1XLV6g6de5WTUT73sN5Qcqk/bXoSP19lJDChjYvIqWuUgFbRL65H470V4WLPZzxukR 7md4TWBQMGDVLCuMo3Iv9EgoA0U+Z6c+j5G/uAxX1uG6aIcUVLTUqtQTjKDGWIfaNrJx Xn5FPH3V3SbPWWD5VB4grQ1m1XDVCS+LM/1L/qjVbxxOBsJu0Z3NpId9kJxeChgFwtJx nOoZJh9N8fqw5ZGi5FKUmyCKkQ0yROXcfzgyprZ0aNlDK330Qx8Fzw70oA60+1LzlkVR Fe1MCNTZgkgGesKcZJeZxIQLxQMPAdivolz5Y2QDWJpInliPPfAWqqz1XPWAkYoF78r3 VM4Q== X-Gm-Message-State: AOAM5311vTJpUhHJYjTawf5sJ9zVWoQTxcEEwpJKzU/zBUChDPljTY/4 UdnSFZnA659ZVzs7gXQ1H7REXJ1eAyyynHlMgdSEcgAHuXUgigXlaRlgUm7B1oT4VXBxWjLDIM1 UzBs9e9XOvoF/SQUZlVPZQUpXaBD0ug== X-Received: by 2002:a17:902:ebd1:b0:162:224f:abbb with SMTP id p17-20020a170902ebd100b00162224fabbbmr6571078plg.160.1653328316388; Mon, 23 May 2022 10:51:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0DTFH3aUpw40dExpR4cwSzz5bEZKeHU0Jb3q7lq9pP5ooBesfC3b21mhBviCeW6x4C4u8H97lZxFdFqVAnnc= X-Received: by 2002:a17:902:ebd1:b0:162:224f:abbb with SMTP id p17-20020a170902ebd100b00162224fabbbmr6571063plg.160.1653328316169; Mon, 23 May 2022 10:51:56 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Matt Zagrabelny Date: Mon, 23 May 2022 12:51:44 -0500 Message-ID: Subject: Re: inconsistency between bash and zsh subshells To: Mikael Magnusson Cc: zsh-users@zsh.org Content-Type: multipart/alternative; boundary="000000000000fb98e905dfb17ed3" X-Seq: 27795 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: --000000000000fb98e905dfb17ed3 Content-Type: text/plain; charset="UTF-8" On Mon, May 23, 2022 at 12:32 PM Mikael Magnusson wrote: > On 5/23/22, Matt Zagrabelny wrote: > > On Mon, May 23, 2022 at 12:01 PM Mikael Magnusson > > wrote: > > > >> On 5/23/22, Matt Zagrabelny wrote: > >> > >> > Why does the subshell in zsh get executed even though the conditional > >> > branch is not? That is, the "touch"-ing of /tmp/FOO. > >> > >> You're most likely using a poorly written prompt theme and/or thing > >> that updates your terminal title. > > > > > > Haha. Probably! > > > > > > > >> Try disabling that code and try > >> again if so. > >> > > > > Yup - that was it. I removed my .zshrc and it works as expected. > > > > Thanks for the hint! Time to figure out what poorly written part of my > > .zshrc is to blame. > > It will probably be something involving print -P and \a or \007 in > something named preexec. If you change $1 in that to \$1 it is more > likely to work, Probably = 100% likely. > though it's of course hard to say without seeing the > particular code. For fun, and full disclosure, here is the code: preexec () { case $TERM in (xterm*|screen*|tmux*|rxvt) print -Pn "\e]0;%(!.-=*[ROOT]*=- | .)%n@%m:%y : $1\a" esac } to which I've changed $1 to \$1 and it fixes the issue. Thanks for the help, Mikael! It is very appreciated! -m --000000000000fb98e905dfb17ed3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, May 23, 2022 at 12:32 PM Mika= el Magnusson <mikachu@gmail.com= > wrote:
On 5= /23/22, Matt Zagrabelny <mzagrabe@d.umn.edu> wrote:
> On Mon, May 23, 2022 at 12:01 PM Mikael Magnusson <mikachu@gmail.com>
> wrote:
>
>> On 5/23/22, Matt Zagrabelny <mzagrabe@d.umn.edu> wrote:
>>
>> > Why does the subshell in zsh get executed even though the con= ditional
>> > branch is not? That is, the "touch"-ing of /tmp/FOO= .
>>
>> You're most likely using a poorly written prompt theme and/or = thing
>> that updates your terminal title.
>
>
> Haha. Probably!
>
>
>
>> Try disabling that code and try
>> again if so.
>>
>
> Yup - that was it. I removed my .zshrc and it works as expected.
>
> Thanks for the hint! Time to figure out what poorly written part of my=
> .zshrc is to blame.

It will probably be something involving print -P and \a or \007 in
something named preexec. If you change $1 in that to \$1 it is more
likely to work,

Probably =3D 100% likely.
=C2=A0
= though it's of course hard to say without seeing the
particular code.

For fun, and full disclosu= re, here is the code:

preexec () {
=C2=A0 =C2= =A0 case $TERM in (xterm*|screen*|tmux*|rxvt)
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 print -Pn "\e]0;%(!.-=3D*[ROOT]*=3D- | .)%n@%m:%y : $1\a"
= =C2=A0 =C2=A0 esac
}

to which I've changed = $1 to \$1 and it fixes the issue.

Thanks for the h= elp, Mikael! It is very appreciated!

-m
<= /div>
--000000000000fb98e905dfb17ed3--