fix: explicitly replace linefeeds

This commit is contained in:
imkiva
2018-07-31 22:20:12 +08:00
parent 76154efd35
commit 247087c5fe
2 changed files with 4 additions and 1 deletions

View File

@ -2474,6 +2474,9 @@ public final class TerminalEmulator {
public void paste(String text) {
// First: Always remove escape key and C1 control characters [0x80,0x9F]:
text = text.replaceAll("(\u001B|[\u0080-\u009F])", "");
// Second: Convert DOS (\r\n) CRLF newlines and linefeeds (\n) into carriage returns (\r==13).
text = text.replaceAll("\r?\n", "\r");
// Then: Implement bracketed paste mode if enabled:
boolean bracketed = isDecsetInternalBitSet(DECSET_BIT_BRACKETED_PASTE_MODE);
if (bracketed) mSession.write("\033[200~");

View File

@ -54,7 +54,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.android.tools.build:gradle:3.1.2'
classpath rootProject.ext.deps["kotlin-gradle-plugin"]
// NOTE: Do not place your application dependencies here; they belong