* PATCH: prompt_clint and battery level with no battery
@ 2001-06-26 13:47 Clint Adams
2001-06-26 15:28 ` Bart Schaefer
0 siblings, 1 reply; 2+ messages in thread
From: Clint Adams @ 2001-06-26 13:47 UTC (permalink / raw)
To: zsh-workers
On a system with /proc/apm that is not a laptop and thus has
no battery, my prompt has an unfortunate -1% in it.
I also think that the prompt system should behave more
harmoniously with user-defined precmd()s.
Index: Functions/Prompts/prompt_clint_setup
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Prompts/prompt_clint_setup,v
retrieving revision 1.1
diff -u -r1.1 prompt_clint_setup
--- Functions/Prompts/prompt_clint_setup 2001/05/27 05:03:11 1.1
+++ Functions/Prompts/prompt_clint_setup 2001/06/26 13:36:45
@@ -67,7 +67,7 @@
local bat
bat=${${="$(</proc/apm)"}[7]/%/%%}
- [[ $bat == "100%" ]] && psvar[2]=() || psvar[2]=$bat
+ [[ $bat == ("100%"|"-1%") ]] && psvar[3]=() || psvar[2]=$bat
}
prompt_clint_setup "$@"
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: PATCH: prompt_clint and battery level with no battery
2001-06-26 13:47 PATCH: prompt_clint and battery level with no battery Clint Adams
@ 2001-06-26 15:28 ` Bart Schaefer
0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2001-06-26 15:28 UTC (permalink / raw)
To: Clint Adams, zsh-workers
On Jun 26, 9:47am, Clint Adams wrote:
}
} I also think that the prompt system should behave more
} harmoniously with user-defined precmd()s.
Cleaning up the prompt system is on the bug list on sourceforge, but I
guess Adam never got there.
You might look at the way prompt_bart_setup uses string-replacement on
$functions[precmd] to insert and delete its own precmd fragment.
Aside: I still don't understand why $prompt_newline is ever necessary.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-06-26 15:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-26 13:47 PATCH: prompt_clint and battery level with no battery Clint Adams
2001-06-26 15:28 ` Bart Schaefer
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).