screen
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
screen [2021/03/16 05:27] – [.screenrc] hc9 | screen [2021/03/16 21:38] – [Multiple windows] hc9 | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | [[http:// | + | [[http:// |
In this tutorial '' | In this tutorial '' | ||
- | 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' | + | 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' |
You'll need to be a [[http:// | You'll need to be a [[http:// | ||
- | If you want a screencast tutorial, type: | + | If you want a "screencast" |
- | "$ ttyplay / | + | '' |
on a terminal connected to SDF. | on a terminal connected to SDF. | ||
Line 25: | Line 25: | ||
'' | '' | ||
- | 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.]" |
'' | '' | ||
Line 35: | Line 35: | ||
'' | '' | ||
- | 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 "-d" |
'' | '' | ||
Line 47: | Line 47: | ||
'' | '' | ||
- | 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 |
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' | + | 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" |
<file config .screenrc> | <file config .screenrc> | ||
Line 66: | Line 66: | ||
===== Multiple sessions ===== | ===== Multiple sessions ===== | ||
- | It's possible to have various Screen sessions running, each one with their own set of windows open. If you started Screen by just typing screen, a new session is created. If you detach and type screen again, a new session will start. If you now type: | + | It's possible to have various Screen sessions running, each one with their own set of windows open. If you started Screen by just typing |
'' | '' | ||
Line 88: | Line 88: | ||
'' | '' | ||
- | where mysession is the name you want to give to your session (e.g., work). | + | where mysession is the name you want to give to your session (e.g., |
===== Splitting windows ===== | ===== Splitting windows ===== | ||
Line 184: | Line 184: | ||
=== Keybindings === | === Keybindings === | ||
- | It's possible to bind keys so that when you type CTRL-a KEY Screen | + | It's possible to bind keys so that when you type **CTRL-a KEY** Screen |
<file config .screenrc> | <file config .screenrc> | ||
Line 192: | Line 192: | ||
</ | </ | ||
- | each time you'll type CTRL-a m a new window (named mail)with mutt will be created. Be careful: when you bind a key, you'll overwrite Screen' | + | each time you'll type **CTRL-a m** a new window (named |
===== Cheat sheet ===== | ===== Cheat sheet ===== |
screen.txt · Last modified: 2021/03/16 21:39 by hc9