fix(interpreter): seed cd dash from OLDPWD exec option#292
Open
skovranek wants to merge 1 commit into
Open
Conversation
|
@skovranek is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
cramforce
approved these changes
Jul 12, 2026
Contributor
|
Please sign your commit |
Author
@cramforce Thank you, it's verified now. I hadn't added the key to GH for signing so it couldn't verify the sig. Ref for others: |
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
previousDirfromOLDPWDwhen callers pass an env snapshot intoexec()cd -across isolatedexec()calls using persistedcwdandenvWhy
exec()supports per-callcwdandenv, which lets callers preserve shell state between isolated executions.cdupdatesOLDPWDin the returned env, butcd -reads the interpreter's internalpreviousDirstate instead.That means a caller can pass the returned
PWDandOLDPWDinto the nextexec()call and still get stalecd -behavior.Verification
pnpm --filter just-bash test:run src/Bash.exec-options.test.ts src/interpreter/builtins/cd.test.tspnpm --filter just-bash test:run src/spec-tests/bash/spec.test.ts -t 'cd - without OLDPWD'pnpm lintpnpm knippnpm --filter just-bash typecheckpnpm --filter just-bash build