mirror of
https://github.com/nix-community/nix-on-droid-app.git
synced 2025-11-08 11:36:11 +01:00
Replace CRLF with CR as well.
This should replace both \r\n and \n with \r now. "\r?\n" matches 0 or 1 \r and one \n, which should capture both escape sequences.
This commit is contained in:
parent
be6a73d862
commit
ec1087d56f
1 changed files with 2 additions and 2 deletions
|
|
@ -2338,8 +2338,8 @@ 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: Replace all newlines (\n) with carriage returns (\r).
|
||||
text = text.replace('\n', '\r');
|
||||
// Second: Replace all newlines (\n) or CRLF (\r\n) with carriage returns (\r).
|
||||
text = text.replaceAll("\r?\n", "\r");
|
||||
|
||||
// Then: Implement bracketed paste mode if enabled:
|
||||
boolean bracketed = isDecsetInternalBitSet(DECSET_BIT_BRACKETED_PASTE_MODE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue