mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-19 16:31:21 +00:00
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
This commit is contained in:
parent
9444f01a5c
commit
a57925a23d
|
@ -121,12 +121,11 @@ void TerminalPanel::sendCdToTerminal(const QString& dir)
|
||||||
// The TerminalV2 interface does not provide a way to delete the
|
// The TerminalV2 interface does not provide a way to delete the
|
||||||
// current line before sending a new input. This is mandatory,
|
// current line before sending a new input. This is mandatory,
|
||||||
// otherwise sending a 'cd x' to a existing 'rm -rf *' might
|
// otherwise sending a 'cd x' to a existing 'rm -rf *' might
|
||||||
// result in data loss. As workaround backspaces are send...
|
// result in data loss. As workaround Ctrl+C is send.
|
||||||
QString clearLine;
|
QString cancel;
|
||||||
for (int i = 0; i < 256; ++i) {
|
cancel.append(QChar(3));
|
||||||
clearLine.append(QChar(8));
|
cancel.append(QChar('c'));
|
||||||
}
|
m_terminal->sendInput(cancel);
|
||||||
m_terminal->sendInput(clearLine);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_terminal->sendInput("cd " + KShell::quoteArg(dir) + '\n');
|
m_terminal->sendInput("cd " + KShell::quoteArg(dir) + '\n');
|
||||||
|
|
Loading…
Reference in a new issue