7 ms·
Tmux 1.9 released
- remirezk 13y agoHas anyone used these, and can they give me a comparison: tmux/scree/byobu Currently a byobu user, it seems fine so far. Wondering what others offer more than that.
- mandalar12 13y agoI also use byobu but byobu uses preconfigured screen or tmux configuration. You can choose the tmux or screen backend with the commands byobu-tmux or byobu-screen.
- joeyoung 13y agoI use screen and tmux for different tasks. I'll use screen when I need to run a long-running task and can't keep my terminal session open. I use tmux with a script so that I can ssh into multiple nodes and broadcast the same commands to them all at the same time. Great for interactive deployments that I haven't been able to automate away with CFEngine just yet.
- thelibrarian 13y agoSo why do you use screen rather than tmux for long running tasks, if you use tmux for everything else?
- joeyoung 13y agoForce of habit more than anything else. I just learned about tmux a month ago when I needed to find a way to implement that broadcast solution. For the moment, broadcasting is the only thing I use tmux for - Just as detaching from long running sessions is the only thing I use screen for. I don't have an allegiance to either as most of my tasks I do in a single terminal window.
- krasin 13y agoif you're running it on linux, is any reason to use screen for long-running tasks, instead of Docker?
- ars 13y agoDocker and screen do completely different things, unless you mean some other Docker than what google found for me.
- joeyoung 13y agoI haven't explored Docker yet. Some of my team members have been looking into it. Hoping to read up and experiment with it a bit once I have some free time.
- sillysaurus2 13y agoDocker can be used as a screen replacement?
- davvid 13y agoThe reason folks asked, "docker is a screen replacement?" is because one typical use case is using screen within an ssh session where you might get disconnected. screen holds onto the session so that you can ssh back in and continue from where you left off. $ ssh hostname $ screen # some time later, you get disconnected... $ ssh hostname $ screen -x # back to where you were before getting disconnected.
- naterator 13y agoScreen is amazing for SSH work or if you just don't want to have 50 tabs open. I've been looking into tmux lately though for the later. I just found out about it last week. Seriously, the amount of commands linux has that most people don't know about is staggering. This link[1] was on HN just the other day. [1] http://www.danielmiessler.com/blog/collection-of-less-commonly-used-unix-commands http://www.danielmiessler.com/blog/collection-of-less-common...
- 13y ago
- laumars 13y agoThat tmux broadcast trick sounds interesting. Are you able to provide some more details about it please?
- andyhmltn 13y agoI didn't know about it either but found this: https://twitter.com/j_melis/status/179173797285478400 https://twitter.com/j_melis/status/179173797285478400 Seems like a neat trick
- joeyoung 13y agoPull up the command line with "Ctrl-b :" Synchronize your panes: "setw synchronize-panes on" Now you can send the same commands to all panes in the current window. To turn synchronization off: "setw synchronize-panes off" My shell script takes in a list of tuples (hostname plus a special id that I need to paste for my tasks that's unique to each host), splits off a window pane for each hostname(tmux split-window -h), ssh's into each host in it's own pane, and turns on synchronization. I did a little trick to setup pastebuffers to hold that special id from the tuple i passed in. And setup keybindings so that I can press a key combination to paste in that ID whenever I need it to each respective pane. If I ever need to temporarily remove a pane or several panes from the syncronized session but keep the others synced, I just change focus to the pane I want to unsync and put it into copy mode with "Ctrl-b [". Can take the pane back out of copy mode by hitting "q". So far it's made me much more productive when I have to run a bunch of identical commands on a cluster of nodes for which we have no defined process (i.e. I'm figuring it out as I go). I'll need to sanitize the script, but I'll try to put up a github gist of the script later on.
- laumars 13y agoThanks for that :) > I'll need to sanitize the script, but I'll try to put up a github gist of the script later on. If you wouldn't mind, I'd be hugely grateful as I often find myself having to do similar tasks as what you describe (and even wanted to set up a script to auto start sessions in different panes like you do but wasn't aware that was possible). While I do use tmux quite heavily (to the point where I found myself needing to rebind a lot of the keys to be more vi like or more convenient to manage one handed), I reckon I still only use about 10% of it's functionality. So it would be good to see other solutions based around tmux.
- aaronem 13y ago> I use tmux with a script so that I can ssh into multiple nodes and broadcast the same commands to them all at the same time. I sometimes need to do this with multiple VMs. I'm really, really not in favor of bash scripting, but I've found the following to suffice, without the tmux dependency: for host in box1 box2 box3; do ssh $host 'command; command; command'; done (This presumes you've set up ssh-agent or are using passphraseless keys and suitable stanzas in ~/.ssh/config; adjust to taste if not.) I'd never heard of using tmux in this fashion before. Is it that the task sufficiently resembles a nail, or does tmux provide some unique benefit here?
- citrin_ru 13y agoI have switched from screen to tmux and tmux IMHO more convenient (I have about 30 windows in 2..3 tmux sessions). Can't say anything about byobu.
- tomswartz07 13y agoByobu is a pre-configured 'easy mode' for either Screen or Tmux. I use it all the time on my RasPi at work, running a mutt instance. I can hop in from any machine and have my 'native' email client accessible.
- njharman 13y agotmux is very scriptable. I have a shell script "go". go <box> opens new tux window splits it twice (3 total panes) all ssh'd into box, one as root, one tailing log files. The "go" script has grown over time, running custom log tails on specific boxes. And one command "vroom" which ssh's into web and db boxes running atop, apachetop, pg_activity in a bunch of panes. It's just an example. Tux lets you automate interactive shells.
- jzawodn 13y agoI'd love to see that script. I'm a long time screen user and would love to find a few examples that'll show off what tmux makes easy.
- CJefferson 13y agoI remember using on the mac a branch of tmux with iTerm, where the gui understood tmux, giving native tabs and scrollback. I thought this was the greatest thing ever, but am now on Linux. Is this work still continuing does anyone know?
- pi-rat 13y agoWorks out the box with tmux 1.8 and later + iTerm2 these days. Simply run tmux -CC [attach] and the tmux session pops up as tabs in iTerm2. I don't know about any similar alternatives for linux :( https://code.google.com/p/iterm2/wiki/TmuxIntegration https://code.google.com/p/iterm2/wiki/TmuxIntegration
- pyre 13y agoThe part that I dislike about it is that: 1) You have to have a separate terminal window for the 'control' process. 2) Now creating new tabs / windows automatically creates them in said tmux session (unless you manually use the "Profiles" drop-down menu). It would be nice to use Tmux as a way to create a window full of tabs in a scripted way (a la Tmuxinator), but not be forced to use a single Tmux session for everything.
- Moto7451 13y agoYup, it was merged into trunk for 1.8. I love iTerm/Tmux integration.
- pantalaimon 13y agobut is there also an integration for a Linux terminal emulator?
- Myrmornis 13y agoNot as far as I know. The iterm2 - tmux integration work was done by the iterm2 author George Nachman.
- 13y ago
- john2x 13y agoMoving to Emacs, I'm going to miss tmux more than I'll miss vim (there's evil-mode).
- Schiphol 13y agowhat? You can't run emacs in a tmux session?
- wging 13y agoYou definitely can--I do this all the time. I do literally mean all the time. My current session has been running the same emacs process inside a tmux window for about 60 days now I think.
- deleted 13y ago[deleted]
- jwr 13y agoI use emacs inside tmux all the time (on a Mac, in iTerm2). Works great.
- john2x 13y agoHow did you configure the Command key as Meta? I could never get it to work.
- wging 13y agoPreferences -> Keys, see the heading 'Remap Modifier Keys'. You can remap left command to left option, leaving right command as command so you can still cmd+tab out of iTerm. You might also have to to to Preferences -> Profiles -> Keys and on the bottom say that the left and right option keys both act as +Esc. If there's a better way I'd be interested to hear it, but this works for me.
- edoloughlin 13y agoI find that if I run emacsclient and emacs server, I don't need to use tmux. If I get disconnected, I just reconnect and run emacsclient again. All my buffer states are preserved.
- gdiocarez 13y agoDoes anyone know how to save/ retrieve sessions?
- dsirijus 13y agoRTFM.
- git-pull 13y agoDepending on your meaning: $ tmux detach $ tmux attach This will deattach and reattach a tmux session. You can type ``tmux detach`` inside a tmux pane of the session you want to detach. Also the key combo ``Ctrl-b d`` will detach. If you mean a way to save the workspace configuration, tmuxp, teamocil and tmuxinator are great solutions. (Note, I wrote tmuxp as a python project a few months ago.)
- benrhughes 13y agoTmuxifier (https://github.com/jimeh/tmuxifier https://github.com/jimeh/tmuxifier) is a great utility for scripting tmux layouts. Well worth checking out if you have complex layouts you want to be able to recreate.
- yla92 13y agoI use tmuxinator[0] to manage it. [0]: https://github.com/tmuxinator/tmuxinator https://github.com/tmuxinator/tmuxinator
- jasonlotito 13y agotmux new -s session_name Then to reattach tmux attach -t session_name Read it as "tmux, attach to session_name" Forget which sessions you have open? List them out! tmux ls
- joeshaw 13y agoThe one downside to tmux over screen is that tmux basically requires that all clients connecting to it have the same screen size, and by default it chooses the smallest one. So while you can connect to an existing session, the output might be ugly. For this reason, I typically simply 'tmux detach;tmux attach"
- lsiebert 13y agoI have to say that the tmux-users mailing list in general, and Nicholas Marriott in particular, are really nice and friendly. I had a feature request (256 colors in fbterm so you can get 256 color tmux/vim without x), quickly got patch code, got support (I had never used patch before and didn't tell it to ignore whitespace) and when it worked, was told it would be in 1.9, and there it is. :-)
- H3g3m0n 13y agoJust spent half an hour trying to figure out why 256 color mode stopped working in Vim. I'm blaming you =P In all seriousness actually trying to get 256 colour mode auto detecting and working reliability across different xterms, tmux/screen, ssh and so on, without some hack that forces the 256 on even when it's not supported seems impossible :/ I added the following to my zshrc, which seems to have helped. Why don't these terminals report 256 color mode by default? if [ "$COLORTERM" == "yes" -a "$TERM" == "xterm" ]; then export TERM=xterm-256color fi
- lsiebert 13y agoThe escape sequences to set 256 colors were previously hardcoded into tmux, instead of detected from terminfo. That works fine, until you use a program that uses different escape sequences. I suspect terminals don't set 256 colors by default for backward compatibility reasons. tmux itself didn't assume, you needed something in your config file or a command line option. Now though, I believe it can detect it based on your term.
- mariusmg 13y agoIf you're on Windows, ConEmu offers the same functionality. And as a bonus you can also run windows apps inside the terminal window. Here's how it looks http://i.imgur.com/dEpQYJf.jpg http://i.imgur.com/dEpQYJf.jpg
- sdfjkl 13y agoAnd now you can use tmux in Cygwin.
- smrtinsert 13y agoi highly recommend transparency about 85-90% on conemu if you use black/dark backgrounds. it really seems to save me some alt-tabs especially when following instructions.
- andyhmltn 13y agoAwesome little program. It's saved so much time so far. For anyone that wants to get up and running: https://github.com/andyhmltn/dotfiles https://github.com/andyhmltn/dotfiles That contains two tmux config files that add a few things like CTRL+B thenSHIFT+P for a nice layout and a shortcut for switching between panes with ALT+Arrow keys
- jc79 13y agoI personally use: bind-key -n M-1 select-window -t 1 bind-key -n M-2 select-window -t 2 bind-key -n M-3 select-window -t 3 (...) For an IMHO even more convinient ALT+Number to switch directly to the tab in question, just like in firefox.
- andyhmltn 13y agoThat's very similar to CTRL+B then Q then Number. But I have about 5+ panes so I found using the arrow keys a lot easier
- rjzzleep 13y agoi use ctrl-up / ctrl-down bind-key -n C-up next bind-key -n C-down prev ctrl-left and alt-left/right interfere with too many other cli apps. https://github.com/fishman/dot_files/blob/master/tmux/.tmux.conf https://github.com/fishman/dot_files/blob/master/tmux/.tmux....
- thekaleb 13y agoThank you! I did not know about the source-file command. I've been writing shell scripts, instead. You have just changed my entire work-flow!
- kelmop 13y agoThank you! a Great piece of software that I use constantly. The world is better place with developers like you. Go on and hug yourself.
- euoia 13y agoHere are my tmux bindings which I have been using daily for over a year. These are configured in iTerm in the Profiles->Keys section using Send Hex Codes. Cmd-shift-c: New window Cmd-shift-l: New pane to the right Cmd-shift-h: New pane to the left Cmd-shift-k: New pane above Cmd-shift-j: New pane below Cmd-l: Focus pane on right Cmd-h: Focus pane on left Cmd-k: Focus pane above Cmd-j: Focus pane below Cmd-1: Select first window Cmd-2: Select second window ... Option-h: Previous window Option-l: Next window Command-/: Enter copy mode I have the same bindings in MacVim. The nice thing about using command is that it doesn't interfere with other cli apps like ctrl. The following allows you to yank the tmux clipboard into the system clipboard: https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
- joeshaw 13y agoHere's a good blog post describing how to use the "Send Hex Codes" for integrating tmux and iTerm: http://tangledhelix.com/blog/2012/04/28/iterm2-keymaps-for-tmux/ http://tangledhelix.com/blog/2012/04/28/iterm2-keymaps-for-t...
- mbillie1 13y agoAn absolute staple of my development setup, and one of those rare tools that always just seems to work. Thanks for all the work! Sidebar: if you're a die-hard tmux user in Linux, and you do something like, say, open vim and then realize you haven't opened it in tmux, check out https://github.com/nelhage/reptyr https://github.com/nelhage/reptyr - it lets you do things like ctrl-z to background vim, start tmux, then steal the vim process into your new tmux session. Pretty cool!
- joyofdata 13y agoInstalled it today for the first time (just switched from Windows to Ubuntu) and I love it already! http://askubuntu.com/questions/423529/how-to-efficiently-switch-between-several-terminal-windows-using-the-keyboard http://askubuntu.com/questions/423529/how-to-efficiently-swi...
- bashcoder 13y agoThanks for the useful tip. I also really appreciate the power and utility of tmuxinator. [1] [1] https://github.com/tmuxinator/tmuxinator https://github.com/tmuxinator/tmuxinator
- saosebastiao 13y agoI love and use tux all the time, but for me it doesn't always just work. I regularly run into weird backspace/delete behavior when using tmux with ssh. For example, ssh from ubuntu into rhel and then running tmux will give me a completely different behavior compared to when I tmux in ubuntu and then ssh into rhel. I know that backspace/delete behavior has more to do with the terminal than tmux, but gnome terminal seems to handle it fine outside of tmux.
- mbillie1 13y agoHmm, I remember having this issue with RHEL also, but I thought it was fixed in maybe tmux 1.8... although I could certainly be wrong.
- cfallin 13y agoI've run into this a few times, too -- seems to have something to do with the termcap info for tmux's virtual term. FWIW, I was able to work around it with 'stty', e.g.: $ stty erase ^? to recognize DEL (ASCII 127, or ^?) as backspace. I have that in my .bashrc on a particular machine that gives me this problem...
- bigtunacan 13y agoI just wanted to say thanks for the hard work! I absolutely love this tool. About 1/2 of my team has started using this tool since I introduced it to the group and everyone of them loves it. I started using tmux just because I was frustrated that I would occasionally kill the terminal with Command + Q instead of just the current window Command + W. But now there is just so much of tmux that helps my daily work flow I don't know how I ever got by without it.
- caiob 13y agoCan't wait until this gets incorporated onto Homebrew. Apparently there's already a pull request https://github.com/adnissen/homebrew/commit/2b0e92805b445988f7c1ba9d0fd09b16d2afc087 https://github.com/adnissen/homebrew/commit/2b0e92805b445988...
- adn 13y agoHere's the working homebrew PR, if you can't wait to use it: https://github.com/Homebrew/homebrew/pull/26884 https://github.com/Homebrew/homebrew/pull/26884. Should get merged pretty soon.
- DArcMattr 13y agoThe tmux project is part of the ones developed alongside and included in OpenBSD, so when you support OpenBSD, you're also supporting tmux.
- beatgammit 13y ago> 'default-path' has been removed This kind of annoys me, but I'm successfully using this workaround (hinted at in the announcement): bind c run 'tmux new-window -c "#{pane_current_path}"' bind-key '%' split-window -hc "#{pane_current_path}" bind-key '"' split-window -vc "#{pane_current_path}" Anyone know why this change was made?
- hellabites 13y agoNo, but I am very thankful for your posted workaround.
- jparyani 13y agoFor anyone else who shares tmux configs between different versions, this is a good way to do it: if-shell "[[ `tmux -V` == *1.9* ]]" \ 'unbind c; bind c new-window -c "#{pane_current_path}"'
- deleted 13y ago[deleted]