From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id d4b86826 for ; Wed, 31 Jul 2019 12:41:29 +0000 (UTC) Received: (qmail 2891 invoked by alias); 31 Jul 2019 12:41:24 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 44622 Received: (qmail 3905 invoked by uid 1010); 31 Jul 2019 12:41:24 -0000 X-Qmail-Scanner-Diagnostics: from mail-io1-f44.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25524. spamassassin: 3.4.2. Clear:RC:0(209.85.166.44):SA:0(-2.0/5.0):. Processed in 2.010718 secs); 31 Jul 2019 12:41:24 -0000 X-Envelope-From: roman.perepelitsa@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.166.44 as permitted sender) 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=cyFPFLDYyT7eDXtY6ZMqEhzJD6Sz2U70qUpIumlVMyY=; b=CiGvBsmO/xB3cJsUN/0GxRgtKnawgn9iekgYUFRspv98otZTtZKULC2mvpkFh/0xkI VUA6t5DFwNDqrN1uTJL0glsUdBHei/hd2fJdJBHgFrxYrPbumk5J0JWD7bAlahjYjBRT s4iuzZuaciNU7E49PYh1UKpx1+yNvcoZr8s2N6/tXylsFcvLHn0J99m9X8rKMk9Q9taZ TVTlRjlhGoak1mjiIvH8zF7gl4DcCLRsS7DO3ouBjyKTdRmwLXMTFzoGiAN8xKwqESqO RL5QiiJqUr2Ugq3uv4qQdK81q7Lqzes0f1bR/h9ar1/xj14Lo7HAZOVBz26rwpFo71iC Rilg== 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=cyFPFLDYyT7eDXtY6ZMqEhzJD6Sz2U70qUpIumlVMyY=; b=c9268/9no/y/vRK3TpAY1Y1F/6Ds5IxHx3xD5cgnXQBrlfTTUq58yZ0KAYGv5EsTCb FGFcxEiHAOyjF6oPwjE0iZ3K9hoNVmTaSNgiSWPdOKDtytv7T3qTukqCWCcp5Tri4Glw PUDkFY3n6a9FY3awiOQYrkPk5ywlNmaRlsZ7dcAGkQQvVgiDGRO2hRUzxcsC6RtHA7z3 8ge/QDRdhzSMmuky+hZMnxZirI4pKPx9s//1KEryEflySpgR3Li2tiaGVmzm1QcIrBfP I8FJpUnkNtkV0cRRA0u/4brzoO9A72wPXGCAD9kshmDPqq/X3sDwJK+z7NTQ3PJR1iLk MBCA== X-Gm-Message-State: APjAAAVLR/xb3iHCpzB/zA/wc+YPXb89Eg2Mv0jd+k/4tpLFrFPbaSzf PjYPKn+/X8eXndRN4xZAp4UxdoLNM7QilD1AIvA= X-Google-Smtp-Source: APXvYqyxADynGoKxxrO3Rl+ysLlqUXLfsX/4TuQiJqo6/dr5LX7VWc0clYSs2hNGtwpXeq3BdERSkrc2YVBEGqU0ZN0= X-Received: by 2002:a6b:b985:: with SMTP id j127mr59038170iof.186.1564576849555; Wed, 31 Jul 2019 05:40:49 -0700 (PDT) MIME-Version: 1.0 References: <49013421-774e-4389-a25d-680f1d97a8ef@www.fastmail.com> In-Reply-To: From: Roman Perepelitsa Date: Wed, 31 Jul 2019 14:40:38 +0200 Message-ID: Subject: =?UTF-8?Q?Re=3A_A_serious_bug_in_execution_=E2=80=93_where_to_debug=3F?= To: Sebastian Gniazdowski Cc: Daniel Shahaf , Zsh hackers list Content-Type: text/plain; charset="UTF-8" On Wed, Jul 31, 2019 at 1:41 PM Sebastian Gniazdowski wrote: > I'm not sure if this will not be "honest specification" (that is) "is > tightly tied to their implementation > details", but somewhat user-observable effects of zplugin unload > procedure "described in theory" are: > > [...] When users are told they can unload plugins without restarting ZSH, they hear the following story. Normally, to disable a plugin you must remove it from your ~/.zshrc and restart ZSH. But if you are using zplugin you can achieve the same result without restarting your ZSH simply by typing a command. This is an easy-to-understand feature. If it could be implemented, it would be mildly useful. Unfortunately, it cannot be implemented even for simple plugins. Suppose I have three plugins specified in ~/.zshrc called foo, bar and baz, and they are loaded in the specified order. I want to unload foo. That is, I want to get the same shell state that I would get if I removed foo from ~/.zshrc and restarted ZSH. While loading, foo defined an alias for grep: alias grep='grep --color=auto'. When foo is unloaded, this alias is unset, and this causes two unexpected consequences. The first is that when I type `grep` in my prompt I get output without colors. The second is that calling a function from bar produces colorful output. Once I restart zsh with just bar and baz in ~/.zshrc, these cases swap: interactive grep is colorful while a function in bar isn't. How is this possible? foo.zsh: alias grep='grep --color=auto' bar.zsh: function bar() { grep hello << I think that it's actually possible to predict to a large extent by > looking at the list of unload-actions. You can predict which aliases will be unset and which widgets removed but you cannot predict how it will affect shell. Things can break a little or a lot. Things may look OK but do damage behind the scenes. Roman.