[dev] [st][PATCH] Cancel DCS with SUB, CAN, ESC or any CC1 code

2014-04-25 Thread Roberto E. Vargas Caballero
>From http://www.vt100.net/docs/vt510-rm/chapter4: *The VT510 ignores all following characters until it receives a SUB, ST, or any other C1 control character. So OSC, PM and APC sequence ends with a SUB (it cancels the sequence and show a question mark as error), ST or any anothe

Re: [dev] [st patch queue 12/12] Do not eat ESC character if control string is not properly terminated.

2014-04-25 Thread Roberto E. Vargas Caballero
Well you fixed a bug, but not all the bugs relatd to control strings. After your patch a control string ends with a '\a' or a ESC \\, but if you read [1]: *The VT510 ignores all following characters until it receives a SUB, ST, or any other C1 control character. So OSC, PM and AP

Re: [dev]

2014-04-25 Thread Yuri Karaban
> "CL" == 20h <2...@r-36.net> writes: Thank you very much! From your previous post I thought you will never accept it. I was thinking about stopping using st. But now I got motivation to continue use st and contribute :-) CL>> I applied your patch with an extension. Now st has a Б─░i f

Re: [dev] [st PATCH] X geometry changes

2014-04-25 Thread Yuri Karaban
> "CL" == Christoph Lohmann <2...@r-36.net> writes: CL>> Suckless is writing software for dwm. A specified geometry is CL>> fixed. Otherwise st is not floating by default when forcing a CL>> size. If st was designed only to support tiling window managers then I guess I made a wro

[dev]

2014-04-25 Thread 20h
User-Agent: rohrpost MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit From: Christoph Lohmann <2...@r-36.net> To: dev mail list Subject: Re: [dev] [st PATCH] Honor X geometry specifications X-PGP-Key: http://r-36.net/about/20h.asc Greetings. On Fri,

Re: [dev] [st PATCH] X geometry changes

2014-04-25 Thread Amadeus Folego
> So if bloat is our problem, let's remove all geometry handling code. But the geom setting would still be useful for handling the floating and non tiled wms cases.

Re: [dev] [st PATCH] X geometry changes

2014-04-25 Thread Amadeus Folego
So if bloat is our problem, let's remove all geometry handling code.

Re: [dev] [st PATCH] X geometry changes

2014-04-25 Thread Amadeus Folego
> Well, then geometry is useless in dwm and it would be removed from st. > Just bloat from a distant era. > Exactly, what does specifying geometry means on a tiling window manager when the window is not floating? If you want a tile to have a certain size on your WM you should specify this on y

Re: [dev] [st PATCH] X geometry changes

2014-04-25 Thread FRIGN
On Fri, 25 Apr 2014 17:21:54 -0300 Amadeus Folego wrote: > If you want a tile to have a certain size on your WM you should specify > this on your WM, not on the program. At least, that's what would make > sense for me. Exactly! > The geometry (as specified by rows and columns) would still be us

Re: [dev] [st PATCH] X geometry changes

2014-04-25 Thread Christoph Lohmann
Greetings. On Fri, 25 Apr 2014 21:44:35 +0200 Amadeus Folego wrote: > I don't usually have problems with the geometry specified by > rows and columns, it would be nice if we could retain this behaviour > from the patch. > > [...] > > If you are specifying geometry, you should be prepared to hand

Re: [dev] [st PATCH] X geometry changes

2014-04-25 Thread Amadeus Folego
I don't usually have problems with the geometry specified by rows and columns, it would be nice if we could retain this behaviour from the patch. Even though X11 may have introduced a lot of bad stuff, this one makes sense and simplifies a lot of code and logic. If you are specifying geometry, yo

Re: [dev] [st PATCH] X geometry changes

2014-04-25 Thread Christoph Lohmann
Greetings. On Fri, 25 Apr 2014 21:16:50 +0200 suckl...@dev97.com wrote: > From: Yuri Karaban > > Hello, > > Currently st does not follow X geometry specification. Implementation > is incomplete and partially broken: > > - There is calculation of offset parameters, but these parameters are >

