Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

On my mac, I have $EDITOR set to 'subl -w'. If I run my shell session under tmux, it opens the editor fine, but the command on the terminal never exits. However, this works fine on a terminal by itself, and also under screen, so it could be a tmux bug.

share|improve this question
3  
Possibly related –  Daniel Beck Dec 20 '12 at 14:56
    
thanks Daniel, that solved the problem. I still think it's a bug of tmux, because this plugin is related to copy/paste functionality, and yet it fixes this other thing. Please, post your solution as an answer to this question, so I can vote it as the correct answer. –  Ernesto Dec 20 '12 at 15:39
1  
The “plugin” is not actually specific to pasteboard access (despite the repository name I used to publish it). The problem arises due to the way OS X handles a specific bit of novel process-associated state (the “bootstrap namespace”) that is not present on other Unix-y systems. If OS X provided documented, public APIs for managing a process’s bootstrap namespace, then I would not hesitate to recommend (or even write) a patch to osdep-darwin.c. However, since the required function is undocumented and “private”, I have avoided recommending any changes to tmux itself. –  Chris Johnsen Dec 21 '12 at 3:09
    
Thanks for clarifying it Chris, I stand corrected. Thanks. –  Ernesto Dec 21 '12 at 13:56

1 Answer 1

up vote 6 down vote accepted

The solution to this problem lies in installing tmux MacOSX pasteboard, as pointed out by Daniel Beck in a comment above. Most of the explanation about this can be found is the second comment above, which I reproduce here for clarity:

The “plugin” is not actually specific to pasteboard access (despite the repository name I used to publish it). The problem arises due to the way OS X handles a specific bit of novel process-associated state (the “bootstrap namespace”) that is not present on other Unix-y systems. If OS X provided documented, public APIs for managing a process’s bootstrap namespace, then I would not hesitate to recommend (or even write) a patch to osdep-darwin.c. However, since the required function is undocumented and “private”, I have avoided recommending any changes to tmux itself.

Chris Johnsen

So I decided to finally post it as the answer, although I'm not who devise it originally. Kudos for Daniel for pointing it out, and to Chris Johnsen for writing this fix for tmux on Mac OS X.

share|improve this answer
    
I had to install the above package AND add the following to ~/.tmux.conf: set-option -g default-command "reattach-to-user-namespace -l zsh" –  Fabian Pedregosa May 19 '13 at 22:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.