Re: [hackers] [st][patch] Increase the buffer size for escape sequences

2018-09-24 Thread Ingo Heimbach
I have recognized that a buffer size of 128*4 bytes is quite small to store 
base64 encoded clipboard content (see OSC52), especially when copying multiple 
code lines in a terminal editor like vim. 1048576 is 1 mega of 4 byte UTF-8 
characters. It is quite big but I simply chose a value that should even be big 
enough for very large text copy operations. Other values are also OK. The point 
is that 128*4 bytes are too small for the escape sequence buffer (in my 
opinion).

Best regards,
Ingo 

Am 24. September 2018 17:05:41 MESZ schrieb Laslo Hunhold :
>On Mon, 24 Sep 2018 15:52:41 +0100
>"Roberto E. Vargas Caballero"  wrote:
>
>Dear Roberto,
>
>> I would say, why 1048576 and not 1000? or 1?.
>> Is there a specific reason?
>
>1048576 is 2^20, so it's not completely arbitrary, though the point
>really stands as to why there's such a huge jump in size. Can you give
>a little information about that, Ingo?
>
>With best regards
>
>Laslo
>
>-- 
>Laslo Hunhold 


Re: [hackers] [st][patch] Increase the buffer size for escape sequences

2018-09-23 Thread Ingo Heimbach
What is incorrect? 

Am 23. September 2018 14:12:23 MESZ schrieb Hiltjo Posthuma 
:
>On Sun, Sep 23, 2018 at 12:12:27PM +0200, Ingo Heimbach wrote:
>> Before this commit, long escape sequences (e.g. OSC 52) could be
>trimmed
>> due to a quite small escape sequence buffer. This commit increases
>the
>> escape sequence buffer from 128 to 1048576 UTF-8 characters.
>> ---
>>  st.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/st.c b/st.c
>> index 46c954b..e9d4536 100644
>> --- a/st.c
>> +++ b/st.c
>> @@ -31,7 +31,7 @@
>>  /* Arbitrary sizes */
>>  #define UTF_INVALID   0xFFFD
>>  #define UTF_SIZ   4
>> -#define ESC_BUF_SIZ   (128*UTF_SIZ)
>> +#define ESC_BUF_SIZ   (1048576*UTF_SIZ)
>>  #define ESC_ARG_SIZ   16
>>  #define STR_BUF_SIZ   ESC_BUF_SIZ
>>  #define STR_ARG_SIZ   ESC_ARG_SIZ
>> -- 
>> 2.19.0
>> 
>> 
>
>This is incorrect.
>
>-- 
>Kind regards,
>Hiltjo


[hackers] [st][patch] Increase the buffer size for escape sequences

2018-09-23 Thread Ingo Heimbach

Before this commit, long escape sequences (e.g. OSC 52) could be trimmed
due to a quite small escape sequence buffer. This commit increases the
escape sequence buffer from 128 to 1048576 UTF-8 characters.
---
 st.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/st.c b/st.c
index 46c954b..e9d4536 100644
--- a/st.c
+++ b/st.c
@@ -31,7 +31,7 @@
 /* Arbitrary sizes */
 #define UTF_INVALID   0xFFFD
 #define UTF_SIZ   4
-#define ESC_BUF_SIZ   (128*UTF_SIZ)
+#define ESC_BUF_SIZ   (1048576*UTF_SIZ)
 #define ESC_ARG_SIZ   16
 #define STR_BUF_SIZ   ESC_BUF_SIZ
 #define STR_ARG_SIZ   ESC_ARG_SIZ
--
2.19.0