-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
🐛 Bug Description
Using `cd` command patterns with command-stream fails to maintain the changed directory context, or the current working directory (CWD) behavior is inconsistent.
🔴 Impact
- Directory navigation doesn't work as expected
- Scripts that depend on `cd` fail
- Build processes that change directories break
📝 Problem Details
```javascript
// ❌ Doesn't maintain directory change
await $`cd /some/directory`;
await $`pwd`; // Still in original directory
// Each command runs in a new shell context
```
🔧 Workaround
Chain commands in single execution:
```javascript
// ✅ Commands in same shell context
await $`cd /some/directory && pwd`;
// Or use Node.js process.chdir()
process.chdir('/some/directory');
```
🎯 Root Cause
Each command-stream invocation creates a new shell, losing directory context between commands.
🔗 References
Metadata
Metadata
Assignees
Labels
No labels