Sunday, 7 May 2017

Some hints for GNU Screen


Best way to have interactive shells along VIM without having to hide the editor is using screen (a sort-of virtual terminal within the terminal).

BUT!, it seems you can't launch X forwarded applications from screen

This is the best reference I've found: http://aperiodic.net/screen/quick_reference


Using it:

screen -S MyTerminal  #launch

screen -dm -S MyProcess process_launcher #start in detached mode

screen -ls # list current sessions

screen -r # recover a running session



In a running session:

Ctrl+a d # detach

Ctrl+a D D # detach and logout

Ctrl+a c # create new "window"

Ctrl+a SPACE # jump to next window

Ctrl+a TAB # jump to next split

Ctrl+a A # rename window

Ctrl+a k # kill window

Ctrl+a w # show window bar

The easiest way to display the sessionname is
  C-a : 
  sessionname


Splits:

Ctrl+a S  # split horizontally

Ctrl+a | # split vertically

Ctrl+a X # close current split

Ctrl+a Q # close all splits but current

Ctrl+a :only # the same using verbose commands

Ctrl+a :resize 10 # vertical resize

Ctrl+a :resize -h 40 #horizontal resize




Scrolling and/or copying:

Ctrl+a ESC # enter copy mode

<enter> ... <enter> # select text

Ctrl+a ] # paste text

Ctrl+u # scroll up in copy mode

Ctrl+d # scroll down in copy mode