File tree Expand file tree Collapse file tree 2 files changed +17
-14
lines changed Expand file tree Collapse file tree 2 files changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,7 @@ themes/command_duration.theme.bash
133133themes/easy
134134themes/essential
135135themes/modern
136+ themes/norbu
136137themes/pete
137138themes/powerline
138139themes/pure
Original file line number Diff line number Diff line change 1- #! /usr/bin/env bash
1+ # shellcheck shell=bash
2+ # shellcheck disable=SC2034 # Expected behavior for themes.
23
3- function set_prompt_symbol () {
4- if test $1 -eq 0 ; then
5- PROMPT_SYMBOL =" >_"
6- else
7- PROMPT_SYMBOL =" ${orange} >_${normal} "
8- fi
4+ function set_prompt_symbol() {
5+ if [[ $1 -eq 0 ]] ; then
6+ prompt_symbol =" >_"
7+ else
8+ prompt_symbol =" ${orange? } >_${normal? } "
9+ fi
910}
11+
1012function prompt_command() {
11- set_prompt_symbol $?
12- if test -z " $VIRTUAL_ENV " ; then
13- PYTHON_VIRTUALENV=" "
14- else
15- PYTHON_VIRTUALENV=" ${bold_yellow} [` basename \" $VIRTUAL_ENV \" ` ]"
16- fi
13+ local ret_val=" $? " prompt_symbol scm_prompt_info
14+ if [[ -n " ${VIRTUAL_ENV:- } " ]]; then
15+ PYTHON_VIRTUALENV=" ${bold_yellow?} [${VIRTUAL_ENV##*/ } ]"
16+ fi
1717
18- PS1=" ${bold_orange}${PYTHON_VIRTUALENV}${reset_color}${bold_green} [\w]${bold_blue} \[$( scm_prompt_info) \]${normal} \n${PROMPT_SYMBOL} "
18+ scm_prompt_info=" $( scm_prompt_info) "
19+ set_prompt_symbol " ${ret_val} "
20+ PS1=" ${bold_orange?}${PYTHON_VIRTUALENV:- }${reset_color?}${bold_green?} [\w]${bold_blue?} [${scm_prompt_info} ]${normal?} \n${prompt_symbol} "
1921}
2022
2123# scm themeing
You can’t perform that action at this time.
0 commit comments