mirror of
				https://github.com/dcarrillo/prezto.git
				synced 2025-11-04 07:29:09 +00:00 
			
		
		
		
	utility: Honor pre-defined COLOR settings for grep
Honor `GREP_COLOR` or `GREP_COLORS` if already defined for coloring `grep` output.
This commit is contained in:
		
				
					committed by
					
						
						Indrajit Raychaudhuri
					
				
			
			
				
	
			
			
			
						parent
						
							1ff9421f7b
						
					
				
				
					commit
					2368c9142b
				
			@@ -130,8 +130,8 @@ fi
 | 
			
		||||
 | 
			
		||||
# Grep
 | 
			
		||||
if zstyle -t ':prezto:module:utility:grep' color; then
 | 
			
		||||
  export GREP_COLOR='37;45'           # BSD.
 | 
			
		||||
  export GREP_COLORS="mt=$GREP_COLOR" # GNU.
 | 
			
		||||
  export GREP_COLOR=${GREP_COLOR:-'37;45'}            # BSD.
 | 
			
		||||
  export GREP_COLORS=${GREP_COLORS:-"mt=$GREP_COLOR"} # GNU.
 | 
			
		||||
 | 
			
		||||
  alias grep="${aliases[grep]:-grep} --color=auto"
 | 
			
		||||
fi
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user