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,FREEMAIL_FROM,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 20495 invoked from network); 23 May 2022 17:33:05 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 23 May 2022 17:33:05 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1653327185; b=kp12/5der9V39xpCqO7O6DZpC6QYabALeDmFB5YeM/HA4dtMiMHgu5yHDLozsbt5Ey3JZU6vjn WUUSxXB3yfdXDQG/ctrojCOXiDYVnBqlaqN/GtjL0tY6sPUwbvsPXeVXB0C6umNdOlq6LiF+oF zBXq7zJiNu0xurCuwtnUgMkyUljTzesLFfXlKDruZL57TmXgcEylUGwhyzycn/S0lVPBj3ic5t VwaQYStHLjsZ6lv9mSJbE1glxipHtXQfBmpNE86PxGX9OYHSJl37GW91uak/3zvl/Ltv2cVvK+ Iqobqcj6oGrtyLXKyfINseV1XaIz6yujgnRNkLvGuPga2Q==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-pl1-f182.google.com) smtp.remote-ip=209.85.214.182; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1653327185; bh=9vcoYY5Bdcw5l2NGMNphE+YaDwh7CRs9jDYnrwAgOGg=; 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:References: In-Reply-To:MIME-Version:DKIM-Signature:DKIM-Signature; b=U8NrfuU2hnxoXhkqawWouLEVPRDmx8RRtRYShqnIE7tpZhe0FhXsM3KmzZgrdwCvF+rJvyN6A7 yEWZiHMLtdg+P5a+eZwVG54+kVqSGzmQTZXnoKf8d1p+1QRTl43QJqDQsz8Af4xUfDQQKbkX+F s8r3CJJ2X3UVhHqRmLtXGvzOGZ0dKWM45DCo6Qj1ASo7l5yEszFdGn8c3m83UjpL++7RmQXU1W 676Ty5h+VNSlWF3WXmw3wiP+zQ82fyUiC/G2dbLQiMviJySoObl9tmZ3P5zsyiv4672AwugnVI v3iZRpM/X7VMKXslf9CmYHWsW7SaCXloEnkhggLCLuuQ3Q==; 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:References:In-Reply-To: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=r0XHUVVi4N31Xp42IgI0iCHEcm9Xha6hOJV6wmvwuPU=; b=AHAiNgSx+hRIm2Y229tpE91mPv zPoybLWEVlXvWOMs7KC3A7OT/yqrl+YUeEE4khDlBXqV2GbZhnbcw/pOmsBCCqPzYOwbPYOVMzWO/ IWgLZbMt7XCHJTXKLrCXks9pAjI5ATxh3PTng9fdCZWmL0obEvxcKDAYWGB1ME5H9kG4RxIOWwzWv la8iFjIabZw5aC6GiVNu35fx8uMEueLBn5X+ycLu+XMb7GkML6MFvNfUIGaTMUVpnnKBGmp+zLRMT iETmDfX7vR/tF5CP4PrF3bawZcX8ZXFGk+6NWkv8RNOeB7f/pkVhHr4ngo/xHbvxt0uaGVvmiqFZY eUGjQ68Q==; Received: from authenticated user by zero.zsh.org with local id 1ntBvU-000BNH-St; Mon, 23 May 2022 17:33:04 +0000 Authentication-Results: zsh.org; iprev=pass (mail-pl1-f182.google.com) smtp.remote-ip=209.85.214.182; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-pl1-f182.google.com ([209.85.214.182]:46694) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1ntBuT-000Ac2-S3; Mon, 23 May 2022 17:32:03 +0000 Received: by mail-pl1-f182.google.com with SMTP id w3so7099735plp.13 for ; Mon, 23 May 2022 10:32:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=r0XHUVVi4N31Xp42IgI0iCHEcm9Xha6hOJV6wmvwuPU=; b=fA6QtLxtIHnehNMp+X4R9K2VvX22gVAsv0I4RGYsSeoA2C7vrHIT/U1my5lSXcxiaz Xta996g7IfHG2PaVBWAnXvJEiq+MuVTO3DD8rWRTHFiixOhLOFEeelePwWCZxWD015Vy LhNUdBz4iYAv2lPOnqPBBQDuFRwTFh6HcewZPXzIEyBAEu9VI9HGkeDqagw4D295dEZo 2T0Cbxg+mvKxnflqzzOXYFss62CIMoGY35a8CClX2GyVBUWnhxjw/Q+17GTcRot4g6l3 Rr37jG0fk/VPYO0crbQR/gWx/h2mIJVHTHOMHNpPrBlnJwhiiRr0uC8G6rwdmTMc+NJj fixQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=r0XHUVVi4N31Xp42IgI0iCHEcm9Xha6hOJV6wmvwuPU=; b=Cg7bS8TacQ/efk3F++AOw1SOEPVJlEnBOsy3FFMAHa1hL6OVL+JFI3pL+Eny5DAPj0 opuohhNwIquRw/hQOwSUdYUl1LS9iNJ4dDuBtysp2K3Q3olz2ot69lor8Xql0vQ3VEpB FhqshWcMis/gIPTy2HLH45VsUZuA5qmEAdFHD4pD5l0ayx7O+wR6E2FKaCT+zVJUoteA T0vxr49yeDvbxdD0xMhZZPUP6o8l8utilHwsjCfRSu6930NEsHgp04o96vT7lMY+Rcwr mFZj3871TWWcq6eoSURiUV7EmFnJhDMIuKdWyKk/SfI4EVj0ovp26YeTPHVt3iP4UX1/ nUQQ== X-Gm-Message-State: AOAM530IO5U5bMO4MznLfYJSGihzI9WEZULi/xV/C5ReexwzECcNHveh iqt9WtVBex2riGj8nYhnOacxNrkrUiaVdBTFvEzgzyBM X-Google-Smtp-Source: ABdhPJxhDMcxuwlLhT3W+aDBke1H+nS9gAUT5+6/F1gJi0DU/oHcTRbbo0bXyAFOlmDAGxgx1wYiDyg5KaxR2euoWvc= X-Received: by 2002:a17:902:e053:b0:161:ba27:5216 with SMTP id x19-20020a170902e05300b00161ba275216mr24211063plx.79.1653327120501; Mon, 23 May 2022 10:32:00 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6a10:e897:0:0:0:0 with HTTP; Mon, 23 May 2022 10:31:59 -0700 (PDT) In-Reply-To: References: From: Mikael Magnusson Date: Mon, 23 May 2022 19:31:59 +0200 Message-ID: Subject: Re: inconsistency between bash and zsh subshells To: Matt Zagrabelny Cc: zsh-users@zsh.org Content-Type: text/plain; charset="UTF-8" X-Seq: 27794 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: 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, though it's of course hard to say without seeing the particular code. If you instead remove any setopt printsubst it should work fine without modifying the preexec function. (only do one of these changes). Basically what's happening is you're expanding the string to put in the title twice, resulting in things like $() actually being executed which is usually not great. -- Mikael Magnusson