Screen

https://stackoverflow.com/questions/20202269/set-up-git-bash-to-work-with-tabs-on-windows
https://stormpath.com/blog/tutorial-setup-git-cli-environment-windows
https://www.udemy.com/git-bash/
https://github.com/zeit/hyper/issues/1252
https://www.udacity.com/wiki/ud775/git-bash-copy-paste
http://www.sitepoint.com/10-killer-tmux-tips/

What is the purpose of screen?

Screen is a shell multiplexer. It allows us to run multiple shells within one shell. There is a scrollback history buffer for each virtual terminal and a copy-and-paste mechanism that allows the user to move text regions between windows. When screen is called, it creates a single window with a shell in it (or the specified command) and then gets out of your way so that you can use the program as you normally would. Then, at any time, you can create new (full-screen) windows with other programs in them (including more shells), kill the current window, view a list of the active windows, turn output logging on and off, copy text between windows, view the scrollback history, switch between windows, etc. All windows run their programs completely independent of each other. Programs continue to run when their window is currently not visible and even when the whole screen session is detached from the users terminal.

How can we launch a new screen session?

screen

How can we detach from current session?

CTRL+a d

How can we reconnect to existing session?

screen -r

How can we create a window?

CTRL+a c

How can we give current window a name?

CTRL+a A

How can we switch window?

CTRL+a CTRL+a

How can we switch to next window?

CTRL+a n

How can we switch to previous window?

CTRL+a p

How can we get the list of windows?

CTRL+a "

You can navigate this list using the arrow key.

How can we switch to window 0 - 9?

CTRL+a 0-9

How can we get a small non-interactive list of windows?

CTRL+a w

How can we kill misbehaving programs?

CTRL+a K

How can we enter copy mode?

CTRL+a [

How can we paste?

CTRL+a ]

How can we enter the scroll mode?

If we need to scroll up to see the text that has scrolled past the screen, use the copy mode:

CTRL+a [

and then use the up or down arrow to move around.

How can we copy?

  1. Press CTRL+a [ (enter into the copy mode. )
  2. Use the arrow keys, or vim-like keybindings, to move around the screen. 0 gets you to the start of a line, and $ to the end of a line. When you've reached the point where you want to start the copy, hit Enter.
  3. Move the cursor to the end point of your selection (you'll see what you're copying highlighted), and then hit Enter again.
  4. Move the cursor to wherever you want to paste the selection (you can move to another screen within your session), and hit Ctrl+A ] to paste the selection.

You can also use Ctrl+A > filename to paste the selection to a filename and Ctrl+A < filename to read a file into the selection buffer so you can then paste it out again using Ctrl+A ].

I had a screen which I use the mysql client to run a SQL statement. I've copied the result of the SQL statement. To save the result of this SQL statement, I launch a new screen with "CTRL+A c", and then launch vim, and I was able to paste using CTRL+], and use vim to save its buffer to a file. Without using this, the "Ctrl+A > filename" approach did not work for me for some reason.

Ctrl-B will move up a screen/Ctrl-F will move down a screen.

When in copy mode, you can also use screen's scrollback feature (i.e., you can scroll back upward past the top of the currently displayed text) and the search function.

Use ? to search backward. This is probably what you want initially, as you'll be starting by default from the bottom of the scrollback.

/ searches forward.

Bear in mind that the default scrollback is only 100 lines. To increase this, add a line to your ~/.screenrc:

defscrollback 1000

How can we display a terse list of commands?

CTRL+a ?
CTRL+a _                  // stop monitoring the current window for 30 seconds of silence
CTRL+a M                  // start or stop monitoring current window for activity

List the currently running screen sessions:

screen -ls
screen -t editor 0
screen -t server 1 ssh me@myserver
screen -t IRC 2 irssi
screen -t Mail 3 mutt

screen is also capable of logging to files.

You can split the screen to see 2 windows at the same time.
http://www.kuro5hin.org/story/2004/3/9/16838/14935
http://magazine.redhat.com/2007/09/27/a-guide-to-gnu-screen/
http://www.rackaid.com/resources/linux-screen-tutorial-and-how-to/
http://www.linuxjournal.com/article/6340
https://www.linux.com/learn/tutorials/285795-taking-command-of-the-terminal-with-gnu-screen-
http://www.pixelbeat.org/lkdb/screen.html
http://en.gentoo-wiki.com/wiki/Screen
https://wiki.archlinux.org/index.php/GNU_Screen
http://www.noah.org/wiki/Screen_notes
man screen

Can two users collaborate on one document at the same time?
How to enter command mode? What is the purpose of the command mode?
What is screen's multi-user mode?

Competitions / Alternatives:

| Tmux

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License