Closed naclander closed 5 years ago
me too~*;
Same here, also JVM binary + Linux.
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
?
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.
Java 11 for me. Thanks for taking a look!
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
@dundalek Thanks! Looks like that fixed the issue for me.
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.