unset local variables that interfere with autonamedirs in oh-my-zsh
1) unset local variable p before use in zsh pwd truncation
2) prefix LP_OLD_PWD with "LP:" to avoid autonaming
_lp_upwards_find was using a single-quoted $@, not double-quoted, so
find was actually looking for files called '$@'.
In addition, once _lp_upwards_find finds the file it's looking for, it
breaks out so it doesn't need to always traverse to root. I doubt
this actually saves much in practice, but it might as well be there.
Mercurial and Bazaar are written in Python, which, on my system,
causes a noticeable hitch in the prompt generation when changing
directories. I have added code that, before invoking the 'hg' or
'bzr' executables, first tests if we could possibly be in a bazaar or
hg repository checkout by traversing the directory structure upwards
to the root, looking for an '.hg' or '.bzr' folder.
At least for me, this makes the prompt instantaneous. There may be
more elegant solutions to this problem, but this one works.
Revert "Added null check for count in _lp_temp_sensors() to stop division by zero errors in case count is still zero."
Closes#214.
Thanks @jaesivsm
This reverts commit 9d96a82c80.
Conflicts:
liquidprompt
FreeBSD: fixed _lp_cpu_load
Darwin: optimized _lp_cpu_load
Note that this change may break syntax coloring in Vim if Vim is not
configured to read the file as 'bash'. Workaround: create a symbolic
link with a '.bash' extension and open that file.
I broke it in cf2ff289c8.
Thanks to François Schmidts who immediately noticed the bug and produced
a patch (but that I choose to not apply).
Closes#201.
If under root user, for VCS directories we do not collect anymore the
VCS status information. Before it was collected (even if
LP_ENABLE_VCS_ROOT=0, which is the default) but just not displayed.
This is a huge optimisation for VCS directories, and also a security
feature, as our shell code is absolutely not resistant to specially
crafted VCS content.
$EUID will not change during the shell life. So we can optimize color
selection at liquidprompt startup instead of testing multiple times
every time the prompt is shown.
Optimizes LP_MARK and LP_PWD.
Given a second parameters, _lp_color_map is now able to display
different colors depending on a scale. The second parameter is the
lowest step on the scale and ten times it the highest.
This commit changes most of the occurrences of
x=$(cmd)
into
x="$(cmd)"
When cmd is returning multiple words or lines Zsh interprets
them as an array. Putting those quotes ensures we get a single
string with spaces inside.
the string substitution assumed "insertions" was always plural, but git
actually takes care of suffixing insertion with an "s" only if there is
more than one insertion
* the average may hide temp that are significantly higher than the other temps
* _lp_temp_sensors will also now use more values to calculate system temperature