Re: [dwm] input status text bug?

2007-11-03 Thread Anselm R. Garbe
On Fri, Nov 02, 2007 at 10:49:18PM +0100, Sander van Dijk wrote: On Nov 2, 2007 10:02 PM, Anselm R. Garbe [EMAIL PROTECTED] wrote: Hmm, if that's the reason I tend to write a read()-based getline function which does not block ;) Try doing this: for i in `seq 1 10` do echo -n bla

Re: [dwm] input status text bug?

2007-11-02 Thread Enno Gottox Boland
It doesn't work at all... 2007/11/2, Anselm R. Garbe [EMAIL PROTECTED]: Ritesh, I pushed a simplified status text processing version which uses fgets again, for readability and simplicity reasons. Could you please recheck if hg tip fixes your issue? Regards, -- Anselm R. Garbe

Re: [dwm] input status text bug?

2007-11-02 Thread Enno Gottox Boland
The reason was something in my .xinitrc. I changed it and everything is fine. 2007/11/2, Anselm R. Garbe [EMAIL PROTECTED]: On Fri, Nov 02, 2007 at 05:21:36PM +0100, Enno Gottox Boland wrote: It doesn't work at all... Sorry, but I can't reproduce. It works correctly for me so far.

Re: [dwm] input status text bug?

2007-11-02 Thread Sander van Dijk
On Nov 2, 2007 6:37 PM, Anselm R. Garbe [EMAIL PROTECTED] wrote: On Fri, Nov 02, 2007 at 05:21:36PM +0100, Enno Gottox Boland wrote: It doesn't work at all... Sorry, but I can't reproduce. It works correctly for me so far. It seems to me that the call to fgets() blocks, that is, when it's

Re: [dwm] input status text bug?

2007-11-02 Thread Sander van Dijk
On Nov 2, 2007 10:02 PM, Anselm R. Garbe [EMAIL PROTECTED] wrote: Hmm, if that's the reason I tend to write a read()-based getline function which does not block ;) Try doing this: for i in `seq 1 10` do echo -n bla if test $i = 5 then echo fi sleep 3 done | dwm

Re: [dwm] input status text bug?

2007-10-31 Thread Anselm R. Garbe
Hi Ritesh, On Tue, Oct 30, 2007 at 11:04:33PM -0400, Ritesh Kumar wrote: I used to run dwm using the following bash script: while true; do date; sleep 1; done | dwm ... and things used to run fine :). I changed it to: while true; do cat $HOME/.dwm/status_* ;

Re: [dwm] input status text bug?

2007-10-31 Thread Anselm R. Garbe
On Wed, Oct 31, 2007 at 09:28:33AM +0100, Anselm R. Garbe wrote: I see the problem in the above code, and also believe that your solution is more correct. What scares me is, that it might seen as valid input if someone feeds dwm with for example: echo -n foo during while... but we can fix

Re: [dwm] input status text bug?

2007-10-31 Thread Chris Webb
Anselm R. Garbe [EMAIL PROTECTED] writes: If we decide for line-based input reading, one easily could block dwm from further event processing through running echo -n foo | dwm I think that'd be a big disadvantage. It could append read text to the end of stext[] whenever it successfully

Re: [dwm] input status text bug?

2007-10-31 Thread Ritesh Kumar
On 10/31/07, Sander van Dijk [EMAIL PROTECTED] wrote: On Oct 31, 2007 7:01 AM, Vasil Dimov [EMAIL PROTECTED] wrote: On Tue, Oct 30, 2007 at 23:04:33 -0400, Ritesh Kumar wrote: [...] I went through the source code and fixed the status input handling code to make sure it flushes the

Re: [dwm] input status text bug?

2007-10-31 Thread Ritesh Kumar
On 10/31/07, Anselm R. Garbe [EMAIL PROTECTED] wrote: Hi Ritesh, snip Well let's have a look at the relevant bits in the code: (a) switch(r = read(STDIN_FILENO, stext, sizeof stext - 1)) { [...] default: (b) for(stext[r] = '\0', p = stext +

Re: [dwm] input status text bug?

2007-10-31 Thread Ritesh Kumar
On 10/31/07, Ritesh Kumar [EMAIL PROTECTED] wrote: On 10/31/07, Anselm R. Garbe [EMAIL PROTECTED] wrote: Hi Ritesh, snip Well let's have a look at the relevant bits in the code: (a) switch(r = read(STDIN_FILENO, stext, sizeof stext - 1)) { [...]

[dwm] input status text bug?

2007-10-30 Thread Ritesh Kumar
Hi folks, I came across this curious behavior for the input status text... I used to run dwm using the following bash script: while true; do date; sleep 1; done | dwm ... and things used to run fine :). I changed it to: while true; do cat $HOME/.dwm/status_* ; date; sleep

Re: [dwm] input status text bug?

2007-10-30 Thread Ritesh Kumar
The full patch (against dwm 4.6 + clientspertag) is present at http://www.cs.unc.edu/~ritesh/dwm/index.html It should not be difficult to chop out unwanted bits from it :) _r On 10/30/07, Ritesh Kumar [EMAIL PROTECTED] wrote: Hi folks, I came across this curious behavior for the input status

Re: [dwm] input status text bug?

2007-10-30 Thread Vasil Dimov
On Tue, Oct 30, 2007 at 23:04:33 -0400, Ritesh Kumar wrote: [...] I went through the source code and fixed the status input handling code to make sure it flushes the input status text only if in encounters a '\n'. [...] if(FD_ISSET(STDIN_FILENO, rd)) { -