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.
84
votes
9answers
13k views
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.
45
votes
4answers
10k views
Tmux - move window to pane
How do I move an existing window into a pane in another window in tmux when I have multiple windows? And vise versa?
I'm coming from screen, where I can switch to the pane and then switch windows ...
32
votes
3answers
7k views
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 ...
29
votes
2answers
14k views
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 ...
23
votes
10answers
11k views
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 ...
18
votes
1answer
3k views
Create new-window with 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.
15
votes
2answers
1k views
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 ...
15
votes
3answers
4k views
Is there an equivalent of GNU Screen's “log” command in tmux?
I make heavy use of screen's "log" command to log the output of a session to a file, when I am making changes in a given environment. I searched through tmux's man page, but couldn't find an ...
13
votes
2answers
3k views
tmux: write all scrollback to a file?
How can I write all the scrollback in a tmux session to a file? (I know that, ex, capture-panel can grab the current screen… But I want the entire scrollback)
13
votes
1answer
2k views
How can I tell if I'm in a tmux session from a bash script?
I like to keep my bash_profile in a git repository and clone it to whatever machines I have shell access to. Since I'm in tmux most of the time I have a user@host string in the status line, rather ...
13
votes
4answers
2k views
How to get vim to work with tmux properly?
I'm trying to figure out how to get vim and tmux play together.
My problem is:
When I use xterm-256color I get vim to work nicely, but the background doesn't render properly.
I fixed this by using ...
13
votes
5answers
7k views
How can I run a script immediately after connecting via SSH?
I started to ask this question but answered it while I had it open. I'm going to post this question, follow it up with my solution and leave it open to other potential solutions.
<backstory>
...
13
votes
2answers
2k views
Shift-arrow not working in emacs within tmux
I recently started using tmux (was a screen user before) and I'm loving it, except for one small problem. I use emacs within my tmux session and I am used to using Shift-arrow keys to move between ...
12
votes
3answers
2k views
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 ...
10
votes
1answer
1k views
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 ...
8
votes
4answers
3k views
How do I bind the tmux prefix to a Super?
I find even Ctrl+b to be very emacs like but I understand the point. I'm wondering if I could bind it to a single keypress of a key I don't other wise use? namely Super_L (also known as the left ...
8
votes
1answer
2k views
How can I move tmux's status bar to the top?
How can I move tmux's status bar to the top? Can't find it on the man page.
8
votes
1answer
418 views
Best Practices for SSH, tmux & GnuPG Agent
I'm attempting to consolidate my encryption software to GnuPG, and I'm running into a confusing problem.
My primary unit is a headless server, and I exclusively work in tmux. There is no X session, ...
7
votes
3answers
2k views
ESC key causes a small delay in terminal due to its Alt+ behavior
My terminal setup is gnome-terminal + tmux + zsh with vi bindings.
In applications like vim or even in the zsh's command line vi editing mode, I need to frequently hit the ESC key but there is a ...
7
votes
1answer
651 views
tmux — unlimited history?
In your .tmux.conf file you can set the window history with something like:
set -g history-limit 4096
Is there a way to set an unlimited history for each window?
7
votes
2answers
907 views
tmux session lost in unknown pts, cause and possible solution?
I was trying to re-attach to a long-running tmux session to check up on a python web-application. However tmux attach claims that there is no running session, and ps shows a tmux process (first line), ...
7
votes
3answers
133 views
+100
Why do I have to re-set env vars in tmux when I re-attach?
I mainly work on a mac and ssh/tmux attach to a Linux machine to do my work. I have ssh-agent running on the Linux machine. I have
set -g update-environment "SSH_AUTH_SOCK SSH_ASKPASS WINDOWID ...
6
votes
2answers
392 views
Two prefix commands for tmux?
We have a tmux session that several people need to connect to. Some people like the Ctrl+a prefix shortcut and some people prefer the default Ctrl+b shortcut. Is there anything I can put in the ...
6
votes
3answers
1k views
Using Ctrl+B in less within tmux
I use the Ctrl+B command prefix in tmux, however this clashes with Ctrl+B in less, which is used for scrolling up a file.
How can I get this to work? Do I have to set a different command prefix in ...
6
votes
2answers
937 views
Prevent pane/window from closing when command completes - tmux
In my tmux.conf file I have it configured to open windows, name them, setup panes etc.. etc..
However one issue I have is that if one of the panes launches a command, let's say ls, then the pane ...
6
votes
2answers
319 views
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 ?
6
votes
4answers
845 views
tmux status-bar corrupted after catting a binary file, how to reset?
I accidentally screw up my tmux terminal after cating a binary file. Now my tmux is messed up. Detaching and re-attaching doesn't help, nor does a redraw (C-b r). Running reset only redraws the active ...
6
votes
1answer
594 views
Is there a tmux shortcut to go read only?
I've been using screen for years now as a way of ensuring that any remote work is safely kept open in after disconnects/crashes. In fact, as a matter of course, I use screens even when working ...
6
votes
1answer
390 views
tmux disable confirmation prompt on kill-window
I've looked through the man pages so this might be asking in vain. I get annoyed at the confirmation message for kill-window (Ctrl-b & or Ctrl-b kill-window on the default setup). This always ...
6
votes
1answer
3k views
How do i bind to Shift+arrow in tmux?
I'm looking at tmux from screen, and have hit a bump while configuring the (highly configurable!) tmux key bindings.
Problem is, in my .screenrc i have
bindkey ^[[d prev
bindkey ^[[c next
bindkey ...
6
votes
1answer
788 views
Automatically adjust window width in tmux
Is there a way to set tmux so that it automatically adjusts window width when I switch to the pane so that it will be wide axactly as the longest (visible on screen) line in the file I have open?
I'm ...
6
votes
2answers
146 views
Replacing tmux with exec
I'm using tmux from a while and I'm very happy with it. Since I need it most of the time, I made it my default shell (in guake, to be precise).
This is nice and I'm perfectly fine with this.
But ...
6
votes
1answer
467 views
How to send-key to break out of scroll mode in tmux?
I have a key-mapping in VIM that looks like this:
map <F5> :silent !tmux send-keys -t 0:0 C-m "python %" C-m<cr>
When I press F5, vim runs my current Python script in tmux session 0, ...
6
votes
3answers
308 views
Why might tmux only be capable of attaching once per shell session?
I'm using tmux on a Fedora 8 server (workplace restriction) to monitor several boxes on a stress rack. I noticed that I can only attach to my detached tmux session once per shell session. In order ...
5
votes
3answers
666 views
Does a terminal multiplexer have any benefit when used with a tiling window manager?
Both terminal multiplexers (screen, tmux) and keyboard-driven tiling window managers (ratpoison, dwm, xmonad) provide similar functionality. Is there any benefit in using both at the same time? What ...
5
votes
2answers
652 views
Aliases and tmux
Aliases defined in .bash_aliases and .bashrc don't work in tmux.
Can this be changed in some configuration, so the aliases work under tmux?
5
votes
2answers
1k views
How do I cycle through panes inside a window in tmux like in screen?
I thought Tmux - move window to pane was the same question but it doesn't seem to be.
Coming from using GNU screen regularly, I'm looking for tmux to do the same things. On of the things I do ...
5
votes
1answer
578 views
tmux bottom bar color change
I recently started to use tmux and like it much, but it's green bottom bar is a bit distracting, is there a way to change its color? or a way to hide it?
5
votes
1answer
406 views
How do you make tmux count windows starting with 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
...
5
votes
2answers
1k views
How can I bind multiple tmux commands to one keystroke?
Specifically I'm trying to give a notification after some command was completed. So, for example, if I reload my configuration file, I'd like to have some confirmation that it worked, which might be ...
5
votes
1answer
250 views
Upload & Download speed in Tmux status line
Is there a way to get upload and download speeds in Tmux's status line?
5
votes
1answer
878 views
using environment variables in tmux.conf files
Is it possible to use an environment variable in a tmux.conf file? I am trying to set a default-path to an environment variable. Currently what I am trying is:
set -g default-path $MYVAR
further I ...
5
votes
3answers
1k views
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.
5
votes
2answers
47 views
tmux not respecting disabled control flow
In my shell I have flow control disabled using stty -ixon. This works
perfectly in the shell and when I launch tmux and start programs within
tmux.
However, when starting a new session from the ...
5
votes
2answers
270 views
emacs colors based on $TERM environment variable
I want to know if it is possible to make emacs, when running in a gnu screen or tmux session, use the same colors as when TERM=xterm. In a gnu screen or tmux session, TERM=screen and emacs uses a ...
5
votes
2answers
360 views
Byobu with tmux, how to use F-Keys
I'm accessing a linux box with Byobu enabled (with tmux) and I don't seem to be able to use some F-Keys without being binded to Byobu. For example using F6 to sort on htop. I followed this advice, but ...
5
votes
1answer
175 views
tmux: execute a process in the current pane, redirecting stdio to/from the pane
GNU Screen has a command called exec that will launch a subprocess and optionally let you do things with its file descriptors, including tying them in your window. I frequently use :exec !! sx -b ...
4
votes
3answers
1k views
Is there a tmux equivalent of “screen -D -R”
I would like to know if there is a way to get tmux to behave like screen -D -R so I could say, have the command as a default command in Putty.
These screen switches would force detach of an existing ...
4
votes
2answers
1k views
Convert gnu screen status line to tmux status line
I am using the following screen status line, configured in my screenrc:
I configured it using the following line:
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= ...
4
votes
2answers
805 views
Is it possible to run a Vim clientserver instance over SSH+tmux
I've been a vim junkie for a year or so now and I've got some great little tricks burnt in to my memory. I do a lot of development (at the office) in a terminal on Ubuntu.
One of the things I value ...

