From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Sat, 11 Nov 2006 00:35:06 +0000 From: "Arvindh Rajesh Tamilmani" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: Re: [9fans] winclear in p9p In-Reply-To: <3e1162e60611100617j625e6831x9f1cbb7cb44cf2af@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <88a477560610310922j6c5ed52dg6327ab6587479977@mail.gmail.com> <3e1162e60611100617j625e6831x9f1cbb7cb44cf2af@mail.gmail.com> Topicbox-Message-UUID: dd993420-ead1-11e9-9d60-3106f5b1d025 > > Here is a simpler one: > > > > echo -n , >/mnt/acme/$winid/addr > > echo -n >/mnt/acme/$winid/data > > > > Maybe it's how I keyed it in, or that I've got the worst cold I've had > in about 6 or 7 years, but I'm getting invalid address with this > version. It looks cleaner but for some reason it's just not liking > me. Were you trying it on win(1)? I think the original winclear was built for that. The two-liner clears win, but then win stops responding to commands. The following patch to win/main.c seems to make the two-liner work. Arvindh /acme/bin/source/win/main.c:237,243 - main.c:237,242 sprint(buf, "#%lud,#%lud", q0, q0+n); winsetaddr(w, buf, 0); write(w->data, buf, 0); - *q1 -= n; return 0; } /acme/bin/source/win/main.c:457,463 - main.c:456,466 case 'F': /* generated by our actions (specifically case 'S' above) */ delta = e->q1-e->q0; if(e->c2=='D'){ - /* we know about the delete by _sendinput */ + endpt -= delta; + if(e->q1 < hostpt) + hostpt -= delta; + else if(e->q0 < hostpt) + hostpt = e->q0; break; } if(e->c2=='I'){