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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4704 invoked from network); 28 Nov 2021 21:12:08 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 28 Nov 2021 21:12:08 -0000 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:Message-ID:Date:Content-ID: Content-Type:MIME-Version:Subject:To:References:From:In-reply-to:cc:Reply-To: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=HlWl4ykkcbVMv3c6N3HNokT+Y2wlGjbo5Bu4e3ZhLPk=; b=mBk5NESlmRrUY5jv8H/v/pUDtB 0pLDcAyDc0cDN/vbDr9s9Ep41bkqZ8x7ruEIHl9p7CM/sNRcJFvcpJCPKCPa20oiElxUQhQyIsYpu kh+kAwY/hxl0StjKzwCVClfW06WNtS9SKssYnzmfoCUK2jalLKqH96oGR6PdhONamy3J0wap3tueg 2IOKqT+uAxsfKeMRotGpJt4eBurTC6iILnfQd4iPi88bZpI0OZfqUdzJX+gNMw7n/LMzt9ZoESAVU ldhC4PO7kl2JocaGkEmX/fJhP2Zt+RM4gwhfIQur5ISyxWA+IRtboGJhVRJtRt9BCmzpJpT2FWfzI 0iNvxEXw==; Received: from authenticated user by zero.zsh.org with local id 1mrRSy-000JZq-EP; Sun, 28 Nov 2021 21:12:08 +0000 Received: from authenticated user by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mrRRo-000JEX-3g; Sun, 28 Nov 2021 21:10:56 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.94.2) (envelope-from ) id 1mrRRn-000E86-MN; Sun, 28 Nov 2021 22:10:55 +0100 cc: Zsh hackers list In-reply-to: From: Oliver Kiddle References: To: Roman Perepelitsa Subject: Re: Prompt expansion on signals MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <54316.1638133855.1@hydra> Date: Sun, 28 Nov 2021 22:10:55 +0100 Message-ID: <54317-1638133855.690561@cAWR.fGbz.m1n1> X-Seq: 49613 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: Roman Perepelitsa wrote: > I sometimes change prompt_* options in functions when I want to use `print -P`. > > emulate -L zsh -o prompt_percent no_prompt_subst > print -Pru2 -- '%F{1}error%f: missing required parameter: %F{3}--foo%f' In some cases, you might be better off using the ${(%)var} prompt expansion. That sets prompt_percent and unsets prompt_subst and prompt_bang for the expansion. ${(%%)var} uses current options. > What do you think about not running signal handlers for SIGCHLD and > SIGWINCH while zle widgets are running? Postpone them. This already > sort of happens when a signal arrives during recursive-edit. It isn't necessarily just hooks and signal handlers that are affected. Someone might want to use emulate in a zle widget directly. If this is a plugin, and the author uses default prompt options, it mightn't be clear to them that this could break for other users. There are some cases in completion too where it'd be useful to restore the user's option settings for a particular command. Perhaps we could have an argument to emulate - user or global perhaps - for restoring the original options. Making options sticky when PS1, PS2 etc are set might break someone's setup where they set their prompt before their options. Oliver