[dev] [st PATCH] Honor X geometry specifications

2014-04-25 Thread suckless
From: Yuri Karaban - Interpret width and height as rows and columns (common behavior for X applications with resize increment hints set) - Obey the offset parameters --- st.c | 98 ++-- 1 file changed, 38 insertions(+), 60 deleti

[dev] [st PATCH] X geometry changes

2014-04-25 Thread suckless
From: Yuri Karaban Hello, Currently st does not follow X geometry specification. Implementation is incomplete and partially broken: - There is calculation of offset parameters, but these parameters are never saved in window manager hints. Therefore setting offsets has no effect. - Instead

Re: [dev] [st patch queue 11/12] Fix for multibyte characters in techo.

2014-04-25 Thread Roberto E. Vargas Caballero
Applied to, thanks!!! -- Roberto E. Vargas Caballero

Re: [dev] [st patch queue 10/12] s/DSC/DCS/ DCS stands for DEVICE CONTROL STRING

2014-04-25 Thread Roberto E. Vargas Caballero
> - case 'P': /* DSC -- Device Control String */ > + case 'P': /* DCS -- Device Control String */ I begin to think that you have a very good eyes, because we didn't realise this stupid typo. Thanks!!! -- Roberto E. Vargas Caballero

Re: [dev] [st patch queue 08/12] Use xwrite instead of write.

2014-04-25 Thread Roberto E. Vargas Caballero
It makes sense, so I will apply it. Regards, -- Roberto E. Vargas Caballero

Re: [dev] [st patch queue 07/12] Remove unnecessary break;s

2014-04-25 Thread Roberto E. Vargas Caballero
> although a break statement in the last case is unnecessary, I think it should > be > left there. If someone appends a new case, he could forget to break this one > and > get an unwanted fallthrough. The style in st.c is not consistent, there are > multiple places without the break in the last c

Re: [dev] [st patch queue 05/12] Consistent FALLTHROUGH comments.

2014-04-25 Thread Roberto E. Vargas Caballero
It is true that it is ugly to have different styles in fall through, but it is also true that we have a lot of fall through where we don't put any comment. Put a comment in all these places is a very bad idea, but I think maybe there are more places where we should put a comment. I agree with you t

Re: [dev] [st patch queue 07/12] Remove unnecessary break;s

