From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29436 invoked from network); 30 Jul 2004 16:06:31 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 30 Jul 2004 16:06:31 -0000 Received: (qmail 6427 invoked from network); 30 Jul 2004 16:06:25 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 30 Jul 2004 16:06:25 -0000 Received: (qmail 5951 invoked by alias); 30 Jul 2004 16:06:12 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20225 Received: (qmail 5941 invoked from network); 30 Jul 2004 16:06:11 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by 130.225.247.90 with SMTP; 30 Jul 2004 16:06:11 -0000 Received: (qmail 5197 invoked from network); 30 Jul 2004 16:04:13 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 30 Jul 2004 16:04:11 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id 4E64D7004E; Fri, 30 Jul 2004 12:04:10 -0400 (EDT) Date: Fri, 30 Jul 2004 12:04:10 -0400 From: Clint Adams To: Philippe Troin Cc: zsh-workers@sunsite.dk, 205685@bugs.debian.org Subject: Re: [vincent@vinc17.org: Re: Bug#205685: clone corruption] Message-ID: <20040730160410.GC4059@scowler.net> References: <20040720181612.GA18242@scowler.net> <87658ifrga.fsf@ceramic.fifi.org> <20040728155035.GA17226@scowler.net> <87isc767g9.fsf@ceramic.fifi.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87isc767g9.fsf@ceramic.fifi.org> User-Agent: Mutt/1.5.6+20040523i X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-1.5 required=6.0 tests=BAYES_01 autolearn=no version=2.63 X-Spam-Hits: -1.5 > Hope that explains clone better. Good now? Index: Doc/Zsh/mod_clone.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/mod_clone.yo,v retrieving revision 1.1.1.8 diff -u -r1.1.1.8 mod_clone.yo --- Doc/Zsh/mod_clone.yo 20 Dec 1999 11:24:39 -0000 1.1.1.8 +++ Doc/Zsh/mod_clone.yo 30 Jul 2004 16:02:38 -0000 @@ -16,5 +16,32 @@ The return value of the builtin is zero in both shells if successful, and non-zero on error. + +The target of tt(clone) should be an unused terminal, such as an unused virtual +console or a virtual terminal created by + +xterm -e sh -c 'trap : INT QUIT TSTP; tty; while :; do sleep 100000000; done' + +Some words of explanation are warranted about this long xterm command +line: when doing clone on a pseudo-terminal, some other session +("session" meant as a unix session group, or SID) is already owning +the terminal. Hence the cloned zsh cannot acquire the pseudo-terminal +as a controlling tty. That means two things: + + the job control signals will go to the sh-started-by-xterm process + group (that's why we disable INT QUIT and TSTP with trap; otherwise + the while loop could get suspended or killed) + + the cloned shell will have job control disabled, and the job + control keys (control-C, control-\ and control-Z) will not work. + +This does not apply when cloning to an bf(unused) vc. + +Cloning to an used (and unprepared) terminal will result in two +processes reading simultaneously from the same terminal, with +input bytes going randomly to either process. + +tt(clone) is mostly useful as a shell built-in replacement for +openvt. ) enditem()