Skip to content

Instantly share code, notes, and snippets.

@suplo
Created August 9, 2016 00:32
Show Gist options
  • Save suplo/289ca2f6ec40ed1e064603d1736c6be3 to your computer and use it in GitHub Desktop.
Save suplo/289ca2f6ec40ed1e064603d1736c6be3 to your computer and use it in GitHub Desktop.
Fix open command issue when in tmux session

Reference

I recently installed tmux on my laptop running OSX 10.10.4. I’d not had any issues until I tried to use the ‘open’ command in order to install a .pkg file manually.

When I ran open package.pkg, I got the following output: The window server could not be contacted. open must be run with a user logged in at the console, either as that user or as root.

I found the fix on a chinese blog

brew update
brew install reattach-to-user-namespace
brew upgrade reattach-to-user-namespace
echo "set -g default-command \"reattach-to-user-namespace -l ${SHELL}\"" >> ~/.tmux.conf
@danielb2
Copy link

Does this still work for you in macOS sierra?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment