malxau / yori

Yori is a CMD replacement shell that supports backquotes, job control, and improves tab completion, file matching, aliases, command history, and more.
http://www.malsmith.net/yori/
MIT License
1.24k stars 31 forks source link

Running a .bat script to change the directory does not change the directory #89

Closed Beliavsky closed 3 years ago

Beliavsky commented 3 years ago

If I have a script foo.bat with contents "cd c:\foo", running that script within yori does not change the directory. In CMD it does.

ghost commented 3 years ago

Duplicate of #51 If you want to change directory via scripts in Yori, just rename it to .ys1 so it is executed by Yori, not CMD

malxau commented 3 years ago

In #51 , I said that fixing this may be possible but hadn't looked into it. It looks like somebody else described how this can work at https://stackoverflow.com/questions/14018280/how-to-get-a-process-working-dir-on-windows which is almost exactly how Yori is currently getting the environment block from CMD processes, so I should just be able to extend this logic to the current directory as well. If two people have hit this, it seems likely to keep causing problems for other people too.

malxau commented 3 years ago

This should be fixed in 1.50, released today. Please let me know if there are further related issues.