From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22559 invoked from network); 14 May 2007 19:44:58 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.0 (2007-05-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=no version=3.2.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 14 May 2007 19:44:58 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 48634 invoked from network); 14 May 2007 19:44:50 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 14 May 2007 19:44:50 -0000 Received: (qmail 5808 invoked by alias); 14 May 2007 19:44:43 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23439 Received: (qmail 5798 invoked from network); 14 May 2007 19:44:41 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 14 May 2007 19:44:41 -0000 Received: (qmail 47838 invoked from network); 14 May 2007 19:44:41 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 14 May 2007 19:44:37 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id B6DDC1C001; Mon, 14 May 2007 15:44:29 -0400 (EDT) Date: Mon, 14 May 2007 15:44:29 -0400 From: Clint Adams To: zsh-workers@sunsite.dk Cc: Alexander Myodov , 423897@bugs.debian.org Subject: Re: Bug#423897: zsh: better completion for screen Message-ID: <20070514194429.GA346@scowler.net> Mail-Followup-To: zsh-workers@sunsite.dk, Alexander Myodov , 423897@bugs.debian.org References: <20070514193129.27357.92367.reportbug@srv-castle1.pvt> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070514193129.27357.92367.reportbug@srv-castle1.pvt> User-Agent: Mutt/1.5.13 (2006-08-11) On Mon, May 14, 2007 at 11:31:29PM +0400, Alexander Myodov wrote: > Currently -r and -R completions list only detached sessions, and -x completion lists only attached sessions. In fact, when any of these arguments used together with -D or -d command (in the format either "-D -r" or "-Dr"), they should complete any available sessions, no matter are they detached or attached. > This means that any combination of "-[Dd][Rrx]" or "-[Dd] -[Rrx]" should complete into the list of any available sessions. > I include the trivial patch to handle the "-[Dd][Rrx]" part (the file to change is /usr/share/zsh/4.3.2/functions/Completion/Unix/_screen); if anyone can provide the similar completion for "-[Dd] -[Rrx]", it would be good. > > > --- _screen.old 2007-05-14 22:25:16.000000000 +0400 > +++ _screen.new 2007-05-14 22:51:36.000000000 +0400 > @@ -75,7 +75,11 @@ > '-p[preselect the named window]:window number or name:((\=\:windowlist -\:blank\ window \:window\ number))' \ > '-q[quiet startup, exit with non-zero return code if unsuccessful]' \ > '-r[reattach to a detached screen process]: :->detached-sessions' \ > + '-Dr: :->any-sessions' \ > + '-dr: :->any-sessions' \ > '-R[reattach if possible, otherwise start a new session]: :->detached-sessions' \ > + '-DR: :->any-sessions' \ > + '-dR: :->any-sessions' \ > '-s[shell to execute rather than $SHELL]:shell name: _command_names -e' \ > '-S[name this session .sockname instead of ..]:session name' \ > "-t[set title (window's name)]:title" \ > @@ -84,6 +88,8 @@ > '(-)-v[print screen version]' \ > '(-)-wipe[do nothing, clean up SockDir]' \ > '-x[attach to a not detached screen (multi display mode)]: :->attached-sessions' \ > + '-Dx: :->any-sessions' \ > + '-dx: :->any-sessions' \ > '-X[execute command as a screen command in the specified session]:screencmd:(${scr_cmds[@]})' \ > '*::arguments: _normal' > > @@ -101,6 +107,11 @@ > -ls)"}:#*[Dd]etached*}##[[:blank:]]}%%[[:blank:]]*} > ) > ;; > + any-sessions) > + sessions=( > + ${${${(M)${(f)"$(_call_program screen-sessions $words[1] \ > + -ls)"}:#*tached*}##[[:blank:]]}%%[[:blank:]]*} > + ) > esac > > # check if initial PID is necessary to make sessions unambiguous This option agglutination makes me uncomfortable, but -s isn't on for _arguments, and -dmS is already in there, so I'll commit this.