Currently you can't make a conditional custom segment. This changes the
prompt_custom function responsible for printing custom segments so that
it won't print the segment in case the content is empty.
With this it becomes possible to make conditional custom prompts simply
by making it not print anything when it's not supposed to be shown.
`git rev-parse --git-dir` returns just `.` when in the top level of
a`.git` directory. This would cause a problem when extracting the
package_path. Closes#271
This ensures that the following package.json extract would just give the
prompt "foo" rather than "foo\nbar".
{
"name": "foo",
"author":
{
"name": "bar",
}
}
This commit provides a new segment `pyenv` to show current python environment.
This prompt can be used in place of `virtualenv` segment. However, it is
targeted at users of [pyenv](https://github.com/yyuu/pyenv) and not meant to
replace the `virtualenv` segment.
The prompt works by parsing output of `pyenv version` and displaying the first
word of the output as segment text. The design (color etc.) is same as the
`virtualenv` segment including the icon. The segment would need to be
revisited if `pyenv version` changes its output format.
Tested on my personal machines (Mac OSX 10.11.4 and Ubuntu 15.04).
Currently you can't make a conditional custom segment. This changes the
prompt_custom function responsible for printing custom segments so that
it won't print the segment in case the content is empty.
With this it becomes possible to make conditional custom prompts simply
by making it not print anything when it's not supposed to be shown.
Now it is possible to set the installation path by setting
POWERLEVEL9K_INSTALLATION_PATH. If set, this path will always be used.
If it was not set manually, we try to determine the path automatically.
The segment relies on a lookaround to determine the currently
active conda environment.
If available ack is preferred, otherwise grep will be used.
Recent versions of grep offer `-P` to support perl-regex.
Older ones (e.g. those shipped on OSX) will fail.
This commit changes nvm prompt setup to return immediately if no node
version is installed/available.
Currently, prompt complains for lack of global node version.
Specifically, if you install nvm (from brew or manually) and do not have
global node installed (or set), then the prompt should not set or show
anything. This commit ensures this by immediately returning if
`nvm current` returns "none".
Prior to this, the rbenv prompt only showed something if the
$RBENV_VERSION environment variable was set. This was not a complete
solution because rbenv can be configured locally, per directory, with
dotfiles. When using dotfiles, the $RBENV_VERSION variables is not set.
This fixes the issue by taking the output of the `rbenv version-name`
command which shows the real rbenv version being used based on any of
the 4 ways to change rbenv as shown here:
https://github.com/rbenv/rbenv#choosing-the-ruby-version
If the current version of Ruby being used is the same as the global
Ruby, nothing is shown.
This commit also adds documentation to the README that describes the
prompt.
Fixes issue #215
Big thanks to @dritter for guidance, @rjorgenson for great explanation.
And @bhilburn for further guidance and encouragement.
See http://i.imgur.com/2Vncypo.png for a presentation of how it looks.
icon as content print these icons as visual identifiers. Some of these
segments have a verbose mode. If this verbose mode is false, some print
just the icon (like the battery segment), which didn't work correctly
before this change.
with the previous one. Just add "_joined" to the segment name in
your `POWERLEVEL9K_LEFT_PROMPT_ELEMENTS`-array.
Developers: Be aware that the order of parameters given to
left/right_prompt_segment has changed!