Screen

From Leo's Notes
Revision as of 19:13, 24 February 2017 by Leo (talk | contribs) (Text replacement - "<code>" to "{{code|")
This page was last edited on 24 February 2017, at 19:13.

Disable Visual Bell

To disable the visual bell for the current screen instance, hit:

CTRL+A, CTRL+G

For a permanent fix, put the following into the {{code|~/.screenrc file

vbell_msg "bell: window ~%" # Message for visual bell
vbellwait 2 # Seconds to pause the screen for visual bell
vbell off # Turns visual bell off

Force Background Redraw

Screen will sometimes mess with any background colors set by programs such as vim. This will cause weird visuals in the terminal where background colors are only rendered where there is text.

You can force screen to redraw the entire area such that the background colors are preserved by putting the following in your {{code|.screenrc file:

defbce on

Scrollback Buffer

.screenrc

defscrollback 5000


C-a [


h - Move the cursor left by one character j - Move the cursor down by one line k - Move the cursor up by one line l - Move the cursor right by one character 0 - Move to the beginning of the current line $ - Move to the end of the current line. G - Moves to the specified line

      (defaults to the end of the buffer).

C-u - Scrolls a half page up. C-b - Scrolls a full page up. C-d - Scrolls a half page down. C-f - Scrolls the full page down.



/ - Search forward ? - Search backward

Rename Screen Session

C-a :sessionname mySessionName

Lock a Session

You can use screen to lock the virtual terminal by using the

C-x

key.

Running a command detached

To run a command in a screen session in the background, use:

screen -S screename -dm command

Running screen through su

If you are running screen not directly through the terminal (such as through su), you will get the following error message:

% screen 
Cannot open your terminal '/dev/pts/0' - please check.

You can remedy this using script:

script /dev/null

Serial

You can use screen as a serial console as well.

screen /dev/ttyS0 <baud>[,<options>]

Common baud rates are 9600 or 115200.