From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28203 invoked by alias); 24 Mar 2011 22:09:32 -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: X-Seq: 15890 Received: (qmail 21572 invoked from network); 24 Mar 2011 22:09:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at necoro.eu does not designate permitted sender hosts) Message-ID: <4D8BC113.3070703@necoro.eu> Date: Thu, 24 Mar 2011 23:09:23 +0100 From: =?UTF-8?B?UmVuw6kgJ05lY29ybycgTmV1bWFubg==?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110323 Lightning/1.0b3pre Thunderbird/3.1.9 MIME-Version: 1.0 To: zsh-users@zsh.org Subject: Re: problem with function in prompt References: In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig4232036912CE50ED3AB90E76" --------------enig4232036912CE50ED3AB90E76 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am 24.03.2011 21:23, schrieb Stephen Prater: >=20 > The problem is that it never re-executes the function in the prompt ---= - >=20 > setopt prompt_subst >=20 > PROMPT_INFO=3D"$(draw f21 ul hbar) $(host_name)- %L > $(draw f21 ll hbar) $(dir_name) $(free_mem)" > DEF_PROMPT=3D"${(e)${PROMPT_INFO}} %F{cyan} [ %f" > INS_MODE_PROMPT=3D"${(e)${PROMPT_INFO}} %F{red} [ %f" >=20 >=20 > The value that appears in the prompt is always the same as the one when= > the shell was initially executed. You should use FOO=3D'$bla' instead of FOO=3D"$bla" -- with the latter, $= bla is evaluated while assigning -- with the first one, $bla is evaluated while evaluating $FOO. This means, with your current way, the variables and functions are all computed while setting the prompt variable -- and then there is nothing left to evaluate while printing the prompt :) HTH, - Ren=C3=A9 --------------enig4232036912CE50ED3AB90E76 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk2LwRYACgkQ4UOg/zhYFuCO/wCdHvnmy6pmr8bXJlvt2ibzGsuG 3dsAniSYt322EhqU4t+Z7yZ32lqJ04Ub =VmLr -----END PGP SIGNATURE----- --------------enig4232036912CE50ED3AB90E76--