Showing posts with label screen. Show all posts
Showing posts with label screen. Show all posts

Monday, January 14, 2013

Simulating multiple paste buffers with the screen

Multiple paste buffers can be simulates by using screen registers.

To copy a string to a register use. Here are the command to add content to two registers:

C-a : register a "reg1content"
C-a : register b "reg2content"

Now to paste the contents, use this:

C-a : paste a
C-a : paste b


Sunday, September 11, 2011

Nested screen sessions

I have been using GNU screens since few years but never thought of using nested screen SESSIONS. Nested screen sessions comes handy when you want to SSH to other server from screen WINDOWS. Here is my recipe for handling nested screen sessions.

* ssh jayrajput@serverA
* screen -e ^Ee # Change escape character from Ctrl-A to Ctrl-E. see escape function in man screen.
* screen -d -m -S serverA # Create a new detached screen session named "serverA" on serverA in detached mode.
* screen -x serverA # Attach to the "serverA" screen session.
* Ctrl-E + c # create a new screen window
* ssh jayrajput@serverB # ssh to serverB
* screen # Run screen on serverB


Use Ctrl-A as command leader in inner screen sessions .
User Ctrl-E as command leader in outer screen sessions.

Setting the hardstatus your .screenrc also comes handy

hardstatus alwayslastline
hardstatus string "%t"

This will show the hostname in the outer screen session status. Do not know why but it does show the hostname.