Skip to content

Commit

Permalink
Replace prompt mark shell escape string
Browse files Browse the repository at this point in the history
Part of #651, this removes a shell prompt escape string, making it
easier to work with terminal titles, as well as making it possible to
customize the prompt mark for the root user. This patch does not do
that, as the functionality has remained the same, but it would now be
possible to add a LP_MARK_ROOT.

This patch should have no functional difference, as the checks that Bash
and Zsh did in the prompt escape are exactly the same that Liquidprompt
is doing: comparing EUID to 0.
  • Loading branch information
Rycieos committed Mar 1, 2021
1 parent d5e8f5a commit 1a22e1e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions liquidprompt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if test -n "${BASH_VERSION-}"; then
_LP_HOST_SYMBOL="\h"
_LP_FQDN_SYMBOL="\H"
_LP_TIME_SYMBOL="\t"
_LP_MARK_SYMBOL='\$'
_LP_MARK_SYMBOL='$'

_LP_FIRST_INDEX=0
_LP_PERCENT='%' # must be escaped on zsh
Expand Down Expand Up @@ -72,7 +72,7 @@ elif test -n "${ZSH_VERSION-}" ; then
_LP_HOST_SYMBOL="%m"
_LP_FQDN_SYMBOL="%M"
_LP_TIME_SYMBOL="%*"
_LP_MARK_SYMBOL='%(!.#.%%)'
_LP_MARK_SYMBOL='%%'

_LP_FIRST_INDEX=1
_LP_PERCENT='%%'
Expand Down Expand Up @@ -557,6 +557,8 @@ lp_activate() {
LP_DISABLED_VCS_PATHS=("/")
fi

LP_MARK_DEFAULT='#'

LP_COLOR_MARK=$LP_COLOR_MARK_ROOT
LP_COLOR_PATH=$LP_COLOR_PATH_ROOT
LP_COLOR_USER=$LP_COLOR_USER_ROOT
Expand Down

0 comments on commit 1a22e1e

Please sign in to comment.