diff options
| author | Felix Ernst <[email protected]> | 2022-04-27 13:08:09 +0200 |
|---|---|---|
| committer | Felix Ernst <[email protected]> | 2022-04-27 13:08:09 +0200 |
| commit | f08a8dd06b5658a4b62fa3a1550ef39fec722a7e (patch) | |
| tree | ed4aff3d15d5bd17f788091fbbfed3b499d0b75a | |
| parent | 8076b54a2ce8c1253385c9ee3f24938bdbf4773c (diff) | |
| parent | e70e12e3bdf3ce4e9cca4c8f003655ea10b21d7e (diff) | |
Merge branch 'release/22.04'
| -rw-r--r-- | src/panels/terminal/terminalpanel.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/panels/terminal/terminalpanel.cpp b/src/panels/terminal/terminalpanel.cpp index 75bfe93d0..d87ae3b1e 100644 --- a/src/panels/terminal/terminalpanel.cpp +++ b/src/panels/terminal/terminalpanel.cpp @@ -234,7 +234,9 @@ void TerminalPanel::changeDir(const QUrl& url) void TerminalPanel::sendCdToTerminal(const QString& dir, HistoryPolicy addToHistory) { - if (dir == m_konsolePartCurrentDirectory) { + if (dir == m_konsolePartCurrentDirectory // We are already there + && m_sendCdToTerminalHistory.isEmpty() // …and that is not because the terminal couldn't keep up + ) { m_clearTerminal = false; return; } @@ -252,8 +254,6 @@ void TerminalPanel::sendCdToTerminal(const QString& dir, HistoryPolicy addToHist } #endif - m_terminal->sendInput(" cd " + KShell::quoteArg(dir) + '\n'); - // We want to ignore the currentDirectoryChanged(QString) signal, which we will receive after // the directory change, because this directory change is not caused by a "cd" command that the // user entered in the panel. Therefore, we have to remember 'dir'. Note that it could also be @@ -261,6 +261,8 @@ void TerminalPanel::sendCdToTerminal(const QString& dir, HistoryPolicy addToHist if (addToHistory == HistoryPolicy::AddToHistory) m_sendCdToTerminalHistory.enqueue(QDir(dir).canonicalPath()); + m_terminal->sendInput(" cd " + KShell::quoteArg(dir) + '\n'); + if (m_clearTerminal) { m_terminal->sendInput(QStringLiteral(" clear\n")); m_clearTerminal = false; |
