Skip to content

Commit c162565

Browse files
Changed: Increase OCS 52 buffer limit to 100KB for text to set to clipboard
1 parent 5743c5d commit c162565

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

terminal-emulator/src/main/java/com/termux/terminal/TerminalEmulator.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2694,6 +2694,14 @@ void setOscTypeVariables() {
26942694
Integer terminalControlArgsCapacity = null;
26952695
Integer terminalControlArgsMaxLength = null;
26962696
switch (mOscType) {
2697+
case 52:
2698+
// Android has a `~100KB` limit for sharing/sending `UTF-16` encoded `String`
2699+
// with binder tranasactions, including clipboard, otherwise can result in a
2700+
// `TransactionTooLargeException`.
2701+
// - https://www.reddit.com/r/tasker/comments/prro8t/autoshare_crashed_when_i_pasted_the_file_path/
2702+
terminalControlArgsMaxLength = (100 * 1024) +
2703+
/* `52;Pc;` */ 10;
2704+
break;
26972705
case 1337: // iTerm image command sends the base64 encoded image, do not run complex logic for each byte.
26982706
mIsFastPathOsc = true;
26992707
mIgnoreCrLfForOsc = true;

0 commit comments

Comments
 (0)