mirror of
				https://github.com/powerline/powerline.git
				synced 2025-10-31 11:34:53 +01:00 
			
		
		
		
	Add zsh prompt renderer
Zsh can use regular escape sequences in the prompt, but they must be
wrapped in %{...%} to work correctly.
Refs #84.
			
			
This commit is contained in:
		
							parent
							
								
									0b385a11e0
								
							
						
					
					
						commit
						2eb07e894e
					
				
							
								
								
									
										14
									
								
								powerline/renderers/zsh_prompt.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								powerline/renderers/zsh_prompt.py
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,14 @@ | |||||||
|  | # -*- coding: utf-8 -*- | ||||||
|  | 
 | ||||||
|  | from powerline.renderers.shell import ShellRenderer | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class ZshPromptRenderer(ShellRenderer): | ||||||
|  | 	'''Powerline zsh prompt segment renderer.''' | ||||||
|  | 	def hl(self, fg=None, bg=None, attr=None): | ||||||
|  | 		'''Highlight a segment. | ||||||
|  | 
 | ||||||
|  | 		Returns the default ShellRenderer escape sequence with %{...%} wrapped | ||||||
|  | 		around it (required in zsh prompts). | ||||||
|  | 		''' | ||||||
|  | 		return '%{' + super(ZshPromptRenderer, self).hl(fg, bg, attr) + '%}' | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user