zsh-users
 help / color / mirror / code / Atom feed
* _screen calls non-existent program
@ 2010-10-19 12:21 Sebastian Stark
  2010-10-19 12:51 ` Frank Terbeck
  2010-10-19 12:58 ` Peter Stephenson
  0 siblings, 2 replies; 9+ messages in thread
From: Sebastian Stark @ 2010-10-19 12:21 UTC (permalink / raw)
  To: zsh-users


I just noticed that if I try screens completion I am not able to select one of many running sessions:

 screen -S <tab>

gives an empty set.

Looking at _screen I see that the list of existing sessions should come from

  _call_program screen-sessions $words[1] -ls

Now I'm wondering what the screen-sessions command should look like, it is not available on any of my machines. To me it looks a bit like it is the same as screen itself, because of the -ls option. But than I don't get the $words[1] part.

Any pointers?


Sebastian

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: _screen calls non-existent program
  2010-10-19 12:21 _screen calls non-existent program Sebastian Stark
@ 2010-10-19 12:51 ` Frank Terbeck
  2010-10-19 13:00   ` Sebastian Stark
  2010-10-19 12:58 ` Peter Stephenson
  1 sibling, 1 reply; 9+ messages in thread
From: Frank Terbeck @ 2010-10-19 12:51 UTC (permalink / raw)
  To: Sebastian Stark; +Cc: zsh-users

Sebastian Stark wrote:
> Looking at _screen I see that the list of existing sessions should come from
>
>   _call_program screen-sessions $words[1] -ls
>
> Now I'm wondering what the screen-sessions command should look like,
> it is not available on any of my machines. To me it looks a bit like
> it is the same as screen itself, because of the -ls option. But than I
> don't get the $words[1] part.

`_call_program' enables you to actually *change* the used program via a
style. `screen-session' is the tag used with the command
style. "$words[1]" is the first word of the command the completion is
run on. In other words "screen". Thus, the default program being run
here is "screen -ls".

Regards, Frank

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: _screen calls non-existent program
  2010-10-19 12:21 _screen calls non-existent program Sebastian Stark
  2010-10-19 12:51 ` Frank Terbeck
@ 2010-10-19 12:58 ` Peter Stephenson
  2010-10-19 13:52   ` Sebastian Stark
  1 sibling, 1 reply; 9+ messages in thread
From: Peter Stephenson @ 2010-10-19 12:58 UTC (permalink / raw)
  To: zsh-users

On Tue, 19 Oct 2010 14:21:12 +0200
Sebastian Stark <seb-zsh@biskalar.de> wrote:
> I just noticed that if I try screens completion I am not able to
> select one of many running sessions:
> 
>  screen -S <tab>
> 
> gives an empty set.
> 
> Looking at _screen I see that the list of existing sessions should
> come from
> 
>   _call_program screen-sessions $words[1] -ls
> 
> Now I'm wondering what the screen-sessions command should look like,
> it is not available on any of my machines. To me it looks a bit like
> it is the same as screen itself, because of the -ls option. But than
> I don't get the $words[1] part.
> 
> Any pointers?

"screen-sessions" is just the name to use in the completion context.
The command should be in $words[1], which should be "screen".  "screen
-ls" does the right thing.

The real problem is the completion system hasn't actually been told to
complete a session here. The _arguments specification is:

'-S[name this session <pid>.sockname instead of <pid>.<tty>.<host>]:session name'

which simply outputs "session name", but doesn't try to complete
anything.  This is presumably because it's a new session, so completing
exactly an existing session isn't useful.  However, I can see that
completing an existing session might help you create a new name with
minimal typing. If you change that line (around 84) to

'-S[name this session <pid>.sockname instead of <pid>.<tty>.<host>]:session name:->any-sessions'

you'll get that effect.  It could be a style, I suppose.

