Posts tagged 'screen'

Split screen panes

published on January 17, 2020.

I've been using screen a lot more recently, but not enough to have all the commands in muscle memory. Writing down a quick cheat-sheet for working with split panes/windows.

To split a screen pane horizontally: Ctrl+a Shift+s.

To split a screen pane vertically: Ctrl+a Shift+\.

To move between panes: Ctrl+a Ctrl+Tab.

To start a new command line in a pane: Ctrl+a Ctrl+c.

To close the focused pane: Ctrl+a Shift+x.

Save the layout of the panes with: Ctrl+a : and then type layout save name-of-your-layout. After reattaching to the screen session the panes will be restored.

Happy hackin’!

Versions used for examples: screen 4.6.
Tags: screen, split, panes, windows.
Categories: Software, Development.

Attach to an already attached screen

published on January 09, 2020.

Today I ran into a strange error with screen. I was working on a remote server, executing commands in screen when my connection got dropped. I reconnected, wanted to reattach to my screen session with the usual -r option:

screen -r foo

But this greeted me with an error of:

There is a screen on:
	7608.foo	(Attached)
There is no screen to be resumed matching foo.

screen -ls confirms there is a screen session for “foo”. Apparently I came back to the server so quick that screen didn't realize I got dropped from the session and it still thought I was there.

The solution is to run the screen command with -rd:

screen -rd foo

This tells screen to first detach the session and then reattach to it.

Another solution is to run the screen command with -x:

screen -x foo

This tells screen to reattach to an already attached session.

Happy hackin’!

Tags: screen.
Categories: Software, Development.
Robert Basic

Robert Basic

Software developer making web applications better.

Let's work together!

I would like to help you make your web application better.

Robert Basic © 2008 — 2020
Get the feed