diff --git a/Library/Homebrew/dev-cmd/edit.rb b/Library/Homebrew/dev-cmd/edit.rb index 26be25488d..9164c553d7 100644 --- a/Library/Homebrew/dev-cmd/edit.rb +++ b/Library/Homebrew/dev-cmd/edit.rb @@ -28,6 +28,8 @@ module Homebrew sig { override.void } def run ENV["COLORTERM"] = ENV.fetch("HOMEBREW_COLORTERM", nil) + # Recover $TMPDIR for emacsclient + ENV["TMPDIR"] = ENV.fetch("HOMEBREW_TMPDIR", nil) unless (HOMEBREW_REPOSITORY/".git").directory? odie <<~EOS diff --git a/bin/brew b/bin/brew index 5c527f632d..58bc4f24a3 100755 --- a/bin/brew +++ b/bin/brew @@ -193,6 +193,7 @@ USED_BY_HOMEBREW_VARS=( RBENV_ROOT SSH_TTY SUDO_USER + TMPDIR TMUX XDG_CACHE_HOME XDG_DATA_DIRS