]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Send CTRL+C to the terminal instead of of backspaces. Thanks to the FiNeX and g111...
authorPeter Penz <peter.penz19@gmail.com>
Mon, 22 Mar 2010 18:28:16 +0000 (18:28 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Mon, 22 Mar 2010 18:28:16 +0000 (18:28 +0000)
CCBUG: 161637

svn path=/trunk/KDE/kdebase/apps/; revision=1106403

src/panels/terminal/terminalpanel.cpp

index 856eed4c0fdbfce6a435a0108eb41578992b6549..d6b3703293b5fb328edde02766d1e51bbbc133a7 100644 (file)
@@ -121,12 +121,11 @@ void TerminalPanel::sendCdToTerminal(const QString& dir)
         // The TerminalV2 interface does not provide a way to delete the
         // current line before sending a new input. This is mandatory,
         // otherwise sending a 'cd x' to a existing 'rm -rf *' might
-        // result in data loss. As workaround backspaces are send...
-        QString clearLine;
-        for (int i = 0; i < 256; ++i) {
-            clearLine.append(QChar(8));
-        }
-        m_terminal->sendInput(clearLine);
+        // result in data loss. As workaround Ctrl+C is send.
+        QString cancel;
+        cancel.append(QChar(3));
+        cancel.append(QChar('c'));
+        m_terminal->sendInput(cancel);
     }
 
     m_terminal->sendInput("cd " + KShell::quoteArg(dir) + '\n');