Skip to content

Glob after quoted parameter prefix is not expanded in for list #15

Closed

Description

@caomengxuan666

While wiring the Oh My Winuxsh framework loader, I hit a Bash-compatible glob expansion gap in rubash/Winuxsh.

Repro

From the Winuxsh repo with a current debug binary:

./target/debug/winuxsh.exe -c 'X=C:/Users/caomengxuan/repo/oh-my-winuxsh; for p in "$X"/lib/*.winux; do printf "<%s>\n" "$p"; done'

Actual

<C:/Users/caomengxuan/repo/oh-my-winuxsh/lib/*.winux>

The glob remains literal when the path is built from a parameter expansion plus a glob suffix.

Expected

Bash expands the unquoted glob part even when the directory prefix comes from a quoted parameter expansion. The same command shape should iterate over the matching files:

<C:/Users/caomengxuan/repo/oh-my-winuxsh/lib/git.winux>
<C:/Users/caomengxuan/repo/oh-my-winuxsh/lib/hooks.winux>
<C:/Users/caomengxuan/repo/oh-my-winuxsh/lib/prompt.winux>

A fully literal path with the same glob does expand in Winuxsh:

./target/debug/winuxsh.exe -c 'for p in C:/Users/caomengxuan/repo/oh-my-winuxsh/lib/*.winux; do printf "<%s>\n" "$p"; done'

That produces the three expected files.

Why this matters

This is a common framework-loader pattern:

for file in "$PLUGIN_ROOT"/lib/*.winux; do
  [ -f "$file" ] && . "$file"
done

Without this expansion behavior, Oh My-style loaders need hardcoded source lists or unsafe/unquoted paths. This blocks a clean directory-first plugin framework for Winuxsh.

Activity

  1. added a commit that references this issue on Aug 2, 2026
    6887ef1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions