From f54f27d6211de1b905ffaf88cd03e8f4fa7aad6d Mon Sep 17 00:00:00 2001 From: ilovezfs Date: Sat, 30 Apr 2016 14:33:16 -0700 Subject: [PATCH] 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. --- Library/Homebrew/caveats.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/caveats.rb b/Library/Homebrew/caveats.rb index 6e02b168d9..350e2d57b3 100644 --- a/Library/Homebrew/caveats.rb +++ b/Library/Homebrew/caveats.rb @@ -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