Tty.width: use tput cols when stty size returns 0;
				
					
				
			bin/brew: add 'COLUMNS' and 'LINES' to env variables Signed-off-by: lukertty <lukertty@gmail.com>
This commit is contained in:
		
							parent
							
								
									ca8bfef553
								
							
						
					
					
						commit
						f308aa4800
					
				@ -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
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								bin/brew
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								bin/brew
									
									
									
									
									
								
							@ -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 LINES 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
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user