Merge pull request #4241 from lukertty/master

Fix Tty.width cannot get the real width in certain terminal like emacs shell
This commit is contained in:
Mike McQuaid 2018-05-31 14:46:52 +01:00 committed by GitHub
commit efc02899c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ module Tty
def width
width = `/bin/stty size 2>/dev/null`.split[1]
width ||= `/usr/bin/tput cols 2>/dev/null`.split[0]
width = `/usr/bin/tput cols 2>/dev/null`.split[0] if width.to_i.zero?
width ||= 80
width.to_i
end

View File

@ -72,7 +72,7 @@ then
FILTERED_ENV=()
# Filter all but the specific variables.
for VAR in HOME SHELL PATH TERM LOGNAME USER CI TRAVIS SSH_AUTH_SOCK SUDO_ASKPASS \
for VAR in HOME SHELL PATH TERM COLUMNS LOGNAME USER CI TRAVIS SSH_AUTH_SOCK SUDO_ASKPASS \
http_proxy https_proxy ftp_proxy no_proxy all_proxy HTTPS_PROXY FTP_PROXY ALL_PROXY \
"${!HOMEBREW_@}" "${!TRAVIS_@}"
do