Is it possible to change the name of a GNU screen session? Say I called started it with "screen -S foo" and I want to rename it to bar.

link|improve this question

80% accept rate
feedback

1 Answer

up vote 7 down vote accepted

Summary

C-a :sessionname mySessionName

Details

This is,

0) Attach to the session in question.

1) Ctrl + a

2) Type ":sessionname mySessionName" - yes, the first colon is needed there, no extra spaces.

3) Type Enter.

Example

$ screen -S foo
[detached from 8890.foo]
$ screen -ls
There is a screen on:
    8890.foo    (22/12/11 18:39:22) (Detached)
1 Socket in /var/run/screen/S-user.

$ screen -r

( "C-a :sessionname bars" here )

[detached from 8890.bars]
$ screen -ls
There is a screen on:
    8890.bars   (22/12/11 18:39:21) (Detached)
1 Socket in /var/run/screen/S-user.

$ 

Renaming without attaching

Screen's -X switch lets you rename a session without attaching it.

$ screen -X sessionname foobars
$ screen -ls
There is a screen on:
    8890.foobars    (22/12/11 18:39:22) (Detached)
1 Socket in /var/run/screen/S-user.

$ 
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.