Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup for modern theme #1817

Merged
merged 2 commits into from
Jan 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions clean_files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ themes/bobby-python
themes/brainy
themes/brunton
themes/command_duration.theme.bash
themes/modern

# plugins
#
Expand Down
9 changes: 6 additions & 3 deletions themes/modern/modern.theme.bash
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# shellcheck shell=bash

SCM_THEME_PROMPT_PREFIX=""
SCM_THEME_PROMPT_SUFFIX=""

Expand All @@ -19,14 +21,14 @@ esac
PS3=">> "

is_vim_shell() {
if [ ! -z "$VIMRUNTIME" ]; then
if [ -n "$VIMRUNTIME" ]; then
echo "[${cyan}vim shell${normal}]"
fi
}

modern_scm_prompt() {
CHAR=$(scm_char)
if [ $CHAR = $SCM_NONE_CHAR ]; then
if [ "$CHAR" = "$SCM_NONE_CHAR" ]; then
return
else
echo "[$(scm_char)][$(scm_prompt_info)]"
Expand All @@ -44,7 +46,8 @@ detect_venv() {
}

prompt() {
if [ $? -ne 0 ]; then
retval=$?
if [[ retval -ne 0 ]]; then
PS1="${TITLEBAR}${bold_red}┌─${reset_color}$(modern_scm_prompt)[${cyan}\u${normal}][${cyan}\w${normal}]$(is_vim_shell)\n${bold_red}└─▪${normal} "
else
PS1="${TITLEBAR}┌─$(modern_scm_prompt)[${cyan}\u${normal}][${cyan}\w${normal}]$(is_vim_shell)\n└─▪ "
Expand Down