From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4261 invoked from network); 29 Jun 2006 03:13:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 29 Jun 2006 03:13:48 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 26056 invoked from network); 29 Jun 2006 03:13:38 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 29 Jun 2006 03:13:38 -0000 Received: (qmail 7936 invoked by alias); 29 Jun 2006 03:13:31 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10454 Received: (qmail 7927 invoked from network); 29 Jun 2006 03:13:30 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 29 Jun 2006 03:13:30 -0000 Received: (qmail 24970 invoked from network); 29 Jun 2006 03:13:30 -0000 Received: from vms040pub.verizon.net (206.46.252.40) by a.mx.sunsite.dk with SMTP; 29 Jun 2006 03:13:29 -0000 Received: from torch.brasslantern.com ([71.116.74.94]) by vms040.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0J1L0097AQAFXILB@vms040.mailsrvcs.net> for zsh-users@sunsite.dk; Wed, 28 Jun 2006 22:13:28 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id k5T3DQA2020442 for ; Wed, 28 Jun 2006 20:13:26 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id k5T3DQBH020441 for zsh-users@sunsite.dk; Wed, 28 Jun 2006 20:13:26 -0700 Date: Wed, 28 Jun 2006 20:13:26 -0700 From: Bart Schaefer Subject: Re: insert a partial command into the command line In-reply-to: <04667443@wizzle.ran.pp.ru> To: zsh-users@sunsite.dk Message-id: <060628201326.ZM20440@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <04667443@wizzle.ran.pp.ru> Comments: In reply to Artem Chuprina "insert a partial command into the command line" (Jun 24, 3:24pm) On Jun 24, 3:24pm, Artem Chuprina wrote: } } xterm -e zsh -i -t } } and it will do the most valuable thing of this - allow me to write a } command with completion and then exit. But I need to write all the } command and manually add '&' to detach it. Put this in your ~/.zshrc file: if [[ -o interactive && -o single_command ]] then print -z "$*" function auto-bg { BUFFER="{ $BUFFER } &|" zle .accept-line } zle -N accept-line auto-bg fi Now you run zsh like xterm -e zsh -s -t -i "ssh some.host.name " The -s is needed to prevent zsh from treating the argument as the name of a script file.