Results 1 to 6 of 6

Thread: Split Terminal Screen Into Multiple!

  1. #1
    Join Date

    Split Terminal Screen Into Multiple!

    Today I would like to share the screen command Its really very helpful and necessary in many cases so no need to open separate terminals for each program you can open them all in one Terminal screen.

    Below i will show you only how to open 4 bash shells in one terminal you can increase it but 4 are enough according to me.

    View a sample image of my terminal screen_by_hitman.jpg

    1) First of all open the terminal and run the command screen and then press. (now you invoked the screen and you are in)
    2) Now press (control+a followed by shift+s) it will split the screen horizontally into two.

    So we created the two screens horizontally now its time to split the screen vertically as well so

    3) Press (control+a followed by shift+| (don't get confuse its a pipe sign) now it will split the screen vertically but in the top screen not at bottom to split the bottom screen vertically also we have to move to that screen so press (control+a followed by tab) two times then again press (control+a followed by shift+|) it will split the bottom screen vertically also.

    Its time to run the shell in all remaining screens so to move from one screen to another press (control+a followed by tab) and then in that screen press (control+a followed by c) it will create the session there. So you will have 4 shells working in one single terminal :-)

    Lesson Learned.

    control+a followed by shift+s = it will split screen horizontally
    control+a followed by shift+| = it will split screen vertically
    control+a followed by tab = to move around the screens opened
    control+a followed by c = to create session in the opened screen

    Some more key bindings of screen for your information
    (note ^A means control+a)
    ^A ? show a help screen (display key bindings)
    ^A c create a new window and switch to it
    ^A n go to next window
    ^A p go to previous window
    ^A 0 go to window number 0
    ^A 1 go to window number 1
    ^A w show a list of windows
    ^A a send a Ctrl-A to current window as keyboard input
    ^A h write a hardcopy of current window to file
    ^A H begin/end logging current window to file
    ^A ^X lock the terminal (password protected)
    ^A d detach screen session from the terminal
    ^A DD detach screen session and log out

    If you find any problem let me know......

    Screen Command powerful usage that i like the most.

    Screen command not only allows one terminal window to work with multiple processes, but also allow remote shell process to survive interrupted connections. Here is a typical example

    1) You login to a remote machine.

    2) You start screen on a single console.

    3) You execute multiple programs in screen windows created with ^A c ("Control-A" followed by "c").

    4) You execute multiple programs in screen windows created with ^A c ("Control-A" followed by "c").

    5) You switch among the multiple screen windows by ^A n ("Control-A" followed by "n")

    6) Suddenly you need to leave your terminal, but you don't want to lose your active work by keeping the connection

    7) You may detach the screen session by any methods.

    a) Brutally unplug your network connection

    b) Type ^A d ("Control-A" followed by "d") and manually logging out from the remote connection

    c) Type ^A DD ("Control-A" followed by "DD") to have screen detach and log you out

    8)You log in again to the same remote machine (even from a different terminal).

    9)You start screen as "screen -r".

    Screen will magically reattaches all previous screen windows with all actively running programs.

    What more you need now :-) its great tool but unfortunately only few people know how to use it.
    Attached Images Attached Images
    Last edited by Hitman; 2013-05-19 at 16:06. Reason: to add more usage of screen command

  2. #2
    Join Date
    NC USA
    Thats cool but I just use Terminator. Right click split .

  3. #3
    Thanks for sharing Hitman - very well done

  4. #4
    Join Date
    Thanks @ g0tmi1k & @reaperz73. well you can right click in GUI only :-)

  5. #5
    Join Date
    tmux has similar functionality, but it easier to manage
    ctrl+b and " - split the pane vertically
    ctrl+b and % - split the pane horizontally
    ctrl+b and arrows - switch between panes

    also it's easier to send commands remotely to the chosen pane:
    # start new tmux session
    tmux new-session -n winName -s sessName
    # spit window vertically outside the tmux session
    tmux split-window -t "sessName:winName.0" -v
    # than spit second pane horizontally 
    tmux split-window -t "sessName:winName.1" -h
    # and at last launch "top" command on the third pane
    tmux send-keys -t "sessName:winName.2" "top" C-m

  6. #6
    Join Date
    Quote Originally Posted by reaperz73 View Post
    Thats cool but I just use Terminator. Right click split .
    Was going to say the same, terminator is quite nice.

Similar Threads

  1. Black screen with up arrow when using terminal
    By eng.ma90 in forum TroubleShooting Archive
    Replies: 0
    Last Post: 2016-10-01, 15:04
  2. Xterm doesn't work, cannot open multiple windows on terminal
    By nedo in forum NetHunter General Questions
    Replies: 0
    Last Post: 2015-12-08, 21:38
  3. Terminal and root terminal doesn't working
    By jamalMint in forum General Archive
    Replies: 4
    Last Post: 2015-12-01, 05:01
  4. Replies: 0
    Last Post: 2014-06-12, 10:57

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts