Tmux – the Terminal multiplexer Linuxaria

Screen and ByobuTmuxterminatorFlattr this!http://www.netswarm.net/themes/dot_tmux.conf-256color&quothttp://www.netswarm.net/screenshots/tmux256-pane.png&quot
Subscribe to RSS» English by mailIscriviti agli RSS» Italiano via Email














Tmux – the Terminal multiplexer



 Articles, Guides, Pills, Reviews
 Add comments



Sep 152011

 



In a former article i’ve show how to use Screen and Byobu, in short Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells) while Byobu is an elegant enhancement of the otherwise functional, plain, practical GNU Screen. Byobu includes an enhanced profile and configuration utilities for the GNU screen window manager, such as toggle-able system status notifications.


But today we’ll see something similar, but different: Tmux


Like Screen 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.


Among the most notable features of tmux there are:


  • The use of commands that use syntax-like vi or emacs,

  • The possibility to copy/paste between created terminals (panels)

  • Total customization through the file ~ /.tmux.conf

tmux runs as a server-client system. A server is created automatically when necessary and holds a number of sessions, each of which may have a number of windows linked to it. Any number of clients may connect to a session, or the server may be controlled by issuing commands with tmux. Communication takes place through a socket, by default placed in /tmp.


tmux


Installation


tmux is usually availabe in all the official Linux distribution repository, so i’ve installed it on my ubuntu 11.04 with



aptitude install tmux

aptitude install tmux



This has installed for me the release 1.3-2+squeeze1


Basic usage


In a terminal just write tmux and you’ll start it.

Now you can use a combination of keys to get some results, the most commons/useful i’ve saw so far are:


CTRL + b This combination it’s the default to tell tmux you are about to issue a command
CTRL + b " Split the current pane into two, top and bottom.
CTRL + b % Split the current pane into two, left and right.
CTRL + b arrow using the arrows you can change to the pane above, below, to the left, or to the right of the current pane
CTRL + b x Kill the current pane.
CTRL + b c Create a new window
CTRL + b l Move to the previously selected window.
CTRL + b n Move to the next window.
CTRL + b d Detach the client


Finally, I would like to nominate the copy & paste feature which I think is a really useful. To enter the Copy mode all you have to do is Ctrl + b [ and move up to what needs to be copied. Then press Ctrl + Space and select the text. Once selected, copy with Alt + w . To paste the text all you have to do is Ctrl + b ].





Once that you detach from tmux you’ll be back on terminal. From here you can use these commands:


1) List all sessions managed by the server with the parameter ls


#tmux ls 
0: 2 windows (created Thu Sep 15 12:46:14 2011) [203x50]

#tmux attach -t 0

This will return your terminal to your detached session.


3) Destroy the given session, closing any windows linked to it and no other sessions, and detaching all clients attached to it with the parameter kill-session -t # of session



#tmux ls 
0: 2 windows (created Thu Sep 15 12:46:14 2011) [203x50]
 
#tmux kill-session -t 0

#tmux ls
0: 2 windows (created Thu Sep 15 12:46:14 2011) [203x50]
#tmux kill-session -t 0



This will close the session and all the windows in our formerly detached session.


Conclusions


These are only the main options of tmux, check the man page for some more, this can be a great program to be used on server without graphical terminals, personally on desktops I still prefer to use smart terminal programs like terminator, they do perhaps less things but you don’t have to remember all the combinations of keys, and for a PC that your turn on and off every day it’s enough.

Regarding that in tmux you can customise all the combinations so they can be more user friendly.



Popular Posts:





Flattr this!



 Posted by Riccardo at 15:08  Tagged with: bash, byobu, emacs, gnu screen, linux, shell, terminal multiplexer, tmux


 
2 Responses to “Tmux – the Terminal multiplexer”








  1. I have used Screen a lot, but once I learned about Tmux, I never went back.




    Reply








  2. And it perfectly fits my 256 color terminal setup:

    <a href="http://www.netswarm.net/themes/dot_tmux.conf-256color&quot; title="tmux.conf 256 color values"

    <a href="http://www.netswarm.net/screenshots/tmux256-pane.png&quot; title="tmux 256 color screenshot"




    Reply




 Leave a Reply Cancel reply






You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>




(required)




(required)






CAPTCHA


Refresh



*















//
if (window.addthis_product === undefined) window.addthis_product = "wpwt"; if (window.wp_product_version === undefined) window.wp_product_version = "wpwt-3.1.5"; if (window.wp_blog_version === undefined) window.wp_blog_version = "4.9.10"; if (window.addthis_share === undefined) window.addthis_share = "passthrough":"twitter":"via":"linuxaria"; if (window.addthis_config === undefined) window.addthis_config = "data_track_clickback":true,"data_ga_property":"UA-17850046-1","data_ga_social":true,"ui_atversion":"300"; if (window.addthis_plugin_info === undefined) window.addthis_plugin_info = "info_status":"enabled","cms_name":"WordPress","plugin_name":"Website Tools by AddThis","plugin_version":"3.1.5","plugin_mode":"AddThis","anonymous_profile_id":"wp-bcbd139924527ed902f4979ebac72e1f","page_info":"template":"posts","post_type":"","sharing_enabled_on_post_via_metabox":false;
(function()
var first_load_interval_id = setInterval(function ()
if (typeof window.addthis !== 'undefined')
window.clearInterval(first_load_interval_id);
if (typeof window.addthis_layers !== 'undefined' && Object.getOwnPropertyNames(window.addthis_layers).length > 0)
window.addthis.layers(window.addthis_layers);

if (Array.isArray(window.addthis_layers_tools))
for (i = 0; i < window.addthis_layers_tools.length; i++)
window.addthis.layers(window.addthis_layers_tools[i]);



,1000)
());

/* */

Popular posts from this blog

Obelisk of Theodosius Contents History Description Notes Bibliography Further reading External links Navigation menuAge of spirituality : late antique and early Christian art, third to seventh centuryOver 60 picturesObelisks of the World41°00′21.24″N 28°58′31.43″E / 41.0059000°N 28.9753972°E / 41.0059000; 28.97539727724550-7235741376235741376

밀양 대씨 역사 각주 함께 보기 둘러보기 메뉴밀양 대씨

1973년 목차 사건 문화 탄생 사망 노벨상 달력 둘러보기 메뉴