Skip to content

Feature/winux shell integrationfix(repl): make cd and drive switching persistent in interactive mode - #31

Merged
caomengxuan666 merged 5 commits into
unixwin:mainfrom
arookieofc:feature/winux-shell-integration
Mar 18, 2026
Merged

caomengxuan666 merged 5 commits into
unixwin:mainfrom
arookieofc:feature/winux-shell-integration

Conversation

@arookieofc

Copy link
Copy Markdown
Member

Summary
This PR fixes a REPL bug where cd and drive switching commands appeared to run but did not change the winuxcmd prompt/current directory.

Root Cause
In interactive mode, unknown/native commands were executed through a child cmd.exe fallback.
Commands like cd D: or d: changed directory only inside the child process, not in the winuxcmd parent process.

What Changed
Added REPL built-in handling for:
cd
chdir
drive switch syntax like D:
Directory changes are now applied in the current winuxcmd process using SetCurrentDirectoryW.
Kept native fallback path for other non-built-in commands unchanged.
Behavior After Fix
cd D:\ updates prompt/cwd immediately.
D: switches drive in-place.
cd .. works as expected in REPL.
cd with no args prints current directory.
Validation
Built with MSVC successfully.
Verified interactive scenarios:
cd D:
d:
cd ..
Prompt now reflects actual cwd changes instead of staying on previous path.
Files
src/Main/main.cpp

@caomengxuan666
caomengxuan666 merged commit 604c503 into unixwin:main Mar 18, 2026
4 checks passed
caomengxuan666 added a commit that referenced this pull request Mar 24, 2026
…l-integration

Feature/winux shell integrationfix(repl): make cd and drive switching persistent in interactive mode
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.

2 participants