7 ms·
Tmux, for fun and profit
- SkyMarshal 14y agoThis is cool and something I didn't know about tmux: "The one disadvantage of everyone at DockYard working remotely is that you can't just turn around and ask someone to come to your desk to pair up. Tmux allows multiple users to connect to a specific session. With a bit of dynamic DNS magic, port forwarding, and ssh tunneling, multiple people can connect to the same tmux session, work in the same vim window, and see the same development server." ... "With a tmux, ssh port forwarding, and Google+ Hangout, you can create a useful pair programming environment with your remote coworkers. We find this setup very effective and use it often to work together and tackle an issue."
- pyre 14y agoMy comment from the blog post: tmux and screen both have upsides and downsides for pair programming. Ones that I know of: 1. screen requires itself to be setuid root for session sharing. This is security issue to say the least. The frustrating part of this is that screen explicitly checks that that uid == 0. This means that, even if you can iron out all of the permissions issues between you and your partner without needing root access, screen will only accept suid root as the solution. 2. When you are screen sharing in tmux, the configuration used is the configuration of the person hosting the session. This can suck if you have a lot of non-standard bindings, because it forces the person you're pairing with to know them too. screen allows you to both use your own configurations while being connected to the same session.
- phsr 14y agoOne way we are going to get around this is that we plan to have a golden .tmux.conf that we will all use at DockYard, so that any non-standard bindings will be standard to us
- ajross 14y agoRegarding #1: if you are doing software development on a system with any security requirements at all, you have already lost. Maybe I can see bending that rule for debugging a live system in extremis, but not for "pair programming".
- pyre 14y ago> if you are doing software development on a > system with any security requirements at all, > you have already lost Could you expand on how security and development are diametrically opposed to each other? If my development server is exposed to the Internet and I do something like disable root logins in ssh, why/what have I 'lost?'
- ajross 14y agoA box under development can and will have all sorts of terribly insecure behavior. It shouldn't be on the internet. I'm not saying you "lose" anything by trying to secure it, I'm saying that you already "lost the [security] game" when you put the box on the unfiltered internet in the first place. Your goal should be limiting exposure when it is compromised, not trying to lock down hatches on a leaky hull. Specifically: dickering over whether or not to make screen suid root on your dev boxes is an exercise in needless optimization.
- pyre 14y ago> Specifically: dickering over whether or not to make > screen suid root on your dev boxes is an exercise > in needless optimization. Are you speaking from the point of view of a 13 person startup, a 200 person business or a Fortune 500 corporation?
- 14y ago
- bulibuta 14y ago``Mouse free environment'' is a retarded concept. And that book doesn't understand anything about tmux and why it came about.
- teach 14y agoWhat's wrong with striving for a more 'mouse-free environment'? And what about 'tmux and why it came about' is missing from the book, in your opinion?
- pestaa 14y agoSounds implied you do understand it better, so don't keep it to yourself. Also, mouse-free environment is not just a concept, and most certainly not retarded. Care to elaborate why you think that?
- mattwdelong 14y agoJust out of curiosity and without creating yet another HN Poll; Who prefers Tmux over Screen and why?
- bcardarella 14y agoMy preference for tmux is solely based around Brian's book. It was the first time that I actually "got" terminal multiplexing.
- jasonlotito 14y agoGoing to once again pimp this book and it's delectable goodness. It's a wonderful book, well written, clear, concise, and in just a few pages, gives you a lot to work with. Highly recommended. http://pragprog.com/book/bhtmux/tmux http://pragprog.com/book/bhtmux/tmux
- darklajid 14y agoLooked at the book. We had an article recently about (technical) books being blown up to fill pages - this obviously wasn't. I don't doubt that this might be a great work, but I have to admit that I felt the '88 pages?' thought coming up. The price isn't too bad. I just found out, while checking out the pragprog site, that I fell for the 'Seems thin' thing. Maybe a conditioning I need to correct - I don't know.
- xnxn 14y agoI do, having used screen for a couple of years before switching. It has vertical splits, a saner config, and was easier to get colors working the way I wanted them to. I can also appreciate that it has a more modern codebase with less legacy baggage, even if the benefits of that aren't readily apparent to end-users.
- muuh-gnu 14y ago> It has vertical splits So has screen and has been for years. tmux just had it first. > a saner config I never had any trouble configuring screen to do anything I needed. Can you give a practical example of what somewhat important for the average user you can do in tmux with less effort than in screen?
- pgambling 14y agoThis post got me thinking about building a remote dev system using tmux running on EC2 or some other cheap VPC host. I like the idea of pulling up a fully configured dev system from anywhere. Mainly so I can pick up the same session from home or work for hacking on my own projects, rather than keeping two separate systems in sync. Does anyone else do something like this?
- cturner 14y ago> Does anyone else do something like this? Yup - I do exactly this for about the last year, and it works as you describe. Long-lived IRC sessions, all of my editing windows open as I like them. You can have nice monitor/chair/keyboard setups at work and home. I find I don't have much use for a laptop any more. If your Windows/ubuntu desktop install breaks, you can reinstall quickly and get back to where you were.
- dfc 14y agoI hope I never need to get back to my Windows/Ubuntu install...
- cturner 14y agoWhat I mean is - whatever is driving your graphics card, monitors and local network. Sometimes I do a dist upgrade and my video drivers go to junk. Or family install something to my workstation and I find that it has added junk to the boot sector, and I want to get rid of it for sure. Or my mac laptop just starts being really slow for reasons I can't be bothered to investigate. These things are no longer an issue because your desktop install is expendable.
- dfc 14y agoDefinitely do not want to get back to my ubuntu machine with proprietary video drivers.
- canthonytucci 14y ago
- drivebyacct2 14y agoDoes Mosh (posted yesterday) support multiple connections? I know it can suspend resume like screen/tmux. Seems like it would be preferable if it does.
- pestaa 14y agoCan someone please explain why dynamic DNS, port forwarding and SSH tunneling involved when attaching to the same session? I just fired up two instances of Putty and see my keystrokes replicated within a second.
- dfc 14y agoAre you in two separate locations connected to two different networks at the same time? The author is talking about telecommuting. Sure dynamic dns is not needed but timsbox.dyndomain.com is a lot easier to work with than whatever IP he has today.
- pestaa 14y agoAh I see now, thanks. You don't need any of this though if you have a dedicated development/staging server, which is I prefer.
- bcardarella 14y agoalso the IPs will change over time. The dynamic DNS will not.
- afhof 14y agoI am going to go out on a limb and say this article has little to no content. I am surprised that it has 69 points despite being very light on content. More over, the comments here are mostly tangential to the article (except in the sense that they involve the word tmux). Am I totally wrong? Can everyone else see into this article where I can't?
- ericb 14y agoHe explains how he uses tmux for pair programming. Seems useful to me.
- arnoooooo 14y agoHe says he switched from screen to tmux, then describes very shortly a use case in which tmux does not bring any benefit over screen (sharing a vim session).
- pestaa 14y agoMore often than not, I upvote submissions only to influence what's discussed on the front page. Many comments are far more in-depth than the original article however tangential they may be, but the topic has to be brought up.
- CJefferson 14y agoI've used tmux and screen on occasion, but I can't get past the fact that they don't fit well with GUI terminals. I love having "GUI" scroll-back, which I can go through with mouse scroll-wheel, or just dragging the scroll bar up and down.
- wonginator1221 14y agoYou could enable the mouse for mouse interaction with a supported terminal. In my tmux config: set -g mode-mouse on setw -g mouse-select-window on setw -g mouse-select-pane on This particular configuration will allow you to scroll, select text and focus windows and panes with just a mouse click.
- moe 14y agoExcept you can't natively select text for copy/paste anymore. When you click-drag you're now triggering a tmux selection, not the native terminal-emulator highlight. This is a big problem because the emulated variant is slow and behaves nothing like the real thing. To my understanding this is also a problem that can't be solved without further terminal emulator support. As it stands the remote application (tmux) can either receive all mouse-events or none of them. This means you have to choose between scroll-wheel support plus broken text-selection - or no scroll-wheel support.
- ajtaylor 14y agoI tried the mouse integration and turned it back off for the same reason as you. Not having copy-paste at the terminal level is a non-starter as far as I'm concerned. Learning the vim movement commands better eliminated most needs for the mouse-pointing ability anyway.
- moe 14y agoLearning the vim movement commands better eliminated most needs for the mouse-pointing ability anyway. Sadly not for me. I'm a die-hard vim-user but I can't live without my scroll-wheel in the terminal.
- akkartik 14y agoI found this to be a far superior article: http://news.ycombinator.com/item?id=3824399 http://news.ycombinator.com/item?id=3824399
- shurane 14y agoIt's rather amusing that your link has only seen 3 up votes. That's a real shame.