Repository navigation
Closed
Labels
Description
Summary
Explore a PowerShell integration mode that borrows the PSReadLine rewrite + .cmd wrapper idea used by microsoft/coreutils, while keeping WinuxCmd's command-internal glob expansion as the single place where wildcard expansion happens.
Motivation
PowerShell aliases such as ls, cat, and rm can shadow WinuxCmd commands. Today WinuxCmd supports explicit activation/deactivation, but PowerShell's native argument passing can still make quoted glob patterns hard to preserve correctly.
microsoft/coreutils avoids PowerShell function wrappers and instead rewrites interactive input through PSReadLine, then invokes .cmd entry points so PowerShell uses legacy native argument passing. This is worth studying for WinuxCmd.
Design direction
- Use PSReadLine only for interactive PowerShell rewriting.
- Avoid PowerShell function wrappers for command execution, especially for commands that need byte-preserving pipelines.
- Consider
.cmdentry points for PowerShell to preserve quote/glob boundaries better. - Keep WinuxCmd's internal
glob_expandlogic. Windows shells do not provide POSIX-style glob expansion, so directwinuxcmd rm *.txt, CMD usage, and AI sandbox usage still need command-side glob handling. - Ensure wildcard expansion happens only once: the shell hook should preserve or mark quote state, not expand globs itself.
Non-goals
- Do not remove command-internal glob expansion.
- Do not make PowerShell integration mandatory.
- Do not replace the existing explicit
winux activate/winux deactivatemodel without a migration path.
Open questions
- Can the PSReadLine hook preserve enough quote metadata for WinuxCmd to distinguish quoted
"*.txt"from unquoted*.txt? - Should this be an opt-in mode separate from current activation?
- Should
.cmdwrappers call individual hardlinks or dispatch throughwinuxcmd.exe <command>? - How should this interact with Windows PowerShell 5.1, where PSReadLine and native argument passing differ from PowerShell 7?
Activity
arookieofc commentedon Jun 18, 2026
I think we need discuss about this and AI sandbox, maybe we need a tool using winuxsh rather than pwsh?
based on microsoft/coreutils#138
perhaps we can only use a small REPL? and when use winuxsh we deactivate it and in cmd/pwsh activate it
winuxcmd is a coreutils not a shell some conditions not the responsibility of it. A little patch can we accept,but not huge