From: Andrey Yashkin Date: Sun, 28 Jul 2019 16:26:36 +0000 (+0200) Subject: Fix dir change when show hidden terminal panel with running program in it X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/8bed4c25ee42056174519b45b899dddfce24a0e9 Fix dir change when show hidden terminal panel with running program in it Summary: Terminal panel doesn't change its working directory, while any procces is running in it. However, if you hide it and show again the program will get a string with a //cd path// command. Test Plan: 1. Open dolphin 2. Press F4 3. Start any process like gnu nano 4. Press F4 two more times Reviewers: #dolphin Subscribers: anthonyfieroni, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D22422 --- diff --git a/src/panels/terminal/terminalpanel.cpp b/src/panels/terminal/terminalpanel.cpp index 8dedd0be1..52d2a77df 100644 --- a/src/panels/terminal/terminalpanel.cpp +++ b/src/panels/terminal/terminalpanel.cpp @@ -177,7 +177,9 @@ void TerminalPanel::showEvent(QShowEvent* event) } if (m_terminal) { m_terminal->showShellInDir(url().toLocalFile()); - changeDir(url()); + if(!hasProgramRunning()) { + changeDir(url()); + } m_terminalWidget->setFocus(); connect(m_konsolePart, SIGNAL(currentDirectoryChanged(QString)), this, SLOT(slotKonsolePartCurrentDirectoryChanged(QString)));