Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I saw some body split their window to 2x2, I just want to know how to do that? I know the 'split' command in Screen can only split the window horizontally.

share|improve this question
3  
This is not possible in some (all?) versions of gnu screen, a custom patch was developed to do this and has been applied in many distributions. I believe this patch is supposed to have made it into upstream, but may not have been released yet. Consider using tmux instead. – xenoterracide Dec 13 '11 at 6:44

3 Answers

up vote 5 down vote accepted

GNU Screen does not support vertical split unless it's patched (some distros have a patched version of screen in their repositories, but it's rare.)

The Patch is licensed under GPLv2. Some people say that the vertical split in GNU screen makes the application slow but I haven't tested. I use tmux (The Terminal Multiplexor)

share|improve this answer
so, looks like it's time to migrate to tmux. – Rocky Dec 14 '11 at 8:34
1  
Note: This is no longer true. Vertical splits are part of the official source and Ubuntu packages ship with the functionality built in. – JaredMcAteer Feb 20 at 15:49

Use the -v option to split command in screen. From the manpage:

   Split  the current region into two new ones. All regions on the display
   are resized to make room for the new region. The blank window  is  dis‐
   played  on  the  new  region. Splits are made horizontally unless -v is
   used. Use the "remove" or the "only" command  to  delete  regions.  Use
   "focus" to toggle between regions.
share|improve this answer
Which split command are you referring to? – xiaohan2012 Dec 13 '11 at 4:54
As mentioned, the command in screen. – Arcege Dec 13 '11 at 6:10
it does not accept arguments. :( – Rocky Dec 13 '11 at 7:41
google says we need a patch for vertical split. – Rocky Dec 13 '11 at 8:04
2  
It works here (Ubuntu 11.10), also with shortcur C-a |. – enzotib Dec 13 '11 at 8:35

The latest version of GNU screen allows you split the window vertically without any external patches. Here's one way to get it and use it

  1. Checkout/clone/download the source
  2. Build it in an easy sequence of ./configure, make and install. I didn't have any problems with dependencies on Mountain Lion.
  3. To get a vertical split use:

    C-a |  // Create a split
    C-a <Tab> // Move to the split
    C-a c // Create a new window within the split
    

I don't think this is a reason to switch to tmux any more like others have been suggesting.

share|improve this answer
1  
Is it possible to preconfigure screen to autostart with multiple splits ? – Fedir Apr 3 at 13:41
@Fedir Sorry about the late response. But I'm not sure. – gkb0986 May 5 at 21:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.