screen & xterm: how to get window split vertically in custom ratio

5,208

If xterm isn't a necessity, one solution is changing terminals. Terminator has built-in split capability, horizontal and vertical, and the size of each section can be adjusted with keyboard shortcuts. Each section can also be further split. Should be available in repos.

Share:
5,208

Related videos on Youtube

syntaxerror
Author by

syntaxerror

Shyy erny anzr - Naqernf Rvonpu

Updated on September 18, 2022

Comments

  • syntaxerror
    syntaxerror over 1 year

    To begin with, I am on Lubuntu, so I can benefit from the latest screen patches that will enable vertical splitting of windows with no need to compile from source. (It really took ages...)

    However, despite reading the manual thoroughly a few times, there was no indication how to get the split ratio to something else but 50:50.

    So I opened xterm, launched screen, pressing Ctrl+a| to split the window vertically in a 50:50 fashion.
    Good, but what if I want a 70:30 ratio for a change? Sometimes I might need this, when I'm working deeply in the hierarchy of subdirectories on the left hand side, and just doing something rather trivial (that does not require this width) on the right.
    Curiously enough, even the official manual will only tell about modifying the height, but what I need is the width. Even more curiously, I read something about passing a -h/-v parameter to the resize command on the command line inside screen. (As I'm writing this, you won't find these parameters explained in the manual.) My GNU screen 4.02.01 does not seem to accept either of these two options; only a :resize <value> (with value being a signed integer number) is possible, which, as mentioned, will only ever modify the height, but not the width.

    Perhaps modifying the width when the window is split vertically is not intended in the first place?
    Well, it would come in handy sometimes, that is for sure.

    • garethTheRed
      garethTheRed over 9 years
      Is there an error message when you try Ctl-A :resize -h 50? It works for me, but I'm on v4.01 though.
    • syntaxerror
      syntaxerror over 9 years
      You're right, it works! The -h option actually does what I want!! However I wanted to get the thing bigger when panes are split vertically, that's why I used -v throughout (and the window only "shook" for a moment, but it didn't really work)! I think we both have figured out the basic problem in current screen: the options are confusing as heck and far from self-explanatory. Plus, I wish someone could tell me a plausible reason why these two options for resize aren't explained anywhere in the man page.
    • garethTheRed
      garethTheRed over 9 years
      You also use a percentage, as in Ctl-A :resize -h 50% to split it 50/50.
    • syntaxerror
      syntaxerror over 9 years
      OK, I think I finally understood why it's called h. The h must be understood as horizontal AXIS (X, mathematically). Anyway, had I written screen, I'd have used resizeX and resizeY which would have been way more self-explanatory and would not (in complex split setups) force the user to draw the setup on paper to not mix up horizontal and vertical. Supposing you have 2 windows split 50:50, horizontally. Isn't it confusing that you need to change a vertical (-v) parameter to change the splitting ratio? To talk about X axis and Y axis would no longer let your brain rotate.
    • garethTheRed
      garethTheRed over 9 years
      I'd go for h for horizontal as it fits in well with v for vertical. When you resize your horizontal split with resize -h 33% you are moving the split line in a horizontal direction, which sit if makes sense. However, you can create a split with the :split [-v] command and that oddly enough works the other way. You end up creating a split with :split -v and resize it with :resize -h!
    • syntaxerror
      syntaxerror over 9 years
      "You end up creating a split with :split -v and resize it with :resize -h!" But that IS the very thing what I was on about! This necessity of having to use the complement of the option when creating/resizing. Eh...please? This feels (figuratively) as if you create an even square() but you need a circle_resize() method to resize the thing! ;) * laugh * New users must've been totally confused by that "dialectics" since the day when the option was implemented. My word on it. This should be made more logical and more user-friendly. (* plead over )
  • syntaxerror
    syntaxerror over 9 years
    No, I do want to keep using xterm because I like to stick to standard tools (for now) which work everywhere, on a home PC as well as on a workstation in the office without further tweaking or fiddling. What I can additionally install to make life easier on my private box is yet another story. But thanks for replying anyway.