Skip to content

Release 0.6.2 — completion fixes + test coverage#31

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

Release 0.6.2 — completion fixes + test coverage#31
alexzhangs merged 3 commits into
masterfrom
develop

Conversation

@alexzhangs

Copy link
Copy Markdown
Owner

Patch release. Ships three commits off develop:

  • fix: completion garbage and 500ms TAB delay (265774d) — gate xsh help's ANSI formatter on [ -t 1 ] (no more ^[[0m in piped / tab-completion output), and cache the completer's LPUE list (cold ~581 ms → warm ~1 ms).
  • test: expand xsh.sh coverage; scope kcov to the library (fa86229) — ~30 new error/guard-branch tests; library line coverage ~76% → ~90%. Coverage scoped to xsh.sh (install.sh/boot run as child processes kcov can't trace).
  • docs: changelog for 0.6.2 (32c4429).

Full notes: the [0.6.2] section of CHANGELOG.md. Pushing tag 0.6.2 after merge triggers the GitHub release.

alexzhangs and others added 3 commits June 11, 2026 00:21
Two issues reported on bash 3.2 macOS:

1. ANSI suffix in completions, e.g. "x/dotfile/diff^[[0m"
   Root cause: __xsh_help (xsh.sh:705) unconditionally piped through
   awk that wraps every line in \033[1m...\033[0m, regardless of whether
   stdout is a TTY. Pipe consumers — like the completer's awk $2 — got
   garbage. Fix: gate the formatter on [ -t 1 ]; pass through cat otherwise.
   This is the standard Unix-tools convention (don't emit escapes to
   non-TTY). Tested: piped output is clean, terminal output still bolded.

2. ~500ms delay on every TAB press
   Root cause: completer ran 'xsh list "*"' on every TAB, walking every
   loaded library directory. Fix: cache the LPUE list in a shell-global
   var (_XSH_COMPLETE_LPUE_CACHE), populated lazily on first need. Helper
   is called directly (not via $(...)) so the assignment lands in the
   caller's shell rather than a lost subshell.

Empirical: cold 581ms → warm 1ms (500x). Cache survives until manual
unset; documented refresh after xsh load/unload/update is:
  unset _XSH_COMPLETE_LPUE_CACHE

The defensive ANSI-strip sed in the completer is kept even though it's
a no-op once the xsh.sh fix lands, so the completer stays correct during
mixed-version installs / upgrades.

Behavior change (very low impact): tooling that grepped ANSI bold
sequences from piped 'xsh help' output now sees plain text. The old
behavior was a misfeature.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add error/guard-branch tests to spec/xsh_func_spec.sh: null-argument paths,
git-clone/git-force-update option and failure handling, lib-manager and
lib-get-cfg-property errors, __xsh_help_self cache rebuild, scripts-type util
import/exec/unimport, the init runtime decorator, load cleanup-on-link-failure,
and environment guards. Library line coverage rises from ~76% to ~90%.

Scope kcov --include-path to xsh.sh in .shellspec. install.sh and boot run as
child bash processes that kcov's bash tracer cannot instrument, so they always
reported 0% despite spec/install_spec.sh exercising them end-to-end; counting
them understated real coverage. They remain integration-tested, not line-counted.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.78%. Comparing base (52563cf) to head (32c4429).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
xsh.sh 50.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master      #31       +/-   ##
===========================================
+ Coverage   63.29%   89.78%   +26.49%     
===========================================
  Files           3        1        -2     
  Lines         790      666      -124     
===========================================
+ Hits          500      598       +98     
+ Misses        290       68      -222     

☔ 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.

@alexzhangs alexzhangs merged commit 276a8a9 into master Jun 10, 2026
17 of 18 checks passed
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