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

Submitter:  None
Submitted:  Sun 25 Mar 2012 07:32:42 PM UTC
   
 
Category:  User Interface Severity:  3 - Normal
Priority:  * 5 - Normal Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Release:  4.0.3
Fixed Release:  None Planned Release:  None
Work Required:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

No changes have been made to this item

Back to the top

Powered by Savane 3.13-d3ae.
Corresponding source code