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.

learn more… | top users | synonyms

66
votes
2answers
37k 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 ...
17
votes
6answers
19k 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> ...
43
votes
12answers
28k 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 ...
11
votes
2answers
3k 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 ...
11
votes
4answers
5k 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 ...
127
votes
10answers
27k 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.
88
votes
5answers
26k views

Moving tmux window to pane

How do I move an existing window into a pane in 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 ...
54
votes
4answers
12k 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 ...
23
votes
4answers
8k 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 ...
21
votes
1answer
4k 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 ...
27
votes
1answer
5k 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 ...
16
votes
2answers
3k views

protocol version mismatch (client 8, server 6) when trying to upgrade

I'm trying to upgrade to a newer version (that has a bug fix) than my current 1.6. I am on Ubuntu and recently upgraded to Ubuntu 13.04. Ideally I want to use tmux version 1.8 or even 1.9. I've ...
13
votes
2answers
4k views

tmux, TERM and 256 colours support

Introduction My question arises from the necessity of understanding why I have now (after multiple trials) Terminal and tmux supporting 256 colours and tput colors telling me there are only 8 of ...
15
votes
4answers
4k views

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 ...
4
votes
1answer
968 views

How to run streamripper and mplayer in a split-screen X terminal, via a single script

I want to run streamripper in its own X Terminal (window), then split the terminal horizontally, and then run mplayer in the lower half. This is simple enough to do manually, but getting a script to ...
9
votes
2answers
703 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 ...
2
votes
2answers
777 views

Changing tmux .bash_profile behavior

I have a script in my .bash_profile that prompts for X sessions to boot. When I launch tmux, I get this prompt that I had only intended for the TTY login. Is there something I can put in ...
1
vote
1answer
383 views

Tmux viewport caused by multiple concurrent sessions

When attaching to the same tmux sessions from multiple computers using ssh and tmux attach, my screen looks like: ------------------------- $> |........ |........ ...
3
votes
1answer
919 views

Fixing scrolling in nano running in tmux in mate-terminal

The problem: I open a terminal (in Linux Mint, so mate-terminal) zsh is the shell Then I run tmux Edit a file with nano Scroll up and down that file with the cursor Issue: When scrolling down in ...
1
vote
1answer
577 views

Set environment variable for all of tmux shells when gnome-sessions gets restarted

To solve this problem, I need to set the environment variable DBUS_SESSION_BUS_ADDRESS for all shells inside tmux every time I restart gnome without restarting tmux (this is often). How can I best ...
42
votes
5answers
13k 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.
31
votes
3answers
6k 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 ...
13
votes
6answers
12k views

How can I page up or down in tmux with Terminal.app?

I have tmux installed. But I can not scroll up or down. I.e. as soon as I tmux I get only a portion of the screen and can not scroll up. crtl-b + Page Up does not work since I am in Mac and I can not ...
13
votes
2answers
9k 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?
15
votes
4answers
5k 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 ...
16
votes
1answer
2k views

copy (to X clipboard) shortcut in .tmux.conf

