2

When attempting to split Tmux windows by using commands, I get the opposite effect of what one should expect:

The command

tmux split-window -v

Produces a horizontal split, while the command

tmux split-window -h 

Produces a vertical split.

When attempting to split via the default keybinds it works as intended,

C-b %      # Produces a vertical split
# or 
C-b "      # Produces a horizontal split

It feels ridiculous to waste time on this, but something is borked, somewhere, somehow. Can post tmux.conf if required.

1

The default binding of Prefix+% (“vertical split” as you describe it) is split-window -h (see the output of list-keys).

It sounds like you may be thinking only of the orientation of the new pane divider. It may help if you instead consider “horizontal” and “vertical” as describing which dimension of the pane is being divided up to form the new pane.

split-window -h splits the horizontal space of a pane.

                                <#####|#####> horizontal space

+-----------+                   +-----+-----+
|           |                   |     |     |
|           |     Prefix %      |     |     |
|           |                   |     |     |
|           |  split-window -h  |     |     |
|           |                   |     |     |
+-----------+                   +-----+-----+

split-window (without -h) and split-window -v split the vertical space of a pane.

+-----------+                   +-----------+  ^  vertical space
|           |                   |           |  #
|           |     Prefix "      |           |  #
|           |                   +-----------+  -
|           |  split-window -v  |           |  #
|           |                   |           |  #
+-----------+                   +-----------+  v

The dividers necessarily end up with the opposite orientation.

  • Oh boy, why would they do that? Goes against the logical naming conventions of most Tiling WM's and Vim. Thanks for clarifying :) – krystah Dec 19 '13 at 8:06
  • It was probably done that way because it matches the Emacs convention. – Chris Johnsen Dec 20 '13 at 6:46

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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