Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cd . changes path #2432

Closed
VincentWo opened this issue Aug 27, 2020 · 3 comments
Closed

cd . changes path #2432

VincentWo opened this issue Aug 27, 2020 · 3 comments

Comments

@VincentWo
Copy link
Contributor

@VincentWo VincentWo commented Aug 27, 2020

Describe the bug
With the default prompt the command cd . changes the path (appends a '.'), this stacks and doesn't go away when changing paths.
To Reproduce
Steps to reproduce the behavior:

  1. Go to random directory
  2. Type cd . once or more
  3. Observe the prompt changing

Expected behavior
The prompt shouldn't change when one does cd .

Configuration (please complete the following information):

  • OS (e.g. Windows): (Arch)Linux
  • Nu version (you can use the version command to find out): 0.17.0
  • Optional features (if any): None
@VincentWo
Copy link
Contributor Author

@VincentWo VincentWo commented Aug 27, 2020

I would also be open to try to fix this issue myself, if somebody could give me a general direction where the error could have originated (and if you think this is easy enough for a novice rusteacan.

@dmeijboom
Copy link
Contributor

@dmeijboom dmeijboom commented Aug 27, 2020

@VincentWo I believe you can add this behaviour in crates/nu-cli/src/shell/help_shell.rs:175 and crates/nu-cli/src/shell/value_shell.rs:146 because it seems like that's where the actual code for the cd builtin is being executed. I'm also quite new to this codebase but it might be an option to move some of the behaviour (how to deal with . and .. for example) outside of those files as it should be the same for other builtins as well.

@dmeijboom
Copy link
Contributor

@dmeijboom dmeijboom commented Aug 29, 2020

@VincentWo Please let me know if you have sufficient information to go for a PR. If not I can make a PR to fix this.

jonathandturner pushed a commit that referenced this issue Aug 30, 2020
Doing 'cd .' or an equal command used to modify the prompt: It appended an './' and was even
repeatable, leading to strange prompts (believe me, I tested it for too long).

This fixes #2432
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.