codeapp icon indicating copy to clipboard operation
codeapp copied to clipboard

(Improvement) Terminal pwd does not change upon open folder

Open thxrben opened this issue 3 years ago • 4 comments

While it may be useful, to have the terminal stay where it was before, I would at least like to have the option to change the terminal-directory upon opening or changing the workspace.

I would add a switch in the settings to allow „Automatically switch terminal working directory“ when opening a folder.

thxrben avatar Jan 17 '22 22:01 thxrben

This is probably a regression. I'll see what caused it.

bummoblizard avatar Jan 18 '22 02:01 bummoblizard

I actually can't reproduce this issue on my device. Which device are you using and what is the iOS version of it?

bummoblizard avatar Jan 19 '22 03:01 bummoblizard

Well, as it seems it does "change" it, but upon running clang++ it went back to the previous folder. image

As you can see, the folder is called "Test" and while the Terminal has been changed to the Test folder, and after running the command it changed to the previous one. I can only assume that any command will invoke this behaviour.

thxrben avatar Jan 21 '22 13:01 thxrben

I have tested it again, and it seems like it reverts to whatever last project folder is, or in which folder the last successfull executed command was. (no error return value)

This is a video demonstrating the point further:

https://user-images.githubusercontent.com/46635221/164999699-edf1f799-3738-4717-8012-43c093674727.MOV

I think it matters that the clang command failed, otherwise It would stay in the directory of the project. After running help, it reverted back upon a error code:

2878EC8C-3DB8-45D6-9732-52DFBCEBC487

EDIT:

I also uses ls for showing files. The Terminal actually is in the project directory, it really switches and is not just a visual bug or similar when seeing the project names folder inside the terminal. You can interact with the project folder in any way possible.

thxrben avatar Apr 24 '22 22:04 thxrben