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 doesn't change directory #144

Closed
naclander opened this issue May 30, 2019 · 7 comments
Closed

cd doesn't change directory #144

naclander opened this issue May 30, 2019 · 7 comments
Labels

Comments

@naclander
Copy link

I am running the release JVM binary under Linux and using the cd command doesn't actually seem to be changing directories.

Digging a little deeper it seems that https://github.com/dundalek/closh/blob/master/src/jvm/closh/zero/platform/process.clj#L30 doesn't actually permanently change the user.dir value.

@PlumpMath
Copy link

me too~*;

@eggsyntax
Copy link

Same here, also JVM binary + Linux.

@naclander
Copy link
Author

I was also doing some reading about user.dir, I'm still not familiar with the inner workings of closh, but would a global variable that represents the cwd work, instead of saving it in user.dir?

@dundalek
Copy link
Owner

Sorry for the delayed response, I was on a vacation and then was busy with other work. That is strange, I run Linux and cd works for me. I am running Java 8, what version are you running?

I believe user.dir is also used when spawning processes or IO, but if it is causing trouble we might wanna change it to keep cwd explicitly. More issues around CWD are appearing, I will try to get a deeper look on a weekend.

I just tried it under Java 11 to confirm it and indeed cd does not work anymore.

@eggsyntax
Copy link

Java 11 for me. Thanks for taking a look!

@dundalek dundalek added the bug label Jun 29, 2019
@dundalek
Copy link
Owner

Fixed in master.

There are couple of small items I would like to tackle before I will push a release. In the meantime you can use manual build.

Interesting background on how this issue came to be:
https://bugs.openjdk.java.net/browse/JDK-8194154
https://bugs.openjdk.java.net/browse/JDK-8202127

@naclander
Copy link
Author

@dundalek Thanks! Looks like that fixed the issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants