From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.42.224.197 with SMTP id ip5cs41487icb; Sun, 27 Feb 2011 12:20:02 -0800 (PST) Received: by 10.52.67.34 with SMTP id k2mr1057002vdt.291.1298838001946; Sun, 27 Feb 2011 12:20:01 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id n23si3772962vbl.97.2011.02.27.12.20.00; Sun, 27 Feb 2011 12:20:00 -0800 (PST) Received-SPF: pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-devel-bounces@rubyforge.org Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 73B7B19782F8; Sun, 27 Feb 2011 15:20:00 -0500 (EST) Received: from steel.pruts.nl (pruts.nl [82.94.235.106]) by rubyforge.org (Postfix) with ESMTP id 5A86D18581F3 for ; Sun, 27 Feb 2011 14:44:22 -0500 (EST) Received: from localhost (localhost.localdomain [127.0.0.1]) by steel.pruts.nl (Postfix) with ESMTP id 645B0E20D6 for ; Sun, 27 Feb 2011 20:44:21 +0100 (CET) X-Virus-Scanned: amavisd-new at pruts.nl Received: from steel.pruts.nl ([127.0.0.1]) by localhost (steel.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TufyiadV0Hbk for ; Sun, 27 Feb 2011 20:44:15 +0100 (CET) Received: by steel.pruts.nl (Postfix, from userid 1000) id 70A35E20D9; Sun, 27 Feb 2011 20:44:15 +0100 (CET) From: Ico Doornekamp To: sup-devel In-reply-to: <1298826314-sup-276@whisper> References: <1298239068-sup-6985@whisper> <1298747943-sup-9749@whisper> <1298768518-sup-4041@alvh.no-ip.org> <1298774629-sup-4062@medusa> <1298819507-sup-8138@pruts.nl> <1298826314-sup-276@whisper> Date: Sun, 27 Feb 2011 20:44:15 +0100 Message-Id: <1298833983-sup-4830@pruts.nl> User-Agent: Sup/git Subject: Re: [sup-devel] editing messages outside of sup X-BeenThere: sup-devel@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Sup developer discussion List-Id: Sup developer discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-devel-bounces@rubyforge.org Errors-To: sup-devel-bounces@rubyforge.org * On Sun Feb 27 18:20:55 +0100 2011, Hamish wrote: > Excerpts from Ico Doornekamp's message of Sun Feb 27 15:31:14 +0000 2011: > > > Hamish, definitely thank you for doing something about this. I > > > actually had a general question about this problem a while back - if > > > it is possible to edit the message independently via the approach you > > > took in this patch, why can't the editor be fired up in a > > > "nonblocking" kind of mode in the first place? Something like a > > > fork()/exec() to start the editor, and then handling SIGCHLD rather > > > than calling a variant of wait() immediately. The SIGCHLD handling > > > could check the return code from the editor, and then update the > > > message sending buffer appropriately. > > > > But in what tty should the forked editor run then? I guess the above > > idea would work for spawning an editor under X, but can not be used when > > running on a (remote) console. I guess the 'vim --remote' solution would > > be feasable, bug I guess this is not simple enough to add as an > > out-of-the-box solution. > > If you have ssh'ed to a remote machine then I don't think there is a > good way to manage this automatically without turning sup into screen > (which I think would be a bad idea), though I wouldn't want to get in > the way of imaginative hooks of course. I've just hooked up a few lines of code (standalone, not part of sup) that forks two editors (one joe, one vim) in ptys and handling both terminal outputs with select(), allowing me to 'switch' between processes on-the-fly using a magic keystroke. Redrawing is forced before 'switching' to a process by doing a TIOCSWINSZ ioctl and sending a SIGWINCH twice, first with a fake, then with the true window size. This is not quite a complete rewrite of screen, but seems to work quite well. (Although I'm sure there are plenty of cases not covered by this crude method of switching) When the infrastructure for background-editor hooks is there, I'm ready to try to make the hook! -- :wq ^X^Cy^K^X^C^C^C^C _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel