zsh-workers
 help / color / mirror / code / Atom feed
* bugs in prompt_zefram_setup and prompt_clint_setup
@ 2006-09-06  0:33 arno.
  2006-09-07 18:10 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: arno. @ 2006-09-06  0:33 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1839 bytes --]

Hello,
I had a bug with zefram and clint prompts themes.
Theses prompts put stuff in psvar. When ksharrays is set, the references 
are wrong. Prompt themes working with psvar should always check that 
ksharrays is not set.
I found another bug in clint in prompt_clint_precmd

  setopt noxtrace localoptions
  local exitstatus=$?

I think exitstatus is supposed to get the exit status of the last 
command. But as setopt is execute just before, exitstatus always 
receives "0". setopt should be after "local exitstatus=$?"

Here is a patch, apply with patch -p 0

>>>>

diff -Nur zsh/Functions/Prompts/prompt_clint_setup zsh~/Functions/Prompts/prompt_clint_setup
--- zsh/Functions/Prompts/prompt_clint_setup	2006-09-06 02:07:42.000000000 +0200
+++ zsh~/Functions/Prompts/prompt_clint_setup	2006-09-06 02:07:59.000000000 +0200
@@ -56,8 +56,8 @@
 }
 
 prompt_clint_precmd () {
-  setopt noxtrace localoptions
   local exitstatus=$?
+  setopt noxtrace noksharrays localoptions
 
   [[ $exitstatus -ge 128 ]] && psvar[1]=" $signals[$exitstatus-127]" ||
 	psvar[1]=""
@@ -67,7 +67,7 @@
 }
 
 prompt_clint_apm_precmd () {
-  setopt noxtrace localoptions
+  setopt noxtrace noksharrays localoptions
   local bat ac
 
   bat=${${="$(</proc/apm)"}[7]/%/%%}
diff -Nur zsh/Functions/Prompts/prompt_zefram_setup zsh~/Functions/Prompts/prompt_zefram_setup
--- zsh/Functions/Prompts/prompt_zefram_setup	1999-11-19 12:48:09.000000000 +0100
+++ zsh~/Functions/Prompts/prompt_zefram_setup	2006-09-06 01:49:29.000000000 +0200
@@ -1,5 +1,6 @@
 function prompt_zefram_precmd {
 	local exitstatus=$?
+    setopt localoptions noxtrace noksharrays
 	psvar=(SIG)
 	[[ $exitstatus -gt 128 ]] && psvar[1]=SIG$signals[$exitstatus-127]
 	[[ $psvar[1] = SIG ]] && psvar[1]=$exitstatus

>>>>

hopes this helps
arno

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: bugs in prompt_zefram_setup and prompt_clint_setup
  2006-09-06  0:33 bugs in prompt_zefram_setup and prompt_clint_setup arno.
@ 2006-09-07 18:10 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2006-09-07 18:10 UTC (permalink / raw)
  To: arno.; +Cc: zsh-workers

On Wed, 6 Sep 2006 02:33:23 +0200
"arno." <arno.@no-log.org> wrote:
> I had a bug with zefram and clint prompts themes.
>...
> Here is a patch, apply with patch -p 0

Applied, thanks.

Note to zsh-workers.... "emulate -L zsh" is a splendid thing to do.  I
don't dare change the prompt functions myself, however.

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-09-07 18:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-06  0:33 bugs in prompt_zefram_setup and prompt_clint_setup arno.
2006-09-07 18:10 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).