- simme / Install_tmux
- This comment has been minimized.
- constfun commented Apr 17, 2012
- This comment has been minimized.
- simme commented Apr 17, 2012
- This comment has been minimized.
- christiangenco commented Jun 10, 2012
- This comment has been minimized.
- fesplugas commented Jun 21, 2012
- This comment has been minimized.
- agfor commented Jul 6, 2012
- This comment has been minimized.
- simme commented Jul 9, 2012
- This comment has been minimized.
- kennym commented Sep 8, 2012
- This comment has been minimized.
- tkleczek commented Oct 2, 2012
- This comment has been minimized.
- oraclebill commented Oct 11, 2012
- This comment has been minimized.
- Stuk commented Feb 16, 2013
- This comment has been minimized.
- veloper commented Feb 19, 2013
- This comment has been minimized.
- mattacular commented Mar 30, 2013
- This comment has been minimized.
- mayoralito commented Apr 5, 2013
- This comment has been minimized.
- Globegitter commented Apr 23, 2013
- This comment has been minimized.
- danslee commented Jun 8, 2013
- Шпаргалка по работе с Tmux (терминальный мультиплексор)
- 1. Установка
- 2. Конфигурационные файлы
- 3. Работа с Tmux
- Install tmux mac os
- Latest commit
- Git stats
- Files
- About
- tmux Integration
- Introduction
- Usage
- Limitations
- Configuration
- Best Practices
simme / Install_tmux
# 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
This comment has been minimized.
Copy link Quote reply
constfun commented Apr 17, 2012
This comment has been minimized.
Copy link Quote reply
simme commented Apr 17, 2012
@pacemkr Glad you found it helpful!
This comment has been minimized.
Copy link Quote reply
christiangenco commented Jun 10, 2012
Thanks for the mouseterm tip!
This comment has been minimized.
Copy link Quote reply
fesplugas commented Jun 21, 2012
Works like a charm! Thanks.
This comment has been minimized.
Copy link Quote reply
agfor commented Jul 6, 2012
Thanks, this was very helpful. What exactly does Teamocil do / why is it necessary?
This comment has been minimized.
Copy link Quote reply
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.
This comment has been minimized.
Copy link Quote reply
kennym commented Sep 8, 2012
Thanks. This worked great!
This comment has been minimized.
Copy link Quote reply
tkleczek commented Oct 2, 2012
Great tip! Thanks!
This comment has been minimized.
Copy link Quote reply
oraclebill commented Oct 11, 2012
This comment has been minimized.
Copy link Quote reply
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.
This comment has been minimized.
Copy link Quote reply
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 🙂
This comment has been minimized.
Copy link Quote reply
mattacular commented Mar 30, 2013
This comment has been minimized.
Copy link Quote reply
mayoralito commented Apr 5, 2013
Nice work, thank you!
This comment has been minimized.
Copy link Quote reply
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.
This comment has been minimized.
Copy link Quote reply
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.
Источник
Шпаргалка по работе с Tmux (терминальный мультиплексор)
На Хабрахабре Tmux (ти-макс) упоминался неоднократно, тем не менее, решил написать еще одну шпаргалку, т.к. в других некоторые важные моменты не показаны.
Tmux (терминальный мультиплексор) позволяет работать с несколькими сессиями в 1 окне. Вместо нескольких окон терминала к серверу — вы можете использовать одно. Позволяет подключаться/отключаться к текущему состоянию сессии. Запущенные программы и процессы продолжают работать. (Можно использовать вместо nohup, dtach).
Например, на работе правим файлы в Vim. Окно терминала с открытыми файлами, процессами. Отключаемся от сессии. Далее подключаемся к этой сессии из дома и получаем те же окна с открытыми файлами в Vim, процессами и т.д. Можно продолжить работу с того же момента, на котором остановились. Также удобно при разрыве связи. Дополнительно можно работать совместно с другими в терминале, если подключены к одной сессии. Каждый видит, что делает другой.
1. Установка
2. Конфигурационные файлы
С версии 2.1 для включения режима мыши (скролл, изменение размера панели, выбор панели и др.) нужно добавить в tmux.conf:
3. Работа с Tmux
Старт
# tmux //без параметров будет создана сессия 0
# tmux new -s session1 //новая сессия session1. Название отображается снизу-слева в квадратных скобках в статус строке. Далее идет перечисление окон. Текущее окно помечается звездочкой.
Префикс (с него начинаются команды)
(CTRL + b)
Новое окно (нажать CTRL+b, затем нажать с)
Список окон
// переключиться курсором вверх-вниз
Переключение
// следующее окно
// предыдущее окно
// переключиться на номер окна
Окна можно делить на панели (Panes)
Как в тайловых (мозаичных) оконных менеджерах.
Деление окна горизонтально
либо команда
# tmux split-window -h
Деление окна вертикально
либо команда
# tmux split-window -v
Переход между панелей
// либо режим мыши
Изменение размеров панелей
// либо режим мыши
Закрытие окон
// нужно подтвердить y
либо
# exit
Отключение от сессии
либо
# tmux detach
Список сессий
# tmux ls
Подключиться к работающей сессии
# tmux attach //подключение к сессии, либо к единственной, либо последней созданной
# tmux attach -t session1 // подключение к сессии session1
Завершение сессии
# tmux kill-session -t session1
Завершить все сессии
# tmux kill-server
Список поддерживаемых комманд
# tmux list-commands
Дополнительная информация
# man tmux
Источник
Install tmux mac os
🇫🇷 Oh my tmux! My self-contained, pretty & versatile tmux configuration made with ❤️
Latest commit
Git stats
Files
Failed to load latest commit information.
💡 You can clone the repository anywhere you want, provided you create the proper
/.tmux.conf symlink and you copy the .tmux.conf.local sample file in your home directory:
Then proceed to customize your
If you’re a Vim user, setting the $EDITOR environment variable to vim will enable and further customize the vi-style key bindings (see tmux manual).
If you’re new to tmux, I recommend you read tmux 2: Productive Mouse-Free Development by @bphogan.
I’m running tmux HEAD and things don’t work properly. What should I do?
Please open an issue describing what doesn’t work with upcoming tmux. I’ll do my best to address it.
Status line is broken and/or gets duplicated at the bottom of the screen. What gives?
This particularly happens on Linux when the distribution provides a version of glib that received Unicode 9.0 upgrades (glib >= 2.50.1 ) while providing a version of glibc that didn’t (glibc ). You may also configure LC_CTYPE to use an UTF-8 locale. Typically VTE based terminal emulators rely on glib’s g_unichar_iswide() function while tmux relies on glibc’s wcwidth() function. When these two functions disagree, display gets messed up.
This can also happen on macOS when using iTerm2 and «Use Unicode version 9 character widths» is enabled in Preferences. > Profiles > Text
For that reason, the default
/.tmux.conf.local file stopped using Unicode characters for which width changed in between Unicode 8.0 and 9.0 standards, as well as Emojis.
I installed Powerline and/or (patched) fonts but can’t see Powerline symbols.
First, you don’t need to install Powerline. You only need fonts patched with Powerline symbols or the standalone PowerlineSymbols.otf font. Then make sure your
/.tmux.conf.local copy uses the right code points for tmux_conf_theme_left_separator_XXX values.
I’m using Bash On Windows (WSL), colors and Powerline look are broken.
There is currently a bug in the new console powering Bash On Windows preventing text attributes (bold, underscore, . ) to combine properly with colors. The workaround is to search your
/.tmux.conf.local copy and replace attributes with ‘none’ .
Also, until Window’s console replaces its GDI based render with a DirectWrite one, Powerline symbols will be broken.
The alternative is to use the Mintty terminal for WSL.
- C-a acts as secondary prefix, while keeping default C-b prefix
- visual theme inspired by Powerline
- maximize any pane to a new window with
Configuring the status line
Contrary to the first iterations of this configuration, by now you have total control on the content and order of status-left and status-right .
The sleep 900 call makes sure the network request is issued at most every 15 minutes whatever the value of status-interval .
💡 You can also define your own custom variables. See the sample .tmux.conf.local file for instructions.
Finally, remember tmux_conf_theme_status_left and tmux_conf_theme_status_right end up being given to tmux as status-left and status-right which means they’re passed through strftime() . As such, the % character has a special meaning and needs to be escaped by doubling it, e.g.
See man 3 strftime .
Using TPM plugins
This configuration now comes with built-in TPM support:
- use the set -g @plugin . syntax to enable a plugin
- whenever a plugin introduces a variable to be used in status-left or status-right , you can use it in tmux_conf_theme_status_left and tmux_conf_theme_status_right variables, see instructions above 👆
- ⚠️ do not add set -g @plugin ‘tmux-plugins/tpm’
- ⚠️ do not add run ‘
/.tmux.conf or your
/.tmux.conf.local copy ← people who are used to alter .tmux.conf to add TPM support will have to adapt their configuration
⚠️ The TPM bindings differ slightly from upstream:
Once installed, reattach-to-usernamespace will be automatically detected.
Using the configuration under Cygwin within Mintty
I don’t recommend running this configuration with Cygwin anymore. Forking under Cygwin is extremely slow and this configuration issues a lot of run-shell commands under the hood. As such, you will experience high CPU usage. As an alternative consider using Mintty terminal for WSL.
It is possible to use this configuration under Cygwin within Mintty, however support for Unicode symbols and emojis lacks behind Mac and Linux.
Particularly, Mintty’s text rendering is implemented with GDI which has limitations:
- color emojis are only available through DirectWrite starting with Windows 8.1
- display of double width symbols, like the battery discharging symbol indicator (U+1F50B) is buggy
To get Unicode symbols displayed properly, you have to use font linking. Open regedit.exe then navigate to the registry key at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink and add a new entry for you preferred font to link it with the Segoe UI Symbol font.
About
🇫🇷 Oh my tmux! My self-contained, pretty & versatile tmux configuration made with ❤️
Источник
tmux Integration
iTerm2 is integrated with tmux, allowing you to enjoy a native user interface with all the benefits of tmux’s persistence.
Introduction
Normally, when you use tmux, multiple virtual windows are displayed in a single «physical» window. You can manipulate the environment by issuing commands to tmux. This poses a few problems:
- Some keystroke must be dedicated to tmux to enter its command mode (^B, by default, which means moving the cursor to the left in emacs or an interactive shell becomes more difficult).
- You have to ssh to the remote host more than once to get more than one view of your tmux session’s window.
- You have to learn tmux commands.
- To adjust split panes, you have to enable mouse reporting, even if you don’t want it otherwise.
- Some built-in features of your terminal emulator don’t work as well as they would if you weren’t using tmux: for instance, you can’t access tmux’s scrollback history as easily or quickly as you can in a normal terminal window. Also, tmux’s find feature isn’t as good as iTerm2’s.
For many users, a terminal multiplexer would be a great way to work, but they don’t want to accept the drawbacks.
iTerm2’s tmux integration solves these problems.
When you run «tmux -CC», a new tmux session is created. An iTerm2 window opens and it acts like a normal iTerm2 window. The difference is that when iTerm2 quits or the ssh session is lost, tmux keeps running. You can return to the host you were ssh’ed into and run «tmux -CC attach» and the iTerm2 windows will reopen in the same state they were in before. A few use cases come to mind:
For users who do most of their work in ssh:
- Restore the environment you had at work when you get home.
- No more anxiety about letting System Update reboot!
- Collaborate with another user by having two people attach to the same tmux session.
Usage
You should be able to use tmux as always. Just add the -CC argument to its invocation. In practice, this means running one of these commands:
When you run tmux -CC, what you’ll see on that terminal is a menu:
- If you press esc, the tmux windows will close and the tmux client will exit.
- If you press esc and nothing happens, then the tmux client may have crashed or something else has gone wrong. Press «X» to force iTerm2 to exit tmux mode. You may need to run «stty sane» to restore your terminal’s state if the tmux client did crash.
- If you want to report a bug, press L and reproduce the issue. The tmux protocol commands will be written to the screen.
- If you want to run a tmux command that isn’t available through the menus, you can press C. A dialog box opens and you can enter a command. For example, «new-window».
In general, you don’t need to run commands to perform the most common actions. The following iTerm2 actions affect tmux:
- Close a session, tab, or window: Kills the tmux session or window.
- Split a pane: Splits the tmux window using the split-window command.
- Resize a split pane: Resizes tmux split panes using the resize-pane command.
- Resize a window: Tells tmux that the client size has changed, causing all windows to resize. Windows are never larger than the smallest attached client. A gray area on the right or bottom of a window indicates that a physical window is larger than the maximum allowed tmux window size. One consequence of this rule is that all tmux windows/tabs will contain the same number of rows and columns.
- Create a window or tab using the Shell->tmux menu: Creates a new tmux window.
- Detach using Shell->tmux->Detach: Detaches from the tmux session. All tmux windows are closed. You can get them back with tmux -CC attach.
Limitations
There are a few limitations of tmux integration which are related to the design of tmux.
- A tab with a tmux window may not contain non-tmux split panes.
- A tab with split panes may have «empty» areas. This is because tmux wants every tmux window to be the same size, but our split pane dividers are not exactly one cell by one cell in size.
Configuration
Check Preferences > General > tmux for configuration settings. You can also adjust whether to open the tmux Dashboard when connecting to a session with a large number of windows. You can open the tmux Dashboard by selecting the menu item Shell > tmux > Dashboard.
See also the tmux section of General Preferences.
Best Practices
For practical tips on how to configure iTerm2 for use with tmux integration in the real world, please see tmux Integration Best Practices.
iTerm2 by George Nachman. Website by Matthew Freeman, George Nachman, and James A. Rosen.
Источник