informatique:logiciels:screen
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| informatique:logiciels:screen [2009/06/10 21:10] – Combinaisons de touches pteu | informatique:logiciels:screen [2020/12/03 10:11] (current) – Copier le buffer dans un fichier pteu | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | {{tag> | + | ======Screen====== |
| - | + | ||
| - | ======SCREEN====== | + | |
| =====Présentation===== | =====Présentation===== | ||
| - | **Screen** permet de créer | + | **Screen** |
| + | //NB : Il existe d' | ||
| - | =====Configuration===== | ||
| - | Le fichier de configuration se nomme '' | + | =====Utilisation===== |
| - | Pour afficher une barre de statut | + | Installation, |
| + | <code bash> | ||
| + | aptitude install screen | ||
| - | hardstatus alwayslastline " | + | screen |
| - | Pour éviter le message au lancement : | + | echo test |
| + | | ||
| + | </ | ||
| - | startup_message off | + | On va ensuite **d**étacher la console avec la combinaison '' |
| + | //Plus tard// on décide de récupérer (**r**attacher) notre screen : | ||
| + | <code bash> | ||
| + | screen -r | ||
| + | </ | ||
| - | =====Utilisation===== | + | On récupère ainsi l' |
| - | On installe et on lance screen : | + | On peut également **c**réer d' |
| - | aptitude install | + | Pour la rejoindre plus tard : '' |
| - | screen | + | <code bash> |
| + | screen -r | ||
| + | There are several suitable screens on: | ||
| + | | ||
| + | | ||
| + | Type "screen | ||
| - | Dans le terminal qu'on vient d' | + | screen -r 314..soekris-01 |
| + | </ | ||
| - | echo test | + | Sinon, pour simplement lister les sessions existantes : '' |
| - | test | + | |
| - | On va ensuite **d**étacher la console avec la combinaison '' | + | Pour lancer un script dans un screen au démarrage par exemple, |
| + | <code bash> | ||
| + | screen -d -m script.sh | ||
| + | </ | ||
| + | ... pour créer une nouvelle session sans l'attacher. | ||
| - | //Plus tard// on décide de récupérer (**r**attacher) notre screen : | ||
| - | screen -r | + | =====Combinaisons de touches===== |
| - | On récupère ainsi l'état dans lequel on l'avait laissé. | + | Pour afficher les raccourcis courants, appuyer sur la touche de préfixe '' |
| - | On peut également **c**réer d' | + | Une fois screen |
| - | On peut aussi partager un terminal : il faut créer un '' | + | * '' |
| - | On utilise cette fonctionnalité avec un utilisateur | + | * '' |
| + | * '' | ||
| + | * '' | ||
| + | * ''< | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * soit le mdp de votre utilisateur | ||
| + | * soit il demande un mdp avant de la verrouiller, | ||
| + | * '' | ||
| + | * '':'' | ||
| - | On peut lancer plusieurs screen à la fois ; pour se rattacher à l'un d' | ||
| - | screen -r | + | =====Diviser la fenêtre |
| - | There are several suitable screens on: | + | |
| - | 314..soekris-01 | + | |
| - | 9364..soekris-01 | + | |
| - | Type " | + | |
| - | screen -r 314..soekris-01 | + | |
| - | Pour lancer | + | Plutôt que d' |
| - | screen -d -m script.sh | + | Pour diviser la fenêtre : '' |
| + | * '' | ||
| + | * '' | ||
| - | pour créer une nouvelle session sans l'attacher. | + | Autres raccourcis liés au split : |
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * ''< | ||
| + | Il n' | ||
| + | <code bash> | ||
| + | bind k focus down | ||
| + | bind j focus up | ||
| + | bind t focus top | ||
| + | bind b focus bottom | ||
| + | </ | ||
| + | =====Configuration===== | ||
| - | =====Combinaisons | + | Le fichier |
| - | Une fois screen lancé, on utilise la combinaison | + | Lorsqu' |
| - | * c : pour créer un nouveau terminal | + | |
| - | * k : killer le terminal courant (une confirmation vous est demandée (y/n)) | + | =====Tips===== |
| - | * n : se déplacer vers le terminal suivant | + | |
| - | * p : se déplacer vers le terminal précédent | + | ====Copier |
| - | * <n> : se déplacer vers le terminal <n>, | + | |
| - | * " | + | Pour enregistrer |
| - | | + | |
| - | | + | Une autre méthode, plus compliquée mais qui permet de comprendre le mécanisme de copies de screen |
| - | * ctrl+x | + | |
| - | * soit le mdp de votre utilisateur vous sera demandé pour rouvrir | + | |
| - | * soit il demande | + | - Lancer |
| + | - Coller le buffer : '' | ||
| =====Annexes===== | =====Annexes===== | ||
| - | ====Ma conf==== | + | ====Exemple de template de conf==== |
| - | | + | <code bash> |
| - | startup_message off | + | # ne pas afficher le message au lancement |
| - | deflogin on | + | startup_message off |
| - | vbell on | + | deflogin on |
| - | vbell_msg " | + | vbell on |
| - | defscrollback 1024 | + | vbell_msg " |
| - | bind ^k | + | defscrollback 1024 |
| - | bind ^\ | + | bind ^k |
| - | bind \\ quit | + | bind ^\ |
| - | bind K kill | + | bind \\ quit |
| - | bind I login on | + | bind K kill |
| - | bind O login off | + | bind I login on |
| - | bind } history | + | bind O login off |
| - | termcapinfo vt100 dl=5\E[M | + | bind } history |
| - | hardstatus off | + | termcapinfo vt100 dl=5\E[M |
| - | termcapinfo xterm*|rxvt*|kterm*|Eterm* hs: | + | hardstatus off |
| - | hardstatus alwayslastline " | + | termcapinfo xterm*|rxvt*|kterm*|Eterm* hs: |
| - | termcapinfo xterm*|linux*|rxvt*|Eterm* OP | + | # Pour afficher une barre de statut : |
| - | termcapinfo xterm ' | + | #hardstatus alwayslastline " |
| + | # ou | ||
| + | hardstatus alwayslastline " | ||
| + | termcapinfo xterm*|linux*|rxvt*|Eterm* OP | ||
| + | termcapinfo xterm ' | ||
| + | # ~/.screenrc | ||
| + | defscrollback 4096 | ||
| + | startup_message off | ||
| + | caption always " | ||
| + | </ | ||
informatique/logiciels/screen.1244668257.txt.gz · Last modified: 2013/10/14 20:55 (external edit)