2014-04-25 Thread Markus Teich
noname wrote: > @@ -1897,7 +1896,6 @@ tsetmode(bool priv, bool set, int *args, int narg) { > fprintf(stderr, > "erresc: unknown set/reset mode %d\n", > *args); > - b

Re: [dev] [st patch queue 06/12] Avoid integer overflow in dump().

2014-04-25 Thread Roberto E. Vargas Caballero
> @@ -1234,8 +1234,10 @@ dump(char c) { > static int col; > > fprintf(stderr, " %02x '%c' ", c, isprint(c)?c:'.'); > - if(++col % 10 == 0) > + if(++col == 10) { > fprintf(stderr, "\n"); > + col = 0; > + } > } dump is not used in any place. It is

Re: [dev] [st patch queue 04/12] Comment fix.

2014-04-25 Thread Roberto E. Vargas Caballero
> - * As seen in selcopy: > + * As seen in getsel: Good catch, I'll apply it. Regards, -- Roberto E. Vargas Caballero

Re: [dev] [st patch queue 01/12] Simplify tsetscroll.

2014-04-25 Thread Roberto E. Vargas Caballero
This patch is duplicated. I usually wait some days before of applying a patch, so if someone has something to say he can do it. If you see that in a longer time there is no reply for your patch, please send a ping. Due to the repetion I have to verify that the patches are identical and they are no

Re: [dev] [st] [PATCH] On terminal resize, clear the alt screen with its own cursor.

2014-04-25 Thread Roberto E. Vargas Caballero
> Currently the alternate screen get messed up on resize if it has > different colors or mode. Good catch, I'll apply it. Regards, -- Roberto E. Vargas Caballero

Re: [dev] [st PATCH 4/4] Optimize tputtab.

2014-04-25 Thread Roberto E. Vargas Caballero
> Before this patch executing > printf '\e[100I' > or > printf '\e[100Z' > resulted in long delay. I don't mind this delay, because it is a uncommon case, but code feels better with this patch (the while in the switch was a bit ugly), so I will apply it to. Regards, -

Re: [dev] [st PATCH 3/4] Use != instead of ^ for logical values.

2014-04-25 Thread Roberto E. Vargas Caballero
> - if(sel.alt ^ IS_SET(MODE_ALTSCREEN)) > + if(sel.alt != IS_SET(MODE_ALTSCREEN)) This bit logical operation comes from another age when IS_SET had not a comparision operator. It does not make sense anymore, so this change is good. Regards, -- Roberto E. Vargas Caballero

Re: [dev] [st PATCH 2/4] Use BETWEEN macro in xsetcolorname and fix style.

2014-04-25 Thread Roberto E. Vargas Caballero
Hi, It makes sense with the rest of the code, so I'll apply it. Regards, -- Roberto E. Vargas Caballero

[dev] [st][PATCH] Simplify a bit more tdeletechar and tinsertblank

2014-04-25 Thread Roberto E. Vargas Caballero
The large and repeated expression used in memmove to indirect the line can be simplified using a pointer, that makes more clear where begins and where ends the movement. --- st.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/st.c b/st.c index 263abaa..e468d73 10064

Re: [dev] [st PATCH 1/4] Simplify tsetscroll.

2014-04-25 Thread Roberto E. Vargas Caballero
Applied, thanks! -- Roberto E. Vargas Caballero

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-25 Thread Roberto E. Vargas Caballero
> We can modify it as follows: > if(BETWEEN(c, 0x00, 0x1f) || c == 0x7f) { /* control code */ I like this solution because make explicit what we want to do. With the u suffix is a bit obscure and can generate some errors. > I also thought about using incntrl(). It should work the same way

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-25 Thread Christoph Lohmann
Greetings. On Fri, 25 Apr 2014 16:51:15 +0200 "Roberto E. Vargas Caballero" wrote: > Hi, > > > We use ‐Wall to show all warnings. If the compiler complains, fix the > > warning. Easy. At least this keeps the code to a certain style. St was > > The problem is Wall change from one system to

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-25 Thread Roberto E. Vargas Caballero
Hi, > We use ‐Wall to show all warnings. If the compiler complains, fix the > warning. Easy. At least this keeps the code to a certain style. St was The problem is Wall change from one system to another (this is something OpenBSD users know with strcpy calls...), and it doesn't force how to

[dev] [st patch queue 08/12] Use xwrite instead of write.

2014-04-25 Thread noname
--- st.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/st.c b/st.c index 061dafd..e4df18f 100644 --- a/st.c +++ b/st.c @@ -450,7 +450,7 @@ static char utf8encodebyte(long, size_t); static size_t utf8len(char *); static size_t utf8validate(long *, size_t); -static ss

[dev] [st patch queue 09/12] Simplify tdeletechar and tinsertblank and fix memory corruption.

2014-04-25 Thread noname
Removed special handling of corner case. Current CSI parsing code uses strtol to parse arguments and allows them to be negative. Negative argument is not properly handled in tdeletechar and tinsertblank and results in memory corruption in memmove. Reproduce with printf '\e[-500@' --- st.c | 26 +

[dev] [st patch queue 11/12] Fix for multibyte characters in techo.

2014-04-25 Thread noname
Works for both signed and unsigned char. --- st.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/st.c b/st.c index 22ce4fb..cb95b8c 100644 --- a/st.c +++ b/st.c @@ -2292,7 +2292,7 @@ techo(char *buf, int len) { for(; len > 0; buf++, len--) { char c = *b

[dev] [st patch queue 12/12] Do not eat ESC character if control string is not properly terminated.

2014-04-25 Thread noname
Currently tputc handles the case of too long control string waiting for the end of control string. Another case is when there is ESC character is encountered but is not followed by '\\'. In this case st stops processing control string, but ESC character is ignored. After this patch st processes

[dev] [st patch queue 10/12] s/DSC/DCS/ DCS stands for DEVICE CONTROL STRING

2014-04-25 Thread noname
--- st.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/st.c b/st.c index 5477c81..22ce4fb 100644 --- a/st.c +++ b/st.c @@ -149,7 +149,7 @@ enum charset { enum escape_state { ESC_START = 1, ESC_CSI= 2, - ESC_STR= 4, /* DSC, OSC,

[dev] [st patch queue 05/12] Consistent FALLTHROUGH comments.

2014-04-25 Thread noname
--- st.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/st.c b/st.c index fd342aa..dae23c5 100644 --- a/st.c +++ b/st.c @@ -1839,7 +1839,7 @@ tsetmode(bool priv, bool set, int *args, int narg) { if (!allowaltscreen)

[dev] [st patch queue 06/12] Avoid integer overflow in dump().

2014-04-25 Thread noname
--- st.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/st.c b/st.c index dae23c5..9de7f81 100644 --- a/st.c +++ b/st.c @@ -1234,8 +1234,10 @@ dump(char c) { static int col; fprintf(stderr, " %02x '%c' ", c, isprint(c)?c:'.'); - if(++col % 10 == 0) +

[dev] [st patch queue 04/12] Comment fix.

2014-04-25 Thread noname
--- st.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/st.c b/st.c index 083d1c1..fd342aa 100644 --- a/st.c +++ b/st.c @@ -990,7 +990,7 @@ selnotify(XEvent *e) { } /* -* As seen in selcopy: +* As seen in getsel

[dev] [st patch queue 07/12] Remove unnecessary break;s

2014-04-25 Thread noname
--- st.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/st.c b/st.c index 9de7f81..061dafd 100644 --- a/st.c +++ b/st.c @@ -1778,7 +1778,6 @@ tsetmode(bool priv, bool set, int *args, int narg) { for(lim = args + narg; args < lim; ++args) { if(priv) {

[dev] [st patch queue 03/12] Use != instead of ^ for logical values.

2014-04-25 Thread noname
sel.alt is only changed by sel.alt = IS_SET(MODE_ALTSCREEN); --- st.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/st.c b/st.c index 35bbe9c..083d1c1 100644 --- a/st.c +++ b/st.c @@ -3445,7 +3445,7 @@ drawregion(int x1, int y1, int x2, int y2) { bool ena_sel

[dev] [st patch queue 02/12] Use BETWEEN macro in xsetcolorname and fix style.

2014-04-25 Thread noname
--- st.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/st.c b/st.c index 816caf7..35bbe9c 100644 --- a/st.c +++ b/st.c @@ -2746,10 +2746,10 @@ int xsetcolorname(int x, const char *name) { XRenderColor color = { .alpha = 0x }; Colour colour; -

[dev] [st patch queue 01/12] Simplify tsetscroll.

2014-04-25 Thread noname
--- st.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/st.c b/st.c index 60243a7..816caf7 100644 --- a/st.c +++ b/st.c @@ -1762,17 +1762,10 @@ tsetattr(int *attr, int l) { void tsetscroll(int t, int b) { - int temp; - LIMIT(t, 0, term.row-1);

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-25 Thread noname
On Thu, Apr 24, 2014 at 07:29:35AM +0200, Roberto E. Vargas Caballero wrote: > Hello, > > > u suffix was here for a purpose. The patch has comment about multibyte > > characters. As 0x20u is unsigned, c was converted to unsigned char > > before comparison so multibyte characters were not conside