Skip to content

feat: zsh support — test suite + bash/zsh CI - #1

Merged
alexzhangs merged 3 commits into
mainfrom
feature/zsh-support
Jun 14, 2026
Merged

feat: zsh support — test suite + bash/zsh CI#1
alexzhangs merged 3 commits into
mainfrom
feature/zsh-support

Conversation

@alexzhangs

Copy link
Copy Markdown
Contributor

Makes shadowsocks zsh-ready. The utilities are already zsh-compatible under xsh's ksh emulation (no ${!var}/FUNCNAME/read-array/special-var-local constructs; the getopts loop reads only OPTARG; the /json/parser call is $()-isolated). This adds the missing test suite + bash/zsh CI to prove it.

  • New test.sh: import-smoke + functional assertions for config (plugin/plugin_opts rewrite incl. tls variant, missing-file error). Self-sources ~/.xshrc to run under either shell.
  • New CI: os × {bash, zsh} matrix; loads xsh-lib/core then this lib.

Verified under zsh 5.9 + macOS bash 3.2.57. Requires xsh >= 0.7.0 for zsh. 🤖 Generated with Claude Code

alexzhangs and others added 3 commits June 14, 2026 18:23
The utilities are already zsh-compatible (xsh runs them under ksh emulation):
config.sh's getopts loop only reads OPTARG with no nested getopts-util call,
its /json/parser call is captured in $(), and there are no ${!var}/FUNCNAME/
read-array/special-var-local constructs. This change adds what was missing —
tests and CI — to prove and keep it that way.

- New test.sh: import-smokes the function utilities, then asserts
  ss/libev/plugin/v2ray/config rewrites a config to add the v2ray-plugin
  plugin/plugin_opts keys (incl. the -n/-c/-k tls variant) and errors on a
  missing config. Self-sources ~/.xshrc so it runs under bash or zsh.
- New CI: os × {bash, zsh} matrix; loads xsh-lib/core then this library.

Verified under zsh 5.9 and macOS bash 3.2.57. Requires xsh >= 0.7.0 for zsh.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mirror alexzhangs/xsh's CI matrix: bash 3.2 (macOS), 4.4 (rockylinux:8),
5.x (Linux + Homebrew macOS), zsh 5.x (macOS + Linux).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A scalar starting with a double quote (`run: "$SHELL_PATH" ...`) is parsed
by YAML as a quoted string with trailing junk, so the workflow failed to parse
(0 jobs ran). Use a block scalar.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alexzhangs
alexzhangs merged commit 585c40b into main Jun 14, 2026
6 checks passed
@alexzhangs
alexzhangs deleted the feature/zsh-support branch June 14, 2026 11:10
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