Fix TMUX env variable filtering

We currently filter out `TMUX`, but this breaks displaying some caveats.
This also enables an alias I use (and improved by @Rylan12):

    brew alias fzp='!id="$(gh pr list -L200 -R github.com/Homebrew/homebrew-core | TMUX=$HOMEBREW_TMUX fzf-tmux -p "90%,50%" --multi | cut -f1)"; [ -n "$id" ] && brew pr-publish --autosquash $id'
This commit is contained in:
Carlo Cabrera 2021-05-13 17:05:18 +01:00
parent 321c165bd3
commit 4fb06efe81
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0
3 changed files with 3 additions and 3 deletions

View File

@ -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?

View File

@ -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

View File

@ -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