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:
commit
efc02899c8
@ -7,7 +7,7 @@ module Tty
|
|||||||
|
|
||||||
def width
|
def width
|
||||||
width = `/bin/stty size 2>/dev/null`.split[1]
|
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 ||= 80
|
||||||
width.to_i
|
width.to_i
|
||||||
end
|
end
|
||||||
|
|||||||
2
bin/brew
2
bin/brew
@ -72,7 +72,7 @@ then
|
|||||||
|
|
||||||
FILTERED_ENV=()
|
FILTERED_ENV=()
|
||||||
# Filter all but the specific variables.
|
# 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 \
|
http_proxy https_proxy ftp_proxy no_proxy all_proxy HTTPS_PROXY FTP_PROXY ALL_PROXY \
|
||||||
"${!HOMEBREW_@}" "${!TRAVIS_@}"
|
"${!HOMEBREW_@}" "${!TRAVIS_@}"
|
||||||
do
|
do
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user