Hacker News new | past | comments | ask | show | jobs | submit login

I covered that in the tmux book briefly - you want the join-pane and break-pane commands. By default, prefix ! will break a pane into a new window, and join-pane will let you move a pane to a different window - you have to specify the window number and the pane.

Does that help?




Thanks for the suggestions!

Yeah, this kind of works, but I need to do maybe too many steps to get what I want, maybe with some tmux scripting fu I'd make it work.

The main issue is that I can open my apps always in the same order, so I know wich window number it has, then, joining-pane by window number would be doable. the problem is that after breaking and joining a few times, numbers may get scrambled.

Another issue is that if an app is in a pane, it looses the identity, and cannot be joined to another window alone.

I'm thinking on doing something in the lines of:

WINDOW=`tmux list-windows | grep active | sed -e 's/^\(.\).*/\1'`

choose-window "join-pane -s $WINDOW -t %%"

But for the moment, no luck.

Will keep trying :)


I had similar issues to yourself when migrating from screen.. the notion of 'panes' ~= 'windows' doesn't really work in some sense.. in screen when you split you initiate an empty 'pane' (if that makes sense).. and then you put some content into it.. you can also move the 'windows' around to wherever you want.. but all within a single 'pane'-buffer

however, in tmux.. what you have is like a whole series of pane containers.. these are called windows.. now, each window can have a name.. whilst a pane on its own does not.. you can fortunately 'join' and 'send' panes between windows.. also, another thing I tend to find useful is the ability to 'break' a 'pane' out've its current window and devote a full window to it..

the .tmux.conf bits you need are

bind-key 'j' command-prompt -p "join pane from:" "join-pane -s '%%'"

bind-key '@' command-prompt -p "send pane to:" "join-pane -t ':%%'"

whilst :break-pane (or ^b ! by default) allows you to send a 'pane' away to its own window.. (apologies it that sounds awfully convoluted/confusing)


That's what I was thinking of :). Thanks!

Maybe that's as far as we can get by now with it. Luckily tmux is heavily developed so there's hope for that workflow being easily usable in the future.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: