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, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4825 invoked from network); 27 Apr 2021 11:38:50 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 27 Apr 2021 11:38:50 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1619523530; b=kZ2J8WeG7xO19xHEljKKaE5Rt5P3NAlYZopRy71loM8bddg50AVzBG/LVbpyUNqYiuiK8zfXyw nVrVm3aaj1i6sNdpG1ohUgJVtflYNNVeqnrsqTE/2Gxfq79A5Tn62d+lDWZaX6dnsNbtueeCK1 0r3td0f4+PuYQhw8d3qHBK6qixwMWCFL7fXKGStitpG3/VcSvoJtI6dn0gumInOZYF5tjtBSlx +e6Gpzi6VQ7Zg1xuPWyw26T9XqDWY+M6aOrPyMAwqS8Q++tmd4rnfXKifZO2JdUUca9jAxGVa6 g5tyJkTAh3N5qtWwNO8lilgb4YdqX1aWAiuPM0+RUzqCtA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f173.google.com) smtp.remote-ip=209.85.208.173; dkim=pass header.d=gmail.com header.s=20161025 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-20200801; t=1619523530; bh=cDVTDYGaT05EbTvZvM/5ZzYIj6KCkYOdX6DUq0ycY84=; 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=SQQldahUJGQOywWSbwV4ekO5CdoxMfWBVXXf/0nMbNdotZ9a5cdYQEAU8UoYcTG4/+JXVvFYPs o3x7u44ah3O1rj5G4xrsHwSgVCqu7BrpJ1kZBWKAhRwo4wSnrsujVuu+U+Cz4SKAejtTW23rih KtJ4h7uMhDTjSIk8DqfrGFQKdQrpq2DwKjkjwiNjEm3lqdlawb3dwe/FSwuqHRLFIFuxUAhH3F 6egLPrwleWxLfr89t6YpY4ZQyisnWEMkyvdrUxY7NUjLMSpx4Ztih3uEjYEoadT/upCh8L0zd/ d/70B9D08VYTIgg+Lq7o+kA8Ir9acvpD6xPPiG5e/Rp4aw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; 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=JI01GCHvf+6MO72t1UE3m2Uy83qrSRKyeH/JGSOLGuY=; b=fd/xERgkzuvAvq4FkW5SWfE2pf q6RbANdn0N0CG+YwZlxEhB0Pc8lQ5iCXeFx3FSuxXot3MkMogZaJwq2EQ7oa9u+mPOUMQyvtIZqgc 9ApKbcEEB+Tr9coey+r4K2Q/8mLmIeFFqBMZOoyK3LPgi6gcveUgB7maaRxpoDKGQix6fbFRweerN M6Ypq8FV454PF5pp1A+DGWUlY/XrWVUFR9fe5gIHwT03ZzzKgLnorg3UxTg+37NqMtgUreq8rCN8t Qd3s5QsPgFOHhFT615SbbZzUPWiQOlNe/M1Is0XJLNa5nbhXawO5hHvl87EsJmzf2gKoa6NrKTNbv 3clpfewg==; Received: from authenticated user by zero.zsh.org with local id 1lbM3B-000O6p-9v; Tue, 27 Apr 2021 11:38:45 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f173.google.com) smtp.remote-ip=209.85.208.173; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lj1-f173.google.com ([209.85.208.173]:46634) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1lbM2a-000Nra-Kx; Tue, 27 Apr 2021 11:38:09 +0000 Received: by mail-lj1-f173.google.com with SMTP id u20so67798055lja.13 for ; Tue, 27 Apr 2021 04:38:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JI01GCHvf+6MO72t1UE3m2Uy83qrSRKyeH/JGSOLGuY=; b=Nz6s47Qt+1vpNOpRhwtE8DTDPHEV5cs26dhDwolpR/ML7BEjSxhqjSaLH1hjlymJD6 ePWLs+m1LGf2Cy8xFX3KeJoI46L1FgpZF/AWozb/Ykp79jceu2mcMwotod8dDAdll1Bp cPdCi3d0n0GNtl+ZGQtR6w4OwBSi0WxfwG7YaObI7QMnMCg/vuAqRZnEMiuADU5NoPvY PwSHb/Ec5MbLeCXOt5XdoSKRLYD0l5p4NeTQ1HzGLfHEXb1gzBtuYjlsYnzyMn0kzkn9 yI5dEAbksOtf24bdnC+4yWs/etTqLTNSzVyYvhGEmw8RAzqEp160Wsc9XEKAehIPYSlY iMRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JI01GCHvf+6MO72t1UE3m2Uy83qrSRKyeH/JGSOLGuY=; b=LrVMsS59Xm67ZSL3sNhOdMBM91DrHAvUqzkwAyMf2fpV1Zu+brfIwsZ+Y8D+wBnr5i RyEXkCn1vFjo27s31rUCz0Z8oLRquBWbgVjCHe3X5ZMQIfSD/4e/twMN4uqsv+fAhvGk Rw8sQwLojLe+1YsByzXPjMbSVHHsgyx5XKg2X5OGJjkc3Bir4L/DOOQh5kndho7ioLhF XKPEJzuB11VULl0XILCp8JnoCWg7xMs/DkbFc9i5oX0vg6wUZpP3LEd/rzc6Fe5b2vcn cUZ5S9ED+2+klITONO6sZtSuA1i4AUnkAO7eRvOGAj37iCrfA4c8/v/0IsW7lFIj1dJA 3CSw== X-Gm-Message-State: AOAM530Tx5pAl0+85zt4ApqyvVph7HOx+zZBouv2g/i+E9uLFHqvk8j4 XD2hXN2p2Bm42LC8H6uZzSgPQmttHUQw6gxeNjSz0XNrFsnCcg== X-Google-Smtp-Source: ABdhPJzqXWRefDH2NnIbBzPQG+ye2UyjT0GsW9f4UzRPuY9z0i80PlEOx4f+TmVumvWOFPhBPuILR1ugkKMvdRSkBhI= X-Received: by 2002:a2e:8e68:: with SMTP id t8mr16733565ljk.497.1619523487794; Tue, 27 Apr 2021 04:38:07 -0700 (PDT) MIME-Version: 1.0 References: <20210426032200.GA26443@tarpaulin.shahaf.local2> In-Reply-To: From: Marlon Richert Date: Tue, 27 Apr 2021 14:37:30 +0300 Message-ID: Subject: Re: [RFC][PATCH] Add zrestart() To: Daniel Shahaf Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 48727 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Mon, Apr 26, 2021 at 10:29 PM Daniel Shahaf wrote: > > > > + local err="$(zsh --interactive --monitor --zle -c '' 2>&1 > /dev/null)" > > > > > > Also, I think it's quite a stretch to describe this line as "_tests_ > > > whether the shell is able to restart". > > > > Care to comment about the part of my answer before the "Also", which you > had snipped? Sure: On Mon, Apr 26, 2021 at 6:22 AM Daniel Shahaf wrote: > > + local err="$(zsh --interactive --monitor --zle -c '' 2>&1 > /dev/null)" > > This doesn't necessarily restart the _same_ zsh, if there's more than > one installed. I think your observation is correct and I was planning to fix it in the next version of my patch. :) When I don't reply to a point you make, it means that I either agree or think it's not worth arguing about, and I've put it on my TODO list for the next version of my patch. I was trying to be brief and not post a bunch of agrees/will-dos or quote unnecessarily. But if it's prefered that I do respond to every point I agree with and/or quote each part of every email I reply to, just let me know. :) > > I originally had `zsh -fn `, along the lines of what > > was suggested earlier, but that test can fail on a valid dotfile that > > uses dynamically named dirs. > > A minimal example of this would not be out of place. % zsh_directory_name() { [[ $2 == home ]] && reply=($HOME) } % cd ~[home]; print $? 0 % print 'zsh_directory_name() { [[ $2 == home ]] && reply=($HOME) } cd ~[home]' > tmp % zsh -fn tmp tmp:2: no directory expansion: ~[home] % > > Plus, if any dotfile sources other files, > > those files aren't checked this way at all. The approach above is the > > only one I've found so far that appears to be completely reliable in > > determining whether the shell can start up successfully. > > > > > This line executes a whole bunch of code you have no control over. > > > > It is, however, exactly the code we want to test here. > > I'm aware. However, you aren't "testing" it, you are *running* it. > > First, that means the docs are wrong. > > Second, that code might do things that are inappropriate for the use-case > of "testing" the startup code. When you execute `make check`, does it not _run_ the code? How else are you going to test it? :) > Or, in other words: the trick is to throw the bathwater out and > keep the baby. Keeping *both* the baby and the bathwater isn't an > ideal solution. What exactly here is the "bathwater"? Would it help to mock out certain features in the subshell that you wouldn't want to actually run in this test? Would it help to invoke the subshell with -o RESTRICTED?