Hacker News new | past | comments | ask | show | jobs | submit login
How to copy and paste with tmux on Mac OS X (thoughtbot.com)
33 points by Croaky on March 20, 2012 | hide | past | favorite | 13 comments



If you are on Linux, add this to your ~/.tmux.conf file.

  ##CLIPBOARD selection integration
  ##Requires prefix key before the command key
  #Copy tmux paste buffer to CLIPBOARD
  bind C-c run "tmux show-buffer | xclip -i -selection clipboard"
  #Copy CLIPBOARD to tmux paste buffer and paste tmux paste buffer
  bind C-v run "tmux set-buffer -- \\"$(xclip -o -selection clipboard)\\"; tmux paste-buffer"


could we please stop creating headlines that address everybody, when the content only addresses specific sub-groups? This headline should have ended with "on OS X". I seriously doubt i'm the only one who clicked through, only to discover it was completely irrelevant to me.


Ah, didn't think of that. Valid critique. Edited the headline.


This article is an intro to the screencast the author has created and is selling for $15 at https://workshops.thoughtbot.com/pages/tmux . It is linked to at the bottom of the page. I really enjoy learning about new pieces of software but in my personal opinion $15 for a 26 minute screencast is kind of pricey.


The screencast covers a lot of things, including workflow, key bindings, and tweaks to OS X to make you a faster developer. If you save ten minutes a day, you'll have made up the cost of the screencast in a day or two - which, in my opinion, is well worth it.


Or you can buy the tmux book for $11 which tells pretty much the same: http://pragprog.com/book/bhtmux/tmux


Can someone explain the use case for using tmux locally on your mac (which is what this article seems to be about)? My only use for tmux right now is for when I am ssh-ing into remote computers: It gives me a saved state so I don't lose history or kill long running processes if I become disconnected and it also gives me multiple tabs. But it seems that if I am local then Terminal.app or iTerm2 already does all of that. So... why would I use tmux locally?


I use it to organize everything I'm doing. iTerm2 does splits, and both iTerm2 and Terminal do tabs, but using Tmux decouples my workflow from the operating system I'm using. Additional benefits are being able to close my terminal at the end of the day and reattach the next morning with all my programs open, being able to script things I do often, etc.



Great idea, but I think the word "screen" is too overloaded (even alongside GNU or shell) to be meaningful for comparison.

The useful information here is simply that tmux mentions are going up: <http://google.com/trends/?q=tmux>.


I might be missing the point, but at least with Emacs, copy and paste works nicely from within tmux without doing any of this stuff.

Using clipboard-kill-ring-save and clipboard-yank (I have them bound to C-c c and C-c v) just works.


reattach-to-user-namespace also fixes the following when running launchctl from tmux:

  Bug: launchctl.c:2408 (24957):13: (dbfd = open(g_job_overrides_db_path, O_RDONLY | O_EXLOCK | O_CREAT, S_IRUSR | S_IWUSR)) != -1
  launch_msg(): Socket is not connected


Very handy little snippet, now I just have to relearn vim




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: