Skip to content

Commit

Permalink
Add nested shell level feature
Browse files Browse the repository at this point in the history
Add display of the $SHLVL environment variable if it is above 1.

Resolves #606
  • Loading branch information
Rycieos committed Apr 28, 2022
1 parent d4f10c9 commit ffc3851
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/theme/included/powerline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,12 @@ ______

Color for the command runtime section.

.. attribute:: POWERLINE_SHLVL_COLOR
:type: array<int>
:value: (231, 58, 0, 0, 7, 2)

Color for the nested shell level section.

.. attribute:: POWERLINE_SOFTWARE_COLLECTIONS_COLOR
:type: array<int>
:value: (231, 62, 0, 0, 7, 5)
Expand Down
7 changes: 7 additions & 0 deletions powerline.theme
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ _lp_powerline_full_theme_activate() {
POWERLINE_RUNTIME_COLOR=( ${POWERLINE_RUNTIME_COLOR[@]+"${POWERLINE_RUNTIME_COLOR[@]}"} )
[[ ${#POWERLINE_RUNTIME_COLOR[@]} == 0 ]] && POWERLINE_RUNTIME_COLOR=(226 17 0 0 3 4)

POWERLINE_SHLVL_COLOR=( ${POWERLINE_SHLVL_COLOR[@]+"${POWERLINE_SHLVL_COLOR[@]}"} )
[[ ${#POWERLINE_SHLVL_COLOR[@]} == 0 ]] && POWERLINE_SHLVL_COLOR=(231 58 0 0 7 2)

POWERLINE_SOFTWARE_COLLECTIONS_COLOR=( ${POWERLINE_SOFTWARE_COLLECTIONS_COLOR[@]+"${POWERLINE_SOFTWARE_COLLECTIONS_COLOR[@]}"} )
[[ ${#POWERLINE_SOFTWARE_COLLECTIONS_COLOR[@]} == 0 ]] && POWERLINE_SOFTWARE_COLLECTIONS_COLOR=(231 62 0 0 7 5)

Expand Down Expand Up @@ -250,6 +253,10 @@ _lp_powerline_full_theme_prompt() {
__powerline_section "${LP_MARK_DIRSTACK}${lp_dirstack}" "${POWERLINE_DIRSTACK_COLOR[@]}"
fi

if _lp_shell_level; then
__powerline_section "${LP_MARK_SHLVL}${lp_shell_level}" "${POWERLINE_SHLVL_COLOR[@]}"
fi

local lp_chroot
if _lp_chroot; then
__powerline_section "${POWERLINE_CHROOT_MARKER}${lp_chroot}" "${POWERLINE_CHROOT_COLOR[@]}"
Expand Down

0 comments on commit ffc3851

Please sign in to comment.