-- 
Peter Stephenson <pws@csr.com>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: _screen calls non-existent program
  2010-10-19 12:51 ` Frank Terbeck
@ 2010-10-19 13:00   ` Sebastian Stark
  2010-10-19 13:07     ` Mikael Magnusson
  0 siblings, 1 reply; 9+ messages in thread
From: Sebastian Stark @ 2010-10-19 13:00 UTC (permalink / raw)
  To: Frank Terbeck; +Cc: zsh-users


Am 19.10.2010 um 14:51 schrieb Frank Terbeck:

> Sebastian Stark wrote:
>> Looking at _screen I see that the list of existing sessions should come from
>> 
>>  _call_program screen-sessions $words[1] -ls
>> 
>> Now I'm wondering what the screen-sessions command should look like,
>> it is not available on any of my machines. To me it looks a bit like
>> it is the same as screen itself, because of the -ls option. But than I
>> don't get the $words[1] part.
> 
> `_call_program' enables you to actually *change* the used program via a
> style. `screen-session' is the tag used with the command
> style. "$words[1]" is the first word of the command the completion is
> run on. In other words "screen". Thus, the default program being run
> here is "screen -ls".

Thanks for explaining. .oO(must read manual page harder ...)

Anyway, it does not work for me:

% screen -ls
There is a screen on:
	22789.ttys000.suck	(Attached)
1 Socket in /var/folders/zz/zzzivhrRnAmviuee+++2I+++-3+/-Tmp-/.screen.

% screen -S <tab>
session name

No session is displayed in the "session name" menu by the completion system. I have no customisation regarding screen in my configuration ("zstyle -L | grep screen" is empty). I still must be doing something wrong here.


Sebastian

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: _screen calls non-existent program
  2010-10-19 13:00   ` Sebastian Stark
@ 2010-10-19 13:07     ` Mikael Magnusson
  2010-10-19 13:48       ` Sebastian Stark
  0 siblings, 1 reply; 9+ messages in thread
From: Mikael Magnusson @ 2010-10-19 13:07 UTC (permalink / raw)
  To: Sebastian Stark; +Cc: zsh-users

On 19 October 2010 15:00, Sebastian Stark <seb-zsh@biskalar.de> wrote:
>
> Am 19.10.2010 um 14:51 schrieb Frank Terbeck:
>
>> Sebastian Stark wrote:
>>> Looking at _screen I see that the list of existing sessions should come from
>>>
>>>  _call_program screen-sessions $words[1] -ls
>>>
>>> Now I'm wondering what the screen-sessions command should look like,
>>> it is not available on any of my machines. To me it looks a bit like
>>> it is the same as screen itself, because of the -ls option. But than I
>>> don't get the $words[1] part.
>>
>> `_call_program' enables you to actually *change* the used program via a
>> style. `screen-session' is the tag used with the command
>> style. "$words[1]" is the first word of the command the completion is
>> run on. In other words "screen". Thus, the default program being run
>> here is "screen -ls".
>
> Thanks for explaining. .oO(must read manual page harder ...)
>
> Anyway, it does not work for me:
>
> % screen -ls
> There is a screen on:
>        22789.ttys000.suck      (Attached)
> 1 Socket in /var/folders/zz/zzzivhrRnAmviuee+++2I+++-3+/-Tmp-/.screen.
>
> % screen -S <tab>
> session name
>
> No session is displayed in the "session name" menu by the completion system. I have no customisation regarding screen in my configuration ("zstyle -L | grep screen" is empty). I still must be doing something wrong here.

screen -S names the session you're starting, it does nothing with
existing sessions.

-- 
Mikael Magnusson


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: _screen calls non-existent program
  2010-10-19 13:07     ` Mikael Magnusson
@ 2010-10-19 13:48       ` Sebastian Stark
  0 siblings, 0 replies; 9+ messages in thread
From: Sebastian Stark @ 2010-10-19 13:48 UTC (permalink / raw)
  To: Mikael Magnusson; +Cc: zsh-users


Am 19.10.2010 um 15:07 schrieb Mikael Magnusson:
>> 
>> % screen -ls
>> There is a screen on:
>>       22789.ttys000.suck      (Attached)
>> 1 Socket in /var/folders/zz/zzzivhrRnAmviuee+++2I+++-3+/-Tmp-/.screen.
>> 
>> % screen -S <tab>
>> session name
>> 
>> No session is displayed in the "session name" menu by the completion system. I have no customisation regarding screen in my configuration ("zstyle -L | grep screen" is empty). I still must be doing something wrong here.
> 
> screen -S names the session you're starting, it does nothing with
> existing sessions.

Sorry, I pasted only half of my command. What I really want to do is:

  screen -X kill -S <tab>

