-
Notifications
You must be signed in to change notification settings - Fork 942
Conversation
The way I was filtering out entries in the frameworks array stopped working in newer versions of ZSH; it would convert the array into a string (you could see it with `typeset -p frameworks`) So I rewrote it. I don't see anything in the release notes for ZSH that would explain this and I didn't find any option that would restore this behavior. Related: Powerlevel9k#882
Marking variables as readonly is helpful for debugging and preventing problems.
Additionally - Add a fourth parameter to prompt_battery for better testability. This parameter is the root prefix, so we can use our own test batteries.
Change regular expressions to a more compatible format.
#937 was applied to context but not to user segments |
@@ -189,7 +189,7 @@ left_prompt_segment() { | |||
# End the left prompt, closes the final segment. | |||
left_prompt_end() { | |||
if [[ -n $CURRENT_BG ]]; then | |||
echo -n "%k%F{$CURRENT_BG}$(print_icon 'LEFT_SEGMENT_SEPARATOR')" | |||
echo -n "%k$(foregroundColor ${CURRENT_BG})$(print_icon 'LEFT_SEGMENT_SEPARATOR')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$CURRENT_BG
will contain a numeric, since getColorCode
was already called in left_prompt_segment
. Do we really have to add another function call to slow the prompt down more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, $CURRENT_BG
is already numeric. I made this change anyway, to match up with the other occurrences of foreground color. To go full nuts I removed the possibility to stop an fore/background color with a call to that method without params.
In an upcoming release we should either go all in with helper methods for getting a prepared string that contains "start a foreground color", or nothing. I am undecided between the two ways. In another programming language I would prefer a helper method that wraps a cryptic DSL to a nice interface, but here I would indeed prefer going for speed and not call a subshell for that. We should think about a concept for that.
`sudo -n true` only checks that we _could_ use `sudo`, not if we are in a sudo session. closes Powerlevel9k#852
Just tested this on my system. Colors seem to be working just fine. However, I did notice something else. Despite setting |
Thx for testing @Slabity . |
Fix broken link referencing zsh date and time configuration in prompt expansion. The current broken link points to `http://zsh.sourceforge.net/Doc/Release Prompt-Expansion.html`, while the correct link is http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Date-and-time
This is a preparation for
v0.6.6
.The following PRs are incorporated in here:
Bugs fixed
sudo
detection #852etc
state for thedir
segment in docs #926What's not included in this PR