Working with .screenrc file for a better screen experience

The .screenrc file resides in your home folder which is /home/<your_username>/.screenrc 

Opening multiple default screen windows when `screen` starts:

In this case 2 default windows with the first one at the bash prompt and the second one starting the python prompt.

Enter the following one after the other in your ~/.screenrc  

screen -t Shell 1 bash
screen -t Python 2 python

Selecting the 0th window on screen launch, if multiple windows open:

select 0

Go to the screen number mapped with that character:

Bind a character to the index of the screen window pane.

In this case bind character j to window index number 1 and so on. Use it by typing <Ctrl-a> j to go to Window pane 1.

bind j select 1
bind k select 2
bind l select 3

Bind v to vertical split of window and h to horizontal split of the window.

bind v split -v
bind h split -h

The above helps create regions on your main window splitting it vertically and horizontally when used.

Create a Vertical split by using Screen Command Key + v

Command Key in our case is Ctrl-a, so let’s press Ctrl-a and then v

This is what it yields.

And to split the Window region horizontally, press Command Key + h.

So with Ctrl-a + h, the below is what it yields

If you wish to delete of kill the regions created by the vertical and horizontal split just type your main Command character and Shift+x like so. In this case the screen command character key is Ctrl-a and upper case x.

Ctrl-a X

Thanks for reading up until here. We’ll come back with more interesting stuff soon.

Happy screening…!

Author: Admin

Hello Friends, welcome to Hackerdays.com. I am the Admin of the site. I have worked as a software programmer for 7 years. I have started this site to learn as well as share whatever little knowledge i have gained over the period of time. If you wish to contact me, you can drop in an email to: admin[AT]hackerdays[DOT]com or you can also use the contact page. Thank you and I'll see you around.

Let us know your thoughts: