• From vi, if you issue the command :sp, the screen splits into two “views”, allowing you to edit more than one file from the same terminal.
  • Along those same lines, is there a way to have multiple shells open in the same terminal?

  • You can do it in screen the terminal multiplexer.
[pastacode lang=”bash” manual=”To%20split%20vertically%3A%20ctrl%20a%20then%20%7C.%0ATo%20split%20horizontally%3A%20ctrl%20a%20then%20S%20(uppercase%20one).%0ATo%20unsplit%3A%20ctrl%20a%20then%20Q%20(uppercase%20one).%0ATo%20switch%20from%20one%20to%20the%20other%3A%20ctrl%20a%20then%20tab%0A” message=”bash code” highlight=”” provider=”manual”/]

Note: After splitting, you need to go into the new region and start a new session via ctrl a then c before you can use that area.

EDIT, basic screen usage:

[pastacode lang=”bash” manual=”New%20terminal%3A%20ctrl%20a%20then%20c.%0ANext%20terminal%3A%20ctrl%20a%20then%20space.%0APrevious%20terminal%3A%20ctrl%20a%20then%20backspace.%0AN’th%20terminal%20ctrl%20a%20then%20%5Bn%5D.%20(works%20for%20n%E2%88%88%7B0%2C1%E2%80%A69%7D)%0ASwitch%20between%20terminals%20using%20list%3A%20ctrl%20a%20then%20%22%20(useful%20when%20more%20than%2010%20terminals)%0ASendNew%20terminal%3A%20ctrl%20a%20then%20c.%0ANext%20terminal%3A%20ctrl%20a%20then%20space.%0APrevious%20terminal%3A%20ctrl%20a%20then%20backspace.%0AN’th%20terminal%20ctrl%20a%20then%20%5Bn%5D.%20(works%20for%20n%E2%88%88%7B0%2C1%E2%80%A69%7D)%0ASwitch%20between%20terminals%20using%20list%3A%20ctrl%20a%20then%20%22%20(useful%20when%20more%20than%2010%20terminals)%0ASend%20ctrl%20a%20to%20the%20underlying%20terminal%20ctrl%20a%20then%20a.%0A%20ctrl%20a%20to%20the%20underlying%20terminal%20ctrl%20a%20then%20a.%0A” message=”bash code” highlight=”” provider=”manual”/] [ad type=”banner”]

  • As mentioned in the comments, besides screen, another good terminal multiplexer is tmux. You can refer to the manual for a complete description and command reference. Some basic operations to get started are:
[pastacode lang=”bash” manual=”Split%20screen%20vertically%3A%20Ctrl%20b%20and%20Shift5%0ASplit%20screen%20horizontally%3A%20Ctrl%20b%20and%20Shift%22%0AToggle%20between%20panes%3A%20Ctrl%20b%20and%20o%0AClose%20current%20pane%3A%20Ctrl%20b%20and%20x%0A” message=”bash code” highlight=”” provider=”manual”/]
  • You can achieve more complex layouts by splitting panes. You can also have multiple windows with panes and switch between them.
[pastacode lang=”bash” manual=”Create%20windows%3A%20Ctrl%20b%20and%20c%0ASwitch%20to%20next%20window%3A%20Ctrl%20b%20and%20n%0ASwitch%20to%20previous%20window%3A%20Ctrl%20b%20and%20p%0ADestroy%20current%20window%3A%20Ctrl%20b%20and%20Shift7%0A” message=”bash code” highlight=”” provider=”manual”/]

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

  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.
  3. So we created the two screens horizontally now its time to split the screen vertically as well so
  4.  Press (control+a followed by shift+| ( 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 .

[ad type=”banner”]

Categorized in: