Repository navigation
Feature/winux shell integrationfix(repl): make cd and drive switching persistent in interactive mode - #31
Merged
caomengxuan666 merged 5 commits intoMar 18, 2026
Conversation
…tensions, and update README docs for GIF/demo + config
…cursor movement, and robust Ctrl+C handling
…o feature/winux-shell-integration
…ersist in winuxcmd
caomengxuan666
approved these changes
Mar 18, 2026
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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