screen
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
screen [2021/03/16 05:16] – [Starting Screen, detaching and reattaching] hc9 | screen [2021/03/16 05:31] – [.screenrc] hc9 | ||
---|---|---|---|
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 screen, you can use the shortcut |
- | 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 |
- | 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 that shows you each window number. For doing this in a permanent manner, you'll have to create a .screenrc (Screen' |
<file config .screenrc> | <file config .screenrc> | ||
Line 80: | Line 80: | ||
where HOST is the hostname and YOU is your username. | where HOST is the hostname and YOU is your username. | ||
- | You can reattach a screen session by name. Say for instance that you want to resume the 4522.pts-8.HOST session. In this case you'll have to type: | + | You can reattach a screen session by name. Say for instance that you want to resume the "4522.pts-8.HOST" |
'' | '' | ||
- | Obviously 4522.pts-8.HOST is not a very userfriendly session name. You can give a meaningful name by starting screen as: | + | Obviously |
'' | '' | ||
Line 92: | Line 92: | ||
===== Splitting windows ===== | ===== Splitting windows ===== | ||
- | It could be useful to split a window so that you can have two programs running on the viewport. In this case, type CTRL-a S and you'll see that the window will be split in two regions, with the one at the bottom blank. You can swith to it with CTRL-a TAB (TAB is the tab key) and then select a window by typing its number, or p (previous) or n (next), e.g., CTRL-a 2. You can always swith through regions with CTRL-a TAB. | + | It could be useful to split a window so that you can have two programs running on the viewport. In this case, type **CTRL-a S** and you'll see that the window will be split in two regions, with the one at the bottom blank. You can swith to it with **CTRL-a TAB** (TAB is the tab key) and then select a window by typing its number, or "p" |
- | It's possible to split the window in more then two regions, each time by typing CTRL-a S | + | It's possible to split the window in more then two regions, each time by typing |
If you want to split a window vertically, you'll have to either use a // | If you want to split a window vertically, you'll have to either use a // | ||
Line 170: | Line 170: | ||
===== .screenrc ===== | ===== .screenrc ===== | ||
- | As we previously saw, it is possible to customize Screen by writing settings in a file named .screenrc in your $HOME directory. We will now some useful Screen settings. | + | As we previously saw, it is possible to customize Screen by writing settings in a file named ".screenrc" |
=== Avoiding the startup message === | === Avoiding the startup message === | ||
Line 176: | Line 176: | ||
A full screen message with copyright and other stuff is usually displayed at startup. This can get annoying. In order to avoid it, you can put in your .screenrc the following: | A full screen message with copyright and other stuff is usually displayed at startup. This can get annoying. In order to avoid it, you can put in your .screenrc the following: | ||
- | | + | <file config .screenrc> |
+ | |||
+ | startup_message off | ||
+ | |||
+ | </ | ||
=== 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> |
+ | |||
+ | bind m screen -t mail 1 mutt | ||
+ | |||
+ | </ | ||
- | 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