bugGNU Screen - Bugs: bug #36001, screen can't reattach by session...

 
 

bug #36001: screen can't reattach by session name if it is a substring of another session name

Submitted by:  None
Submitted on:  Sun 25 Mar 2012 07:32:42 PM UTC  
 
Category: User InterfaceSeverity: 3 - Normal
Priority: 5 - NormalStatus: None
Privacy: PublicAssigned to: None
Open/Closed: OpenRelease: 4.0.3
Fixed Release: NonePlanned Release: None
Work Required: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 25 Mar 2012 07:32:42 PM UTC, original submission:

If I create a screen called "moo" via
screen -S moo
and then create screen moose via
screen -S moose

and then attempt to reattach moo via
screen -r moo

I get
There are several suitable screens on:
13960.moo (Detached)
13969.moose (Detached)
Type "screen [-d] -r [pid.]tty.host" to resume one of them.

rather than it simply attaching moo.

Now, this behavior can be kludged around by using -d/-D and -RR, but it creates a few problems:

if moo is attached, and moose is detached, screen -RR moo will attach to moose instead.

If moo is attached, screen -d -RR moo will detach it.
This is not the original behavior of -r:
screen -r moo if moo was attached would normally output

There is a screen on:
13960.moo (Attached)
There is no screen to be resumed matching moo.

This can also be worked around by using the full name of moo:
screen -r 13960.moo, or just screen -r 13960, but then why bother with the session name at all?

I understand that it's useful to be able to type just "screen -r moo" when you mean session name moose, but wouldn't it make more sense to check if there's an exact match too? If I have a command named dd, and a command named ddrescue, bash doesn't get all confused and make me type the full path to dd.

Moreover, wouldn't having
screen -R sessionname
do the aggressive matching make more sense?

An example of what this would be like follows:

$ screen -ls
There are screens on:
13995.moo (Detached)
14022.moose (Detached)
2 Sockets in /var/folders/5r/37vxtt554lgfskbrxs_b2ldh0000gn/T/.screen.

$ screen -r moo
<attaches screen moo>
[detached]

$ screen -R moos
<attaches screen moose>
[detached]

$ screen -R moo
There are several suitable screens on:
13995.moo (Detached)
14022.moose (Detached)
Type "screen [-d] -r [pid.]tty.host" or "screen -r full_session_name" to resume one of them.

$ screen -r moos
There is no screen to be resumed matching moos.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

No Changes Have Been Made to This Item

Back to the top


Powered by Savane 3.1-cleanup