Skip to content

Commit 247087c

Browse files
committed
fix: explicitly replace linefeeds
1 parent 76154ef commit 247087c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

app/src/main/java/io/neoterm/backend/TerminalEmulator.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2474,6 +2474,9 @@ private void setTitle(String newTitle) {
24742474
public void paste(String text) {
24752475
// First: Always remove escape key and C1 control characters [0x80,0x9F]:
24762476
text = text.replaceAll("(\u001B|[\u0080-\u009F])", "");
2477+
// Second: Convert DOS (\r\n) CRLF newlines and linefeeds (\n) into carriage returns (\r==13).
2478+
text = text.replaceAll("\r?\n", "\r");
2479+
24772480
// Then: Implement bracketed paste mode if enabled:
24782481
boolean bracketed = isDecsetInternalBitSet(DECSET_BIT_BRACKETED_PASTE_MODE);
24792482
if (bracketed) mSession.write("\033[200~");

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ buildscript {
5454
google()
5555
}
5656
dependencies {
57-
classpath 'com.android.tools.build:gradle:3.1.0'
57+
classpath 'com.android.tools.build:gradle:3.1.2'
5858
classpath rootProject.ext.deps["kotlin-gradle-plugin"]
5959

6060
// NOTE: Do not place your application dependencies here; they belong

0 commit comments

Comments
 (0)