KDE Version: 4.14.3 Reproducible: Always Steps to Reproduce: 1. run konsole 2. run mc in konsole 3. navigate to a directory 4. open a new tab Actual Results: The new tab opens in the user's home directory. Expected Results: The new tab opens in the directory where the user navigated in mc. I investigated the problem - I think. At the moment I am using the following versions of konsole: konsole-4.14.3-1.fc20.x86_64.rpm konsole-part-4.14.3-1.fc20.x86_64.rpm So I returned back to the last working previous version, which are: konsole-4.14.2-1.fc20.x86_64.rpm konsole-part-4.14.2-1.fc20.x86_64.rpm And now everything works perfectly. So I downloaded konsole-4.14.3 and konsole-4.14.2 from here (http://download.kde.org/stable/4.14.3/src/konsole-4.14.3.tar.xz) and here (http://download.kde.org/stable/4.14.2/src/konsole-4.14.2.tar.xz) I did a directory comparison in Meld, and I found some changes in src/Session.cpp --- konsole-4.14.2/konsole-4.14.2/src/Session.cpp +++ konsole-4.14.3/konsole-4.14.3/src/Session.cpp @@ -289,15 +289,15 @@ } ProcessInfo* Session::updateWorkingDirectory() { - ProcessInfo* process = getProcessInfo(); - - const QString currentDir = process->validCurrentDir(); + updateSessionProcessInfo(); + + const QString currentDir = _sessionProcessInfo->validCurrentDir(); if (currentDir != _currentWorkingDir) { _currentWorkingDir = currentDir; emit currentDirectoryChanged(_currentWorkingDir); } - return process; + return 0; // not used - for BIC in KDE 4.14.x } QList<TerminalDisplay*> Session::views() const @@ -989,7 +989,8 @@ QString Session::getDynamicTitle() { // update current directory from process - ProcessInfo* process = updateWorkingDirectory(); + updateWorkingDirectory(); + ProcessInfo* process = getProcessInfo(); // format tab titles using process info bool ok = false; I think the problem lies on that line where the null reference is returned.
Even though the null reference does not exist any more, I can still reproduce this bug. SYSTEMINFO: Konsole 18.08.2 KDE Plasma 5.14.1 KDE Neon Developer Edition (Stable)
3.5 years after the original report, I'm not sure the proposed patch (adjusting the way Konsole digs under /proc to figure out the tree of descendants, which may happen to break who knows what else) takes the right approach. Konsole already supports OSC 7 for setting its belief about the working directory. In my opinion Midnight Commander should use this, that is, https://midnight-commander.org/ticket/3088 should be completed and submitted to mc.
After further investigation, I agree with Egmont. It does not make sense to implement a workaround for a specific app when the app does already have a patch ready to go which also makes it work better with other terminal emulators. Please comment on https://midnight-commander.org/ticket/3088 to push their patch forward. Thanks!