The KPart-terminal that is brought up with F4 in Dolphin should stay in sync with folder changes in Dolphin I think. Sometimes when changing folders however, the terminal session keeps the old working directory. I could not find a way to reliably reproduce this, it just happens sometimes, and sometimes it doesn't. Bringin up the F4 terminal and changing around folders for a while will sooner or later show the bug however.
It's definitely supposed to, and generally does. Unfortunately, without a way to reproduce the issue, there's no way to debug your issue. If you do manage to find a reliable set of Steps To Reproduce, please feel free to re-open the bug and add them here. See https://community.kde.org/Get_Involved/Bug_Reporting#Steps_to_Reproduce
I can confirm it still happens on 18.04.0 Steps to reproduce: 1. open Dolphin 2. click on folder 3. press enter to open it 4. press backspace to leave 5. do steps 3 and 4 repeatedly 6. sooner or later, the folder change won't happen in the embedded terminal anymore
step 1.5, open Terminal with F4
The issue still persists with Applications 18.08.1 When changing folders with the builtin F4-terminal and Enter/Backspace keys as described above, it syncs the folder change *if* I enter/leave the folder only once a second, it starts bugging out when I do it faster. Maybe this means there is a race condition somewhere?
This bug has a side effect that regularly happens to me and has been annoying me for years: When I leave a directory, let's call it "dir", but the working directory of the shell does not change and I then delete the directory, that will be interpreted as a directory change to "dir (deleted)" in the terminal and that will sync, so the directory view navigates to "dir (deleted)" showing no contents and an error message that the directory does not exist. I am not sure how I manage to trigger this as often as I do, but I assume it is because I probably often have the directory and its parent directory both open in a split view and then at some point while working in the parent directory when I want to delete the directory I quickly change to its view to close it and that makes the shell go in there, but the closing follows too quickly to make it leave again. I took some time to debug this issue and it seems to occur because there is a significant (about 0.5 to 1 s on my system I would guess) delay between the call to `sendCdToTerminal` that sends the cd command to the shell and the execution of the slot `slotKonsolePartCurrentDirectoryChanged` which is caused by the shell changing its directory (all references are to src/panels/terminal/terminalpanel.cpp of the code currently on the git master branch). This can at least partially be fixed by not doing the check for `dir == m_konsolePartCurrentDirectory` at the beginning of `sendCdToTerminal` and instead always sending the cd command because `m_konsolePartCurrentDirectory` is incorrect if the slot has not yet been executed after the previous call. However, as far as I can tell, when quickly navigating between directories how often and when exactly the slot is called is somewhat unreliable and with this change only, some entries might be left in `m_sendCdToTerminalHistory`. If you then change to one of those directories in the terminal, the directory view does not follow. It would be quite nice if someone could at least fix this sufficiently that what I described in the first paragraph does not happen any more, but I can not see an easy way to make it work correctly under all circumstances right now. (But I also have absolutely no experience working on dolphin or any KDE software for that matter.) Also, it seems to me that bug 421337 is a duplicate of this bug and possibly bug 416690 as well, although I am not so sure about that one.
I was affeted by this bug a few minutes ago on Arch Linux running Dolphin 21.12 beta. Operating System: Arch Linux KDE Plasma Version: 5.23.3 KDE Frameworks Version: 5.88.0 Qt Version: 5.15.2 Graphics Platform: Wayland
*** Bug 449650 has been marked as a duplicate of this bug. ***
*** Bug 452788 has been marked as a duplicate of this bug. ***
I opened a merge request: https://invent.kde.org/system/dolphin/-/merge_requests/382
Git commit e70e12e3bdf3ce4e9cca4c8f003655ea10b21d7e by Felix Ernst. Committed on 27/04/2022 at 10:40. Pushed by felixernst into branch 'release/22.04'. Fix terminal panel not keeping up with dir changes The terminal panel is supposed to show the same location as the currently active Dolphin view at all times. However there was an issue when the terminal is supposed to quickly switch to a new location and then back again to the old one. The terminal ignored the switch to the old location unless it had already fully switched to the new location. Because it isn't particularly fast at fully switching to the new location, it would never do the expected thing of switching back to the old location. This commit makes it so the switch to the old location is only ignored if there are no in-progress switches to a different location. Related: bug 416690 FIXED-IN: 22.04.2 Not totally sure if this fixes everything but it seems like an improvement. M +5 -3 src/panels/terminal/terminalpanel.cpp https://invent.kde.org/system/dolphin/commit/e70e12e3bdf3ce4e9cca4c8f003655ea10b21d7e