SUMMARY Yes, this bug is being initially reported for Dolphin, because even though the problem only shows up in Konqueror the bug seems to be either in the DolphinPart or KParts. When using Konqueror's Tools - Open Terminal action (F4), the terminal shell should start in the directory shown in the file manager. Since https://phabricator.kde.org/D26140 this is not the case, the terminal always starts in $HOME. In DolphinPart::slotOpenTerminal() that change replaced the stat and local file conversion with KParts::ReadOnlyPart::localFilePath(). localFilePath() returns d->m_file, which is never set by any function that DolphinPart calls; it remains as null and so the KToolInvocation::invokeTerminal() always starts in the home directory. DolphinPart::openUrl() calls KParts::ReadOnlyPart::setUrl() with the comment "remember it at the KParts level", but KParts::ReadOnlyPart::setUrl() does not set d->m_file, only KParts::ReadOnlyPart::openUrl() does. Possible solutions that I can think of would be either: (a) Call KParts::ReadOnlyPart::openUrl() instead of setUrl() in DolphinPart::openUrl(). (b) Resolve the local directory in DolphinPart::openUrl(), as was removed by the diff, and pass that to KParts::ReadOnlyPart::setLocalFilePath(). (c) Additionally resolve the local path and set d->m_file in KParts::ReadOnlyPart::setUrl(). The Dolphin application does not use the DolphinPart, hence this problem does not show with its version of Open Terminal (Shift+F4). STEPS TO REPRODUCE 1. From the command linbe, run "konqueror /tmp". 2. Observe that the specificied directory is shown. 3. Press F4 and note that the terminal does not open in /tmp but $HOME.
Shouldn't this be fixed in KParts with ReadOnlyPart::setUrl() not only setting d->m_url but also updating d->m_file in a similar manner as the removed code did?
https://phabricator.kde.org/D27148
(In reply to Jonathan Marten from comment #0) > SUMMARY > > Yes, this bug is being initially reported for Dolphin, because even though > the problem only shows up in Konqueror the bug seems to be either in the > DolphinPart or KParts. > > When using Konqueror's Tools - Open Terminal action (F4), the terminal shell > should start in the directory shown in the file manager. Since > https://phabricator.kde.org/D26140 this is not the case, the terminal always > starts in $HOME. > > In DolphinPart::slotOpenTerminal() that change replaced the stat and local > file conversion with KParts::ReadOnlyPart::localFilePath(). localFilePath() > returns d->m_file, which is never set by any function that DolphinPart > calls; it remains as null and so the KToolInvocation::invokeTerminal() > always starts in the home directory. > > DolphinPart::openUrl() calls KParts::ReadOnlyPart::setUrl() with the comment > "remember it at the KParts level", but KParts::ReadOnlyPart::setUrl() does > not set d->m_file, only KParts::ReadOnlyPart::openUrl() does. > > Possible solutions that I can think of would be either: > > (a) Call KParts::ReadOnlyPart::openUrl() instead of setUrl() in > DolphinPart::openUrl(). This looks like the simpler solution to me. Any volunteer?
https://phabricator.kde.org/D27790
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/151
Fixed with 741072272f5d8b45228a3adc9ccb873abf78f891