From bbe51fc2fdd61c4b6e3577185a94ab7182252999 Mon Sep 17 00:00:00 2001 From: Ira Abramov Date: Mon, 13 Oct 2025 10:32:40 +0300 Subject: [PATCH 1/7] Add bash 3.3+ version check to pack plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pack plugin uses associative arrays (declare -A) which require bash 4.0+, but has existing checks for bash > 3 on lines 162 and 230. Add early version check to disable and return if bash < 3.3. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- plugins/available/pack.plugin.bash | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/available/pack.plugin.bash b/plugins/available/pack.plugin.bash index 13b72c00e7..cfad308f41 100644 --- a/plugins/available/pack.plugin.bash +++ b/plugins/available/pack.plugin.bash @@ -1,6 +1,13 @@ # shellcheck shell=bash # bash completion for pack -*- shell-script -*- +# Requires bash 3.3+ for associative arrays +# Skip loading if bash version is too old +if [[ -n "${BASH_VERSINFO[0]}" ]] && [[ "${BASH_VERSINFO[0]}" -eq 3 ]] && [[ "${BASH_VERSINFO[1]}" -lt 3 ]]; then + _disable-plugin pack + return 0 +fi + cite about-plugin about-plugin 'CNB pack cli aliases' From ae4577ff88d70cfcc8fe63688a7cd1d6c00c7459 Mon Sep 17 00:00:00 2001 From: Ira Abramov Date: Mon, 13 Oct 2025 10:39:40 +0300 Subject: [PATCH 2/7] Add plugin disable calls to version checks in history-eternal and percol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both plugins already had bash version checks with early returns, but didn't explicitly disable themselves. Now they call _disable-plugin before returning to ensure consistent plugin state. - history-eternal: requires bash 4.3+ for unlimited history - percol: requires bash 4.0+ for bind -x functionality 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- plugins/available/history-eternal.plugin.bash | 1 + plugins/available/percol.plugin.bash | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/available/history-eternal.plugin.bash b/plugins/available/history-eternal.plugin.bash index 26bea839e4..0fc1dc268e 100644 --- a/plugins/available/history-eternal.plugin.bash +++ b/plugins/available/history-eternal.plugin.bash @@ -3,6 +3,7 @@ about-plugin 'eternal bash history' if [[ ${BASH_VERSINFO[0]} -lt 4 ]] || [[ ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 3 ]]; then _log_warning "Bash version 4.3 introduced the 'unlimited' history size capability." + _disable-plugin history-eternal return 1 fi diff --git a/plugins/available/percol.plugin.bash b/plugins/available/percol.plugin.bash index 027dfdc4af..f0d26536b4 100644 --- a/plugins/available/percol.plugin.bash +++ b/plugins/available/percol.plugin.bash @@ -18,6 +18,7 @@ _command_exists percol || return if [[ ${BASH_VERSINFO[0]} -lt 4 ]]; then _log_warning "You have to upgrade Bash to Bash v4.x to use the 'percol' plugin." _log_warning "Your current Bash version is $BASH_VERSION." + _disable-plugin percol return fi From 0c0b49b2471e81ce62730db9ee63f92cb73d80bd Mon Sep 17 00:00:00 2001 From: Ira Abramov Date: Mon, 13 Oct 2025 10:40:56 +0300 Subject: [PATCH 3/7] Standardize return codes and log messages for version checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed both plugins to return 0 instead of 1/nothing and added consistent log messages explaining why the plugin is being disabled: - history-eternal: return 0 with "Disabling history-eternal plugin" message - percol: return 0 with "Disabling percol plugin" message This provides clearer feedback to users and consistent exit codes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- plugins/available/history-eternal.plugin.bash | 3 ++- plugins/available/percol.plugin.bash | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/available/history-eternal.plugin.bash b/plugins/available/history-eternal.plugin.bash index 0fc1dc268e..3b95cac606 100644 --- a/plugins/available/history-eternal.plugin.bash +++ b/plugins/available/history-eternal.plugin.bash @@ -3,8 +3,9 @@ about-plugin 'eternal bash history' if [[ ${BASH_VERSINFO[0]} -lt 4 ]] || [[ ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 3 ]]; then _log_warning "Bash version 4.3 introduced the 'unlimited' history size capability." + _log_warning "Disabling history-eternal plugin (current version: $BASH_VERSION)" _disable-plugin history-eternal - return 1 + return 0 fi # Modify history sizes before changing location to avoid unintentionally diff --git a/plugins/available/percol.plugin.bash b/plugins/available/percol.plugin.bash index f0d26536b4..b873aede6e 100644 --- a/plugins/available/percol.plugin.bash +++ b/plugins/available/percol.plugin.bash @@ -17,9 +17,9 @@ _command_exists percol || return if [[ ${BASH_VERSINFO[0]} -lt 4 ]]; then _log_warning "You have to upgrade Bash to Bash v4.x to use the 'percol' plugin." - _log_warning "Your current Bash version is $BASH_VERSION." + _log_warning "Disabling percol plugin (current version: $BASH_VERSION)" _disable-plugin percol - return + return 0 fi function _replace_by_history() { From 67c871339c0dab4a6c5d4ede416c19378e898aaf Mon Sep 17 00:00:00 2001 From: Ira Abramov Date: Tue, 14 Oct 2025 11:46:58 +0300 Subject: [PATCH 4/7] add version checks on install and init --- bash_it.sh | 9 ++++++++- install.sh | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/bash_it.sh b/bash_it.sh index 19a26ed965..7d73d810f4 100755 --- a/bash_it.sh +++ b/bash_it.sh @@ -1,7 +1,14 @@ #!/usr/bin/env bash # shellcheck source-path=SCRIPTDIR/lib source-path=SCRIPTDIR/scripts # shellcheck disable=SC2034 -# + +# Requires bash 3.2+ to install and run +# Skip loading if bash version is too old +if [[ -n "${BASH_VERSINFO[0]}" ]] && [[ "${BASH_VERSINFO[0]}" -eq 3 ]] && [[ "${BASH_VERSINFO[1]}" -lt 2 ]]; then + echo "sorry, but the minimum version of BASH supported by bash_it is 3.2, consider upgrading?" >&2 + return 1 +fi + # Initialize Bash It BASH_IT_LOG_PREFIX="core: main: " : "${BASH_IT:=${BASH_SOURCE%/*}}" diff --git a/install.sh b/install.sh index a99993e4ef..44ab9d60a4 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,13 @@ #!/usr/bin/env bash # bash-it installer +# Requires bash 3.2+ to install and run +# Skip loading if bash version is too old +if [[ -n "${BASH_VERSINFO[0]}" ]] && [[ "${BASH_VERSINFO[0]}" -eq 3 ]] && [[ "${BASH_VERSINFO[1]}" -lt 2 ]]; then + echo "sorry, but the minimum version of BASH supported by bash_it is 3.2, consider upgrading?" >&2 + return 1 +fi + # Show how to use this installer function _bash-it-install-help() { echo -e "\n$0 : Install bash-it" From 6b2382b106073644ad21dc8086a570f734fb68ac Mon Sep 17 00:00:00 2001 From: Ira Abramov Date: Tue, 14 Oct 2025 14:54:04 +0300 Subject: [PATCH 5/7] Update bash_it.sh Co-authored-by: Koichi Murase --- bash_it.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash_it.sh b/bash_it.sh index 7d73d810f4..3a42c8244c 100755 --- a/bash_it.sh +++ b/bash_it.sh @@ -4,7 +4,7 @@ # Requires bash 3.2+ to install and run # Skip loading if bash version is too old -if [[ -n "${BASH_VERSINFO[0]}" ]] && [[ "${BASH_VERSINFO[0]}" -eq 3 ]] && [[ "${BASH_VERSINFO[1]}" -lt 2 ]]; then +if [[ "${BASH_VERSINFO[0]-}" -lt 3 || "${BASH_VERSINFO[0]-}" -eq 3 && "${BASH_VERSINFO[1]}" -lt 2 ]]; then echo "sorry, but the minimum version of BASH supported by bash_it is 3.2, consider upgrading?" >&2 return 1 fi From 45ac89205b30e34a52e1d9521df60e5ac5382b7a Mon Sep 17 00:00:00 2001 From: Ira Abramov Date: Tue, 14 Oct 2025 14:58:12 +0300 Subject: [PATCH 6/7] By the Book --- bash_it.sh | 2 +- install.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bash_it.sh b/bash_it.sh index 3a42c8244c..ae98c1fcb4 100755 --- a/bash_it.sh +++ b/bash_it.sh @@ -4,7 +4,7 @@ # Requires bash 3.2+ to install and run # Skip loading if bash version is too old -if [[ "${BASH_VERSINFO[0]-}" -lt 3 || "${BASH_VERSINFO[0]-}" -eq 3 && "${BASH_VERSINFO[1]}" -lt 2 ]]; then +if [[ "${BASH_VERSINFO[0]-}" -lt 3 ]] || [[ "${BASH_VERSINFO[0]-}" -eq 3 && "${BASH_VERSINFO[1]}" -lt 2 ]]; then echo "sorry, but the minimum version of BASH supported by bash_it is 3.2, consider upgrading?" >&2 return 1 fi diff --git a/install.sh b/install.sh index 44ab9d60a4..2732b10aa2 100755 --- a/install.sh +++ b/install.sh @@ -3,7 +3,7 @@ # Requires bash 3.2+ to install and run # Skip loading if bash version is too old -if [[ -n "${BASH_VERSINFO[0]}" ]] && [[ "${BASH_VERSINFO[0]}" -eq 3 ]] && [[ "${BASH_VERSINFO[1]}" -lt 2 ]]; then +if [[ "${BASH_VERSINFO[0]-}" -lt 3 ]] || [[ "${BASH_VERSINFO[0]-}" -eq 3 && "${BASH_VERSINFO[1]}" -lt 2 ]]; then echo "sorry, but the minimum version of BASH supported by bash_it is 3.2, consider upgrading?" >&2 return 1 fi From f3e0e756a9672c03e90dfb026e5313186b40b8a3 Mon Sep 17 00:00:00 2001 From: Ira Abramov Date: Tue, 14 Oct 2025 18:08:31 +0300 Subject: [PATCH 7/7] correct version check --- plugins/available/pack.plugin.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/available/pack.plugin.bash b/plugins/available/pack.plugin.bash index cfad308f41..85d119186b 100644 --- a/plugins/available/pack.plugin.bash +++ b/plugins/available/pack.plugin.bash @@ -1,9 +1,9 @@ # shellcheck shell=bash # bash completion for pack -*- shell-script -*- -# Requires bash 3.3+ for associative arrays +# Requires bash 4+ for associative arrays # Skip loading if bash version is too old -if [[ -n "${BASH_VERSINFO[0]}" ]] && [[ "${BASH_VERSINFO[0]}" -eq 3 ]] && [[ "${BASH_VERSINFO[1]}" -lt 3 ]]; then +if [[ "${BASH_VERSINFO[0]}" -lt 4 ]]; then _disable-plugin pack return 0 fi