Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
# Enable mouse support in ~/.tmux.conf
set-option -g mouse-select-pane on
set-option -g mouse-select-window on
set-window-option -g mode-mouse on
# Install Teamocil to pre define workspaces
https://github.com/remiprev/teamocil
# See http://files.floriancrouzat.net/dotfiles/.tmux.conf for configuration examples
@constfun

This comment has been minimized.

Show comment
Hide comment
@constfun

constfun Apr 17, 2012

Thank you.

constfun commented Apr 17, 2012

Thank you.

@simme

This comment has been minimized.

Show comment
Hide comment
@simme

simme Apr 17, 2012

@pacemkr Glad you found it helpful!

Owner

simme commented Apr 17, 2012

@pacemkr Glad you found it helpful!

@christiangenco

This comment has been minimized.

Show comment
Hide comment
@christiangenco

christiangenco Jun 10, 2012

Thanks for the mouseterm tip!

christiangenco commented Jun 10, 2012

Thanks for the mouseterm tip!

@fesplugas

This comment has been minimized.

Show comment
Hide comment
@fesplugas

fesplugas Jun 21, 2012

Works like a charm! Thanks.

fesplugas commented Jun 21, 2012

Works like a charm! Thanks.

@agfor

This comment has been minimized.

Show comment
Hide comment
@agfor

agfor Jul 6, 2012

Thanks, this was very helpful. What exactly does Teamocil do / why is it necessary?

agfor commented Jul 6, 2012

Thanks, this was very helpful. What exactly does Teamocil do / why is it necessary?

@simme

This comment has been minimized.

Show comment
Hide comment
@simme

simme Jul 9, 2012

@agfor It is not necessary. But I find it helps alot! It let's you define project setups, with panes and windows, in a YAML-file. And then just run a command to setup any number of windows and panes running a command. I do all my dev in the terminal, so for each project I have a YAML file that launches vim in one pane, starts SASS-compilation in another, etc etc. So I do not have to manually setup panes everytime I'm developing on a specific project.

Owner

simme commented Jul 9, 2012

@agfor It is not necessary. But I find it helps alot! It let's you define project setups, with panes and windows, in a YAML-file. And then just run a command to setup any number of windows and panes running a command. I do all my dev in the terminal, so for each project I have a YAML file that launches vim in one pane, starts SASS-compilation in another, etc etc. So I do not have to manually setup panes everytime I'm developing on a specific project.

@kennym

This comment has been minimized.

Show comment
Hide comment
@kennym

kennym Sep 8, 2012

Thanks. This worked great!

kennym commented Sep 8, 2012

Thanks. This worked great!

@tkleczek

This comment has been minimized.

Show comment
Hide comment
@tkleczek

tkleczek Oct 2, 2012

Great tip! Thanks!

tkleczek commented Oct 2, 2012

Great tip! Thanks!

@oraclebill

This comment has been minimized.

Show comment
Hide comment
@oraclebill

oraclebill commented Oct 11, 2012

Thanks!

@Stuk

This comment has been minimized.

Show comment
Hide comment
@Stuk

Stuk Feb 16, 2013

Thanks for the tip. I used EasySIMBL with MouseTerm on Mountain Lion and tmux on a remote Ubuntu and it works really well.

Stuk commented Feb 16, 2013

Thanks for the tip. I used EasySIMBL with MouseTerm on Mountain Lion and tmux on a remote Ubuntu and it works really well.

@veloper

This comment has been minimized.

Show comment
Hide comment
@veloper

veloper Feb 19, 2013

This is so awesome, thanks for this write up. I also used EasySIMBL as @Stuk suggested -- it's working like a champ.

I'd also like to give a shout out to the Tmuxinator gem -- makes tmux setup crazy simple :)

veloper commented Feb 19, 2013

This is so awesome, thanks for this write up. I also used EasySIMBL as @Stuk suggested -- it's working like a champ.

I'd also like to give a shout out to the Tmuxinator gem -- makes tmux setup crazy simple :)

@mattacular

This comment has been minimized.

Show comment
Hide comment
@mattacular

