diff --git a/Library/Homebrew/extend/os/mac/caveats.rb b/Library/Homebrew/extend/os/mac/caveats.rb index 97392b4be8..6f9bc6639c 100644 --- a/Library/Homebrew/extend/os/mac/caveats.rb +++ b/Library/Homebrew/extend/os/mac/caveats.rb @@ -48,7 +48,7 @@ class Caveats # pbpaste is the system clipboard tool on macOS and fails with `tmux` by default # check if this is being run under `tmux` to avoid failing - if ENV["TMUX"] && !quiet_system("/usr/bin/pbpaste") + if ENV["HOMEBREW_TMUX"] && !quiet_system("/usr/bin/pbpaste") s << "" << "WARNING: brew services will fail when run under tmux." end "#{s.join("\n")}\n" unless s.empty? diff --git a/Library/Homebrew/test/caveats_spec.rb b/Library/Homebrew/test/caveats_spec.rb index 7b4c32d463..f6d76521ac 100644 --- a/Library/Homebrew/test/caveats_spec.rb +++ b/Library/Homebrew/test/caveats_spec.rb @@ -135,7 +135,7 @@ describe Caveats do "plist_test.plist" end end - ENV["TMUX"] = "1" + ENV["HOMEBREW_TMUX"] = "1" allow(Homebrew).to receive(:_system).with("/usr/bin/pbpaste").and_return(false) caveats = described_class.new(f).caveats diff --git a/bin/brew b/bin/brew index 5644a1c49e..8446cc54ae 100755 --- a/bin/brew +++ b/bin/brew @@ -64,7 +64,7 @@ HOMEBREW_LIBRARY="${HOMEBREW_REPOSITORY}/Library" # Copy and export all HOMEBREW_* variables previously mentioned in # manpage or used elsewhere by Homebrew. -for VAR in BROWSER DISPLAY EDITOR NO_COLOR PATH +for VAR in BROWSER DISPLAY EDITOR NO_COLOR PATH TMUX do # Skip if variable value is empty. [[ -z "${!VAR}" ]] && continue