In order to copy text to X clipboard in tmux, what I currently do is: go selection mode with prefix[ start selection with space (using mode-keys vi btw) select the text and press enter copy tmux ...
15
votes
4answers
5k 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 ...
10
votes
3answers
2k 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 ...
6
votes
2answers
2k views

Creating launchable tmux configurations?

I find myself often doing the same thing with tmux: cd to a given directory. tmux Rename window to what I'm doing. Split the window vertically 50%. Start one process in the left window. Start ...
6
votes
1answer
1k views

tmux, Vim and Solarized

Premises Browsing around tmux, Vim and Solarized I can find lots of complains about 256 colours and "user experience". Well, I'm having the opposite "problem", i.e. Vim works well with a full ...
6
votes
3answers
831 views

tmux after start

Can I configure tmux so it will after running tmux automatically opens two windows named src and cmd? I always type after starting it: prefix + c, prefix + ,srcENTER prefix + c, prefix + ,cmdENTER ...
4
votes
1answer
258 views

Using Ctrl+[0-9] to cycle between windows using tmux

I have started using tmux but I feel that using Ctrlb0-9 is very annoying, because it's used so often. How do I bind the keyboard so I only need to do Ctrl0-9 for changing windows (like in Chrome)? ...
3
votes
1answer
272 views

Waching YouTube videos in bash sessions, in ASCII mode

I already found how to watch YouTube videos in terminal, in ASCII mode, but my goal is to watch them in a bash session, without opening a different window. So, supposing I already have a tmux ...
7
votes
2answers
2k views

New Tmux Panes go to the same directory as the current pane; new tmux windows go to home directory?

Can anyone help me set up this configuration? If I create a new pane, the new pane should start out in the same working directory as the pane I was just in. If I create a new window, the new window ...
7
votes
2answers
1k 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
2answers
327 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 ...
5
votes
2answers
2k views

zsh: set TERM=screen-256color in tmux, but xterm-256color without tmux

I need my $TERM to be xterm-256color outside of tmux (in "plain" terminal with zsh), but screen-256color inside tmux. First I tried: add export TERM='xterm-256color' to my ~/.zshrc. add set -g ...
4
votes
1answer
1k views

How to quickly send commands to nested tmux sessions?

I have the following in my .tmux.conf set -g prefix M-j bind-key j send-prefix I need to press (Atl+J) + (J) + bound-key to send something to the nested tmux session. I feel it is rather slow. Is ...
4
votes
1answer
887 views

tmux equivalent to GNU screen's :wrap mode

I'm a long time screen user trying to make the jump to tmux. One screen feature I use is the ability to truncate Ctrla :set wrap output. This is especially useful when tailing log files or following ...
4
votes
3answers
969 views

`$XAUTHORITY` appears from 'nowhere' on su+tmux

When I switched from su+bash to su+tmux+zsh I noticed that I get $XAUTHORITY variable defined as /root/.xauthXXXXXX where XXXXXX are 6 random alphanumeric characters. With previous configuration X ...
3
votes
2answers
2k views

Use system clipboard in vi-copy mode in tmux

I'm running tmux 1.6 and I'm trying to configure it to use vi-style keybindings as well as use the system clipboard when copying in interactive mode: set-window-option -g mode-keys vi bind-key -t ...
3
votes
1answer
1k views

Kill a tmux session and select another tmux session

I am trying to bind X to do the following: prompt the user whether the session should be killed if y is entered, kill the session after the session is killed select another session (last, previous, ...
2
votes
3answers
954 views

Attach to tmux session and run a command

How I can run a command in Tmux when I'm attaching to a session ? I want attach and immediately run a command. I read the docs, but found only send keys, which not suits my needs.
1
vote
1answer
2k views

Failed to get bus connection: Could not connect: Connection refused

When I'm running evince file.pdf I got this error Failed to get bus connection: Could not connect: Connection refused Ubuntu 12.04 I have to reboot. Can I repair this error without reboot?
3
votes
2answers
101 views

Finding out whether current alias/function/script is running inside Tmux - with a twist

NB: Yes, I've read How can I tell if I'm in a tmux session from a bash script? How can I find out whether I am running inside a Tmux session from my shell or shell script or shell function or ...
2
votes
1answer
267 views

vim and tmux are conflicting. How can I fix this? [duplicate]

I'm having a painful experience with tmux. I'm using solarized in vim but when I run tmux then my vim configuration does not work. It's as if solarized is not configured in my .vimrc. Out of tmux ...
2
votes
1answer
2k views

How can I create a shortcut to resize panes in a tmux window?

I am having lots of issues with tmux in mac. Another problem I have is that I can not bind a key in my tmux.conf to be able to resize my panes. What I need is the CTRL-b: resize-pane -U 10 I currently ...
1
vote
1answer
589 views

How can I start tmux automatically in fish shell while connecting to remote server via ssh

I switched from bash to fish shell. I liked it and decided to use it on my servers also. How can I start tmux automatically on ssh connection? I followed this instruction for bash but fish shell is ...
1
vote
1answer
1k views

tmux exits abruptly right after loading

I just compiled my own version of tmux with libevent. Whenever I run tmux from zsh, tmux starts, but exits quickly returning [exited]. I read here that the problem could be my configuration for ...