Imported Upstream version 1.10

parent 8389869b
......@@ -6,6 +6,7 @@ Alex Prengere <alexprengere@gmail.com> Alex <alexprengere@gmail.com>
Aurélien Requiem <aurelien@requiem.fr> <aurelien.requiem@loadedtech.com.au>
Aurélien Requiem <aurelien@requiem.fr>
Clément Mathieu <clement@unportant.info>
Christophe Drevet (dr4Ke) <dr4ke@dr4ke.net> <christophe.drevet@cea.fr>
François Schmidts (jaesivsm) <francois.schmidts@gmail.com>
François Schmidts (jaesivsm) <francois.schmidts@gmail.com> <fschmidts@olfeo.com>
François Schmidts (jaesivsm) <francois.schmidts@gmail.com> <jaesivsm>
......@@ -22,10 +23,11 @@ Ludovic Rousseau <ludovic.rousseau@gmail.com> <lroussea@370bh2j.(none)>
Matthew Micene (nzwulfin) <nzwulfin@gmail.com>
Nicolas Lacourte <nicolas@dotinfra.fr>
Olivier Dupuis <oj.dupuis@gmail.com>
Ying Li (cyli) <cyli@twistedmatrix.com>
Poil <poil@quake.fr> M.Poil <?@?>
Poil <poil@quake.fr> Poil <?@?>
Thomas Debesse <thomas.debesse@gmail.com>
Rolf Morel (polyphemus) <rolfmorel@gmail.com>
Wilson Maravilha (algaerhythm) <algaerhythm@gmail.com>
Yannack <yannack@gmail.com>
Brad Beyenhof <bbeyenhof@gmail.com> <bbeyenhof@icloud.com>
1.10 2016-05-30
Breaking changes:
- In themes, LP_COLORMAP_x variables are replaced by a single
LP_COLORMAP array variable. A warning will be displayed at startup
if your config still uses the old variables, but a compatibility
shim is active (will be removed in next release).
- Many LP_ENABLE_* settings are now static (their effect applies when
liquidprompt is loaded, and changing them at the prompt does nothing)
to more and more improve speed.
- zsh: option 'nopromptsubst' is enabled for security reasons.
This will unfortunately also affect evaluations of other prompt
contexts such as RPS1.
- Variables LP_SCREEN_TITLE_OPEN and LP_SCREEN_TITLE_CLOSE are now
removed to simplify the code (GitHub #371)
New features:
- Sudo:
* The color of the prompt mark is now dynamic and changes to
LP_COLOR_MARK_SUDO (default: bold red) as long as your sudo
credentials are cached (GitHub #335).
Requires sudo 1.7.0+.
This feature must be enabled with LP_ENABLE_SUDO=1
Use 'sudo -K' to revoke your credentials early.
* This feature is disabled by default as there is no way to
detect if the user has sudo rights without triggering a security
alert that will annoy the sysadmin.
- Git:
* Show the number of commits behind the remote (GitHub #269)
* Show the rebasing/merging/cherry-picking state (GitHub #409)
- Add variable LP_TTYN: the basename of the terminal (GitHub #357)
- Add setting LP_ENABLE_FQDN to show the fully qualified domain name
of the host (GitHub #254, #277)
- LP_HOSTNAME_ALWAYS=-1 to always hide the hostname (GitHub #406)
- Run duration of the last command (LP_ENABLE_RUNTIME) is now also
supported on zsh (GitHub #404, #355)
- Python: add support for Conda (CONDA_DEFAULT_ENV) (GitHub #425)
Bug fixes:
- Use $XDG_CONFIG_HOME to locate the config (GitHub #415, #420, #425)
- Improved zsh integration (but most issues had no impact of the
user experience)
- Fix escaping of special chars from $PWD (well, almost, see GitHub
#389) and explicitely set the shell options we need (instead of
relying on the shell default settings)
- Git:
* Fix typo in git work directory detection
- Fossil:
* Fix on darwin (GitHub #390)
- LP_DISABLED_VCS_PATH is fixed on zsh (GitHub #423)
- Battery indicator:
* MacOS: many fixes to handle (all?) edge cases (GitHub #326)
We now have a pmset simulator to better detect regressions.
- Temperature indicator:
* The code using the 'sensors' command now uses the '-u' option
("raw output") that is easier to parse. This format is at least
7 years old. (GitHub #379, #380)
* We now try each backend (acpi/sensors) once to check it works
at startup and disable the feature if none works.
(GitHub #410, #319, #381, #387)
- CPU load indicator:
* Fix the scale that was incorrectly 0-200 (GitHub #391)
- Title:
* Fix terminal sequences that were sent in the title text (the
escaping algorithm is rewritten and now just correct).
- Terminal channel:
* Fix detection of tmux (GitHub #304, #377)
* Fix detection of local session on OS X (GitHub #407)
- Misc:
* Fix bash 3 compatibility (GitHub #313)
* Clear GREP_OPTIONS and skip 'grep' aliases (GitHub #372)
- Shortened path:
* Fix bugs when $PWD contains spaces or special chars (GitHub #369)
* Optimize implementation in case of LP_PATH_KEEP=-1 : LP_PWD
becomes static (related to GitHub #256, #336)
* Optimize implementation in case LP_ENABLE_SHORTEN_PATH=0
* Optimize implementation in case LP_ENABLE_SHORTEN_PATH=0 on bash
with PROMPT_DIRTRIM
- Sample configuration files:
* example.bashrc: major fixes
- The last statement of liquidprompt did not return 0 (GitHub #360,#361)
- Analog clock:
* complete rewrite for speed and correctness (GitHub #365 and other
issues)
- Documentation:
* Many small fixes
- Move dist/ to contrib/dist/ as files there are unmaintained
- Fix title escapes in zsh inside tmux/screen (GitHub #370, #371)
Thanks to Matt Fletcher (@MaffooBristol), Kevin Yap (@iKevinY), Sean
Hussey (@seanhussey), François Schmidts (@jaesisvsm), Morgan Knicely
(@morganizeit), Daniel Serodio (@dserodio), Jonathan Giddy
(@jongiddy), Jeremy Clement (@jeremyclement), Panayiotis Kkolos
(@pkkolos), Arturo Borrero Gonzalez (@aborrero), Samuel Krieg
(@SamK), Brian May (@brianmay), Colin Lieberman (@colinlieberman),
@hegedus, Anthony Gelibert (@anthonygelibert), Anthony Ramine (@nox),
Erik M Jacobs (@thoraxe), Pedro Parracho (@berserck), Brad Beyenhof
(@augmentedfourth), Austen Adler (@stonewareslord), Hagen Graf
(@hcgraf), William P. Riley-Land (@wprl), Dave Rigby (@daverigby),
Ned Batchelder (@nedbat), Fabien Marty (@thefab), Alessio Garzi
(@Ozzyboshi), Roger Huang (@rhuang2014), Sebastian Bremicker
(@sebrem), Alex Prengere (@alexprengere), Philipp Grogg (@grog-gg),
Tener Hades (@tenerhades), Thomas Kühnel (@kuehnelth), Étienne Deparis
(@milouse), @Hotschke, Software Mechanic (@softwaremechanic), Simon
McVittie (@smcv)...
... for their patches or bug reports.
1.9 2014-11-?? dolmen (Olivier Mengué)
1.9 2014-11-12 dolmen (Olivier Mengué)
Bug fixes:
- Battery indicator:
* General fixes (Github #264)
* MacOS: fix for computers without battery (like iMacs) (Github
* General fixes (GitHub #264)
* MacOS: fix for computers without battery (like iMacs) (GitHub
#319)
* Optimize colormap
- Temperature indicator:
* Linux: Add a guard against any future l10n of the 'acpi' command
* Linux: Fix for negative temperature values (Github #308)
* Linux: Fix for negative temperature values (GitHub #308)
- CPU load:
* Darwin/BSD: quoting fixes
- Hostname:
......@@ -17,44 +120,44 @@
* Simplify chroot detection
- VCS:
- Git:
* Use --porcelain for "git status" (Github #270)
* Minir optimization (Github #266)
* Use --porcelain for "git status" (GitHub #270)
* Minir optimization (GitHub #266)
- Fossil:
* Cleanup and fixes (Github #274 and others)
* Cleanup and fixes (GitHub #274 and others)
- Subversion:
* Fix branch/tag name extraction (Github #117, #237, #293)
* Fix branch/tag name extraction (GitHub #117, #237, #293)
- Bazar:
* Fix branch name extraction
* zsh fixes (Github #303)
* zsh fixes (GitHub #303)
- Mercurial:
* General cleanup for speed and fixes
* Disabled "hg outgoing" because it is slow (Github #217)
* Disabled "hg outgoing" because it is slow (GitHub #217)
- Shortened path:
* Bash: Fix quoting for PROMPT_DIRTRIM
- Prompt mark:
* Simplify implementation of LP_MARK_DEFAULT
- Jobs:
* Refactoring
* Fix when screen/tmux are not installed (Github #304)
* Fix when screen/tmux are not installed (GitHub #304)
- Analog clock:
* Fix hour for 12AM and 12PM (Github #273)
* Fix hour for 12AM and 12PM (GitHub #273)
- Misc:
* bash: save and set 'promptvars'
* bash: workaround broken pattern substitution in bash 4.2 (Github
* bash: workaround broken pattern substitution in bash 4.2 (GitHub
#289, #294, #302)
* zsh: fix restoration of the original (pre-liquidprompt) prompt
* Fix tmux detection (Github #279)
* Save IFS (Github #267)
* Fix $TERM check (Github #291)
* Fix tmux detection (GitHub #279)
* Save IFS (GitHub #267)
* Fix $TERM check (GitHub #291)
* Various quoting fixes
* Apply some shellcheck.com suggestions
* Many, many optimizations (Github #267)
* Many, many optimizations (GitHub #267)
New features:
- Add vcsh support (Github #148, #287)
- Add support for Software Collections (Github #299, #300)
- Add vcsh support (GitHub #148, #287)
- Add support for Software Collections (GitHub #299, #300)
Thanks to Anthony Gelibert, Frédéric Mahé, Panayiotis Kkolos, Étienne
Deparis, Frençois Schmidts, Linus Wallgren, Alexander Belaev, Bartosz
Deparis, François Schmidts, Linus Wallgren, Alexander Belaev, Bartosz
Janda, Brett McBride, Chase Colman, Cosmin L. Neagu, Matthew Micene,
Vincent Lara, Wilson Maravilha and Yannack for their patches. Thanks
to all the other contributors who reported issues or proposed patches
......
......@@ -6,21 +6,11 @@ Contributing a patch
The public stable branch for end users is `master`.
The main branch for development is `develop`. This is on top of this branch
that you must write your patches.
Any pull request built on top of `master` instead of `develop`
is additional merge work for maintainers, and you want to avoid this if you
aim for quick integration of your work.
If you wrote your patch on the wrong branch the maintainers may choose to close
the pull request and ask you to rewrite it on top of the current `develop`.
How to do the right thing?
--------------------------
$ git clone -b develop -o upstream git://github.com/nojhan/liquidprompt.git
$ git clone -o upstream git://github.com/nojhan/liquidprompt.git
$ cd liquidprompt
# Run liquidprompt and check that your issue is still on that branch
......@@ -34,29 +24,31 @@ How to do the right thing?
# Hack, commit, hack, commit...
# Fork the project on Github (if you haven t yet)
# Fork the project on GitHub (if you haven't yet)
# Add the remote target for pushes
$ git remote add github git@github.com:$GITHUB_USER/liquidprompt.git
# Check that your local repo is up to date
$ git fetch
# Rebase your work on the latest state of `develop`
$ git rebase upstream/develop
# Rebase your work on the latest state of `master`
$ git rebase upstream/master
# Push
# Push your commits
$ git push github fix/my-fix
$ git push github fix/my-feature
$ git push github feature/my-feature
# Create the pull request on Github. Check that Github choose the `develop`
# Create the pull request on GitHub. Check that Github chose the `master`
# branch as the starting point for your branch.
How to make a good pull request?
--------------------------------
1. Check that your git settings for authorship are right:
$ git config -l | grep ^user\.
1. Check that your Git authorship settings are correct:
$ git config -l | grep ^user\.
2. All the commits in the pull request must be on the same topic. If instead
you propose fixes on different topics, use separate branches in your repo
and make a pull request for each.
......@@ -65,16 +57,16 @@ How to make a good pull request?
- second line must be empty
- following lines (72 chars max) are optional and take this space freely
to express what that changes does.
Use references to Github issues number (ex: `#432`) if applicable
4. Use a good title for your pull request
Use references to GitHub issues number (ex: `#432`) if applicable
4. Use a good title for your pull request.
5. Put details, web links, in the pull request body. Use Markdown fully to
format the content (see
[Markdown syntax](http://daringfireball.net/projects/markdown/syntax)).
For example use triple backquotes for code blocks.
Never, ever, merge the branches `develop` or `master` of the main repo into one
of your own branches. Instead, always rebase your own work on top the `develop`
Never, ever, merge the branches `master` of the main repo into one
of your own branches. Instead, always rebase your own work on top the `master`
branch.
How my patch will be applied?
......@@ -86,7 +78,7 @@ pull requests.
If your patch is accepted it will be applied either:
- by "merging" your branch
- by cherry-picking your commit on top of the `develop` branch. This makes the
- by cherry-picking your commit on top of the `master` branch. This makes the
history linear, and so easier to track.
In any case, your authorship will be preserved in the commit.
......@@ -99,8 +91,8 @@ between pings: 1 week, 2 weeks, then every month.
If a stable version is released while your pull request has still not been
merged on any working branch of the main repo, it would be helpful to ease
the maitainer's work by rebasing your branch on top of the latest `develop`
and push it again to your Github repo. Be careful (for example create a
the maitainer's work by rebasing your branch on top of the latest `master`
and push it again to your GitHub repo. Be careful (for example create a
branch or a tag before your rebase) because your may lose all your work in
that process.
......
This diff is collapsed.
liquidprompt/contrib Policy
---------------------------
This directory contains files that have been contributed by contributors
but that the core liquidprompt maintainers don't take care.
So they are probably outdated, maybe of poor quality (because the maintainers
do not have the knowledge to properly review them).
So use them at your own risks, and don't fill issues about them, just send
patches.
# if you want to use the liquidprompt without bothering about its configuration,
# just:
# If you want to use Liquid Prompt without bothering about its configuration,
# just run the following command:
# cp example.bashrc ~/.bashrc
# This part is a minimalist bash config file example
# The following is a minimalistic Bash config file
# Use the system config if any
# Use the system config if it exists
if [ -f /etc/bashrc ]; then
. /etc/bashrc # --> Read /etc/bashrc, if present.
. /etc/bashrc # --> Read /etc/bashrc, if present.
elif [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc # --> Read /etc/bash.bashrc, if present.
fi
# Use bash completion, if installed
# The following lines are only for interactive shells
[[ $- = *i* ]] || return
# Use Bash completion, if installed
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
# If you have your own config for the liquid prompt, edit and uncomment this line:
# source /path/to/liquidpromptrc
# Use the liquidprompt
source ~/.liquidprompt
# Use Liquid Prompt
source ~/liquidprompt/liquidprompt
......@@ -17,6 +17,7 @@
# LP_ERR last error code
# LP_MARK prompt mark
# LP_TIME current time
# LP_TTYN number of current terminal (useful in title for quick switching)
# LP_RUNTIME runtime of last command
# LP_MARK_PREFIX user-defined prompt mark prefix (helpful if you want 2-line prompts)
# LP_PS1_PREFIX user-defined general-purpose prefix (default set a generic prompt as the window title)
......
......@@ -6,7 +6,7 @@
# Special characters
# Be sure to use characters that exists in the font you use. You can use several
# characters at once.
# Below is an example of how to fallback to ascii if the term is not unicode capable.
# Below is an example of how to fallback to ASCII if the term is not Unicode-capable.
# Defaults to UTF-8 characters.
if [[ "$(locale -k LC_CTYPE | sed -n 's/^charmap="\(.*\)"/\1/p')" == *"UTF-8"* ]]; then
# If charset is UTF-8.
......@@ -73,6 +73,7 @@ LP_COLOR_ERR="$PURPLE"
# Prompt mark
LP_COLOR_MARK="$BOLD" # as user
LP_COLOR_MARK_ROOT="$BOLD_RED" # as root
LP_COLOR_MARK_SUDO="$BOLD_RED" # when sudo credentials are cached
# Current user
LP_COLOR_USER_LOGGED="" # user who logged in
......@@ -92,10 +93,11 @@ LP_COLOR_WRITE="$GREEN" # have write permission
LP_COLOR_NOWRITE="$RED" # do not have write permission
# VCS
LP_COLOR_UP="$GREEN" # repository is up to date / a push have been made
LP_COLOR_COMMITS="$YELLOW" # some commits have not been pushed
LP_COLOR_CHANGES="$RED" # there is some changes to commit
LP_COLOR_DIFF="$PURPLE" # number of lines impacted by current changes
LP_COLOR_UP="$GREEN" # repository is up to date / a push have been made
LP_COLOR_COMMITS="$YELLOW" # some commits have not been pushed
LP_COLOR_COMMITS_BEHIND="$BOLD_RED" # some commits have not been pushed
LP_COLOR_CHANGES="$RED" # there is some changes to commit
LP_COLOR_DIFF="$PURPLE" # number of lines impacted by current changes
# Battery
LP_COLOR_CHARGING_ABOVE="$GREEN" # charging and above threshold
......@@ -115,17 +117,19 @@ LP_COLOR_VIRTUALENV="$CYAN"
# Runtime
LP_COLOR_RUNTIME="$YELLOW"
# Color maps (battery and load levels)
# Color map (for battery and load levels, and temperature)
# Range from 0 (nothing special) to 9 (alert)
LP_COLORMAP_0=""
LP_COLORMAP_1="$GREEN"
LP_COLORMAP_2="$BOLD_GREEN"
LP_COLORMAP_3="$YELLOW"
LP_COLORMAP_4="$BOLD_YELLOW"
LP_COLORMAP_5="$RED"
LP_COLORMAP_6="$BOLD_RED"
LP_COLORMAP_7="$WARN_RED"
LP_COLORMAP_8="$CRIT_RED"
LP_COLORMAP_9="$DANGER_RED"
LP_COLORMAP=(
""
"$GREEN"
"$BOLD_GREEN"
"$YELLOW"
"$BOLD_YELLOW"
"$RED"
"$BOLD_RED"
"$WARN_RED"
"$CRIT_RED"
"$DANGER_RED"
)
# vim: set et sts=4 sw=4 tw=120 ft=sh:
This diff is collapsed.
......@@ -6,7 +6,7 @@
# If you want to use different themes and features,
# you can load the corresponding files here:
#source ~/.config/liquidprompt/nojhan.theme
#LP_PS1_FILE="~/.config/liquidprompt/nojhan.ps1"
#LP_PS1_FILE=~/.config/liquidprompt/nojhan.ps1
#############
# BEHAVIOUR #
......@@ -20,7 +20,7 @@ LP_BATTERY_THRESHOLD=75
# Recommended value is 60
LP_LOAD_THRESHOLD=60
# Minimal value after which the temperature is displayed (in celsius degrees)
# Minimal value after which the temperature is displayed (in degrees Celsius)
# Recommended value is 60
LP_TEMP_THRESHOLD=60
......@@ -35,9 +35,13 @@ LP_PATH_KEEP=2
# Do you want to display the hostname, even if not connected through network?
# Defaults to 0 (do not display hostname when locally connected)
# set to 1 if you want to always see the hostname
# set to -1 if you want to never see the hostname
LP_HOSTNAME_ALWAYS=0
# Do you want to display the user, even if he is the same than the logged one?
# Use the FQDN instead of the short hostname if the hostname is displayed
LP_ENABLE_FQDN=0
# Do you want to display the user, even if the user is the same as the one logged in?
# Defaults to 1 (always display the user)
# set to 0 if you want to hide the logged user (it will always display different users)
LP_USER_ALWAYS=1
......@@ -47,51 +51,56 @@ LP_USER_ALWAYS=1
# Defaults to 1 (display percentages)
LP_PERCENTS_ALWAYS=1
# Do you want to use the permissions feature ?
# Do you want to use the permissions feature?
# Recommended value is 1
LP_ENABLE_PERM=1
# Do you want to use the shorten path feature ?
# Do you want to use the shorten path feature?
# Recommended value is 1
LP_ENABLE_SHORTEN_PATH=1
# Do you want to use the proxy detection feature ?
# Do you want to use the proxy detection feature?
# Recommended value is 1
LP_ENABLE_PROXY=1
# Do you want to use the jobs feature ?
# Do you want to use the jobs feature?
# Recommended value is 1
LP_ENABLE_JOBS=1
# Do you want to use the load feature ?
# Do you want to use the load feature?
# Recommended value is 1
LP_ENABLE_LOAD=1
# Do you want to use the batt feature ?
# Do you want to use the battery feature?
# Recommended value is 1
LP_ENABLE_BATT=1
# Do you want to use vcs features with root account
# Do you want to use the 'sudo credentials' feature?
# Be warned that this may pollute the syslog if you don't have sudo
# credentials, and the sysadmin will hate you.
LP_ENABLE_SUDO=0
# Do you want to use VCS features with the root account?
# Recommended value is 0
LP_ENABLE_VCS_ROOT=0
# Do you want to use the git special features ?
# Do you want to use the Git special features?
# Recommended value is 1
LP_ENABLE_GIT=1
# Do you want to use the svn special features ?
# Do you want to use the Subversion special features?
# Recommended value is 1
LP_ENABLE_SVN=1
# Do you want to use the mercurial special features ?
# Do you want to use the Mercurial special features?
# Recommended value is 1
LP_ENABLE_HG=1
# Do you want to use the fossil special features ?
# Do you want to use the Fossil special features?
# Recommended value is 1
LP_ENABLE_FOSSIL=1
# Do you want to use the bzr special features ?
# Do you want to use the Bazaar special features?
# Recommanded value is 1
LP_ENABLE_BZR=1
......@@ -125,7 +134,7 @@ LP_ENABLE_TEMP=1
# Recommended value is 0
LP_TIME_ANALOG=0
# Use the liquid prompt as the title of the terminal window
# Use the prompt as the title of the terminal window
# The content is not customizable, the implementation is very basic,
# and this may not work properly on exotic terminals, thus the
# recommended value is 0
......
# Simulator for "pmset -g batt" for testing the implementation of
# battery display on MacOS X
pmset()
{
case "$pmset_sim" in
iMac|no-battery)
# https://github.com/nojhan/liquidprompt/issues/315
cat <<EOF
Now drawing from 'AC Power'
EOF
;;
attached)
# https://github.com/nojhan/liquidprompt/issues/326#issuecomment-66120495
cat <<'EOF'
Now drawing from 'AC Power'
-InternalBattery-0 37%; AC attached; not charging
EOF
;;
charging)
# https://github.com/nojhan/liquidprompt/issues/326
cat <<'EOF'
Now drawing from 'AC Power'
-InternalBattery-0 8%; charging; 2:46 remaining
EOF
;;
discharging)
# https://github.com/nojhan/liquidprompt/issues/326
cat <<'EOF'
Now drawing from 'Battery Power'
-InternalBattery-0 9%; discharging; (no estimate)
EOF
;;
warning-Early)
# https://github.com/nojhan/liquidprompt/issues/326
cat <<'EOF'
Now drawing from 'Battery Power'
-InternalBattery-0 7%; discharging; 0:13 remaining
Battery Warning: Early
EOF
;;
*)
echo "unsupported '$pmset_sim' pmset simulation"
;;
esac
}
#!/bin/sh
# Run the testsuite with both bash and zsh
if [ -z "$BASH_VERSION$ZSH_VERSION" ]; then
for sh in bash zsh
do
if [ -x /bin/$sh ]; then
/bin/$sh "$0"
elif [ -x /usr/bin/$sh ]; then
/usr/bin/$sh "$0"
fi
done
exit 0
fi
print_ok()
{
local OK="\\033[1;32m"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment