summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin T. H. Sandsmark <[email protected]>2018-04-07 11:32:23 -0400
committerKurt Hindenburg <[email protected]>2018-04-07 20:49:11 -0400
commita02fcaa475324e80f726144c605295aa1e7a112b (patch)
tree49cd5870102adc2fff6a51a4703fda0ca756bf0e
parent6aad0aa4c66ff38c31a344736f6e0efceff7298d (diff)
Remove ESC sequences from pastes in bracketed mode
Due to copy/paste exploits detailed in below links, remove all \033 from paste in bracketed mode. See https://phabricator.kde.org/D11859 See https://bugs.kde.org/show_bug.cgi?id=392554 (cherry picked from commit 0b482990279d6684089a404df7473f0354c284c3)
-rw-r--r--src/TerminalDisplay.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp
index 82163be..4f91763 100644
--- a/src/TerminalDisplay.cpp
+++ b/src/TerminalDisplay.cpp
@@ -3165,6 +3165,7 @@ void TerminalDisplay::doPaste(QString text, bool appendReturn)
if (!text.isEmpty()) {
text.replace(QLatin1Char('\n'), QLatin1Char('\r'));
if (bracketedPasteMode()) {
+ text.remove(QLatin1String("\033"));
text.prepend(QLatin1String("\033[200~"));
text.append(QLatin1String("\033[201~"));
}