┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2010-03-22 18:28:16 +0000
committerPeter Penz <[email protected]>2010-03-22 18:28:16 +0000
commita57925a23df92e7e41877778756f98ee4aae5766 (patch)
tree0a9b06ec052a4ddf55895f28877e2c0b3d155564
parent9444f01a5ca25980664748bab03e66169e045907 (diff)
Send CTRL+C to the terminal instead of of backspaces. Thanks to the FiNeX and g111 for the hint.
CCBUG: 161637 svn path=/trunk/KDE/kdebase/apps/; revision=1106403
-rw-r--r--src/panels/terminal/terminalpanel.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/panels/terminal/terminalpanel.cpp b/src/panels/terminal/terminalpanel.cpp
index 856eed4c0..d6b370329 100644
--- a/src/panels/terminal/terminalpanel.cpp
+++ b/src/panels/terminal/terminalpanel.cpp
@@ -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');