User Tools

Site Tools


screen

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
screen [2021/03/16 05:34] – [Multiple sessions] hc9screen [2021/03/16 21:39] (current) – [Multiple sessions] hc9
Line 3: Line 3:
 ===== Introduction ===== ===== Introduction =====
  
-[[http://savannah.gnu.org/projects/screen/|Screen]] is a terminal multiplexer, i.e., it will let you have multiple virtual terminals in a single window. You will also be able to 1) detach a screen session, and then detach it in a later moment; 2) share screen sessions.+[[http://savannah.gnu.org/projects/screen/|Screen]] is a "terminal multiplexer", i.e., it will let you have multiple virtual terminals in a single window. You will also be able to 1) "detacha screen session, and then detach it in a later moment; 2) share screen sessions.
  
 In this tutorial ''$'' indicates a terminal prompt (just for visual convenience). In this tutorial ''$'' indicates a terminal prompt (just for visual convenience).
  
-A Screen command is usually of the form **CTRL-a KEY**, i.e., you'll have to press the **CTRL** key along with a, followed by a generic KEY. (Screen's default escape key is **CTRL-a**.)+A Screen command is usually of the form **CTRL-a KEY**, i.e., you'll have to press the **CTRL** key along with "a", followed by a generic KEY. (Screen's default escape key is **CTRL-a**.)
  
 You'll need to be a [[http://sdf.org/?join#meta|MetaARPA]] member in order to use Screen on SDF You'll need to be a [[http://sdf.org/?join#meta|MetaARPA]] member in order to use Screen on SDF
  
-If you want a screencast tutorial, type:+If you want a "screencasttutorial, type:
  
-"$ ttyplay /ftp/pub/users/jecxjo/howto/screen"+''$ ttyplay /ftp/pub/users/jecxjo/howto/screen''
  
 on a terminal connected to SDF. on a terminal connected to SDF.
Line 25: Line 25:
 ''$ screen'' ''$ screen''
  
-When you run it, a window with some copyright and some other info will show up, with [Press Space or Return to end.] at the bottom. OK, as it says, you can now press Space or Enter. You will then see your shell prompt and nothing else. That's fine: you can now run your programs as usual, the difference is that they will run under a Screen session. You can detach it by typing **CTRL-a d**. Screen will keep your session running. Now if you logout, then log back in, and type:+When you run it, a window with some copyright and some other info will show up, with "[Press Space or Return to end.]at the bottom. OK, as it says, you can now press "Spaceor "Enter". You will then see your shell prompt and nothing else. That's fine: you can now run your programs as usual, the difference is that they will run under a Screen session. You can detach it by typing **CTRL-a d**. Screen will keep your session running. Now if you logout, then log back in, and type:
  
 ''$ screen -r'' ''$ screen -r''
Line 35: Line 35:
 ''$ screen -d -r'' ''$ screen -d -r''
  
-The -d flag will detach Screen, while -r will reattach. There are various types of detach and  flags. For instance, if you type the previous command and there was no screen session to be resumed, you'll get a There is no screen to be detached. message. In this case you'll probably need:+The "-dflag will detach Screen, while "-rwill reattach. There are various types of "detachand  flags. For instance, if you type the previous command and there was no screen session to be resumed, you'll get a "There is no screen to be detached.message. In this case you'll probably need:
  
 ''$ screen -d -R'' ''$ screen -d -R''
Line 47: Line 47:
 ''$ screen'' ''$ screen''
  
-will create a new window, leaving the previous window untouched, though not visible. Instead of typing screen, you can use the shortcut **CTRL-a c**.+will create a new window, leaving the previous window untouched, though not visible. Instead of typing "screen", you can use the shortcut **CTRL-a c**.
  
 You can create as many windows as you want. You can swith between windows with **CTRL-a n** (next window) and **CTRL-a p** (previous window). It's also possible to select windows by number. Typing **CTRL-a 1** will open window number 1, **CTRL-a 2**, to window 2, and so on. You can create as many windows as you want. You can swith between windows with **CTRL-a n** (next window) and **CTRL-a p** (previous window). It's also possible to select windows by number. Typing **CTRL-a 1** will open window number 1, **CTRL-a 2**, to window 2, and so on.
  
-How do you know what's a window number? Well, you can type **CTRL-a "** (yeah, that's a double quote). In that case a menu with a windows list will open. You can select a number and press enter to go to that screen. An easier way is to have a hard status line that shows you each window number. For doing this in a permanent manner, you'll have to create a .screenrc (Screen's customization file) in your $HOME directory and write in it the following lines:+How do you know what's a window number? Well, you can type **CTRL-a "** (yeah, that's a double quote). In that case a menu with a windows list will open. You can select a number and press enter to go to that screen. An easier way is to have a "hard status linethat shows you each window number. For doing this in a permanent manner, you'll have to create a ".screenrc(Screen's customization file) in your $HOME directory and write in it the following lines:
  
 <file config .screenrc> <file config .screenrc>
Line 88: Line 88:
 ''$ screen -S mysession'' ''$ screen -S mysession''
  
-where mysession is the name you want to give to your session (e.g., "work").+where "mysessionis the name you want to give to your session (e.g., "work").
  
 ===== Splitting windows ===== ===== Splitting windows =====
screen.1615872893.txt.gz · Last modified: 2021/03/16 05:34 by hc9