| 
									
										
										
										
											2023-06-30 17:05:18 -07:00
										 |  |  | typeset -ag prompt_functions | 
					
						
							|  |  |  | typeset -ag rprompt_functions | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | function prompt_builder () { | 
					
						
							|  |  |  |         result="" | 
					
						
							|  |  |  |         for prompt_func in $prompt_functions; do | 
					
						
							| 
									
										
										
										
											2023-08-15 12:09:31 -07:00
										 |  |  |                 result="${result}$($prompt_func)%{$reset_color%} " | 
					
						
							| 
									
										
										
										
											2023-06-30 17:05:18 -07:00
										 |  |  |         done | 
					
						
							|  |  |  |         # prompt will always end with "% " (or "# " if we're somehow root) | 
					
						
							|  |  |  |         result="${result}%#%{$reset_color%} " | 
					
						
							|  |  |  |         print "${result}" | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | function rprompt_builder () { | 
					
						
							|  |  |  |         result="" | 
					
						
							|  |  |  |         for rprompt_func in $rprompt_functions; do | 
					
						
							| 
									
										
										
										
											2023-08-15 12:09:31 -07:00
										 |  |  |                 result="$($rprompt_func)%{$reset_color%} ${result}" | 
					
						
							| 
									
										
										
										
											2023-06-30 17:05:18 -07:00
										 |  |  |         done | 
					
						
							|  |  |  |         result="${result}%{$reset_color%}" | 
					
						
							|  |  |  |         print "${result}" | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-02 18:58:53 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | if [[ $cols -lt 80 ]]; then | 
					
						
							|  |  |  |     if [[ $(uname -o) == "Android" ]]; then | 
					
						
							|  |  |  |         hostemoji="📞" | 
					
						
							|  |  |  |     else | 
					
						
							|  |  |  |         hostemoji="🖥" | 
					
						
							|  |  |  |     fi | 
					
						
							|  |  |  |     PROMPT="👤%{$fg_bold[white]%}@${hostemoji} %~ %# %{$reset_color%}" | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  |     PROMPT='$(prompt_builder)' | 
					
						
							|  |  |  |     RPROMPT='$(rprompt_builder)' | 
					
						
							|  |  |  | fi  | 
					
						
							|  |  |  | TMOUT=60 | 
					
						
							|  |  |  | TRAPALRM () { | 
					
						
							|  |  |  |     zle reset-prompt | 
					
						
							|  |  |  | } |