From 457c1066170fb048fdda67cdfb6320e9c7fec8cb Mon Sep 17 00:00:00 2001 From: Ira Abramov Date: Wed, 19 May 2021 11:26:08 +0300 Subject: [PATCH 1/6] Fixes by the pre-commit checks --- .../powerline-multiline.base.bash | 186 +++++++++--------- .../powerline-naked/powerline-naked.base.bash | 52 ++--- 2 files changed, 121 insertions(+), 117 deletions(-) diff --git a/themes/powerline-multiline/powerline-multiline.base.bash b/themes/powerline-multiline/powerline-multiline.base.bash index 33a8c398e3..cf70032468 100644 --- a/themes/powerline-multiline/powerline-multiline.base.bash +++ b/themes/powerline-multiline/powerline-multiline.base.bash @@ -1,105 +1,107 @@ +# shellcheck shell=bash . "$BASH_IT/themes/powerline/powerline.base.bash" function __powerline_last_status_prompt { - [[ "$1" -ne 0 ]] && echo "$(set_color ${LAST_STATUS_THEME_PROMPT_COLOR} -) ${1} ${normal}" + [[ "$1" -ne 0 ]] && echo "$(set_color "${LAST_STATUS_THEME_PROMPT_COLOR}" -) ${1} ${normal}" } function __powerline_right_segment { - local OLD_IFS="${IFS}"; IFS="|" - local params=( $1 ) - IFS="${OLD_IFS}" - local padding=0 - local pad_before_segment=" " - - if [[ "${SEGMENTS_AT_RIGHT}" -eq 0 ]]; then - if [[ "${POWERLINE_COMPACT_AFTER_LAST_SEGMENT}" -ne 0 ]]; then - pad_before_segment="" - fi - RIGHT_PROMPT+="$(set_color ${params[1]} -)${POWERLINE_RIGHT_END}${normal}" - (( padding += 1 )) - else - if [[ "${POWERLINE_COMPACT_BEFORE_SEPARATOR}" -ne 0 ]]; then - pad_before_segment="" - fi - # Since the previous segment wasn't the last segment, add padding, if needed - # - if [[ "${POWERLINE_COMPACT_AFTER_SEPARATOR}" -eq 0 ]]; then - RIGHT_PROMPT+="$(set_color - ${LAST_SEGMENT_COLOR}) ${normal}" - (( padding += 1 )) - fi - if [[ "${LAST_SEGMENT_COLOR}" -eq "${params[1]}" ]]; then - RIGHT_PROMPT+="$(set_color - ${LAST_SEGMENT_COLOR})${POWERLINE_RIGHT_SEPARATOR_SOFT}${normal}" - else - RIGHT_PROMPT+="$(set_color ${params[1]} ${LAST_SEGMENT_COLOR})${POWERLINE_RIGHT_SEPARATOR}${normal}" - fi - (( padding += 1 )) - fi - - RIGHT_PROMPT+="$(set_color - ${params[1]})${pad_before_segment}${params[0]}${normal}" - - (( padding += ${#pad_before_segment} )) - (( padding += ${#params[0]} )) - - (( RIGHT_PROMPT_LENGTH += padding )) - LAST_SEGMENT_COLOR="${params[1]}" - (( SEGMENTS_AT_RIGHT += 1 )) + local OLD_IFS="${IFS}" + IFS="|" + local params=("$1") + IFS="${OLD_IFS}" + local padding=0 + local pad_before_segment=" " + + if [[ "${SEGMENTS_AT_RIGHT}" -eq 0 ]]; then + if [[ "${POWERLINE_COMPACT_AFTER_LAST_SEGMENT}" -ne 0 ]]; then + pad_before_segment="" + fi + RIGHT_PROMPT+="$(set_color "${params[1]}" -)${POWERLINE_RIGHT_END}${normal}" + ((padding += 1)) + else + if [[ "${POWERLINE_COMPACT_BEFORE_SEPARATOR}" -ne 0 ]]; then + pad_before_segment="" + fi + # Since the previous segment wasn't the last segment, add padding, if needed + # + if [[ "${POWERLINE_COMPACT_AFTER_SEPARATOR}" -eq 0 ]]; then + RIGHT_PROMPT+="$(set_color - "${LAST_SEGMENT_COLOR}") ${normal}" + ((padding += 1)) + fi + if [[ "${LAST_SEGMENT_COLOR}" -eq "${params[1]}" ]]; then + RIGHT_PROMPT+="$(set_color - "${LAST_SEGMENT_COLOR}")${POWERLINE_RIGHT_SEPARATOR_SOFT}${normal}" + else + RIGHT_PROMPT+="$(set_color "${params[1]}" "${LAST_SEGMENT_COLOR}")${POWERLINE_RIGHT_SEPARATOR}${normal}" + fi + ((padding += 1)) + fi + + RIGHT_PROMPT+="$(set_color - "${params[1]}")${pad_before_segment}${params[0]}${normal}" + + ((padding += ${#pad_before_segment})) + ((padding += ${#params[0]})) + + ((RIGHT_PROMPT_LENGTH += padding)) + LAST_SEGMENT_COLOR="${params[1]}" + ((SEGMENTS_AT_RIGHT += 1)) } function __powerline_right_first_segment_padding { - RIGHT_PROMPT+="$(set_color - ${LAST_SEGMENT_COLOR}) ${normal}" - (( RIGHT_PROMPT_LENGTH += 1 )) + RIGHT_PROMPT+="$(set_color - "${LAST_SEGMENT_COLOR}") ${normal}" + ((RIGHT_PROMPT_LENGTH += 1)) } function __powerline_prompt_command { - local last_status="$?" ## always the first - local move_cursor_rightmost='\033[500C' - - LEFT_PROMPT="" - RIGHT_PROMPT="" - RIGHT_PROMPT_LENGTH=${POWERLINE_PADDING} - SEGMENTS_AT_LEFT=0 - SEGMENTS_AT_RIGHT=0 - LAST_SEGMENT_COLOR="" - _save-and-reload-history "${HISTORY_AUTOSAVE:-0}" - - ## left prompt ## - for segment in $POWERLINE_LEFT_PROMPT; do - local info="$(__powerline_${segment}_prompt)" - [[ -n "${info}" ]] && __powerline_left_segment "${info}" - done - - if [[ -n "${LEFT_PROMPT}" ]] && [[ "${POWERLINE_COMPACT_AFTER_LAST_SEGMENT}" -eq 0 ]]; then - __powerline_left_last_segment_padding - fi - - [[ -n "${LEFT_PROMPT}" ]] && LEFT_PROMPT+="$(set_color ${LAST_SEGMENT_COLOR} -)${POWERLINE_LEFT_END}${normal}" - - ## right prompt ## - if [[ -n "${POWERLINE_RIGHT_PROMPT}" ]]; then - # LEFT_PROMPT+="${move_cursor_rightmost}" - for segment in $POWERLINE_RIGHT_PROMPT; do - local info="$(__powerline_${segment}_prompt)" - [[ -n "${info}" ]] && __powerline_right_segment "${info}" - done - - if [[ -n "${RIGHT_PROMPT}" ]] && [[ "${POWERLINE_COMPACT_BEFORE_FIRST_SEGMENT}" -eq 0 ]]; then - __powerline_right_first_segment_padding - fi - - RIGHT_PAD=$(printf "%.s " $(seq 1 $RIGHT_PROMPT_LENGTH)) - LEFT_PROMPT+="${RIGHT_PAD}${move_cursor_rightmost}" - LEFT_PROMPT+="\033[$(( ${#RIGHT_PAD} - 1 ))D" - fi - - local prompt="${PROMPT_CHAR}" - if [[ "${POWERLINE_COMPACT_PROMPT}" -eq 0 ]]; then - prompt+=" " - fi - - PS1="${LEFT_PROMPT}${RIGHT_PROMPT}\n$(__powerline_last_status_prompt ${last_status})${prompt}" - - ## cleanup ## - unset LAST_SEGMENT_COLOR \ - LEFT_PROMPT RIGHT_PROMPT RIGHT_PROMPT_LENGTH \ - SEGMENTS_AT_LEFT SEGMENTS_AT_RIGHT + local last_status="$?" ## always the first + local move_cursor_rightmost='\033[500C' + + LEFT_PROMPT="" + RIGHT_PROMPT="" + RIGHT_PROMPT_LENGTH=${POWERLINE_PADDING} + SEGMENTS_AT_LEFT=0 + SEGMENTS_AT_RIGHT=0 + LAST_SEGMENT_COLOR="" + _save-and-reload-history "${HISTORY_AUTOSAVE:-0}" + + ## left prompt ## + for segment in $POWERLINE_LEFT_PROMPT; do + local info="$(__powerline_"${segment}"_prompt)" + [[ -n "${info}" ]] && __powerline_left_segment "${info}" + done + + if [[ -n "${LEFT_PROMPT}" ]] && [[ "${POWERLINE_COMPACT_AFTER_LAST_SEGMENT}" -eq 0 ]]; then + __powerline_left_last_segment_padding + fi + + [[ -n "${LEFT_PROMPT}" ]] && LEFT_PROMPT+="$(set_color "${LAST_SEGMENT_COLOR}" -)${POWERLINE_LEFT_END}${normal}" + + ## right prompt ## + if [[ -n "${POWERLINE_RIGHT_PROMPT}" ]]; then + # LEFT_PROMPT+="${move_cursor_rightmost}" + for segment in $POWERLINE_RIGHT_PROMPT; do + local info="$(__powerline_"${segment}"_prompt)" + [[ -n "${info}" ]] && __powerline_right_segment "${info}" + done + + if [[ -n "${RIGHT_PROMPT}" ]] && [[ "${POWERLINE_COMPACT_BEFORE_FIRST_SEGMENT}" -eq 0 ]]; then + __powerline_right_first_segment_padding + fi + + RIGHT_PAD=$(printf "%.s " $(seq 1 "$RIGHT_PROMPT_LENGTH")) + LEFT_PROMPT+="${RIGHT_PAD}${move_cursor_rightmost}" + LEFT_PROMPT+="\033[$((${#RIGHT_PAD} - 1))D" + fi + + local prompt="${PROMPT_CHAR}" + if [[ "${POWERLINE_COMPACT_PROMPT}" -eq 0 ]]; then + prompt+=" " + fi + + PS1="${LEFT_PROMPT}${RIGHT_PROMPT}\n$(__powerline_last_status_prompt ${last_status})${prompt}" + + ## cleanup ## + unset LAST_SEGMENT_COLOR \ + LEFT_PROMPT RIGHT_PROMPT RIGHT_PROMPT_LENGTH \ + SEGMENTS_AT_LEFT SEGMENTS_AT_RIGHT } diff --git a/themes/powerline-naked/powerline-naked.base.bash b/themes/powerline-naked/powerline-naked.base.bash index 98686075bd..3859e2581f 100644 --- a/themes/powerline-naked/powerline-naked.base.bash +++ b/themes/powerline-naked/powerline-naked.base.bash @@ -1,34 +1,36 @@ +# shellcheck shell=bash . "$BASH_IT/themes/powerline/powerline.base.bash" function __powerline_left_segment { - local OLD_IFS="${IFS}"; IFS="|" - local params=( $1 ) - IFS="${OLD_IFS}" - local separator="" - local pad_before_segment=" " + local OLD_IFS="${IFS}" + IFS="|" + local params=("$1") + IFS="${OLD_IFS}" + local separator="" + local pad_before_segment=" " - if [[ "${SEGMENTS_AT_LEFT}" -eq 0 ]]; then - if [[ "${POWERLINE_COMPACT_BEFORE_FIRST_SEGMENT}" -ne 0 ]]; then - pad_before_segment="" - fi - else - if [[ "${POWERLINE_COMPACT_AFTER_SEPARATOR}" -ne 0 ]]; then - pad_before_segment="" - fi - # Since the previous segment wasn't the last segment, add padding, if needed - # - if [[ "${POWERLINE_COMPACT_BEFORE_SEPARATOR}" -eq 0 ]]; then - LEFT_PROMPT+=" " - fi - LEFT_PROMPT+="${POWERLINE_LEFT_SEPARATOR}" - fi + if [[ "${SEGMENTS_AT_LEFT}" -eq 0 ]]; then + if [[ "${POWERLINE_COMPACT_BEFORE_FIRST_SEGMENT}" -ne 0 ]]; then + pad_before_segment="" + fi + else + if [[ "${POWERLINE_COMPACT_AFTER_SEPARATOR}" -ne 0 ]]; then + pad_before_segment="" + fi + # Since the previous segment wasn't the last segment, add padding, if needed + # + if [[ "${POWERLINE_COMPACT_BEFORE_SEPARATOR}" -eq 0 ]]; then + LEFT_PROMPT+=" " + fi + LEFT_PROMPT+="${POWERLINE_LEFT_SEPARATOR}" + fi - LEFT_PROMPT+="$(set_color ${params[1]} -)${pad_before_segment}${params[0]}${normal}" - LAST_SEGMENT_COLOR=${params[1]} - (( SEGMENTS_AT_LEFT += 1 )) - _save-and-reload-history "${HISTORY_AUTOSAVE:-0}" + LEFT_PROMPT+="$(set_color "${params[1]}" -)${pad_before_segment}${params[0]}${normal}" + LAST_SEGMENT_COLOR=${params[1]} + ((SEGMENTS_AT_LEFT += 1)) + _save-and-reload-history "${HISTORY_AUTOSAVE:-0}" } function __powerline_left_last_segment_padding { - LEFT_PROMPT+="$(set_color ${LAST_SEGMENT_COLOR} -) ${normal}" + LEFT_PROMPT+="$(set_color "${LAST_SEGMENT_COLOR}" -) ${normal}" } From f0908c875a16336bb1241d6e761836acd247896b Mon Sep 17 00:00:00 2001 From: Ira Abramov Date: Wed, 19 May 2021 11:46:21 +0300 Subject: [PATCH 2/6] even more Fixes by the pre-commit checks --- clean_files.txt | 3 + .../powerline-multiline.theme.bash | 2 +- .../powerline-naked.theme.bash | 2 +- .../powerline-plain/powerline-plain.base.bash | 95 ++++++++++--------- .../powerline-plain.theme.bash | 2 +- 5 files changed, 55 insertions(+), 49 deletions(-) diff --git a/clean_files.txt b/clean_files.txt index 40dd3ed3f0..a7e70eb932 100644 --- a/clean_files.txt +++ b/clean_files.txt @@ -111,6 +111,9 @@ themes/command_duration.theme.bash themes/easy themes/modern themes/powerline +themes/powerline-multiline +themes/powerline-naked +themes/powerline-plain themes/purity # vendor init files diff --git a/themes/powerline-multiline/powerline-multiline.theme.bash b/themes/powerline-multiline/powerline-multiline.theme.bash index a1663e6f1b..e15c362178 100644 --- a/themes/powerline-multiline/powerline-multiline.theme.bash +++ b/themes/powerline-multiline/powerline-multiline.theme.bash @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +# shellcheck shell=bash . "$BASH_IT/themes/powerline-multiline/powerline-multiline.base.bash" diff --git a/themes/powerline-naked/powerline-naked.theme.bash b/themes/powerline-naked/powerline-naked.theme.bash index 417ae71a83..72c986baab 100644 --- a/themes/powerline-naked/powerline-naked.theme.bash +++ b/themes/powerline-naked/powerline-naked.theme.bash @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +# shellcheck shell=bash . "$BASH_IT/themes/powerline-naked/powerline-naked.base.bash" diff --git a/themes/powerline-plain/powerline-plain.base.bash b/themes/powerline-plain/powerline-plain.base.bash index ce91ef899c..3326414d31 100644 --- a/themes/powerline-plain/powerline-plain.base.bash +++ b/themes/powerline-plain/powerline-plain.base.bash @@ -1,61 +1,64 @@ +# shellcheck shell=bash . "$BASH_IT/themes/powerline/powerline.base.bash" function __powerline_left_segment { - local OLD_IFS="${IFS}"; IFS="|" - local params=( $1 ) - IFS="${OLD_IFS}" - local pad_before_segment=" " - - if [[ "${SEGMENTS_AT_LEFT}" -eq 0 ]]; then - if [[ "${POWERLINE_COMPACT_BEFORE_FIRST_SEGMENT}" -ne 0 ]]; then - pad_before_segment="" - fi - else - if [[ "${POWERLINE_COMPACT_AFTER_SEPARATOR}" -ne 0 ]]; then - pad_before_segment="" - fi - # Since the previous segment wasn't the last segment, add padding, if needed - # - if [[ "${POWERLINE_COMPACT_BEFORE_SEPARATOR}" -eq 0 ]]; then - LEFT_PROMPT+="$(set_color - ${LAST_SEGMENT_COLOR}) ${normal}" - fi - fi - - LEFT_PROMPT+="$(set_color - ${params[1]})${pad_before_segment}${params[0]}${normal}" - LAST_SEGMENT_COLOR=${params[1]} - (( SEGMENTS_AT_LEFT += 1 )) + local OLD_IFS="${IFS}" + IFS="|" + local params=("$1") + IFS="${OLD_IFS}" + local pad_before_segment=" " + + if [[ "${SEGMENTS_AT_LEFT}" -eq 0 ]]; then + if [[ "${POWERLINE_COMPACT_BEFORE_FIRST_SEGMENT}" -ne 0 ]]; then + pad_before_segment="" + fi + else + if [[ "${POWERLINE_COMPACT_AFTER_SEPARATOR}" -ne 0 ]]; then + pad_before_segment="" + fi + # Since the previous segment wasn't the last segment, add padding, if needed + # + if [[ "${POWERLINE_COMPACT_BEFORE_SEPARATOR}" -eq 0 ]]; then + LEFT_PROMPT+="$(set_color - "${LAST_SEGMENT_COLOR}") ${normal}" + fi + fi + + LEFT_PROMPT+="$(set_color - "${params[1]}")${pad_before_segment}${params[0]}${normal}" + LAST_SEGMENT_COLOR=${params[1]} + ((SEGMENTS_AT_LEFT += 1)) } function __powerline_prompt_command { - local last_status="$?" ## always the first + local last_status="$?" ## always the first - LEFT_PROMPT="" - SEGMENTS_AT_LEFT=0 - LAST_SEGMENT_COLOR="" - PROMPT_AFTER="${POWERLINE_PROMPT_AFTER}" + LEFT_PROMPT="" + SEGMENTS_AT_LEFT=0 + LAST_SEGMENT_COLOR="" + PROMPT_AFTER="${POWERLINE_PROMPT_AFTER}" - _save-and-reload-history "${HISTORY_AUTOSAVE:-0}" + _save-and-reload-history "${HISTORY_AUTOSAVE:-0}" - ## left prompt ## - for segment in $POWERLINE_PROMPT; do - local info="$(__powerline_${segment}_prompt)" - [[ -n "${info}" ]] && __powerline_left_segment "${info}" - done + ## left prompt ## + for segment in $POWERLINE_PROMPT; do + local info="$(__powerline_"${segment}"_prompt)" + [[ -n "${info}" ]] && __powerline_left_segment "${info}" + done - [[ "${last_status}" -ne 0 ]] && __powerline_left_segment $(__powerline_last_status_prompt ${last_status}) + # shellcheck disable=SC2046 + [[ "${last_status}" -ne 0 ]] && __powerline_left_segment $(__powerline_last_status_prompt ${last_status}) - if [[ -n "${LEFT_PROMPT}" ]] && [[ "${POWERLINE_COMPACT_AFTER_LAST_SEGMENT}" -eq 0 ]]; then - __powerline_left_last_segment_padding - fi + if [[ -n "${LEFT_PROMPT}" ]] && [[ "${POWERLINE_COMPACT_AFTER_LAST_SEGMENT}" -eq 0 ]]; then + __powerline_left_last_segment_padding + fi - if [[ "${POWERLINE_COMPACT_PROMPT}" -eq 0 ]]; then - LEFT_PROMPT+=" " - fi + if [[ "${POWERLINE_COMPACT_PROMPT}" -eq 0 ]]; then + LEFT_PROMPT+=" " + fi - PS1="${LEFT_PROMPT}${PROMPT_AFTER}" + PS1="${LEFT_PROMPT}${PROMPT_AFTER}" - ## cleanup ## - unset LAST_SEGMENT_COLOR \ - LEFT_PROMPT \ - SEGMENTS_AT_LEFT + ## cleanup ## + unset LAST_SEGMENT_COLOR \ + LEFT_PROMPT \ + SEGMENTS_AT_LEFT } diff --git a/themes/powerline-plain/powerline-plain.theme.bash b/themes/powerline-plain/powerline-plain.theme.bash index 0b8f4f5661..9ea6cde929 100644 --- a/themes/powerline-plain/powerline-plain.theme.bash +++ b/themes/powerline-plain/powerline-plain.theme.bash @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +# shellcheck shell=bash . "$BASH_IT/themes/powerline-plain/powerline-plain.base.bash" From 10713d55450e5ba45c5222e149bc32d23ccee0e2 Mon Sep 17 00:00:00 2001 From: Ira Abramov Date: Wed, 19 May 2021 19:17:58 +0300 Subject: [PATCH 3/6] Get rid of shellcheck disable=SC2046 --- clean_files.txt | 1 + plugins/available/thefuck.plugin.bash | 4 ++-- themes/powerline-plain/powerline-plain.base.bash | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/clean_files.txt b/clean_files.txt index a7e70eb932..edbe1df405 100644 --- a/clean_files.txt +++ b/clean_files.txt @@ -84,6 +84,7 @@ plugins/available/goenv.plugin.bash plugins/available/history-search.plugin.bash plugins/available/history-substring-search.plugin.bash plugins/available/history.plugin.bash +plugins/available/thefuck.plugin.bash plugins/available/xterm.plugin.bash # tests diff --git a/plugins/available/thefuck.plugin.bash b/plugins/available/thefuck.plugin.bash index 242a77df22..a985837f57 100644 --- a/plugins/available/thefuck.plugin.bash +++ b/plugins/available/thefuck.plugin.bash @@ -1,9 +1,9 @@ +# shellcheck shell=bash cite about-plugin about-plugin 'Initialization for fuck' # https://github.com/nvbn/thefuck if _command_exists thefuck; then - # shellcheck disable=SC2046 - eval $(thefuck --alias) + eval "$(thefuck --alias)" fi diff --git a/themes/powerline-plain/powerline-plain.base.bash b/themes/powerline-plain/powerline-plain.base.bash index 3326414d31..0226639cc4 100644 --- a/themes/powerline-plain/powerline-plain.base.bash +++ b/themes/powerline-plain/powerline-plain.base.bash @@ -44,8 +44,7 @@ function __powerline_prompt_command { [[ -n "${info}" ]] && __powerline_left_segment "${info}" done - # shellcheck disable=SC2046 - [[ "${last_status}" -ne 0 ]] && __powerline_left_segment $(__powerline_last_status_prompt ${last_status}) + [[ "${last_status}" -ne 0 ]] && __powerline_left_segment "$(__powerline_last_status_prompt ${last_status})" if [[ -n "${LEFT_PROMPT}" ]] && [[ "${POWERLINE_COMPACT_AFTER_LAST_SEGMENT}" -eq 0 ]]; then __powerline_left_last_segment_padding From dd53b0a7c1155faa8941a7f42058d18cb7541381 Mon Sep 17 00:00:00 2001 From: Ira Abramov Date: Tue, 26 Aug 2025 17:24:27 +0300 Subject: [PATCH 4/6] Clean up 5 theme files and expand linting coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Fix color variable references using ${var?} pattern for fail-fast behavior • Resolve SC2155 variable declaration/assignment separation issues • Fix SC2181 exit code checking and SC2059 printf format issues • Add themes/base.theme.bash, themes/mairan, themes/mbriggs, themes/metal, themes/minimal, themes/modern-t to clean_files.txt • All themes now pass shellcheck, shfmt, and bash-it requirements 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- clean_files.txt | 6 +++++ themes/mairan/mairan.theme.bash | 42 ++++++++++++++++------------- themes/mbriggs/mbriggs.theme.bash | 21 +++++++++------ themes/metal/metal.theme.bash | 21 ++++++++------- themes/minimal/minimal.theme.bash | 13 ++++----- themes/modern-t/modern-t.theme.bash | 25 +++++++++-------- 6 files changed, 74 insertions(+), 54 deletions(-) diff --git a/clean_files.txt b/clean_files.txt index 5a9037c901..1b256afc05 100644 --- a/clean_files.txt +++ b/clean_files.txt @@ -41,6 +41,7 @@ themes/atomic themes/axin themes/bakke themes/barbuk +themes/base.theme.bash themes/binaryanomaly themes/bira themes/bobby @@ -74,7 +75,12 @@ themes/kitsune themes/lambda themes/liquidprompt themes/luan +themes/mairan +themes/mbriggs +themes/metal +themes/minimal themes/modern +themes/modern-t themes/norbu themes/oh-my-posh themes/p4helpers.theme.bash diff --git a/themes/mairan/mairan.theme.bash b/themes/mairan/mairan.theme.bash index 65ef7ac1d3..2e6cec9930 100644 --- a/themes/mairan/mairan.theme.bash +++ b/themes/mairan/mairan.theme.bash @@ -1,3 +1,5 @@ +# shellcheck shell=bash +# shellcheck disable=SC2034 # Mairan Bash Prompt, inspired by "Zork" if tput setaf 1 &> /dev/null; then @@ -34,11 +36,11 @@ BRACKET_COLOR=$ORANGE SCM_THEME_PROMPT_PREFIX="" SCM_THEME_PROMPT_SUFFIX="" -SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}" -SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}" -SCM_GIT_CHAR="${bold_green}±${normal}" -SCM_SVN_CHAR="${bold_cyan}⑆${normal}" -SCM_HG_CHAR="${bold_red}☿${normal}" +SCM_THEME_PROMPT_DIRTY=" ${bold_red?}✗${normal?}" +SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓${normal?}" +SCM_GIT_CHAR="${bold_green?}±${normal?}" +SCM_SVN_CHAR="${bold_cyan?}⑆${normal?}" +SCM_HG_CHAR="${bold_red?}☿${normal?}" #Mysql Prompt export MYSQL_PS1="(\u@\h) [\d]> " @@ -55,23 +57,25 @@ esac PS3=">> " __my_rvm_ruby_version() { - local gemset=$(echo $GEM_HOME | awk -F'@' '{print $2}') + local gemset + gemset=$(echo "$GEM_HOME" | awk -F'@' '{print $2}') [ "$gemset" != "" ] && gemset="@$gemset" - local version=$(echo $MY_RUBY_HOME | awk -F'-' '{print $2}') + local version + version=$(echo "$MY_RUBY_HOME" | awk -F'-' '{print $2}') local full="$version$gemset" [ "$full" != "" ] && echo "[$full]" } is_vim_shell() { - if [ ! -z "$VIMRUNTIME" ]; then - echo "[${cyan}vim shell${normal}]" + if [ -n "$VIMRUNTIME" ]; then + echo "[${cyan?}vim shell${normal?}]" fi } # show chroot if exist chroot() { if [ -n "$debian_chroot" ]; then - my_ps_chroot="${bold_cyan}$debian_chroot${normal}" + my_ps_chroot="${bold_cyan?}$debian_chroot${normal?}" echo "($my_ps_chroot)" fi } @@ -79,7 +83,7 @@ chroot() { # show virtualenvwrapper my_ve() { if [ -n "$VIRTUAL_ENV" ]; then - my_ps_ve="${bold_purple}$ve${normal}" + my_ps_ve="${bold_purple?}$ve${normal?}" echo "($my_ps_ve)" fi echo "" @@ -87,12 +91,12 @@ my_ve() { prompt() { SCM_PROMPT_FORMAT="[%s$GREEN%s]" - my_ps_host="$BOLD$ORANGE\h${normal}" + my_ps_host="$BOLD$ORANGE\h${normal?}" # yes, these are the the same for now ... - my_ps_host_root="$ORANGE\h${normal}" + my_ps_host_root="$ORANGE\h${normal?}" - my_ps_user="$BOLD$GREEN\u${normal}" - my_ps_root="${bold_red}\u${normal}" + my_ps_user="$BOLD$GREEN\u${normal?}" + my_ps_root="${bold_red?}\u${normal?}" if [ -n "$VIRTUAL_ENV" ]; then ve=$(basename "$VIRTUAL_ENV") @@ -101,12 +105,12 @@ prompt() { # nice prompt case "$(id -u)" in 0) - PS1="\n${TITLEBAR}${BRACKET_COLOR}┌─${normal}$(my_ve)$(chroot)[$my_ps_root][$my_ps_host_root]$(scm_prompt)$(__my_rvm_ruby_version)[${green}\w${normal}]$(is_vim_shell)${BRACKET_COLOR} -└─▪ ${prompt_symbol} ${normal}" + PS1="\n${TITLEBAR}${BRACKET_COLOR}┌─${normal?}$(my_ve)$(chroot)[$my_ps_root][$my_ps_host_root]$(scm_prompt)$(__my_rvm_ruby_version)[${green?}\w${normal?}]$(is_vim_shell)${BRACKET_COLOR} +└─▪ ${prompt_symbol} ${normal?}" ;; *) - PS1="\n${TITLEBAR}${BRACKET_COLOR}┌─${normal}$(my_ve)$(chroot)[$my_ps_user][$my_ps_host]$(scm_prompt)${normal}$(__my_rvm_ruby_version)[${green}\w${normal}]$(is_vim_shell)${BRACKET_COLOR} -└─▪ ${prompt_symbol} ${normal}" + PS1="\n${TITLEBAR}${BRACKET_COLOR}┌─${normal?}$(my_ve)$(chroot)[$my_ps_user][$my_ps_host]$(scm_prompt)${normal?}$(__my_rvm_ruby_version)[${green?}\w${normal?}]$(is_vim_shell)${BRACKET_COLOR} +└─▪ ${prompt_symbol} ${normal?}" ;; esac } diff --git a/themes/mbriggs/mbriggs.theme.bash b/themes/mbriggs/mbriggs.theme.bash index 9e1511e316..7ed8851b10 100644 --- a/themes/mbriggs/mbriggs.theme.bash +++ b/themes/mbriggs/mbriggs.theme.bash @@ -1,16 +1,18 @@ +# shellcheck shell=bash +# shellcheck disable=SC2034 # ------------------------------------------------------------------# # FILE: mbriggs.zsh-theme # # BY: Matt Briggs (matt@mattbriggs.net) # # BASED ON: smt by Stephen Tudor (stephen@tudorstudio.com) # # ------------------------------------------------------------------# -SCM_THEME_PROMPT_DIRTY="${red}⚡${reset_color}" -SCM_THEME_PROMPT_AHEAD="${red}!${reset_color}" -SCM_THEME_PROMPT_CLEAN="${green}✓${reset_color}" +SCM_THEME_PROMPT_DIRTY="${red?}⚡${reset_color?}" +SCM_THEME_PROMPT_AHEAD="${red?}!${reset_color?}" +SCM_THEME_PROMPT_CLEAN="${green?}✓${reset_color?}" SCM_THEME_PROMPT_PREFIX=" " SCM_THEME_PROMPT_SUFFIX="" -GIT_SHA_PREFIX=" ${yellow}" -GIT_SHA_SUFFIX="${reset_color}" +GIT_SHA_PREFIX=" ${yellow?}" +GIT_SHA_SUFFIX="${reset_color?}" function git_short_sha() { SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$GIT_SHA_PREFIX$SHA$GIT_SHA_SUFFIX" @@ -18,11 +20,14 @@ function git_short_sha() { function prompt() { local return_status="" - local ruby="${red}$(ruby_version_prompt)${reset_color}" - local user_host="${green}\h${reset_color}" + local ruby + ruby="${red?}$(ruby_version_prompt)${reset_color?}" + local user_host + user_host="${green?}\h${reset_color?}" local current_path="\w" local n_commands="\!" - local git_branch="$(git_short_sha)$(scm_prompt_info)" + local git_branch + git_branch="$(git_short_sha)$(scm_prompt_info)" local prompt_symbol='λ' local open='(' local close=')' diff --git a/themes/metal/metal.theme.bash b/themes/metal/metal.theme.bash index e68a90a9b7..75a4e8bae2 100644 --- a/themes/metal/metal.theme.bash +++ b/themes/metal/metal.theme.bash @@ -1,4 +1,5 @@ -#!/usr/bin/env bash +# shellcheck shell=bash +# shellcheck disable=SC2034 # Emoji-based theme to display source control management and # virtual environment info beside the ordinary bash prompt. @@ -21,11 +22,11 @@ VIRTUALENV_THEME_PROMPT_SUFFIX="" # SCM prompts SCM_NONE_CHAR="" SCM_GIT_CHAR="[±] " -SCM_GIT_BEHIND_CHAR="${red}↓${normal}" -SCM_GIT_AHEAD_CHAR="${bold_green}↑${normal}" +SCM_GIT_BEHIND_CHAR="${red?}↓${normal?}" +SCM_GIT_AHEAD_CHAR="${bold_green?}↑${normal?}" SCM_GIT_UNTRACKED_CHAR="⌀" -SCM_GIT_UNSTAGED_CHAR="${bold_yellow}•${normal}" -SCM_GIT_STAGED_CHAR="${bold_green}+${normal}" +SCM_GIT_UNSTAGED_CHAR="${bold_yellow?}•${normal?}" +SCM_GIT_STAGED_CHAR="${bold_green?}+${normal?}" SCM_THEME_PROMPT_DIRTY="" SCM_THEME_PROMPT_CLEAN="" @@ -33,8 +34,8 @@ SCM_THEME_PROMPT_PREFIX="" SCM_THEME_PROMPT_SUFFIX="" # Git status prompts -GIT_THEME_PROMPT_DIRTY=" ${red}✗${normal}" -GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}" +GIT_THEME_PROMPT_DIRTY=" ${red?}✗${normal?}" +GIT_THEME_PROMPT_CLEAN=" ${bold_green?}✓${normal?}" GIT_THEME_PROMPT_PREFIX="" GIT_THEME_PROMPT_SUFFIX="" @@ -61,19 +62,19 @@ function virtualenv_prompt { # Rename tab function tabname { - printf "\e]1;$1\a" + printf '\e]1;%s\a' "$1" } # Rename window function winname { - printf "\e]2;$1\a" + printf '\e]2;%s\a' "$1" } # PROMPT OUTPUT =============================================================== # Displays the current prompt function prompt_command() { - PS1="\n${icon_start}$(virtualenv_prompt)${icon_user}${bold_green}\u${normal}${icon_host}${bold_cyan}\h${normal}${icon_directory}${bold_purple}\W${normal}\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" on ${icon_branch} \")${white}$(scm_prompt_info)${normal}\n${icon_end}" + PS1="\n${icon_start}$(virtualenv_prompt)${icon_user}${bold_green?}\u${normal?}${icon_host}${bold_cyan?}\h${normal?}${icon_directory}${bold_purple?}\W${normal?}\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" on ${icon_branch} \")${white?}$(scm_prompt_info)${normal?}\n${icon_end}" PS2="${icon_end}" } diff --git a/themes/minimal/minimal.theme.bash b/themes/minimal/minimal.theme.bash index 2bf807c16f..0256ccaf6a 100644 --- a/themes/minimal/minimal.theme.bash +++ b/themes/minimal/minimal.theme.bash @@ -1,12 +1,13 @@ -#!/usr/bin/env bash +# shellcheck shell=bash +# shellcheck disable=SC2034 -SCM_THEME_PROMPT_PREFIX="${cyan}(${green}" -SCM_THEME_PROMPT_SUFFIX="${cyan})" -SCM_THEME_PROMPT_DIRTY=" ${red}✗" -SCM_THEME_PROMPT_CLEAN=" ${green}✓" +SCM_THEME_PROMPT_PREFIX="${cyan?}(${green?}" +SCM_THEME_PROMPT_SUFFIX="${cyan?})" +SCM_THEME_PROMPT_DIRTY=" ${red?}✗" +SCM_THEME_PROMPT_CLEAN=" ${green?}✓" prompt() { - PS1="$(scm_prompt_info)${reset_color} ${cyan}\W${reset_color} " + PS1="$(scm_prompt_info)${reset_color?} ${cyan?}\W${reset_color?} " } safe_append_prompt_command prompt diff --git a/themes/modern-t/modern-t.theme.bash b/themes/modern-t/modern-t.theme.bash index c0a5b556e7..6de2b3c348 100644 --- a/themes/modern-t/modern-t.theme.bash +++ b/themes/modern-t/modern-t.theme.bash @@ -1,3 +1,5 @@ +# shellcheck shell=bash +# shellcheck disable=SC2034 # The "modern-t" theme is a "modern" theme variant with support # for "t", the minimalist python todo list utility by Steve Losh. # Get and install "t" at https://github.com/sjl/t#installing-t @@ -8,11 +10,11 @@ SCM_THEME_PROMPT_PREFIX="" SCM_THEME_PROMPT_SUFFIX="" -SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}" -SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}" -SCM_GIT_CHAR="${bold_green}±${normal}" -SCM_SVN_CHAR="${bold_cyan}⑆${normal}" -SCM_HG_CHAR="${bold_red}☿${normal}" +SCM_THEME_PROMPT_DIRTY=" ${bold_red?}✗${normal?}" +SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓${normal?}" +SCM_GIT_CHAR="${bold_green?}±${normal?}" +SCM_SVN_CHAR="${bold_cyan?}⑆${normal?}" +SCM_HG_CHAR="${bold_red?}☿${normal?}" case $TERM in xterm*) @@ -26,21 +28,22 @@ esac PS3=">> " is_vim_shell() { - if [ ! -z "$VIMRUNTIME" ]; then - echo "[${cyan}vim shell${normal}]" + if [ -n "$VIMRUNTIME" ]; then + echo "[${cyan?}vim shell${normal?}]" fi } prompt() { + local last_status=$? SCM_PROMPT_FORMAT='[%s][%s]' - if [ $? -ne 0 ]; then + if [ $last_status -ne 0 ]; then # Yes, the indenting on these is weird, but it has to be like # this otherwise it won't display properly. - PS1="${TITLEBAR}${bold_red}┌─[${cyan}$(t | wc -l | sed -e's/ *//')${reset_color}]${reset_color}$(scm_prompt)[${cyan}\W${normal}]$(is_vim_shell) -${bold_red}└─▪${normal} " + PS1="${TITLEBAR}${bold_red?}┌─[${cyan?}$(t | wc -l | sed -e's/ *//')${reset_color?}]${reset_color?}$(scm_prompt)[${cyan?}\W${normal?}]$(is_vim_shell) +${bold_red?}└─▪${normal?} " else - PS1="${TITLEBAR}┌─[${cyan}$(t | wc -l | sed -e's/ *//')${reset_color}]$(scm_prompt)[${cyan}\W${normal}]$(is_vim_shell) + PS1="${TITLEBAR}┌─[${cyan?}$(t | wc -l | sed -e's/ *//')${reset_color?}]$(scm_prompt)[${cyan?}\W${normal?}]$(is_vim_shell) └─▪ " fi } From 8c16714fddc2abb16cb8682fa131e9833ae38ebb Mon Sep 17 00:00:00 2001 From: Ira Abramov Date: Tue, 26 Aug 2025 17:30:08 +0300 Subject: [PATCH 5/6] Clean up 5 additional theme files and expand linting coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Fix color variable references using ${var?} pattern for robust error handling • Resolve SC2181 exit code checking and SC2236 style issues in modern-time theme • Remove problematic shebang lines from theme files per bash-it standards • Add themes/modern-time, themes/morris, themes/n0qorg, themes/newin, themes/nwinkler to clean_files.txt • All themes pass shellcheck, shfmt, and bash-it requirements 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- clean_files.txt | 5 +++++ themes/modern-time/modern-time.theme.bash | 25 +++++++++++++---------- themes/morris/morris.theme.bash | 10 +++++---- themes/n0qorg/n0qorg.theme.bash | 11 +++++----- themes/newin/newin.theme.bash | 13 ++++++------ themes/nwinkler/nwinkler.theme.bash | 11 +++++----- 6 files changed, 44 insertions(+), 31 deletions(-) diff --git a/clean_files.txt b/clean_files.txt index 1b256afc05..1c19acbc7c 100644 --- a/clean_files.txt +++ b/clean_files.txt @@ -81,7 +81,12 @@ themes/metal themes/minimal themes/modern themes/modern-t +themes/modern-time +themes/morris +themes/n0qorg +themes/newin themes/norbu +themes/nwinkler themes/oh-my-posh themes/p4helpers.theme.bash themes/pete diff --git a/themes/modern-time/modern-time.theme.bash b/themes/modern-time/modern-time.theme.bash index ceb2f5ede3..0fafaba194 100644 --- a/themes/modern-time/modern-time.theme.bash +++ b/themes/modern-time/modern-time.theme.bash @@ -1,14 +1,16 @@ +# shellcheck shell=bash +# shellcheck disable=SC2034 # Modified version of the original modern theme in bash-it # Removes the battery charge and adds the current time SCM_THEME_PROMPT_PREFIX="" SCM_THEME_PROMPT_SUFFIX="" -SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}" -SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}" -SCM_GIT_CHAR="${bold_green}±${normal}" -SCM_SVN_CHAR="${bold_cyan}⑆${normal}" -SCM_HG_CHAR="${bold_red}☿${normal}" +SCM_THEME_PROMPT_DIRTY=" ${bold_red?}✗${normal?}" +SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓${normal?}" +SCM_GIT_CHAR="${bold_green?}±${normal?}" +SCM_SVN_CHAR="${bold_cyan?}⑆${normal?}" +SCM_HG_CHAR="${bold_red?}☿${normal?}" case $TERM in xterm*) @@ -22,8 +24,8 @@ esac PS3=">> " is_vim_shell() { - if [ ! -z "$VIMRUNTIME" ]; then - echo "[${cyan}vim shell${normal}]" + if [ -n "$VIMRUNTIME" ]; then + echo "[${cyan?}vim shell${normal?}]" fi } @@ -33,14 +35,15 @@ modern_current_time_prompt() { prompt() { SCM_PROMPT_FORMAT='[%s][%s]' - if [ $? -ne 0 ]; then + local last_status=$? + if [ $last_status -ne 0 ]; then # Yes, the indenting on these is weird, but it has to be like # this otherwise it won't display properly. - PS1="${TITLEBAR}${bold_red}┌─${reset_color}$(scm_prompt)$(modern_current_time_prompt)[${cyan}\W${normal}]$(is_vim_shell) -${bold_red}└─▪${normal} " + PS1="${TITLEBAR}${bold_red?}┌─${reset_color?}$(scm_prompt)$(modern_current_time_prompt)[${cyan?}\W${normal?}]$(is_vim_shell) +${bold_red?}└─▪${normal?} " else - PS1="${TITLEBAR}┌─$(scm_prompt)$(modern_current_time_prompt)[${cyan}\W${normal}]$(is_vim_shell) + PS1="${TITLEBAR}┌─$(scm_prompt)$(modern_current_time_prompt)[${cyan?}\W${normal?}]$(is_vim_shell) └─▪ " fi } diff --git a/themes/morris/morris.theme.bash b/themes/morris/morris.theme.bash index 58b1bad816..55cce12f90 100644 --- a/themes/morris/morris.theme.bash +++ b/themes/morris/morris.theme.bash @@ -1,3 +1,5 @@ +# shellcheck shell=bash +# shellcheck disable=SC2034 # prompt theming # added TITLEBAR for updating the tab and window titles with the pwd @@ -18,9 +20,9 @@ function prompt_command() { } # scm theming -SCM_THEME_PROMPT_DIRTY=" ${red}✗" -SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓" -SCM_THEME_PROMPT_PREFIX="${green}(" -SCM_THEME_PROMPT_SUFFIX="${green})${reset_color}" +SCM_THEME_PROMPT_DIRTY=" ${red?}✗" +SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓" +SCM_THEME_PROMPT_PREFIX="${green?}(" +SCM_THEME_PROMPT_SUFFIX="${green?})${reset_color?}" safe_append_prompt_command prompt_command diff --git a/themes/n0qorg/n0qorg.theme.bash b/themes/n0qorg/n0qorg.theme.bash index b82a17f3d4..e81767386b 100644 --- a/themes/n0qorg/n0qorg.theme.bash +++ b/themes/n0qorg/n0qorg.theme.bash @@ -1,4 +1,5 @@ -#!/usr/bin/env bash +# shellcheck shell=bash +# shellcheck disable=SC2034 # n0qorg theme by Florian Baumann ## look-a-like @@ -6,17 +7,17 @@ # for example: # ananas ~/Code/bash-it/themes (master*)» function prompt_command() { - PS1="${bold_blue}[$(hostname)]${normal} \w${normal} ${bold_white}[$(git_prompt_info)]${normal}» " + PS1="${bold_blue?}[$(hostname)]${normal?} \w${normal?} ${bold_white?}[$(git_prompt_info)]${normal?}» " } safe_append_prompt_command prompt_command ## git-theme # feel free to change git chars. -GIT_THEME_PROMPT_DIRTY="${bold_blue}*${bold_white}" +GIT_THEME_PROMPT_DIRTY="${bold_blue?}*${bold_white?}" GIT_THEME_PROMPT_CLEAN="" -GIT_THEME_PROMPT_PREFIX="${bold_blue}(${bold_white}" -GIT_THEME_PROMPT_SUFFIX="${bold_blue})" +GIT_THEME_PROMPT_PREFIX="${bold_blue?}(${bold_white?}" +GIT_THEME_PROMPT_SUFFIX="${bold_blue?})" ## alternate chars # diff --git a/themes/newin/newin.theme.bash b/themes/newin/newin.theme.bash index cabd024fe1..8f9a052389 100644 --- a/themes/newin/newin.theme.bash +++ b/themes/newin/newin.theme.bash @@ -1,13 +1,14 @@ -#!/usr/bin/env bash +# shellcheck shell=bash +# shellcheck disable=SC2034 -SCM_THEME_PROMPT_DIRTY=" ${red}✗" -SCM_THEME_PROMPT_CLEAN=" ${green}✓" -SCM_THEME_PROMPT_PREFIX=" ${purple}|${green} " -SCM_THEME_PROMPT_SUFFIX="${purple} |" +SCM_THEME_PROMPT_DIRTY=" ${red?}✗" +SCM_THEME_PROMPT_CLEAN=" ${green?}✓" +SCM_THEME_PROMPT_PREFIX=" ${purple?}|${green?} " +SCM_THEME_PROMPT_SUFFIX="${purple?} |" prompt() { exit_code=$? - PS1="$(if [[ ${exit_code} = 0 ]]; then echo "${green}${exit_code}"; else echo "${red}${exit_code}"; fi) ${yellow}\t ${cyan}\w$(scm_prompt_info)${reset_color}\n${orange}$ ${reset_color}" + PS1="$(if [[ ${exit_code} = 0 ]]; then echo "${green?}${exit_code}"; else echo "${red?}${exit_code}"; fi) ${yellow?}\t ${cyan?}\w$(scm_prompt_info)${reset_color?}\n${orange?}$ ${reset_color?}" } safe_append_prompt_command prompt diff --git a/themes/nwinkler/nwinkler.theme.bash b/themes/nwinkler/nwinkler.theme.bash index 5bb66aee69..b72c33e180 100644 --- a/themes/nwinkler/nwinkler.theme.bash +++ b/themes/nwinkler/nwinkler.theme.bash @@ -1,4 +1,5 @@ # shellcheck shell=bash +# shellcheck disable=SC2034 # Two line prompt showing the following information: # (time) SCM [username@hostname] pwd (SCM branch SCM status) @@ -15,8 +16,8 @@ # The exit code functionality currently doesn't work if you are using the 'fasd' plugin, # since 'fasd' is messing with the $PROMPT_COMMAND -PROMPT_END_CLEAN="${green}→${reset_color}" -PROMPT_END_DIRTY="${red}→${reset_color}" +PROMPT_END_CLEAN="${green?}→${reset_color?}" +PROMPT_END_DIRTY="${red?}→${reset_color?}" function prompt_end() { echo -e "$PROMPT_END" @@ -31,15 +32,15 @@ prompt_setter() { fi # Save history _save-and-reload-history 1 - PS1="($(clock_prompt)) $(scm_char) [${blue}\u${reset_color}@${green}\H${reset_color}] ${yellow}\w${reset_color}$(scm_prompt_info) ${reset_color}\n$(prompt_end) " + PS1="($(clock_prompt)) $(scm_char) [${blue?}\u${reset_color?}@${green?}\H${reset_color?}] ${yellow?}\w${reset_color?}$(scm_prompt_info) ${reset_color?}\n$(prompt_end) " PS2='> ' PS4='+ ' } safe_append_prompt_command prompt_setter -SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}" -SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}" +SCM_THEME_PROMPT_DIRTY=" ${bold_red?}✗${normal?}" +SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓${normal?}" SCM_THEME_PROMPT_PREFIX=" (" SCM_THEME_PROMPT_SUFFIX=")" RVM_THEME_PROMPT_PREFIX=" (" From 8823ab67303d92a0890f77a52edc4e03253cf50e Mon Sep 17 00:00:00 2001 From: Ira Abramov Date: Tue, 26 Aug 2025 20:32:32 +0300 Subject: [PATCH 6/6] Update themes/modern-t/modern-t.theme.bash Co-authored-by: Koichi Murase --- themes/modern-t/modern-t.theme.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/modern-t/modern-t.theme.bash b/themes/modern-t/modern-t.theme.bash index 6de2b3c348..9051ebcc49 100644 --- a/themes/modern-t/modern-t.theme.bash +++ b/themes/modern-t/modern-t.theme.bash @@ -36,7 +36,7 @@ is_vim_shell() { prompt() { local last_status=$? SCM_PROMPT_FORMAT='[%s][%s]' - if [ $last_status -ne 0 ]; then + if [ "$last_status" -ne 0 ]; then # Yes, the indenting on these is weird, but it has to be like # this otherwise it won't display properly.