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=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 747 invoked from network); 19 Jun 2020 06:59:01 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 19 Jun 2020 06:59:01 -0000 Received: (qmail 377 invoked by alias); 19 Jun 2020 06:58:53 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: Sender: zsh-users@zsh.org X-Seq: 24935 Received: (qmail 3054 invoked by uid 1010); 19 Jun 2020 06:58:53 -0000 X-Qmail-Scanner-Diagnostics: from wout5-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.3/25842. spamassassin: 3.4.4. Clear:RC:0(64.147.123.21):SA:0(-2.7/5.0):. Processed in 0.688862 secs); 19 Jun 2020 06:58:53 -0000 X-Envelope-From: vq@larryv.me X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at spf.messagingengine.com designates 64.147.123.21 as permitted sender) X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudejhedgudduhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurheptggguffhjgffgffkfhfvofesth ejmhdthhdtvdenucfhrhhomhepnfgrfihrvghntggvpgggvghljoiiqhhuvgiiuceovhhq sehlrghrrhihvhdrmhgvqeenucggtffrrghtthgvrhhnpedukedtveehvdevveehteekhe eileegfeegheegjeeugfdutdffvddugeelieeijeenucfkphepudejvddrheekrddvfedt rdduvdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epvhhqsehlrghrrhihvhdrmhgv X-ME-Proxy: Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Subject: Re: Dynamic parameters for PROMPT_SUBST functions From: =?utf-8?Q?Lawrence_Vel=C3=A1zquez?= In-Reply-To: <20200619063233.zybs27xvqp56t4p5@singold> Date: Fri, 19 Jun 2020 02:58:18 -0400 Cc: zsh-users@zsh.org Content-Transfer-Encoding: 7bit Message-Id: References: <20200619063233.zybs27xvqp56t4p5@singold> To: Sebastian Stark X-Mailer: Apple Mail (2.3445.104.14) Hi Sebastian, > On Jun 19, 2020, at 2:32 AM, Sebastian Stark > wrote: > > I am trying to have a function call in my prompt that gets the > return value of the last command as a parameter (%?). > > However I am having trouble to get this right. Instead of an actual > number, what is handed to the function is the literal string %?. Yes, that is because the PROMPT_SUBST expansions (parameter, command, and arithmetic) are done before the percent-escape sequences are expanded. vq