Questions tagged [tmux]

tmux is a terminal multiplexer: it enables a number of terminals (or windows), each running a separate program, to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached.

Features that differentiate tmux from GNU Screen are:

  • menus for interactive selection of running sessions, windows or clients
  • window can be linked to an arbitrary number of sessions
  • vi-like or Emacs command mode (with auto completion) for managing tmux
  • lack of built-in serial and telnet clients
  • different configuration language
  • different command keys—it is not a drop-in replacement for screen

For more information have a look at the project page of tmux.

1317 questions
378
votes
11 answers

Write all tmux scrollback to a file

How can I write all the scrollback in a tmux session to a file? capture-panel can grab the current screen, but not the entire scrollback.
David Wolever
  • 4,654
  • 4
  • 17
  • 15
331
votes
7 answers

How do I equally balance tmux(1) split panes?

I'm looking for a behavior that is similar to how vim(1) handles its split windows with ^w =. I know tmux(1) has predefined layouts with ^b Meta[1-5], but this likely does not have the layout that I am currently using. When splitting a window, it…
Aaron Toponce
  • 4,514
  • 2
  • 18
  • 12
299
votes
7 answers

Moving tmux pane to window

How do I move an existing pane into another window in tmux when I have multiple windows, and vice versa? I'm coming from screen, where I can switch to the pane and then switch windows until I get to the one I want; tmux does not seem to allow this.
mrlanrat
  • 3,093
  • 2
  • 15
  • 5
294
votes
6 answers

How to create a new window on the current directory in tmux?

Is is possible to open a new-window with its working directory set to the one I am currently in. I am using zsh, if it matters.
sharat87
  • 4,199
  • 4
  • 23
  • 17
256
votes
10 answers

Getting 256 colors to work in tmux

I have 256 colors working just fine in konsole,. I thought I'd give tmux a try because, unlike screen, it seems to support vi mode. However I find that the colors of my prompt show up and this is most likely because I have a 256 color mode prompt.…
xenoterracide
  • 57,918
  • 74
  • 184
  • 250
207
votes
10 answers

tmux vs. GNU Screen

Browsing through questions I found about tmux (I normally used GNU Screen). My question is what are pros and cons of each of them. Especially I couldn't find much about tmux.
Maciej Piechotka
  • 16,578
  • 11
  • 57
  • 93
202
votes
9 answers

Copy text from one tmux pane to another (using vim)

I have two files opened in vim, each in one tmux pane. I would like to copy let's say 10 lines from one file to another. How can I accomplish this not using the mouse's Copy -> Paste ?
Patryk
  • 13,556
  • 22
  • 53
  • 61
199
votes
13 answers

How to start tmux with attach if a session exists

If I use tmux attach I can attach to a running session but if there is no session running, I only get the error no sessions How can I automatically start a new session if there is none running? something like tmux attach-or-create-new-session
rubo77
  • 27,777
  • 43
  • 130
  • 199
188
votes
5 answers

Renumbering windows in tmux

I frequently end up with more than ten windows in tmux. Later on, I close some of my older ones. Is there a way to renumber, say window 15, to window 3 (which doesn't exist anymore)? Or to pack them all up again, so that there are no empty slots?…
dogbane
  • 29,087
  • 16
  • 80
  • 60
162
votes
21 answers

How can I set my default shell to start up tmux

I would like my default bash shell to go straight into tmux instead of my always having to type tmux every time.
Michael Durrant
  • 41,213
  • 69
  • 165
  • 232
143
votes
2 answers

exit tmux window without quitting the Terminal program

OK I'm new to this. I installed tmux to run a several days experiment. After typing tmux new -s name I got a new window with green banner at the bottom. I compile and run java program. Now I do not know how to exit the window (while leave it…
seteropere
  • 1,549
  • 2
  • 10
  • 5
142
votes
6 answers

What are other ways to share a tmux session between two users?

I'm looking for a clean and easy way to share a tmux session with another user on the same machine. I've tried the -S socket-path option, but it requires opening up all permissions of the socket-path before someone else can connect to the session. …
Ryan McGeary
  • 1,525
  • 2
  • 10
  • 8
134
votes
1 answer

Attach to different windows in session

I have a pretty simple tmux session running with two open windows; one of them for local hacking and one of them for work. What I'd like to do is to simply connect to the hacking window while leaving the work window open in another terminal.…
Naftuli Kay
  • 38,686
  • 85
  • 220
  • 311
133
votes
17 answers

Getting tmux to copy a buffer to the clipboard

I am trying to figure out a decent way to copy what I have in a tmux buffer into my clipboard. I have tried a couple of different things like bind-key p select-pane -t 2 \; split-window 'xsel -i -b' \; paste-buffer which gets me fairly close, all…
Digital Powers
  • 1,817
  • 4
  • 14
  • 11
129
votes
1 answer

How to make tmux count windows starting from 1 instead of 0?

I was able to make GNU Screen start counting windows with the number 1 instead of the default 0 with this code in my .screenrc: # Get rid of screen 0 bind c screen 1 bind ^c screen 1 bind 0 select 10 When I created windows in .screenrc I used…
hekevintran
  • 3,443
  • 3
  • 14
  • 9
1
2 3
87 88