From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.42.224.197 with SMTP id ip5cs38923icb; Sun, 27 Feb 2011 09:51:22 -0800 (PST) Received: by 10.224.67.149 with SMTP id r21mr3871642qai.172.1298829081735; Sun, 27 Feb 2011 09:51:21 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id 12si5395804qcd.126.2011.02.27.09.51.21; Sun, 27 Feb 2011 09:51:21 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 4F52A185836B; Sun, 27 Feb 2011 12:51:21 -0500 (EST) Received: from mail-wy0-f178.google.com (mail-wy0-f178.google.com [74.125.82.178]) by rubyforge.org (Postfix) with ESMTP id B7C7418581F3 for ; Sun, 27 Feb 2011 12:21:00 -0500 (EST) Received: by wyf28 with SMTP id 28so3484650wyf.23 for ; Sun, 27 Feb 2011 09:21:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:content-type:subject:from:to:in-reply-to :references:date:message-id:user-agent:content-transfer-encoding; bh=IbcPimThuyqsNY5K9wPNMeHZhRHW5cvNfBfsbNEeHRU=; b=g0TquoMv1fEhxtSAnS8l9WEOGUxnq3d/KZ/A9zAzCUkBdUKqhoJ6kGduoi80JrF9QX Il3zgP4k0mwK8VWLGHJc7tDKd2yQjQeU9+FSSy9Zf12opg9zuURZD0Jfb3FG2TmZJb6i V16MM13pkCB4+PpF6iUfd9QhlwALFmBPyNHAE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:subject:from:to:in-reply-to:references:date:message-id :user-agent:content-transfer-encoding; b=xqQIPA3q7Fv4CAJCuBIVQb+ojSsHrnFIVXzGlMEC4R1lLJyFalJZctsw9evqAf0TuG 3uVABAAYhtfrc6VEXFSq4fmAjXXScOkc8+SK7qolqypYg9nblRXXz/BBCf/4RkwXJ4B5 iOiZFgTHcISKI4s1pLzH4c5h3nE+ESD2jLwHI= Received: by 10.216.229.4 with SMTP id g4mr1561350weq.54.1298827260074; Sun, 27 Feb 2011 09:21:00 -0800 (PST) Received: from localhost (cpc12-cmbg15-2-0-cust81.5-4.cable.virginmedia.com [86.30.247.82]) by mx.google.com with ESMTPS id n11sm1451430wej.43.2011.02.27.09.20.56 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 27 Feb 2011 09:20:57 -0800 (PST) From: Hamish To: sup-devel In-reply-to: <1298819507-sup-8138@pruts.nl> 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> Date: Sun, 27 Feb 2011 17:20:55 +0000 Message-Id: <1298826314-sup-276@whisper> 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 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. Now I've got the basic stuff working, I'd be up for adding to it. Probably the best way would be to use a hook that could fire up something using a fork()/exec(). The way I'd see this working is that it would only be useful on a machine running X (or Wayland, or whatever the Mac GUI is called). 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. Basically I would say that if you want to edit your message outside of sup on a remote machine (via ssh) you should use screen/tmux in split mode, or have 2 terminals that ssh to the same server, or something like that. Opening the file tends to involve typing: $ vim /tmp/sup and then pressing tab, so I don't think it's too onerous. And if you turned on X forwarding and had xsel installed you could just press (to copy the path to the clipboard) and then paste that into the other terminal. Anyway, I'll have a think about how best to do a hook for this. I might end up doing a blocking and a non-blocking variant - the blocking variant could drop you straight back to reply-mode when it detects the editor has exited, while the non-blocking mode would make it simpler to write a hook, but you would have to manually exit async mode once editing was done. Hamish _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel