How can I assign a name for a screen? [closed]

Solution 1:

To start a new session

screen -S your_session_name

To rename an existing session

Ctrl+a, : sessionname YOUR_SESSION_NAME Enter

You must be inside the session

Solution 2:

To create a new screen with the name foo, use

screen -S foo

Then to reattach it, run

screen -r foo  # or use -x, as in
screen -x foo  # for "Multi display mode" (see the man page)

Solution 3:

As already stated, screen -S SESSIONTITLE works for starting a session with a title (SESSIONTITLE), but if you start a session and later decide to change its title. This can be accomplished by using the default key bindings:

Ctrl+a, A

Which prompts:

Set windows title to:SESSIONTITLE

Change SESSIONTITLE by backspacing and typing in the desired title. To confirm the name change and list all titles.

Ctrl+a, "

Solution 4:

The easiest way is to use Screen with a name:

screen -S 'name' 'application'
  • Ctrl + a, d = exit and leave the application open

Return to Screen:

screen -r 'name'

For example, using Lynx with Screen.

Create a screen:

screen -S lynx lynx

Ctrl+a, d = exit

Later, you can return with:

screen -r lynx