質問

If I'm running within tmux and I try to update an environment variable with launchctl, I see an error like this:

$ launchctl setenv GIT_SSH /opt/local/bin/ssh
Not privileged to set domain environment.

But it works fine from outside of tmux... any idea why that is, or if there's any sort of workaround?

役に立ちましたか?

解決

Running tmux as root is probably not a good idea. Someone has created a solution and explanation:

https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard

After configuring tmux to use reattach-to-user-namespace you can use launchctl setenv as yourself within tmux.

他のヒント

You need to run it from a privileged account i.e.

$ sudo launchctl setenv GIT_SSH /opt/local/bin/ssh

And enter your password when prompted. This can only be done from an admin account by default.

ライセンス: CC-BY-SA帰属
所属していません apple.stackexchange
scroll top