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 5357 invoked from network); 27 Apr 2021 11:43:39 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 27 Apr 2021 11:43:39 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1619523819; b=075QHZzJHzj1GULFFHhwJDSfzT4ecCc798LSS7A5PKlwYt7TclN3PRap2IFjecKcYOzlBEKQoF n1evWat/HlVpyAwokPIVDvcjjKnAVskfRK98rPXGDZMvgQ/0bAYDFNPJn7A01NqBcVYH692Dsy MzeI2p2qL/fdZ59gapooFSTA9KnoMJo4cw9Y+7wchiFTygkV3GkfwnxGhZdhwyuQwhRWPIKNSm U/rwWGQUneN/H/RLOB5EUPDMJmcoXO04ygJLtO47JrMvLMYodeH6ZKwj37zrmAob9TCW4tySf9 XTf1KjzIaz1xF1mOPihG9bQlB8/4N+/M8IusaobDosAppg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lf1-f50.google.com) smtp.remote-ip=209.85.167.50; 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=1619523819; bh=+wr4tu+HMJsCNUgFwxHgNwsNZRJj2JvaIoqmgyNwecE=; 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=lsIzocC7eYNA9vrJydVqagy2mhdYHw52L7gHTi+sMDfzSGOSpiyfae7w5WpPrNn7YpxM0zaWS9 RPNCVhY/GjVW0b4+/O652Qv8ZtPxyLaCfd0hoPQYjOC+5PP3bVIwbJr2Aqotn7vViGEk7popSd UDc44vnSvVEwNBvlOCTAm4TaElLW8wLdxIfGzQBICIg3WkK6MB4ImSXDUJpIKH3Xu2gyzcHxlH OK1lXdxMvse6SlR52GZ3HgYt3IxNWVw6CAJ3HrPvKRLX3UoiL33H9zNwtU6Zc6n0R1LAypKCzT iERcj5PCOBYuVYabgUQsJC3hih/KA8sPgbiRLSq6VRHzpw==; 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=ZW5fpPF21P0ELkYBuZddjSJU3MGj+M/cdiTbGd26W0o=; b=Lqta38KnE98QVcG/nbOtCogvu1 SijL3srmZobyn+Afe1mcSJ0lF2nQJL3NyoSUZBezVTT7b3zczGHa24Tm6nBwu0XiJsjX241TZuz4d iUhfBkO8a2NKUr4a+yDWtLm5ISyCpAF42NNMWszaGYE1tD6xwVOhdhCaCzBpVpdScFK0mcZNQDlAu H9gI7qZBxe4tU4Two9jU+DjXdUjwwD+peC54ofX7F8cyE98eIGHJH/GoJi6wquuNggogelt/RhMII Sppzh1e0At5td5G3Z2XAHL2ZPQrCFefFizDSi63GSztCqC1QF8s8+anMxlIydsfQBCxAzS/a/18SL sD+P28nA==; Received: from authenticated user by zero.zsh.org with local id 1lbM7v-000Og9-By; Tue, 27 Apr 2021 11:43:39 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lf1-f50.google.com) smtp.remote-ip=209.85.167.50; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lf1-f50.google.com ([209.85.167.50]:44920) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1lbM7g-000OPD-LP; Tue, 27 Apr 2021 11:43:25 +0000 Received: by mail-lf1-f50.google.com with SMTP id 4so33327757lfp.11 for ; Tue, 27 Apr 2021 04:43:24 -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=ZW5fpPF21P0ELkYBuZddjSJU3MGj+M/cdiTbGd26W0o=; b=SPYbL67rEFqduRaKayJrapQvlhSDhtsLtqJ+F5SV/hMaF4EWPkG12rMkHHa8z3xdUR rg/3+51Q6aal9jWecHjcHJAHHFSrDch+DFMAJ1CxLTSPyqAOEtgj3tRPPRFwCFN+J5/2 zwMSLy9xk/fkO8JZ8aIfuF0+hCiIOReuq265H5laCLN20NP1v0ygdJssshQwXdiaHWaX X4kjJoqi7yQsBZUwJwZeTI4niDaec8lhV+jH6pusyzNwNu9ZV2b78iFOEClKD9s7TyqO TRpY7xYOaEJq3JZ+u//cXFZG06oAdwMv9HHUsHVh+0kzRVh9ryONZcsAPcXtLTEflxYc FWBQ== 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=ZW5fpPF21P0ELkYBuZddjSJU3MGj+M/cdiTbGd26W0o=; b=VMjrbglyCExWARQw2i7X7Y4BSh79XjtObXDyYqCLEwYpJMo9ONZReynI9wcLyfKIGF 1TaV1pwl4SFKirG6Uei0mLLVXa60RKLSdU+89SKgZpXcJez47CDVwko+Xiy+oFm7uVvf EPgsjkEkOQz6WD5ZMqVlF37so+9WBcy2rbCkBvOdl97OETjTfVWT4UsQxT5eQcdjJ/VD CkNVtm180orVKzo4L3uGd38sycXgQNyHcpTWh7nQ7/PpN6X8FimmLBVueP6LfMYIXqmO FFTJZdXOGGE7i0z6vi3aG6w3NeuBmYvpyVgjD2PkWMwgNg3+9+3uwwAKjog2VRNzLkLu PPxA== X-Gm-Message-State: AOAM5329wTNBoiolaCFfJHZyQXhLyXtaJM+COrczbwiDLOoFBq5CiBdl 3a+YfY+I/cnZVSL5epr8CsVftv8fiYAm59zjm9RiqFm1XjU= X-Google-Smtp-Source: ABdhPJz6Y2OSC82YhD/QgumySxexozgkvGmrgX46tcuZGnYnH7MDESiiVAXdV3Afnc6PpAw/nrAIcLTQ6aomd8GvGJ0= X-Received: by 2002:a05:6512:79:: with SMTP id i25mr16287056lfo.463.1619523803976; Tue, 27 Apr 2021 04:43:23 -0700 (PDT) MIME-Version: 1.0 References: <20210426032200.GA26443@tarpaulin.shahaf.local2> In-Reply-To: From: Marlon Richert Date: Tue, 27 Apr 2021 14:42:47 +0300 Message-ID: Subject: Re: [RFC][PATCH] Add zrestart() To: Bart Schaefer Cc: Daniel Shahaf , Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 48728 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 Tue, Apr 27, 2021 at 2:55 AM Bart Schaefer wrote: > > On Mon, Apr 26, 2021 at 12:30 PM Daniel Shahaf wrote: > > > > > What kind of approach would be acceptable? > > > > I think you've basically run into the halting problem here > > Consequently we need to decide collectively whether we're just > rejecting "zrestart" as impossible, or if there's a sub-optimal > solution we can agree on. I suspect that executing the entire startup > twice in order to be sure it'll work once, is not one we'll agree on. > > Not really a solution, but an interesting (?) observation: > > If you start an interactive shell in the background, it will stop when > it tries to print the first prompt: > > % echo $$ > 277859 > % Src/zsh -f & > [1] 277861 > % > [1] + suspended (tty output) Src/zsh -f > > You can then do: > > % exec fg > [1] + continued Src/zsh -f > % echo $$ > 277861 > % > > Now you're at the prompt for the previously backgrounded shell. If > you exit from that, the parent is gone. > > So if you had some way to detect that a backgrounded shell had > actually reached the PS1 prompt, you could cause the parent shell to > replace itself. Failing that, perhaps a better option would just be to add a note in the newuser .zshrc to use `zsh` or `zsh && exit` to apply changes? Or perhaps zrestart could be just this: zrestart() { exec zsh } At least then the user has no risk of mistyping the argument to exec. By the way: What kind of error in the dotfiles would cause the shell not to be able to start?