Jamie Schembri
Jamie Schembri

Reputation: 6075

Is it possible to add tab-like functionality to tmux panes?

I generally use tmux with 3-4 panes open. One of these panes is rarely used, so I'd be happy to hide it away somewhere. I suppose I could do this in a new window, but I'd rather hide it "behind" an existing pane.

For example, I'd like to keep rails server running in the background because I rarely need to refer to it, so guard occupies that pane instead. When I need to look at the rails server output, I'll switch to the guard pane and then "tab" over to the rails server.

At least, that's the ideal situation, but I can't figure out how to achieve it.

Upvotes: 8

Views: 8050

Answers (3)

Thai Tran
Thai Tran

Reputation: 9935

i am not sure what is in your mind of the concept "tab"; however, from what you want, a window is more than enough.

Imagine you have a "tab" in tmux, then, you more or less have to switch to that tab in order to see the output, so, the operation is exactly the same with window of tmux.

Normally, I type <c-x> c to have a new window, and then go back to the main workspace (the previous window) with <c-x> p and open my vim there to work. I might have multiple panes on my main workspace with tmux pane (not with vim pane, cos i need to have the terminal always to navigate). Then after I change things, save, just type another <c-x> p to go to the server and see what happen there

(note that I bind <c-b> to <c-x>)

Upvotes: 1

Jan Warchoł
Jan Warchoł

Reputation: 1149

You should be able to do this using break-pane and join-pane - see this question on Unix&Linux.

Upvotes: 1

user777337
user777337

Reputation:

Tmux currently does not provide the functionality of 'hiding' panes.

For now, the closest tmux comes to hiding panes is the 'pane zoom' functionality. It is toggled with prefix + z. When 'on', the pane is resized to 100% of the window and all the other panes are hidden. Setting the pane zoom to 'off' unhides the hidden panes.

That said, I think the 'zoom' functionality is not ideal for your use case. Other have pointed it out: just using a new window that doesn't get in your way might do the trick and is a simple solution.

Upvotes: 6

Related Questions