{"id":1881,"date":"2017-03-23T18:15:25","date_gmt":"2017-03-23T12:45:25","guid":{"rendered":"https:\/\/www.wikitechy.com\/technology\/?p=1881"},"modified":"2017-03-28T17:57:48","modified_gmt":"2017-03-28T12:27:48","slug":"split-terminal-one-view","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/technology\/split-terminal-one-view\/","title":{"rendered":"[Solved &#8211; 3 Answers] LINUX &#8211; How to split the terminal into more than one \u201cview\u201d"},"content":{"rendered":"<p><label class=\"label label-warning\">PROBLEM:<\/label><\/p>\n<ul>\n<li>From vi, if you issue the command :sp, the screen splits into two &#8220;views&#8221;, allowing you to edit more than one file from the same terminal.<\/li>\n<li>Along those same lines, is there a way to have multiple shells open in the same terminal?<\/li>\n<\/ul>\n<p><label class=\"label label-info\">SOLUTION 1:<\/label><\/p>\n<ul>\n<li>You can do it in screen the terminal multiplexer.<\/li>\n<\/ul>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <span class=\"code-embed-name\">bash code<\/span> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">To split vertically: ctrl a then |.<br\/>To split horizontally: ctrl a then S (uppercase one).<br\/>To unsplit: ctrl a then Q (uppercase one).<br\/>To switch from one to the other: ctrl a then tab<\/code><\/pre> <\/div>\n<p><span style=\"color: #003300;\"><strong>Note<\/strong>: <\/span>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.<\/p>\n<p><strong><span style=\"color: #ff6600;\">EDIT, basic screen usage:<\/span><\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <span class=\"code-embed-name\">bash code<\/span> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">New terminal: ctrl a then c.<br\/>Next terminal: ctrl a then space.<br\/>Previous terminal: ctrl a then backspace.<br\/>N&#039;th terminal ctrl a then [n]. (works for n\u2208{0,1\u20269})<br\/>Switch between terminals using list: ctrl a then &quot; (useful when more than 10 terminals)<br\/>SendNew terminal: ctrl a then c.<br\/>Next terminal: ctrl a then space.<br\/>Previous terminal: ctrl a then backspace.<br\/>N&#039;th terminal ctrl a then [n]. (works for n\u2208{0,1\u20269})<br\/>Switch between terminals using list: ctrl a then &quot; (useful when more than 10 terminals)<br\/>Send ctrl a to the underlying terminal ctrl a then a.<br\/> ctrl a to the underlying terminal ctrl a then a.<\/code><\/pre> <\/div>\n[ad type=&#8221;banner&#8221;]\n<p><label class=\"label label-info\">SOLUTION 2:<\/label><\/p>\n<ul>\n<li>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:<\/li>\n<\/ul>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <span class=\"code-embed-name\">bash code<\/span> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">Split screen vertically: Ctrl b and Shift5<br\/>Split screen horizontally: Ctrl b and Shift&quot;<br\/>Toggle between panes: Ctrl b and o<br\/>Close current pane: Ctrl b and x<\/code><\/pre> <\/div>\n<ul>\n<li>You can achieve more complex layouts by splitting panes. You can also have multiple windows with panes and switch between them.<\/li>\n<\/ul>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <span class=\"code-embed-name\">bash code<\/span> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">Create windows: Ctrl b and c<br\/>Switch to next window: Ctrl b and n<br\/>Switch to previous window: Ctrl b and p<br\/>Destroy current window: Ctrl b and Shift7<\/code><\/pre> <\/div>\n<p><label class=\"label label-info\">SOLUTION 3:<\/label><\/p>\n<p>Below, show you only how to open 4 bash shells in one terminal you can increase it but 4 are enough according to you<\/p>\n<ol>\n<li>First of all open the terminal and run the command screen and then press. (now you invoked the screen and you are in)<\/li>\n<li>\u00a0Now press (control+a followed by shift+s) it will split the screen horizontally into two.<\/li>\n<li>So we created the two screens horizontally now its time to split the screen vertically as well so<\/li>\n<li>\u00a0Press (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.<\/li>\n<\/ol>\n<p>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 .<\/p>\n[ad type=&#8221;banner&#8221;]\n","protected":false},"excerpt":{"rendered":"<p>PROBLEM: From vi, if you issue the command :sp, the screen splits into two &#8220;views&#8221;, 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? SOLUTION 1: You can do it in screen the terminal multiplexer. [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1699],"tags":[3996,3989,3991,3987,3988,3994,3986,3998,3997,3995,3990,3992,3993],"class_list":["post-1881","post","type-post","status-publish","format-standard","hentry","category-linux","tag-divorced-input-line-in-gnu-screen","tag-how-can-i-use-the-output-of-a-command-without-using-the-mouse","tag-how-do-i-get-screen-not-to-mangle-some-utf-8-sequences","tag-how-to-display-a-bash-x-terminal-and-graphics-in-split-view-window","tag-how-to-switch-to-another-screen-to-run-git-commands-while-resolving-conflicts-blocking-command","tag-is-split-screen-cating-possible","tag-save-views-in-multiple-screen-terminals","tag-shell-terminal-gnu-screen","tag-split-terminal-screen-into-multiple","tag-terminal-and-web-browser-combination","tag-tmux-with-more-terminals-than-panes","tag-use-system-clipboard-in-vi-copy-mode-in-tmux","tag-why-screen-is-not-splitting-my-gnome-terminal"],"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/1881","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/comments?post=1881"}],"version-history":[{"count":0,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/1881\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/media?parent=1881"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/categories?post=1881"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/tags?post=1881"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}