aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-08-27 11:57:54 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-08-27 11:57:54 +0300
commit0c627eb31de1b816e98fa17a11ecf675c4e2b366 (patch)
tree85f8b8f34198214ba9ce1f0fd398b81e7e665988 /internal/p10k.zsh
parent3f2f38a71eb71719edec5edb8f43a8684f81a2f7 (diff)
add `proxy` prompt segment
Diffstat (limited to 'internal/p10k.zsh')
-rwxr-xr-xinternal/p10k.zsh10
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index cff575b0..5caaea15 100755
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -3052,6 +3052,16 @@ function prompt_terraform() {
[[ $ws == default ]] || _p9k_prompt_segment $0 $_p9k_color1 blue TERRAFORM_ICON 0 '' $ws
}
+function prompt_proxy() {
+ local -U p=(
+ $all_proxy $http_proxy $https_proxy $ftp_proxy
+ $ALL_PROXY $HTTP_PROXY $HTTPS_PROXY $FTP_PROXY)
+ p=(${(@)${(@)${(@)p#*://}##*@}%%/*})
+ (( $#p )) || return
+ (( $#p == 1 )) || p=("")
+ _p9k_prompt_segment $0 $_p9k_color1 blue PROXY_ICON 0 '' "$p[1]"
+}
+
_p9k_preexec() {
if (( $+_p9k_real_zle_rprompt_indent )); then
if [[ -n $_p9k_real_zle_rprompt_indent ]]; then