mattacular Mar 30, 2013

Mucho gracias

mattacular commented Mar 30, 2013

Mucho gracias

@mayoralito

This comment has been minimized.

Show comment
Hide comment
@mayoralito

mayoralito Apr 5, 2013

Nice work, thank you!

mayoralito commented Apr 5, 2013

Nice work, thank you!

@Globegitter

This comment has been minimized.

Show comment
Hide comment
@Globegitter

Globegitter Apr 23, 2013

Hmm, I just switched to Mac and relatively new to this whole terminal/tmux environment, but I followed all the steps and it is not working for me. Could there maybe be a problem with me using zsh? Would be really glad for any other help. If I get this to work, tmux would be perfect.

Edit: Got it working, was just an issue with reloading.
tmux source-file ~/.tmux.conf fixed it. Cheers.

Edit2:
Ok, really strange, somehow itg is not working anymore. I played a bit more with the settings and now I have even changed everything to just the necessary lines and I can't scroll anymore. Hmm, now that I think about it, I had bash instead of zsh (installed via brew) for a short time, because of misconfiguration. I can't remember though if it just worked in bash. Anyway, could that maybe be a reason? Any hints would be really appreciated.

Globegitter commented Apr 23, 2013

Hmm, I just switched to Mac and relatively new to this whole terminal/tmux environment, but I followed all the steps and it is not working for me. Could there maybe be a problem with me using zsh? Would be really glad for any other help. If I get this to work, tmux would be perfect.

Edit: Got it working, was just an issue with reloading.
tmux source-file ~/.tmux.conf fixed it. Cheers.

Edit2:
Ok, really strange, somehow itg is not working anymore. I played a bit more with the settings and now I have even changed everything to just the necessary lines and I can't scroll anymore. Hmm, now that I think about it, I had bash instead of zsh (installed via brew) for a short time, because of misconfiguration. I can't remember though if it just worked in bash. Anyway, could that maybe be a reason? Any hints would be really appreciated.

@danslee

This comment has been minimized.

Show comment
Hide comment
@danslee

danslee Jun 8, 2013

Thanks! You might want to add in support for pbpaste and pbcopy via the very useful reattach-to-user-namespace utility, aka tmux-MacOSX-pasteboard.

brew install reattach-to-user-namespace

followed by adding

set-option -g default-command "reattach-to-user-namespace -l <yourshellhere>"

to your .tmux.conf file.

danslee commented Jun 8, 2013

Thanks! You might want to add in support for pbpaste and pbcopy via the very useful reattach-to-user-namespace utility, aka tmux-MacOSX-pasteboard.

brew install reattach-to-user-namespace

followed by adding

set-option -g default-command "reattach-to-user-namespace -l <yourshellhere>"

to your .tmux.conf file.

@ahmadajmi

This comment has been minimized.

Show comment
Hide comment
@ahmadajmi

ahmadajmi commented Sep 25, 2013

Thank You

@timmysze

This comment has been minimized.

Show comment
Hide comment
@timmysze

timmysze commented Oct 8, 2013

Thanks!

@gad0lin

This comment has been minimized.

Show comment
Hide comment
@gad0lin

gad0lin Nov 7, 2013

Just had to install ragel.

brew install ragel

gad0lin commented Nov 7, 2013

Just had to install ragel.

brew install ragel

@msammarco

This comment has been minimized.

Show comment
Hide comment
@msammarco

msammarco Jan 29, 2014

How about copy? Anyone get that working with default middle click behavior on ubuntu?

msammarco commented Jan 29, 2014

How about copy? Anyone get that working with default middle click behavior on ubuntu?

@miguelmota

This comment has been minimized.

Show comment
Hide comment
@miguelmota

miguelmota commented Feb 25, 2014

It works!

@rhacker

This comment has been minimized.

Show comment
Hide comment
@rhacker

rhacker Apr 25, 2014

brilliant :)

rhacker commented Apr 25, 2014

brilliant :)

@Congee

This comment has been minimized.

Show comment
Hide comment
@Congee

Congee commented May 22, 2014

thx

@mLewisLogic

