Issue #50: CWD with CD pattern - RESOLVED (Already Fixed) #99
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.
🔍 Investigation Summary
After thorough investigation, Issue #50 has already been resolved. The CWD with CD pattern is working correctly in the current codebase.
📋 Issue Analysis
The issue described CWD (Current Working Directory) problems where
cdcommands in shell operator chains likecd /some/directory && pwdwere not maintaining directory context properly.🕐 Timeline Discovery
9255f65"Better cd virtual command support" implemented shell operators support✅ Current Status - All Patterns Work Correctly
1. Basic CD Chain Pattern
2. Separate Commands Pattern
3. Git Scenario (from issue description)
4. Complex Chains
🧪 Verification Tests
Added comprehensive test suite in
tests/cwd-cd-pattern-issue.test.mjscovering:All tests PASS with 100% success rate.
🔧 Technical Implementation
The issue was resolved by the shell operators implementation that:
&&,||,;,()) instead of passing them tosh -cprocess.cwd()()operators📁 Files Added
tests/cwd-cd-pattern-issue.test.mjs- Comprehensive test suite for issue scenariosexamples/test-issue-50-*- Various test scripts demonstrating the fix🎉 Resolution
Issue #50 is RESOLVED. The command-stream library correctly handles all CD patterns mentioned in the issue. The virtual
cdcommand works exactly as expected with shell operators, maintaining directory context across command chains.This PR documents the investigation findings and adds test coverage to ensure the functionality remains working.
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com
Resolves #50