Skip tmux warning if reattached to user namespace

The exit status of pbpaste is a proxy for whether the user has set up
reattach-to-user-namespace. It should be 0 if it is set up, 1 otherwise.

This is the same hack as Homebrew/homebrew-services#48.
This commit is contained in:
ilovezfs 2016-04-30 14:33:16 -07:00 committed by Mike McQuaid
parent c63400d56b
commit f54f27d621

View File

@ -196,7 +196,9 @@ class Caveats
s << " #{f.plist_manual}"
end
s << "" << "WARNING: brew services will fail when run under tmux." if ENV["TMUX"]
if ENV["TMUX"] && !quiet_system("/usr/bin/pbpaste")
s << "" << "WARNING: brew services will fail when run under tmux."
end
end
s.join("\n") + "\n" unless s.empty?
end