This comment has been minimized.

Show comment
Hide comment
@mLewisLogic

mLewisLogic May 27, 2014

Works with TotalTerminal. 👍
Use EasySIMBL for Mavericks.

mLewisLogic commented May 27, 2014

Works with TotalTerminal. 👍
Use EasySIMBL for Mavericks.

@PositiveControl

This comment has been minimized.

Show comment
Hide comment
@PositiveControl

PositiveControl commented Jun 6, 2014

Thanks a lot!

@pfriedland

This comment has been minimized.

Show comment
Hide comment
@pfriedland

pfriedland commented Jun 11, 2014

Thanks!

@piyushkandpal

This comment has been minimized.

Show comment
Hide comment
@piyushkandpal

piyushkandpal Jul 21, 2014

Great man .. worked like magic ...thanks so much :) :)

piyushkandpal commented Jul 21, 2014

Great man .. worked like magic ...thanks so much :) :)

@m9dfukc

This comment has been minimized.

Show comment
Hide comment
@m9dfukc

m9dfukc Sep 30, 2014

Perfect ... thanks so much!!!

m9dfukc commented Sep 30, 2014

Perfect ... thanks so much!!!

@linse

This comment has been minimized.

Show comment
Hide comment
@linse

linse Oct 2, 2014

Thank you, this is so useful!

linse commented Oct 2, 2014

Thank you, this is so useful!

@ccmcbeck

This comment has been minimized.

Show comment
Hide comment
@ccmcbeck

ccmcbeck Feb 19, 2015

The gist that keeps on giving...

ccmcbeck commented Feb 19, 2015

The gist that keeps on giving...

@5FiftySix6

This comment has been minimized.

Show comment
Hide comment
@5FiftySix6

5FiftySix6 Apr 16, 2015

Thanks for the great mouse support 😃

5FiftySix6 commented Apr 16, 2015

Thanks for the great mouse support 😃

@kirkelifson

This comment has been minimized.

Show comment
Hide comment
@kirkelifson

kirkelifson commented Apr 16, 2015

Thanks!

@vtombesi

This comment has been minimized.

Show comment
Hide comment
@vtombesi

vtombesi commented May 14, 2015

Thank you

@vamshisuram

This comment has been minimized.

Show comment
Hide comment
@vamshisuram

vamshisuram May 24, 2015

Infinite thanks..

vamshisuram commented May 24, 2015

Infinite thanks..

@gaoxiang007

This comment has been minimized.

Show comment
Hide comment
@gaoxiang007

gaoxiang007 commented Jun 23, 2015

Thanks :)

@mwaldner-redfall

This comment has been minimized.

Show comment
Hide comment
@mwaldner-redfall

mwaldner-redfall Jul 23, 2015

Awesome! Thank you!

mwaldner-redfall commented Jul 23, 2015

Awesome! Thank you!

@alexserver

This comment has been minimized.

Show comment
Hide comment
@alexserver

alexserver Nov 19, 2015

I got this error when I start tmux after adding those lines to .tmux.conf

.tmux.conf:1: unknown option: mode-mouse
.tmux.conf:2: unknown option: mouse-select-pane
.tmux.conf:3: unknown option: mouse-select-window

alexserver commented Nov 19, 2015

I got this error when I start tmux after adding those lines to .tmux.conf

.tmux.conf:1: unknown option: mode-mouse
.tmux.conf:2: unknown option: mouse-select-pane
.tmux.conf:3: unknown option: mouse-select-window
@tmcoma

This comment has been minimized.

Show comment
Hide comment
@tmcoma

tmcoma Nov 26, 2015

If you're getting the errors like alexserver mentioned above.

.tmux.conf:1: unknown option: mode-mouse
.tmux.conf:2: unknown option: mouse-select-pane
.tmux.conf:3: unknown option: mouse-select-window

Check your version tmux -V. If it's >=2.1, syntax was simplified to:

# Mouse mode for tmux > 2.1 (Oct 2015)
set -g mouse on

http://stackoverflow.com/questions/30185210/ubuntu-change-tmux-1-8-to-tmux-next-1-9 for details.

tmcoma commented Nov 26, 2015

If you're getting the errors like alexserver mentioned above.

.tmux.conf:1: unknown option: mode-mouse
.tmux.conf:2: unknown option: mouse-select-pane
.tmux.conf:3: unknown option: mouse-select-window

Check your version tmux -V. If it's >=2.1, syntax was simplified to:

# Mouse mode for tmux > 2.1 (Oct 2015)
set -g mouse on

http://stackoverflow.com/questions/30185210/ubuntu-change-tmux-1-8-to-tmux-next-1-9 for details.

@flov

This comment has been minimized.

Show comment
Hide comment
@flov

flov Dec 1, 2015

This doesn't work in the newest tmux 2.1, check out tmux/tmux#145
after set -g mouse on do this:
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'"
tmux/tmux#145

flov commented Dec 1, 2015

This doesn't work in the newest tmux 2.1, check out tmux/tmux#145
after set -g mouse on do this:
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'"
tmux/tmux#145

@corv89

This comment has been minimized.

Show comment
Hide comment
@corv89

corv89 Dec 3, 2015

@flov amazingly that incantation worked. thanks!

corv89 commented Dec 3, 2015

@flov amazingly that incantation worked. thanks!

@hprobotic

This comment has been minimized.

Show comment
Hide comment
@hprobotic

hprobotic Aug 17, 2016

Nice, thanks

hprobotic commented Aug 17, 2016

Nice, thanks

@wilgoszpl

This comment has been minimized.

Show comment
Hide comment
@wilgoszpl

wilgoszpl Sep 20, 2016

set -g mouse on

Works fine, but there is no way to copy text using mouse then. Do you guys have any solution on that?

wilgoszpl commented Sep 20, 2016

set -g mouse on

Works fine, but there is no way to copy text using mouse then. Do you guys have any solution on that?

@milansk

This comment has been minimized.

Show comment
Hide comment
@milansk

milansk Nov 9, 2016

@wilgoszpl Hold down Option key while selecting the text.

milansk commented Nov 9, 2016

@wilgoszpl Hold down Option key while selecting the text.

@athrunsun

This comment has been minimized.

Show comment
Hide comment
@athrunsun

athrunsun Jan 5, 2017

Is there a binary version of tmux? I don't like to install a lot of dependencies...

athrunsun commented Jan 5, 2017

Is there a binary version of tmux? I don't like to install a lot of dependencies...

@tony

This comment has been minimized.

Show comment
Hide comment
@tony

tony Feb 9, 2017

I released The Tao of tmux, a book on tmux on leanpub on amazon a few weeks ago. You can read the full book online for free at https://leanpub.com/the-tao-of-tmux/read.

tony commented Feb 9, 2017

I released The Tao of tmux, a book on tmux on leanpub on amazon a few weeks ago. You can read the full book online for free at https://leanpub.com/the-tao-of-tmux/read.

@lucduong

This comment has been minimized.

Show comment
Hide comment
@lucduong

lucduong Apr 24, 2017

Thank you ✌️

lucduong commented Apr 24, 2017

Thank you ✌️

@Chan-Chun

This comment has been minimized.

Show comment
Hide comment
@Chan-Chun

Chan-Chun May 10, 2017

thank you !

Chan-Chun commented May 10, 2017

thank you !

@pezzati

This comment has been minimized.

Show comment
Hide comment
@pezzati

pezzati Jun 12, 2017

nice and easy, very useful for training process of our team :))

pezzati commented Jun 12, 2017

nice and easy, very useful for training process of our team :))

@csmrkid

This comment has been minimized.

Show comment
Hide comment
@csmrkid

csmrkid Jul 13, 2017

Great work , love it

csmrkid commented Jul 13, 2017

Great work , love it

@haythamdouaihy

This comment has been minimized.

Show comment
Hide comment
@haythamdouaihy

haythamdouaihy Apr 16, 2018

great thanks!
for the mouse support:
set -g mouse on

haythamdouaihy commented Apr 16, 2018

great thanks!
for the mouse support:
set -g mouse on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment