Repository navigation
While starting nu, force PWD to be current working directory - #5751
Merged
Merged
Conversation
kubouch
reviewed
Jun 10, 2022
kubouch
reviewed
Jun 10, 2022
Contributor
|
are we ready to land this? |
Contributor
Author
|
I think it's better to see if @kubouch has more comment for it :) |
Contributor
|
Looks good @WindSoilder. Have you verified it solves the issue with the tmux not changing PWD? (I don't know how we could add a test for that...) |
Contributor
Author
|
yeah, I've tested the following commands mentioned in the issue:
But I can't reproduce the issue inside |
Contributor
|
nice! let's try it out. thanks! |
fennewald
pushed a commit
to fennewald/nushell
that referenced
this pull request
Jun 27, 2022
…#5751) * fix current working directory during start * fix tests * always set PWD to current_dir
2 tasks done
1 task
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.
Description
Fixes: #5050
I don't change
merge_delta()because it seems hard to change, especially we have some overlays and some stacks.Instead, The issue seems only happens during start
nu, so maybe it's just enough to changegather_parent_env_varsfunction.The reason to use
init_cwd:While gathering parent env vars, the parent
PWDmay not be the same ascurrent working directory.Consider to the following command as the case (assume we execute command inside
/tmp):Here nu execute external command
tmux, and tmux starts a newnushell, withinit_cwdvalue "#{pane_current_path}".But at the same time
PWDstill remains to be/tmp.In this scenario, the new
nushell's PWD should be "#{pane_current_path}" rather init_cwd.Tests
Make sure you've run and fixed any issues with these commands:
cargo fmt --all -- --checkto check standard code formatting (cargo fmt --allapplies these changes)cargo clippy --workspace --features=extra -- -D warnings -D clippy::unwrap_used -A clippy::needless_collectto check that you're using the standard code stylecargo test --workspace --features=extrato check that all the tests pass