Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tmux "Socket is not connected" error on OS X Lion

Tags:

macos

tmux

I get the following error when I start a new session in tmux:

launch_msg("SetUserEnvironment"): Socket is not connected                                                                                                                         
launch_msg("SetUserEnvironment"): Socket is not connected

My info:

  • OS X 1.0.7.3
  • zsh 4.3.11
  • tmux 1.6

Tmux still launches and I haven't had any huge issues, but I'm hoping to get some insight into why this occurs. I've heard installing tmux-MacOSX-pasteboard "fixes" this message, but I'd rather not install a wrapper if I don't need it's features.

like image 253
Steve McKinney Avatar asked Apr 17 '12 14:04

Steve McKinney


1 Answers

That error message comes from launchctl when its setenv command has (apparently) failed to talk to launchd.

tmux does not automatically use launchctl, so you will have to dig into your specific configuration to find the source of the launchctl usage. My guess is that you are have one or more launchctl setenv … in your shell initialization files.

If you do not care that the launchctl invocations are failing, you could just suppress the error message by sending stderr to /dev/null:

launchctl setenv somevar somevalue 2>/dev/null

I had never heard of this particular application for my wrapper, but it does seem to fix the problem (at least here under 10.6).

If you need your launchctl invocations to succeed, then you do need the wrapper’s functionality (it is not just for pasteboard access; it can help with any functionality that requires access to a service in the “per-user bootstrap namespace”). If you do not want to run your shells “under the wrapper” (as described in its README), then you could run just the individual launchctl invocations under it:

/path/to/reattach-to-user-namespace launchctl setenv somevar somevalue

It appears that the wrapper can be easily installed via MacPort, and Homebrew:

  • port install tmux-pasteboard (MacPorts)
  • brew install reattach-to-user-namespace (Homebrew)
like image 130
Chris Johnsen Avatar answered Nov 17 '22 14:11

Chris Johnsen