Skip to content

Release 0.6.1 — bash completion fix for stock macOS bash 3.2#29

Merged
alexzhangs merged 2 commits into
masterfrom
develop
Jun 10, 2026
Merged

Release 0.6.1 — bash completion fix for stock macOS bash 3.2#29
alexzhangs merged 2 commits into
masterfrom
develop

Conversation

@alexzhangs

Copy link
Copy Markdown
Owner

Summary

Patch release fixing the 0.6.0 tab-completion regression on stock macOS bash 3.2.

What's in 0.6.1

Fixed

  • Bash tab-completion now works on stock macOS bash 3.2 without requiring bash-completion. The 0.6.0 script depended on _init_completion from bash-completion@2 which silently bails on bash 3.2. Now ships a self-contained fallback shim, guarded so a real bash-completion load (now or later) still wins.
  • .xshrc auto-sources the completion file — no need to touch ~/.bash_profile or /etc/bash_completion.d/.

Removed

  • install.sh no longer copies to /etc/bash_completion.d/ (redundant after .xshrc auto-source; was a no-op on macOS anyway).

Changed

  • Test correction (spec: correct __xsh_get_util_by_path selector test #26): the __xsh_get_util_by_path Pending test in 0.6.0 was based on a wrong assumption about selector encoding. xsh-lib/core uses plain-numeric filenames inside util directories (e.g. string/repeat/{1..8}.sh), not basename prefixes like 2-upper.sh. Existing implementation was correct; test replaced with a passing assertion of the real convention.

Why MINOR doesn't bump

Per SemVer pre-1.0: bug fixes → PATCH. No API changes, no removed features (just CI/installer cleanup).

Test plan

  • All 4 matrix entries green (verified locally and on the feature PR)
  • After merge: tag 0.6.1release.yml auto-creates GitHub release from CHANGELOG.md
  • On install: stock macOS bash 3.2 users get working tab-completion via bash install.sh -f -s (or xsh upgrade)

🤖 Generated with Claude Code

alexzhangs and others added 2 commits June 10, 2026 23:19
Stock macOS /bin/bash is 3.2.57. bash-completion@2 requires bash 4+ and
silently bails on 3.2, so completions/xsh.bash's first line — _init_completion
|| return — exited silently and tab-completion did nothing. Three coordinated
changes make tab-completion work out of the box on stock macOS:

1. completions/xsh.bash: define a minimal _init_completion shim if not
   already present. Guarded so a real bash-completion load (now or later)
   wins. Defensive cword<=0 guard matches real _init_completion semantics
   and avoids bash 3.2's bad-array-subscript error on COMP_WORDS[-1].

2. .xshrc: auto-source the completion file. Reaches every bash user without
   requiring them to edit ~/.bash_profile or rely on /etc/bash_completion.d
   discovery (which doesn't exist on stock macOS).

3. install.sh: drop the now-redundant /etc/bash_completion.d/xsh copy. It
   was a no-op on macOS (no such dir) and double-sourced on Linux once
   .xshrc auto-source landed.

Verified on /bin/bash 3.2.57 with no bash-completion installed: 19 built-in
completions + 'xsh load <TAB>' → 3 known public libs. Also verified that
a pre-existing _init_completion is preserved (the shim doesn't override).

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Fixes the 0.6.0 tab-completion regression on stock macOS bash 3.2
(no bash-completion package required) and notes the spec correction
from PR #26.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@alexzhangs alexzhangs merged commit ae70418 into master Jun 10, 2026
8 checks passed
@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.29%. Comparing base (e5df7b1) to head (52563cf).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #29      +/-   ##
==========================================
+ Coverage   63.13%   63.29%   +0.15%     
==========================================
  Files           3        3              
  Lines         792      790       -2     
==========================================
  Hits          500      500              
+ Misses        292      290       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant