Skip to content

Conversation

seefood
Copy link
Contributor

@seefood seefood commented Oct 13, 2025

Summary

Adds an early version check to the pack plugin to prevent it from loading on bash versions older than 3.3.

Changes

  • Added bash version check at the beginning of pack.plugin.bash
  • Calls _disable-plugin pack before returning if bash < 3.3
  • Prevents errors from associative array usage on incompatible bash versions

Test plan

  • ✅ Pre-commit hooks pass
  • ✅ Shellcheck passes
  • ✅ Code follows existing patterns in the codebase

Context

The pack plugin uses associative arrays (declare -A on lines 574-575) which require bash 4.0+, but had inline version checks on lines 162 and 230 checking for bash > 3. This early check prevents the plugin from loading at all on incompatible versions, providing a cleaner user experience.

Related to bash version compatibility improvements across the codebase.

🤖 Generated with Claude Code

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 <[email protected]>
@seefood seefood mentioned this pull request Oct 13, 2025
8 tasks
Ira Abramov and others added 2 commits October 13, 2025 10:39
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 <[email protected]>
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 <[email protected]>
Copy link
Contributor

@akinomyoga akinomyoga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for the changes in history-eternal and percol. See #2354 (comment) for the changes in pack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants