1

I've been using GNU Screen for some time and have become accustomed to the following workflow, where I will:

  • Split a region into two windows (C-a " or C-a |)
  • Open new shells up in these two windows and cycle through them as needed (C-a c, C-a n, etc).

This workflow means I can keep the window split vertically and have documentation open in the left pane, and cycle through various other shells (with other commands running) in the right pane without disturbing the left. I can't seem to do this in tmux.

In tmux I can obvious split a window into panes in a similar fashion, but I don't seem to be able to open new shells in each pane and cycle through them like I can in GNU Screen. Is this a deficiency of tmux, or have I just missed the relevant command in the man page?

  • does this help: lukaszwrobel.pl/blog/… – Jay T. Mar 8 '16 at 19:21
  • @JayT. I'm afraid not; that's a completely different workflow. I can split windows into panes in tmux, but I can't switch what's running in those panes without killing the process and replacing it. – Matthew Bradley Mar 8 '16 at 19:29
  • I am sorry to hear that I guess will have to start messing around with tmux and if I find something will let you know. – Jay T. Mar 8 '16 at 19:31
2

Either you're looking to reorder the panes or looking into something like having tmux windows inside of a tmux pane.

For the first one, check

Ctrl+b Meta+[1-5]

For the second one, that's a difference between tmux and screen.

Tmux differentiates between a window and a pane. Screen only has windows. That's why when you split and detach, it won't remember how it was (if things haven't changed).

Now, in order to do something like that in Tmux, all I can think of is either nesting Tmux sessions or using join-pane: (v2.1)

 join-pane [-bdhv] [-l size | -p percentage] [-s src-pane] [-t dst-pane]
               (alias: joinp)
         Like split-window, but instead of splitting dst-pane and creating a new pane, split it and move src-pane into the space.  This can be used to reverse break-pane.  The -b option causes src-pane to be
         joined to left of or above dst-pane.

         If -s is omitted and a marked pane is present (see select-pane -m), the marked pane is used rather than the current pane.

Based on that I found this answer, https://unix.stackexchange.com/a/14301 that has a bit of an example you might want to use:

# pane movement
bind-key j command-prompt -p "join pane from:"  "join-pane -s '%%'"
bind-key s command-prompt -p "send pane to:"  "join-pane -t '%%'"

Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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