and this should really select a running session. The screen manual does not mention it, but the error message in this case:

% screen -X kill 
There are several suitable screens on:
	22789.ttys000.suck	(Attached)
	24105.ttys004.suck	(Attached)
Use -S to specify a session.


Sebastian

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: _screen calls non-existent program
  2010-10-19 12:58 ` Peter Stephenson
@ 2010-10-19 13:52   ` Sebastian Stark
  2010-10-19 14:13     ` Peter Stephenson
  0 siblings, 1 reply; 9+ messages in thread
From: Sebastian Stark @ 2010-10-19 13:52 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-users


Am 19.10.2010 um 14:58 schrieb Peter Stephenson:
> "screen-sessions" is just the name to use in the completion context.
> The command should be in $words[1], which should be "screen".  "screen
> -ls" does the right thing.
> 
> The real problem is the completion system hasn't actually been told to
> complete a session here. The _arguments specification is:
> 
> '-S[name this session <pid>.sockname instead of <pid>.<tty>.<host>]:session name'
> 
> which simply outputs "session name", but doesn't try to complete
> anything.  This is presumably because it's a new session, so completing
> exactly an existing session isn't useful.  However, I can see that
> completing an existing session might help you create a new name with
> minimal typing. If you change that line (around 84) to
> 
> '-S[name this session <pid>.sockname instead of <pid>.<tty>.<host>]:session name:->any-sessions'

Thank you, this works for me.

> you'll get that effect.  It could be a style, I suppose.

I think it should be default, at least in the -X case, because in this case -S is used to choose from existing sessions. (see my other email).


Sebastian

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: _screen calls non-existent program
  2010-10-19 13:52   ` Sebastian Stark
@ 2010-10-19 14:13     ` Peter Stephenson
  2010-10-19 23:11       ` Phil Pennock
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Stephenson @ 2010-10-19 14:13 UTC (permalink / raw)
  To: zsh-users

On Tue, 19 Oct 2010 15:52:25 +0200
Sebastian Stark <seb@biskalar.de> wrote:
> I think it should be default, at least in the -X case, because in
> this case -S is used to choose from existing sessions. (see my other
> email).

Might be easier to add it in all cases and assume the user knows what
they're doing.  We do that kind of thing elsewhere.

-- 
Peter Stephenson <pws@csr.com>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK



Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: _screen calls non-existent program
  2010-10-19 14:13     ` Peter Stephenson
@ 2010-10-19 23:11       ` Phil Pennock
  0 siblings, 0 replies; 9+ messages in thread
From: Phil Pennock @ 2010-10-19 23:11 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-users

On 2010-10-19 at 15:13 +0100, Peter Stephenson wrote:
> On Tue, 19 Oct 2010 15:52:25 +0200
> Sebastian Stark <seb@biskalar.de> wrote:
> > I think it should be default, at least in the -X case, because in
> > this case -S is used to choose from existing sessions. (see my other
> > email).
> 
> Might be easier to add it in all cases and assume the user knows what
> they're doing.  We do that kind of thing elsewhere.

There is a problem with some of the parsing at present, don't have time
to fix myself but I'll note it here.

{ screen -dr } is handled as any-sessions, but that's just option
bundling. { screen -d -r } is matching on detached-sessions, but should
be any-sessions.  The earlier -d is not changing the state, it's just an
assumption of bundling.

On a related note, "-x" is shown as taking attached-sessions.  In fact,
-x is a parameterless option, simply turning on multi-display mode
(multiple clients all connected to the same screen session, possibly on
different windows, but not necessary).  So { -x -r }, { -xr }, whatever,
they should all take any-sessions.

So if someone new to completion is encountering issues and wants to
explore, this is a good candidate to tackle, as you'd get to redo the
approach, not merely add or remove a line.

-Phil


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-10-19 23:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-19 12:21 _screen calls non-existent program Sebastian Stark
2010-10-19 12:51 ` Frank Terbeck
2010-10-19 13:00   ` Sebastian Stark
2010-10-19 13:07     ` Mikael Magnusson
2010-10-19 13:48       ` Sebastian Stark
2010-10-19 12:58 ` Peter Stephenson
2010-10-19 13:52   ` Sebastian Stark
2010-10-19 14:13     ` Peter Stephenson
2010-10-19 23:11       ` Phil Pennock

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).