From b816abfed0e8785d8bc2e47987cc40f6bcd4bc29 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 26 Jan 2021 12:43:07 +0100 Subject: [PATCH 001/380] work around bugs in add-zle-hook-widget (#1238) --- internal/p10k.zsh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index c63564d8..9dffb547 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7584,9 +7584,15 @@ function _p9k_wrap_widgets() { if (( ! $+functions[_p9k_widget_$widget] )); then functions[_p9k_widget_$widget]='_p9k_widget '${(q)widget}' "$@"' fi - # The leading dot is to work around bugs in zsh-syntax-highlighting. - zle -A $widget ._p9k_orig_$widget - zle -N $widget _p9k_widget_$widget + if [[ $widget == zle-* && + $widgets[$widget] == user:azhw:* && + $functions[add-zle-hook-widget] ]]; then + add-zle-hook-widget $widget _p9k_widget_$widget + else + # The leading dot is to work around bugs in zsh-syntax-highlighting. + zle -A $widget ._p9k_orig_$widget + zle -N $widget _p9k_widget_$widget + fi done 2>/dev/null # `zle -A` fails for inexisting widgets and complains to stderr } From 6a7115b35b42b127ce4e2a8735396a844acd492b Mon Sep 17 00:00:00 2001 From: bcochofel Date: Sun, 21 Feb 2021 18:02:14 +0000 Subject: [PATCH 002/380] add azure classes (#1274) --- internal/p10k.zsh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 9dffb547..43fa8336 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4459,8 +4459,15 @@ prompt_azure() { fi _p9k_cache_stat_set "$name" fi + local pat class + for pat class in "${_POWERLEVEL9K_AZURE_CLASSES[@]}"; do + if [[ $name == ${~pat} ]]; then + [[ -n $class ]] && state=_${${(U)class}//İ/I} + break + fi + done [[ -n $_p9k__cache_val[1] ]] || return - _p9k_prompt_segment "$0" "blue" "white" "AZURE_ICON" 0 '' "${_p9k__cache_val[1]//\%/%%}" + _p9k_prompt_segment "$0$state" "blue" "white" "AZURE_ICON" 0 '' "${_p9k__cache_val[1]//\%/%%}" } _p9k_prompt_azure_init() { @@ -7312,6 +7319,7 @@ _p9k_init_params() { # POWERLEVEL9K_KUBECONTEXT_OTHER_BACKGROUND=yellow _p9k_declare -a POWERLEVEL9K_KUBECONTEXT_CLASSES -- _p9k_declare -a POWERLEVEL9K_AWS_CLASSES -- + _p9k_declare -a POWERLEVEL9K_AZURE_CLASSES -- _p9k_declare -a POWERLEVEL9K_TERRAFORM_CLASSES -- _p9k_declare -b POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT 0 _p9k_declare -a POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES -- 'service_account:*' SERVICE_ACCOUNT From 3920940ea84f6fba767cbed3fe6ba0653411c706 Mon Sep 17 00:00:00 2001 From: bcochofel Date: Sun, 21 Feb 2021 20:03:14 +0000 Subject: [PATCH 003/380] add fluxctl and stern to show kubecontext (#1268) --- README.md | 10 +++++----- config/p10k-classic.zsh | 2 +- config/p10k-lean-8colors.zsh | 2 +- config/p10k-lean.zsh | 2 +- config/p10k-rainbow.zsh | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 92bacb26..32e606ca 100644 --- a/README.md +++ b/README.md @@ -183,8 +183,8 @@ Here's the relevant parameter for kubernetes context: ```zsh # Show prompt segment "kubecontext" only when the command you are typing -# invokes kubectl, helm, kubens, kubectx, oc, istioctl, kogito, k9s or helmfile. -typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile' +# invokes kubectl, helm, kubens, kubectx, oc, istioctl, kogito, k9s, helmfile, fluxctl or stern. +typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|fluxctl|stern' ``` To customize when different prompt segments are shown, open `~/.p10k.zsh`, search for @@ -990,8 +990,8 @@ a relevant tool. ```zsh # Show prompt segment "kubecontext" only when the command you are typing -# invokes kubectl, helm, kubens, kubectx, oc, istioctl, kogito, k9s or helmfile. -typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile' +# invokes kubectl, helm, kubens, kubectx, oc, istioctl, kogito, k9s, helmfile, fluxctl or stern. +typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|fluxctl|stern' ``` Configs created by `p10k configure` may contain parameters of this kind. To customize when different @@ -1007,7 +1007,7 @@ function kube-toggle() { if (( ${+POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND} )); then unset POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND else - POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile' + POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|fluxctl|stern' fi p10k reload if zle; then diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 8bb7e4df..731d6cd9 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1195,7 +1195,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|fluxctl|stern' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 2b1eabca..58a691f4 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1143,7 +1143,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|fluxctl|stern' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index dd6fd959..b5e148e0 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1139,7 +1139,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|fluxctl|stern' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 318792eb..06d1426d 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1261,7 +1261,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|fluxctl|stern' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. From 6d545d5dd06bd85bbfda5cc8fd7938aee4b79d55 Mon Sep 17 00:00:00 2001 From: wzy <32936898+Freed-Wu@users.noreply.github.com> Date: Sun, 7 Mar 2021 16:11:28 +0800 Subject: [PATCH 004/380] Fix #1286 (#1288) --- internal/p10k.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 43fa8336..b78ecd14 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1341,10 +1341,10 @@ _p9k_prompt_battery_set_args() { if _p9k_read_file $dir/(power|current)_now(N) && (( $#_p9k__ret < 9 )); then (( power_now += ${pow::=$_p9k__ret} )) fi - if _p9k_read_file $dir/(energy|charge)_now(N); then - (( energy_now += _p9k__ret )) - elif _p9k_read_file $dir/capacity(N); then + if _p9k_read_file $dir/capacity(N); then (( energy_now += _p9k__ret * full / 100. + 0.5 )) + elif _p9k_read_file $dir/(energy|charge)_now(N); then + (( energy_now += _p9k__ret )) fi _p9k_read_file $dir/status(N) && local bat_status=$_p9k__ret || continue [[ $bat_status != Full ]] && is_full=0 From d28e84ca7061c43c49c91059d15b49bc5859a3a7 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 9 Mar 2021 12:20:28 +0100 Subject: [PATCH 005/380] don't display git tag when on a branch (#1294) --- config/p10k-classic.zsh | 2 +- config/p10k-lean-8colors.zsh | 2 +- config/p10k-lean.zsh | 2 +- config/p10k-rainbow.zsh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 731d6cd9..123ae9c1 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -404,7 +404,7 @@ # Display the current Git commit if there is no branch and no tag. # Tip: To always display the current Git commit, delete the next line. - [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_LOCAL_BRANCH ]] && # <-- this line + [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" # Show tracking branch name if it differs from local branch. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 58a691f4..4f9d8938 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -402,7 +402,7 @@ # Display the current Git commit if there is no branch and no tag. # Tip: To always display the current Git commit, delete the next line. - [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_LOCAL_BRANCH ]] && # <-- this line + [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" # Show tracking branch name if it differs from local branch. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index b5e148e0..c3ecb09d 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -398,7 +398,7 @@ # Display the current Git commit if there is no branch and no tag. # Tip: To always display the current Git commit, delete the next line. - [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_LOCAL_BRANCH ]] && # <-- this line + [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" # Show tracking branch name if it differs from local branch. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 06d1426d..a47fb18e 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -405,7 +405,7 @@ # Display the current Git commit if there is no branch and no tag. # Tip: To always display the current Git commit, delete the next line. - [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_LOCAL_BRANCH ]] && # <-- this line + [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" # Show tracking branch name if it differs from local branch. From 7d786b9c50913028eec0463c5cca00796633997f Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 17 Mar 2021 08:44:29 +0100 Subject: [PATCH 006/380] remove all CR from prompt (#1304 and #1305) --- internal/p10k.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index b78ecd14..17c3308b 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -734,7 +734,7 @@ _p9k_left_prompt_segment() { fi fi - p+="\${_p9k__c::=$content_exp_}" + p+='${_p9k__c::='$content_exp_'}${_p9k__c::=${_p9k__c//'$'\r''}}' p+='${_p9k__e::=${${_p9k__'${_p9k__line_index}l${${1#prompt_}%%[A-Z_]#}'+00}:-' if (( has_icon == -1 )); then p+='${${(%):-$_p9k__c%1(l.1.0)}[-1]}${${(%):-$_p9k__v%1(l.1.0)}[-1]}}' @@ -961,7 +961,7 @@ _p9k_right_prompt_segment() { fi fi - p+="\${_p9k__c::=$content_exp_}" + p+='${_p9k__c::='$content_exp_'}${_p9k__c::=${_p9k__c//'$'\r''}}' p+='${_p9k__e::=${${_p9k__'${_p9k__line_index}r${${1#prompt_}%%[A-Z_]#}'+00}:-' if (( has_icon == -1 )); then p+='${${(%):-$_p9k__c%1(l.1.0)}[-1]}${${(%):-$_p9k__v%1(l.1.0)}[-1]}}' @@ -7990,7 +7990,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v114\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v115\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$GITSTATUS_CACHE_DIR\1$GITSTATUS_AUTO_INSTALL\1${ZLE_RPROMPT_INDENT:-1}\1' From 58f5470cd98343581853dafe2a99430c0a6975e5 Mon Sep 17 00:00:00 2001 From: Daniel <61800298+ffe4@users.noreply.github.com> Date: Sun, 21 Mar 2021 17:03:53 +0100 Subject: [PATCH 007/380] Add font configuration instructions for WezTerm (#1313) --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 32e606ca..488270ef 100644 --- a/README.md +++ b/README.md @@ -582,6 +582,15 @@ applications on your system. Configure your terminal to use this font: font_family MesloLGS NF ``` Restart Kitty by closing all sessions and opening a new session. +- **WezTerm**: Create or open `$HOME/.config/wezterm/wezterm.lua` and add the following: + ```lua + local wezterm = require 'wezterm'; + return { + font = wezterm.font("MesloLGS NF"), + } + ``` + If the file already exists, only add the line with the font to the existing return. + Also add the first line if it is not already present. **IMPORTANT:** Run `p10k configure` after changing terminal font. The old `~/.p10k.zsh` may work incorrectly with the new font. From d3de2e558cc12edc012a868ef11cd0dfb6d03a68 Mon Sep 17 00:00:00 2001 From: Ramon Lucas Date: Sat, 27 Mar 2021 05:16:50 -0300 Subject: [PATCH 008/380] Sets the filter for the current gcloud profile (#1324) When you have multiple profiles set up, you should only search for what is currently active. --- internal/p10k.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 17c3308b..e5f8be76 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4496,7 +4496,8 @@ _p9k_gcloud_prefetch() { if ! _p9k_cache_stat_get $0 ~/.config/gcloud/configurations/config_$P9K_GCLOUD_CONFIGURATION; then local pair account project_id pair="$(gcloud config configurations describe $P9K_GCLOUD_CONFIGURATION \ - --format=$'value[separator="\1"](properties.core.account,properties.core.project)')" + --format=$'value[separator="\1"](properties.core.account,properties.core.project)' \ + --filter=is_active:true)" (( ! $? )) && IFS=$'\1' read account project_id <<<$pair _p9k_cache_stat_set "$account" "$project_id" fi From eafd78c3e0e19022612508e2ded2c1f035c29a25 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 28 Mar 2021 09:54:30 +0200 Subject: [PATCH 009/380] respect POWERLEVEL9K_SHORTEN_DIR_LENGTH when POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_last --- internal/p10k.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index e5f8be76..ea7b63c5 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1768,9 +1768,12 @@ prompt_dir() { fi ;; truncate_to_last) - if [[ $#parts -gt 2 || $p[1] != / && $#parts -gt 1 ]]; then + shortenlen=${_POWERLEVEL9K_SHORTEN_DIR_LENGTH:-1} + (( shortenlen > 0 )) || shortenlen=1 + local -i i='shortenlen+1' + if [[ $#parts -gt i || $p[1] != / && $#parts -gt shortenlen ]]; then fake_first=1 - parts[1,-2]=() + parts[1,-i]=() fi ;; truncate_to_first_and_last) From af86b53047ea6d6866dc5dae83eb219e691b9c76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Cembaluk?= <241574@student.pwr.edu.pl> Date: Sun, 28 Mar 2021 14:59:23 +0200 Subject: [PATCH 010/380] Added urxvt to manual font installation section. (#1326) --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 488270ef..39864696 100644 --- a/README.md +++ b/README.md @@ -591,6 +591,12 @@ applications on your system. Configure your terminal to use this font: ``` If the file already exists, only add the line with the font to the existing return. Also add the first line if it is not already present. +- **urxvt**: Create or open `~/.Xresources` and add the following line to it: + ```text + URxvt.font: xft:MesloLGS NF:size=11 + ``` + You can adjust the font size to your preference. After changing the configuration use `xrdb ~/.Xresources` to reload the config. + The new config is applied for all new terminals. **IMPORTANT:** Run `p10k configure` after changing terminal font. The old `~/.p10k.zsh` may work incorrectly with the new font. From 4d15cf977eb82ec127fd7ddfab281194765748e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89verton=20Arruda?= Date: Tue, 30 Mar 2021 19:46:50 +0200 Subject: [PATCH 011/380] Get active gcloud profile using `list` command (#1331) `gcloud config configure describe` command does not have `--filter` option. To filter the active profile using `--filter` it is necessary to use `gcloud config configure list` command --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index ea7b63c5..ed30454f 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4498,7 +4498,7 @@ _p9k_gcloud_prefetch() { P9K_GCLOUD_CONFIGURATION=$_p9k__ret if ! _p9k_cache_stat_get $0 ~/.config/gcloud/configurations/config_$P9K_GCLOUD_CONFIGURATION; then local pair account project_id - pair="$(gcloud config configurations describe $P9K_GCLOUD_CONFIGURATION \ + pair="$(gcloud config configurations list $P9K_GCLOUD_CONFIGURATION \ --format=$'value[separator="\1"](properties.core.account,properties.core.project)' \ --filter=is_active:true)" (( ! $? )) && IFS=$'\1' read account project_id <<<$pair From 8b2aab74d446d631ff6e85ceb7ab827a38932650 Mon Sep 17 00:00:00 2001 From: Klas Mellbourn Date: Sun, 4 Apr 2021 11:21:39 +0200 Subject: [PATCH 012/380] Add CPU load threshold setting (#1340) --- internal/p10k.zsh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index ed30454f..8baf944e 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -2239,6 +2239,9 @@ prompt_load() { _p9k_read_file /proc/loadavg || return local load=${${(A)=_p9k__ret}[_POWERLEVEL9K_LOAD_WHICH]//,/.} local -F pct='100. * load / _p9k_num_cpus' + if (( pct < _POWERLEVEL9K_LOAD_THRESHOLD )); then + return + fi if (( pct > 70 )); then _p9k_prompt_segment $0_CRITICAL red "$_p9k_color1" LOAD_ICON 0 '' $load elif (( pct > 50 )); then @@ -2274,6 +2277,9 @@ _p9k_prompt_load_async() { _p9k__load_warning= _p9k__load_critical= local -F pct='100. * _p9k__load_value / _p9k_num_cpus' + if (( pct < _POWERLEVEL9K_LOAD_THRESHOLD )); then + return + fi if (( pct > 70 )); then _p9k__load_critical=1 elif (( pct > 50 )); then @@ -7194,6 +7200,7 @@ _p9k_init_params() { 15) _POWERLEVEL9K_LOAD_WHICH=3;; *) _POWERLEVEL9K_LOAD_WHICH=2;; esac + _p9k_declare -i POWERLEVEL9K_LOAD_THRESHOLD 0 _p9k_declare -b POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY 0 _p9k_declare -b POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY 0 _p9k_declare -b POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY 1 From 8dc91004cb0a46898856bfac5fa66b1019824408 Mon Sep 17 00:00:00 2001 From: Tim Ysewyn Date: Sun, 4 Apr 2021 18:59:17 +0200 Subject: [PATCH 013/380] Fix gcloud CLI (#1342) This reverts #1324 (d3de2e5). --- internal/p10k.zsh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 8baf944e..8367e501 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4504,9 +4504,8 @@ _p9k_gcloud_prefetch() { P9K_GCLOUD_CONFIGURATION=$_p9k__ret if ! _p9k_cache_stat_get $0 ~/.config/gcloud/configurations/config_$P9K_GCLOUD_CONFIGURATION; then local pair account project_id - pair="$(gcloud config configurations list $P9K_GCLOUD_CONFIGURATION \ - --format=$'value[separator="\1"](properties.core.account,properties.core.project)' \ - --filter=is_active:true)" + pair="$(gcloud config configurations describe $P9K_GCLOUD_CONFIGURATION \ + --format=$'value[separator="\1"](properties.core.account,properties.core.project)')" (( ! $? )) && IFS=$'\1' read account project_id <<<$pair _p9k_cache_stat_set "$account" "$project_id" fi From 30bd9461b3f013bc4c529de0a123db89a92a87c7 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 10 Apr 2021 14:27:09 +0200 Subject: [PATCH 014/380] replace POWERLEVEL9K_LOAD_THRESHOLD with POWERLEVEL9K_LOAD_{WARNING,CRITICAL}_PCT (#1340) --- internal/p10k.zsh | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 8367e501..4a9a780d 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -2239,12 +2239,9 @@ prompt_load() { _p9k_read_file /proc/loadavg || return local load=${${(A)=_p9k__ret}[_POWERLEVEL9K_LOAD_WHICH]//,/.} local -F pct='100. * load / _p9k_num_cpus' - if (( pct < _POWERLEVEL9K_LOAD_THRESHOLD )); then - return - fi - if (( pct > 70 )); then + if (( pct > _POWERLEVEL9K_LOAD_CRITICAL_PCT )); then _p9k_prompt_segment $0_CRITICAL red "$_p9k_color1" LOAD_ICON 0 '' $load - elif (( pct > 50 )); then + elif (( pct > _POWERLEVEL9K_LOAD_WARNING_PCT )); then _p9k_prompt_segment $0_WARNING yellow "$_p9k_color1" LOAD_ICON 0 '' $load else _p9k_prompt_segment $0_NORMAL green "$_p9k_color1" LOAD_ICON 0 '' $load @@ -2277,12 +2274,9 @@ _p9k_prompt_load_async() { _p9k__load_warning= _p9k__load_critical= local -F pct='100. * _p9k__load_value / _p9k_num_cpus' - if (( pct < _POWERLEVEL9K_LOAD_THRESHOLD )); then - return - fi - if (( pct > 70 )); then + if (( pct > _POWERLEVEL9K_LOAD_CRITICAL_PCT )); then _p9k__load_critical=1 - elif (( pct > 50 )); then + elif (( pct > _POWERLEVEL9K_LOAD_WARNING_PCT )); then _p9k__load_warning=1 else _p9k__load_normal=1 @@ -7199,7 +7193,8 @@ _p9k_init_params() { 15) _POWERLEVEL9K_LOAD_WHICH=3;; *) _POWERLEVEL9K_LOAD_WHICH=2;; esac - _p9k_declare -i POWERLEVEL9K_LOAD_THRESHOLD 0 + _p9k_declare -F POWERLEVEL9K_LOAD_WARNING_PCT 50 + _p9k_declare -F POWERLEVEL9K_LOAD_CRITICAL_PCT 70 _p9k_declare -b POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY 0 _p9k_declare -b POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY 0 _p9k_declare -b POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY 1 @@ -8000,7 +7995,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v115\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v116\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$GITSTATUS_CACHE_DIR\1$GITSTATUS_AUTO_INSTALL\1${ZLE_RPROMPT_INDENT:-1}\1' From b55ad16bdf747e7ff6a3c821d92ed942d4e3be7c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 12 Apr 2021 12:22:19 +0200 Subject: [PATCH 015/380] bug fix: segments whose state contains numbers could not be hidden (#1353) --- internal/p10k.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 4a9a780d..89a7941a 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -735,7 +735,7 @@ _p9k_left_prompt_segment() { fi p+='${_p9k__c::='$content_exp_'}${_p9k__c::=${_p9k__c//'$'\r''}}' - p+='${_p9k__e::=${${_p9k__'${_p9k__line_index}l${${1#prompt_}%%[A-Z_]#}'+00}:-' + p+='${_p9k__e::=${${_p9k__'${_p9k__line_index}l${${1#prompt_}%%[A-Z0-9_]#}'+00}:-' if (( has_icon == -1 )); then p+='${${(%):-$_p9k__c%1(l.1.0)}[-1]}${${(%):-$_p9k__v%1(l.1.0)}[-1]}}' else @@ -962,7 +962,7 @@ _p9k_right_prompt_segment() { fi p+='${_p9k__c::='$content_exp_'}${_p9k__c::=${_p9k__c//'$'\r''}}' - p+='${_p9k__e::=${${_p9k__'${_p9k__line_index}r${${1#prompt_}%%[A-Z_]#}'+00}:-' + p+='${_p9k__e::=${${_p9k__'${_p9k__line_index}r${${1#prompt_}%%[A-Z0-9_]#}'+00}:-' if (( has_icon == -1 )); then p+='${${(%):-$_p9k__c%1(l.1.0)}[-1]}${${(%):-$_p9k__v%1(l.1.0)}[-1]}}' else @@ -7995,7 +7995,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v116\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v117\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$GITSTATUS_CACHE_DIR\1$GITSTATUS_AUTO_INSTALL\1${ZLE_RPROMPT_INDENT:-1}\1' From cd865da150cab138dda586f76d6a02f3a943d629 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 16 Apr 2021 21:42:41 +0200 Subject: [PATCH 016/380] expand c-escapes in kubectl (#1361) --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 89a7941a..da8362b6 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4388,7 +4388,7 @@ prompt_kubecontext() { fi done fi - _p9k_cache_stat_set "$name" "$namespace" "$cluster" "$user" "$cloud_name" "$cloud_account" "$cloud_zone" "$cloud_cluster" "$text" "$state" + _p9k_cache_stat_set "${(g::)name}" "${(g::)namespace}" "${(g::)cluster}" "${(g::)user}" "${(g::)cloud_name}" "${(g::)cloud_account}" "${(g::)cloud_zone}" "${(g::)cloud_cluster}" "${(g::)text}" "$state" fi typeset -g P9K_KUBECONTEXT_NAME=$_p9k__cache_val[1] From 607befe822e52b180fcb28bba01b273d3206bb84 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 16 Apr 2021 22:07:08 +0200 Subject: [PATCH 017/380] bump version (#1361) --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index da8362b6..9b4d0065 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7995,7 +7995,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v117\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v118\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$GITSTATUS_CACHE_DIR\1$GITSTATUS_AUTO_INSTALL\1${ZLE_RPROMPT_INDENT:-1}\1' From 836332f578a5802012b5f9f947285d2a8456c747 Mon Sep 17 00:00:00 2001 From: alsoGAMER <35269770+alsoGAMER@users.noreply.github.com> Date: Sun, 18 Apr 2021 08:48:26 +0200 Subject: [PATCH 018/380] =?UTF-8?q?Font=20instructions=20for=20Asbr=C3=BA?= =?UTF-8?q?=20Connection=20Manager=20(#1362)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- font.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/font.md b/font.md index b7fa4564..4f48ccb7 100644 --- a/font.md +++ b/font.md @@ -51,7 +51,7 @@ applications on your system. Configure your terminal to use this font: *Properties → Font* and set *Font* to `MesloLGS NF`. - **Microsoft Terminal** (the new thing): Open *Settings* (`Ctrl+,`), search for `fontFace` and set value to `MesloLGS NF` for every profile. -- **IntelliJ**: Open *Intellij → Edit → Preferences → Editor → Color Scheme → Console Font*. +- **IntelliJ** (or any other Intellj-Based IDEs): Open *IDE → Edit → Preferences → Editor → Color Scheme → Console Font*. Select *Use console font instead of the default* and set the font name to `MesloLGS NF`. - **Termux**: Type `p10k configure` and answer `Yes` when asked whether to install *Meslo Nerd Font*. @@ -66,6 +66,9 @@ applications on your system. Configure your terminal to use this font: Exit the Preferences dialog by clicking *Close*. - **MobaXterm**: Open *Settings* → *Configuration* → *Terminal* → (Under *Terminal look and feel*) and change *Font* to `MesloLGS NF`. +- **Asbrú Connection Manager**: Open *Preferences* → *Local Shell Options* → *Look and Feel* → Enable *Use these personal options* and change *Font:* (Under *Terminal UI*) to `MesloLGS NF Regular`. + + If you want to change the font for the remote host connections, go to *Preferences* → *Terminal Options* → *Look and Feel* and change *Font:* (Under *Terminal UI*) to `MesloLGS NF Regular`. - **WSLtty**: Right click on an open terminal and then on *Options*. In the *Text* section, under *Font*, click *"Select..."* and set Font to `MesloLGS NF Regular`. - **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and add the following section From 48ff2e8065cf6c78ab303863ca46b91113eb0ddd Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 18 Apr 2021 08:54:54 +0200 Subject: [PATCH 019/380] fix style in font instructions --- README.md | 11 ++++++++--- font.md | 14 ++++++++------ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 39864696..55a0040e 100644 --- a/README.md +++ b/README.md @@ -553,8 +553,9 @@ applications on your system. Configure your terminal to use this font: *Properties → Font* and set *Font* to `MesloLGS NF`. - **Microsoft Terminal** (the new thing): Open *Settings* (`Ctrl+,`), search for `fontFace` and set value to `MesloLGS NF` for every profile. -- **IntelliJ**: Open *Intellij → Edit → Preferences → Editor → Color Scheme → Console Font*. - Select *Use console font instead of the default* and set the font name to `MesloLGS NF`. +- **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor → + Color Scheme → Console Font*. Select *Use console font instead of the default* and set the font + name to `MesloLGS NF`. - **Termux**: Type `p10k configure` and answer `Yes` when asked whether to install *Meslo Nerd Font*. - **Blink**: Type `config`, go to *Appearance*, tap *Add a new font*, tap *Open Gallery*, select @@ -566,8 +567,12 @@ applications on your system. Configure your terminal to use this font: - **Guake**: Right Click on an open terminal and open *Preferences*. Under *Appearance* tab, uncheck *Use the system fixed width font* (if not already) and select `MesloLGS NF Regular`. Exit the Preferences dialog by clicking *Close*. -- **MobaXterm**: Open *Settings* → *Configuration* → *Terminal* → (Under *Terminal look and feel*) +- **MobaXterm**: Open *Settings* → *Configuration* → *Terminal* → (under *Terminal look and feel*) and change *Font* to `MesloLGS NF`. +- **Asbrú Connection Manager**: Open *Preferences → Local Shell Options → Look and Feel*, enable + *Use these personal options* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`. + To change the font for the remote host connections, go to *Preferences → Terminal Options → + Look and Feel* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`. - **WSLtty**: Right click on an open terminal and then on *Options*. In the *Text* section, under *Font*, click *"Select..."* and set Font to `MesloLGS NF Regular`. - **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and add the following section diff --git a/font.md b/font.md index 4f48ccb7..66d8e05a 100644 --- a/font.md +++ b/font.md @@ -51,8 +51,9 @@ applications on your system. Configure your terminal to use this font: *Properties → Font* and set *Font* to `MesloLGS NF`. - **Microsoft Terminal** (the new thing): Open *Settings* (`Ctrl+,`), search for `fontFace` and set value to `MesloLGS NF` for every profile. -- **IntelliJ** (or any other Intellj-Based IDEs): Open *IDE → Edit → Preferences → Editor → Color Scheme → Console Font*. - Select *Use console font instead of the default* and set the font name to `MesloLGS NF`. +- **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor → + Color Scheme → Console Font*. Select *Use console font instead of the default* and set the font + name to `MesloLGS NF`. - **Termux**: Type `p10k configure` and answer `Yes` when asked whether to install *Meslo Nerd Font*. - **Blink**: Type `config`, go to *Appearance*, tap *Add a new font*, tap *Open Gallery*, select @@ -64,11 +65,12 @@ applications on your system. Configure your terminal to use this font: - **Guake**: Right Click on an open terminal and open *Preferences*. Under *Appearance* tab, uncheck *Use the system fixed width font* (if not already) and select `MesloLGS NF Regular`. Exit the Preferences dialog by clicking *Close*. -- **MobaXterm**: Open *Settings* → *Configuration* → *Terminal* → (Under *Terminal look and feel*) +- **MobaXterm**: Open *Settings* → *Configuration* → *Terminal* → (under *Terminal look and feel*) and change *Font* to `MesloLGS NF`. -- **Asbrú Connection Manager**: Open *Preferences* → *Local Shell Options* → *Look and Feel* → Enable *Use these personal options* and change *Font:* (Under *Terminal UI*) to `MesloLGS NF Regular`. - - If you want to change the font for the remote host connections, go to *Preferences* → *Terminal Options* → *Look and Feel* and change *Font:* (Under *Terminal UI*) to `MesloLGS NF Regular`. +- **Asbrú Connection Manager**: Open *Preferences → Local Shell Options → Look and Feel*, enable + *Use these personal options* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`. + To change the font for the remote host connections, go to *Preferences → Terminal Options → + Look and Feel* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`. - **WSLtty**: Right click on an open terminal and then on *Options*. In the *Text* section, under *Font*, click *"Select..."* and set Font to `MesloLGS NF Regular`. - **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and add the following section From b69bb45ab1f3171b88e192a121c86016dc02cd6e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 20 Apr 2021 20:53:58 +0200 Subject: [PATCH 020/380] disable colors in the output of taskwarrior (#1365) --- internal/p10k.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 9b4d0065..4bd35e48 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4908,7 +4908,7 @@ function _p9k_taskwarrior_init_meta() { local last_sig=$_p9k_taskwarrior_meta_sig { local cfg - cfg="$(command task show data.location /dev/null)" || return + cfg="$(command task show data.location rc.color=0 /dev/null)" || return local lines=(${(@M)${(f)cfg}:#data.location[[:space:]]##[^[:space:]]*}) (( $#lines == 1 )) || return local dir=${lines[1]##data.location[[:space:]]#} @@ -4964,7 +4964,7 @@ function _p9k_taskwarrior_init_data() { local name val for name in PENDING OVERDUE; do - val="$(command task +$name count /dev/null)" || continue + val="$(command task +$name count rc.color=0 /dev/null)" || continue [[ $val == <1-> ]] || continue _p9k_taskwarrior_counters[$name]=$val done @@ -4973,7 +4973,7 @@ function _p9k_taskwarrior_init_data() { if (( _p9k_taskwarrior_counters[PENDING] > _p9k_taskwarrior_counters[OVERDUE] )); then local -a ts - ts=($(command task +PENDING -OVERDUE list rc.verbose=nothing \ + ts=($(command task +PENDING -OVERDUE list rc.verbose=nothing rc.color=0 \ rc.report.list.labels= rc.report.list.columns=due.epoch /dev/null)) || ts=() if (( $#ts )); then _p9k_taskwarrior_next_due=${${(on)ts}[1]} @@ -7995,7 +7995,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v118\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v119\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$GITSTATUS_CACHE_DIR\1$GITSTATUS_AUTO_INSTALL\1${ZLE_RPROMPT_INDENT:-1}\1' From 8d1daa4e6340b1689bf951730489bc64c52220c7 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 20 Apr 2021 22:19:51 +0200 Subject: [PATCH 021/380] disable colors in the output of taskwarrior; this time for real (#1365) --- internal/p10k.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 4bd35e48..7da836ac 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4908,7 +4908,7 @@ function _p9k_taskwarrior_init_meta() { local last_sig=$_p9k_taskwarrior_meta_sig { local cfg - cfg="$(command task show data.location rc.color=0 /dev/null)" || return + cfg="$(command task show data.location rc.color=0 rc._forcecolor=0 /dev/null)" || return local lines=(${(@M)${(f)cfg}:#data.location[[:space:]]##[^[:space:]]*}) (( $#lines == 1 )) || return local dir=${lines[1]##data.location[[:space:]]#} @@ -4964,7 +4964,7 @@ function _p9k_taskwarrior_init_data() { local name val for name in PENDING OVERDUE; do - val="$(command task +$name count rc.color=0 /dev/null)" || continue + val="$(command task +$name count rc.color=0 rc._forcecolor=0 /dev/null)" || continue [[ $val == <1-> ]] || continue _p9k_taskwarrior_counters[$name]=$val done @@ -4973,7 +4973,7 @@ function _p9k_taskwarrior_init_data() { if (( _p9k_taskwarrior_counters[PENDING] > _p9k_taskwarrior_counters[OVERDUE] )); then local -a ts - ts=($(command task +PENDING -OVERDUE list rc.verbose=nothing rc.color=0 \ + ts=($(command task +PENDING -OVERDUE list rc.verbose=nothing rc.color=0 rc._forcecolor=0 \ rc.report.list.labels= rc.report.list.columns=due.epoch /dev/null)) || ts=() if (( $#ts )); then _p9k_taskwarrior_next_due=${${(on)ts}[1]} @@ -7995,7 +7995,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v119\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v120\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$GITSTATUS_CACHE_DIR\1$GITSTATUS_AUTO_INSTALL\1${ZLE_RPROMPT_INDENT:-1}\1' From f924646194e95c9ef0423d0e6c10cf41cc7bf6b1 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 14 May 2021 11:41:56 +0200 Subject: [PATCH 022/380] add P9K_IP_{RX,TX}_BYTES_DELTA to the list of parameters available within POWERLEVEL9K_IP_CONTENT_EXPANSION (#1392) --- config/p10k-classic.zsh | 16 +++++++++------- config/p10k-lean-8colors.zsh | 16 +++++++++------- config/p10k-lean.zsh | 16 +++++++++------- config/p10k-rainbow.zsh | 16 +++++++++------- internal/p10k.zsh | 14 ++++++++++++++ 5 files changed, 50 insertions(+), 28 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 123ae9c1..b6f81eb6 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1452,13 +1452,15 @@ # The following parameters are accessible within the expansion: # # Parameter | Meaning - # ----------------------+--------------- - # P9K_IP_IP | IP address - # P9K_IP_INTERFACE | network interface - # P9K_IP_RX_BYTES | total number of bytes received - # P9K_IP_TX_BYTES | total number of bytes sent - # P9K_IP_RX_RATE | receive rate (since last prompt) - # P9K_IP_TX_RATE | send rate (since last prompt) + # ----------------------+------------------------------------------- + # P9K_IP_IP | IP address + # P9K_IP_INTERFACE | network interface + # P9K_IP_RX_BYTES | total number of bytes received + # P9K_IP_TX_BYTES | total number of bytes sent + # P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt + # P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt + # P9K_IP_RX_RATE | receive rate (since last prompt) + # P9K_IP_TX_RATE | send rate (since last prompt) typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='${P9K_IP_RX_RATE:+%70F⇣$P9K_IP_RX_RATE }${P9K_IP_TX_RATE:+%215F⇡$P9K_IP_TX_RATE }%38F$P9K_IP_IP' # Show information for the first network interface whose name matches this regular expression. # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 4f9d8938..abc646b4 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1433,13 +1433,15 @@ # The following parameters are accessible within the expansion: # # Parameter | Meaning - # ----------------------+--------------- - # P9K_IP_IP | IP address - # P9K_IP_INTERFACE | network interface - # P9K_IP_RX_BYTES | total number of bytes received - # P9K_IP_TX_BYTES | total number of bytes sent - # P9K_IP_RX_RATE | receive rate (since last prompt) - # P9K_IP_TX_RATE | send rate (since last prompt) + # ----------------------+------------------------------------------- + # P9K_IP_IP | IP address + # P9K_IP_INTERFACE | network interface + # P9K_IP_RX_BYTES | total number of bytes received + # P9K_IP_TX_BYTES | total number of bytes sent + # P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt + # P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt + # P9K_IP_RX_RATE | receive rate (since last prompt) + # P9K_IP_TX_RATE | send rate (since last prompt) typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='$P9K_IP_IP${P9K_IP_RX_RATE:+ %2F⇣$P9K_IP_RX_RATE}${P9K_IP_TX_RATE:+ %3F⇡$P9K_IP_TX_RATE}' # Show information for the first network interface whose name matches this regular expression. # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index c3ecb09d..6eb56418 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1429,13 +1429,15 @@ # The following parameters are accessible within the expansion: # # Parameter | Meaning - # ----------------------+--------------- - # P9K_IP_IP | IP address - # P9K_IP_INTERFACE | network interface - # P9K_IP_RX_BYTES | total number of bytes received - # P9K_IP_TX_BYTES | total number of bytes sent - # P9K_IP_RX_RATE | receive rate (since last prompt) - # P9K_IP_TX_RATE | send rate (since last prompt) + # ----------------------+------------------------------------------- + # P9K_IP_IP | IP address + # P9K_IP_INTERFACE | network interface + # P9K_IP_RX_BYTES | total number of bytes received + # P9K_IP_TX_BYTES | total number of bytes sent + # P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt + # P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt + # P9K_IP_RX_RATE | receive rate (since last prompt) + # P9K_IP_TX_RATE | send rate (since last prompt) typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='$P9K_IP_IP${P9K_IP_RX_RATE:+ %70F⇣$P9K_IP_RX_RATE}${P9K_IP_TX_RATE:+ %215F⇡$P9K_IP_TX_RATE}' # Show information for the first network interface whose name matches this regular expression. # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index a47fb18e..be6748a2 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1528,13 +1528,15 @@ # The following parameters are accessible within the expansion: # # Parameter | Meaning - # ----------------------+--------------- - # P9K_IP_IP | IP address - # P9K_IP_INTERFACE | network interface - # P9K_IP_RX_BYTES | total number of bytes received - # P9K_IP_TX_BYTES | total number of bytes sent - # P9K_IP_RX_RATE | receive rate (since last prompt) - # P9K_IP_TX_RATE | send rate (since last prompt) + # ----------------------+------------------------------------------- + # P9K_IP_IP | IP address + # P9K_IP_INTERFACE | network interface + # P9K_IP_RX_BYTES | total number of bytes received + # P9K_IP_TX_BYTES | total number of bytes sent + # P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt + # P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt + # P9K_IP_RX_RATE | receive rate (since last prompt) + # P9K_IP_TX_RATE | send rate (since last prompt) typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='${P9K_IP_RX_RATE:+⇣$P9K_IP_RX_RATE }${P9K_IP_TX_RATE:+⇡$P9K_IP_TX_RATE }$P9K_IP_IP' # Show information for the first network interface whose name matches this regular expression. # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 7da836ac..d840e0d8 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5468,6 +5468,8 @@ function _p9k_prompt_net_iface_init() { typeset -g P9K_IP_INTERFACE= typeset -g P9K_IP_TX_BYTES= typeset -g P9K_IP_RX_BYTES= + typeset -g P9K_IP_TX_BYTES_DELTA= + typeset -g P9K_IP_RX_BYTES_DELTA= typeset -g P9K_IP_TX_RATE= typeset -g P9K_IP_RX_RATE= typeset -g _p9__ip_timestamp= @@ -5598,6 +5600,16 @@ function _p9k_prompt_net_iface_async() { _p9k__public_ip_not_vpn=$public_ip_not_vpn P9K_IP_IP=$ip_ip P9K_IP_INTERFACE=$ip_interface + if [[ -n $ip_tx_bytes && -n $P9K_IP_TX_BYTES ]]; then + P9K_IP_TX_BYTES_DELTA=$((ip_tx_bytes - P9K_IP_TX_BYTES)) + else + P9K_IP_TX_BYTES_DELTA= + fi + if [[ -n $ip_rx_bytes && -n $P9K_IP_RX_BYTES ]]; then + P9K_IP_RX_BYTES_DELTA=$((ip_rx_bytes - P9K_IP_RX_BYTES)) + else + P9K_IP_RX_BYTES_DELTA= + fi P9K_IP_TX_BYTES=$ip_tx_bytes P9K_IP_RX_BYTES=$ip_rx_bytes P9K_IP_TX_RATE=$ip_tx_rate @@ -5611,6 +5623,8 @@ function _p9k_prompt_net_iface_async() { P9K_IP_INTERFACE \ P9K_IP_TX_BYTES \ P9K_IP_RX_BYTES \ + P9K_IP_TX_BYTES_DELTA \ + P9K_IP_RX_BYTES_DELTA \ P9K_IP_TX_RATE \ P9K_IP_RX_RATE \ _p9__ip_timestamp \ From 9c034101fe3cec1e2edb8e07c32a3e6dba9afaee Mon Sep 17 00:00:00 2001 From: Maxim Baz Date: Sat, 15 May 2021 13:37:58 +0200 Subject: [PATCH 023/380] Add xplr segment (#1396) --- README.md | 1 + config/p10k-classic.zsh | 7 +++++++ config/p10k-lean-8colors.zsh | 7 +++++++ config/p10k-lean.zsh | 7 +++++++ config/p10k-rainbow.zsh | 8 ++++++++ internal/icons.zsh | 6 ++++++ internal/p10k.zsh | 14 ++++++++++++++ 7 files changed, 50 insertions(+) diff --git a/README.md b/README.md index 55a0040e..8b635471 100644 --- a/README.md +++ b/README.md @@ -307,6 +307,7 @@ enable as many segments as you like. It won't slow down your prompt or Zsh start | `nordvpn` | [nordvpn](https://nordvpn.com/) connection status | | `ranger` | [ranger](https://github.com/ranger/ranger) shell | | `nnn` | [nnn](https://github.com/jarun/nnn) shell | +| `xplr` | [xplr](https://github.com/sayanarijit/xplr) shell | | `vim_shell` | [vim](https://www.vim.org/) shell (`:sh`) | | `midnight_commander` | [midnight commander](https://midnight-commander.org/) shell | | `nix_shell` | [nix shell](https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) indicator | diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index b6f81eb6..a2fdb916 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -79,6 +79,7 @@ nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) nnn # nnn shell (https://github.com/jarun/nnn) + xplr # xplr shell (https://github.com/sayanarijit/xplr) vim_shell # vim shell indicator (:sh) midnight_commander # midnight commander shell (https://midnight-commander.org/) nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) @@ -713,6 +714,12 @@ # Custom icon. # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## + # xplr shell color. + typeset -g POWERLEVEL9K_XPLR_FOREGROUND=72 + # Custom icon. + # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' + ###########################[ vim_shell: vim shell indicator (:sh) ]########################### # Vim shell indicator color. typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=34 diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index abc646b4..5d944328 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -79,6 +79,7 @@ nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) nnn # nnn shell (https://github.com/jarun/nnn) + xplr # xplr shell (https://github.com/sayanarijit/xplr) vim_shell # vim shell indicator (:sh) midnight_commander # midnight commander shell (https://midnight-commander.org/) nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) @@ -711,6 +712,12 @@ # Custom icon. # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## + # xplr shell color. + typeset -g POWERLEVEL9K_XPLR_FOREGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' + ###########################[ vim_shell: vim shell indicator (:sh) ]########################### # Vim shell indicator color. typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=3 diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 6eb56418..fab84a62 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -79,6 +79,7 @@ nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) nnn # nnn shell (https://github.com/jarun/nnn) + xplr # xplr shell (https://github.com/sayanarijit/xplr) vim_shell # vim shell indicator (:sh) midnight_commander # midnight commander shell (https://midnight-commander.org/) nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) @@ -707,6 +708,12 @@ # Custom icon. # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## + # xplr shell color. + typeset -g POWERLEVEL9K_XPLR_FOREGROUND=72 + # Custom icon. + # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' + ###########################[ vim_shell: vim shell indicator (:sh) ]########################### # Vim shell indicator color. typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=34 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index be6748a2..48fdaabb 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -79,6 +79,7 @@ nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) nnn # nnn shell (https://github.com/jarun/nnn) + xplr # xplr shell (https://github.com/sayanarijit/xplr) vim_shell # vim shell indicator (:sh) midnight_commander # midnight commander shell (https://midnight-commander.org/) nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) @@ -733,6 +734,13 @@ # Custom icon. # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## + # xplr shell color. + typeset -g POWERLEVEL9K_XPLR_FOREGROUND=0 + typeset -g POWERLEVEL9K_XPLR_BACKGROUND=6 + # Custom icon. + # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' + ###########################[ vim_shell: vim shell indicator (:sh) ]########################### # Vim shell indicator color. typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=0 diff --git a/internal/icons.zsh b/internal/icons.zsh index 532ab0a6..a10be26d 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -132,6 +132,7 @@ function _p9k_init_icons() { LUA_ICON 'lua' PERL_ICON 'perl' NNN_ICON 'nnn' + XPLR_ICON 'xplr' TIMEWARRIOR_ICON 'tw' TASKWARRIOR_ICON 'task' NIX_SHELL_ICON 'nix' @@ -260,6 +261,7 @@ function _p9k_init_icons() { LUA_ICON 'lua' PERL_ICON 'perl' NNN_ICON 'nnn' + XPLR_ICON 'xplr' TIMEWARRIOR_ICON 'tw' TASKWARRIOR_ICON 'task' NIX_SHELL_ICON 'nix' @@ -391,6 +393,7 @@ function _p9k_init_icons() { LUA_ICON 'lua' PERL_ICON 'perl' NNN_ICON 'nnn' + XPLR_ICON 'xplr' TIMEWARRIOR_ICON 'tw' TASKWARRIOR_ICON 'task' NIX_SHELL_ICON 'nix' @@ -520,6 +523,7 @@ function _p9k_init_icons() { LUA_ICON '\uE620' #  PERL_ICON '\uE769' #  NNN_ICON 'nnn' + XPLR_ICON 'xplr' TIMEWARRIOR_ICON '\uF49B' #  TASKWARRIOR_ICON '\uF4A0 ' #  NIX_SHELL_ICON '\uF313 ' #  @@ -646,6 +650,7 @@ function _p9k_init_icons() { LUA_ICON 'lua' PERL_ICON 'perl' NNN_ICON 'nnn' + XPLR_ICON 'xplr' TIMEWARRIOR_ICON 'tw' TASKWARRIOR_ICON 'task' NIX_SHELL_ICON 'nix' @@ -774,6 +779,7 @@ function _p9k_init_icons() { LUA_ICON 'lua' PERL_ICON 'perl' NNN_ICON 'nnn' + XPLR_ICON 'xplr' TIMEWARRIOR_ICON 'tw' TASKWARRIOR_ICON 'task' NIX_SHELL_ICON 'nix' diff --git a/internal/p10k.zsh b/internal/p10k.zsh index d840e0d8..d96daa7d 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4753,6 +4753,20 @@ function instant_prompt_nnn() { _p9k_prompt_segment prompt_nnn 6 $_p9k_color1 NNN_ICON 1 '${NNNLVL:#0}' '$NNNLVL' } +function prompt_xplr() { + local -i len=$#_p9k__prompt _p9k__has_upglob + _p9k_prompt_segment $0 6 $_p9k_color1 XPLR_ICON 0 '' '' + (( _p9k__has_upglob )) || typeset -g "_p9k__segment_val_${_p9k__prompt_side}[_p9k__segment_index]"=$_p9k__prompt[len+1,-1] +} + +_p9k_prompt_xplr_init() { + typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$XPLR_PID' +} + +function instant_prompt_xplr() { + _p9k_prompt_segment prompt_xplr 6 $_p9k_color1 XPLR_ICON 0 '$XPLR_PID' '' +} + function prompt_vim_shell() { local -i len=$#_p9k__prompt _p9k__has_upglob _p9k_prompt_segment $0 green $_p9k_color1 VIM_ICON 0 '' '' From 0ab7e1ccfd91ecdc3a3ad2efcc8704d589d1ff54 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 22 May 2021 11:00:19 +0200 Subject: [PATCH 024/380] when resolving `python --version`, handle pyenv shims specially (#1378) --- internal/p10k.zsh | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index d96daa7d..69195505 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1082,8 +1082,24 @@ function _p9k_prompt_segment() { "_p9k_${_p9k__prompt_side}_prompt_segment" "$@" function p9k_prompt_segment() { p10k segment "$@" } function _p9k_python_version() { - _p9k_cached_cmd 1 python --version || return - [[ $_p9k__ret == (#b)Python\ ([[:digit:].]##)* ]] && _p9k__ret=$match[1] + case $commands[python] in + "") + return 1 + ;; + ${PYENV_ROOT:-~/.pyenv}/shims/python) + local P9K_PYENV_PYTHON_VERSION _p9k__pyenv_version + local -i _POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=1 _POWERLEVEL9K_PYENV_SHOW_SYSTEM=1 + local _POWERLEVEL9K_PYENV_SOURCES=(shell local global) + if _p9k_pyenv_compute && [[ $P9K_PYENV_PYTHON_VERSION == ([[:digit:].]##)* ]]; then + _p9k__ret=$P9K_PYENV_PYTHON_VERSION + return 0 + fi + ;& # fall through + *) + _p9k_cached_cmd 1 python --version || return + [[ $_p9k__ret == (#b)Python\ ([[:digit:].]##)* ]] && _p9k__ret=$match[1] + ;; + esac } ################################################################ @@ -4149,10 +4165,7 @@ function _p9k_pyenv_global_version() { _p9k_read_pyenv_like_version_file ${PYENV_ROOT:-$HOME/.pyenv}/version python- || _p9k__ret=system } -################################################################ -# Segment to display pyenv information -# https://github.com/pyenv/pyenv#choosing-the-python-version -prompt_pyenv() { +function _p9k_pyenv_compute() { unset P9K_PYENV_PYTHON_VERSION _p9k__pyenv_version local v=${(j.:.)${(@)${(s.:.)PYENV_VERSION}#python-}} @@ -4194,11 +4207,11 @@ prompt_pyenv() { if (( !_POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW )); then _p9k_pyenv_global_version - [[ $v == $_p9k__ret ]] && return + [[ $v == $_p9k__ret ]] && return 1 fi if (( !_POWERLEVEL9K_PYENV_SHOW_SYSTEM )); then - [[ $v == system ]] && return + [[ $v == system ]] && return 1 fi local versions=${PYENV_ROOT:-$HOME/.pyenv}/versions @@ -4210,8 +4223,14 @@ prompt_pyenv() { fi typeset -g _p9k__pyenv_version=$v +} - _p9k_prompt_segment "$0" "blue" "$_p9k_color1" 'PYTHON_ICON' 0 '' "${v//\%/%%}" +################################################################ +# Segment to display pyenv information +# https://github.com/pyenv/pyenv#choosing-the-python-version +prompt_pyenv() { + _p9k_pyenv_compute || return + _p9k_prompt_segment "$0" "blue" "$_p9k_color1" 'PYTHON_ICON' 0 '' "${_p9k__pyenv_version//\%/%%}" } _p9k_prompt_pyenv_init() { @@ -8023,7 +8042,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v120\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v121\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$GITSTATUS_CACHE_DIR\1$GITSTATUS_AUTO_INSTALL\1${ZLE_RPROMPT_INDENT:-1}\1' From 4d2346da0ae352235bfafc7cc8774ce60da7e70b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 22 May 2021 11:32:24 +0200 Subject: [PATCH 025/380] set P9K_PYENV_PYTHON_VERSION correctly when dealing with multiple pyenv versions (#1376) --- internal/p10k.zsh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 69195505..0d4db86a 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4216,11 +4216,15 @@ function _p9k_pyenv_compute() { local versions=${PYENV_ROOT:-$HOME/.pyenv}/versions versions=${versions:A} - local version=$versions/$v - version=${version:A} - if [[ $version == (#b)$versions/([^/]##)* ]]; then - typeset -g P9K_PYENV_PYTHON_VERSION=$match[1] - fi + local name version + for name in ${(s.:.)v}; do + version=$versions/$name + version=${version:A} + if [[ $version(#qN/) == (#b)$versions/([^/]##)* ]]; then + typeset -g P9K_PYENV_PYTHON_VERSION=$match[1] + break + fi + done typeset -g _p9k__pyenv_version=$v } From 1ad8e5759ecd41619746a775d9bc9d2902c5c90e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 22 May 2021 11:57:13 +0200 Subject: [PATCH 026/380] when searching for files in ancestor directories, do match in $HOME (#1376) --- internal/p10k.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 0d4db86a..7d2ade70 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -204,15 +204,15 @@ function _p9k_fetch_cwd() { _p9k__cwd_a=${${_p9k__cwd:A}:-.} case $_p9k__cwd in - ~|/|.) + /|.) _p9k__parent_dirs=() _p9k__parent_mtimes=() _p9k__parent_mtimes_i=() _p9k__parent_mtimes_s= return ;; - ~/*) - local parent=~/ + ~|~/*) + local parent=${${${:-~/..}:a}%/}/ local parts=(${(s./.)_p9k__cwd#$parent}) ;; *) @@ -255,7 +255,7 @@ function _p9k_glob() { # # Returns index within _p9k__parent_dirs or 0 if there is no match. # -# Pattern cannot have slashes. Never matches in / or ~. Search stops before reaching / or ~. +# Search stops before reaching ~/../ or / and never matches in those directories. # # Example: _p9k_upglob '*.csproj' function _p9k_upglob() { @@ -8046,7 +8046,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v121\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v122\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$GITSTATUS_CACHE_DIR\1$GITSTATUS_AUTO_INSTALL\1${ZLE_RPROMPT_INDENT:-1}\1' From 69d3650958ce03d666f433792444290b7b2ffe5d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 22 May 2021 12:09:13 +0200 Subject: [PATCH 027/380] hide python version in pyenv in lean/classic/rainbow if the rest of the content starts with it (#1376) --- config/p10k-classic.zsh | 8 ++++---- config/p10k-lean-8colors.zsh | 8 ++++---- config/p10k-lean.zsh | 8 ++++---- config/p10k-rainbow.zsh | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index a2fdb916..5f167063 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -940,10 +940,10 @@ # # The default format has the following logic: # - # 1. Display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION" if $P9K_PYENV_PYTHON_VERSION is not - # empty and unequal to $P9K_CONTENT. - # 2. Otherwise display just "$P9K_CONTENT". - typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_PYENV_PYTHON_VERSION:#$P9K_CONTENT}:+ $P9K_PYENV_PYTHON_VERSION}' + # 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or + # starts with "$P9K_PYENV_PYTHON_VERSION/". + # 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION". + typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}' # Custom icon. # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 5d944328..6cce4418 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -921,10 +921,10 @@ # # The default format has the following logic: # - # 1. Display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION" if $P9K_PYENV_PYTHON_VERSION is not - # empty and unequal to $P9K_CONTENT. - # 2. Otherwise display just "$P9K_CONTENT". - typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_PYENV_PYTHON_VERSION:#$P9K_CONTENT}:+ $P9K_PYENV_PYTHON_VERSION}' + # 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or + # starts with "$P9K_PYENV_PYTHON_VERSION/". + # 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION". + typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}' # Custom icon. # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index fab84a62..fe97961c 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -917,10 +917,10 @@ # # The default format has the following logic: # - # 1. Display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION" if $P9K_PYENV_PYTHON_VERSION is not - # empty and unequal to $P9K_CONTENT. - # 2. Otherwise display just "$P9K_CONTENT". - typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_PYENV_PYTHON_VERSION:#$P9K_CONTENT}:+ $P9K_PYENV_PYTHON_VERSION}' + # 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or + # starts with "$P9K_PYENV_PYTHON_VERSION/". + # 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION". + typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}' # Custom icon. # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 48fdaabb..9ea3e561 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -981,10 +981,10 @@ # # The default format has the following logic: # - # 1. Display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION" if $P9K_PYENV_PYTHON_VERSION is not - # empty and unequal to $P9K_CONTENT. - # 2. Otherwise display just "$P9K_CONTENT". - typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_PYENV_PYTHON_VERSION:#$P9K_CONTENT}:+ $P9K_PYENV_PYTHON_VERSION}' + # 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or + # starts with "$P9K_PYENV_PYTHON_VERSION/". + # 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION". + typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}' # Custom icon. # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' From f774df6c76c3cf98d7740a00ef63d36e5a5cc0a7 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 22 May 2021 12:19:41 +0200 Subject: [PATCH 028/380] pyenv: skip lines that start with "#" (#1376) --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 7d2ade70..767aca10 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4154,7 +4154,7 @@ function _p9k_read_pyenv_like_version_file() { [[ -n $fd ]] && exec {fd}>&- } local MATCH - local versions=(${(@)${(f)content}/(#m)*/${MATCH[(w)1]#$2}}) + local versions=(${${${${(f)content}/(#m)*/${MATCH[(w)1]}}##\#*}#$2}) _p9k__ret=${(j.:.)versions} _p9k__read_pyenv_like_version_file_cache[$1:$2]=$stat[1]:$_p9k__ret fi From a3494a52d7c01fbc28e7ab12b7af347860aa62a7 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 24 May 2021 09:19:13 +0200 Subject: [PATCH 029/380] don't leak 'token' local variable in parser (#1407) --- internal/parser.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/parser.zsh b/internal/parser.zsh index dc2082de..6c16adcd 100644 --- a/internal/parser.zsh +++ b/internal/parser.zsh @@ -152,7 +152,7 @@ function _p9k_parse_buffer() { local -r var="\$$id|\${$id}|\"\$$id\"|\"\${$id}\"" local -i e ic c=${2:-'1 << 62'} - local skip n s r state cmd prev + local skip n s r state token cmd prev local -a aln alp alf v if [[ -o interactive_comments ]]; then From c59720647a328c9dfdd96702ee22d4217c0974ed Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 25 May 2021 14:01:41 +0200 Subject: [PATCH 030/380] fix asdf, was broken by 1ad8e5759ecd41619746a775d9bc9d2902c5c90e (#1409) --- internal/p10k.zsh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 767aca10..8ceaaffb 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5350,10 +5350,14 @@ function prompt_asdf() { local -A versions local -a stat - zstat -A stat +mtime ~ 2>/dev/null || return - local dirs=($_p9k__parent_dirs ~) - local mtimes=($_p9k__parent_mtimes $stat[1]) local -i has_global + local dirs=($_p9k__parent_dirs) + local mtimes=($_p9k__parent_mtimes) + if [[ $dirs[-1] != ~ ]]; then + zstat -A stat +mtime ~ 2>/dev/null || return + dirs+=(~) + mtimes+=($stat[1]) + fi local elem for elem in ${(@)${:-{1..$#dirs}}/(#m)*/${${:-$MATCH:$_p9k__asdf_dir2files[$dirs[MATCH]]}#$MATCH:$mtimes[MATCH]:}}; do From 35acee119d2d18aa4630a63f36cb5b447bd17637 Mon Sep 17 00:00:00 2001 From: Zachary Palumbo Date: Wed, 26 May 2021 10:40:05 -0400 Subject: [PATCH 031/380] Fix icon padding for VCS bookmark icon (#1414) (#1415) --- internal/icons.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/icons.zsh b/internal/icons.zsh index a10be26d..bf5a1a11 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -816,6 +816,7 @@ function _p9k_init_icons() { icons[LEFT_SEGMENT_END_SEPARATOR]+=' ' icons[MULTILINE_LAST_PROMPT_PREFIX]+=' ' icons[VCS_TAG_ICON]+=' ' + icons[VCS_BOOKMARK_ICON]+=' ' icons[VCS_COMMIT_ICON]+=' ' icons[VCS_BRANCH_ICON]+=' ' icons[VCS_REMOTE_BRANCH_ICON]+=' ' From aa4d36634132b6c510207e6cdbc6d1aceaf7ddbd Mon Sep 17 00:00:00 2001 From: Alex Jurkiewicz Date: Fri, 28 May 2021 14:25:39 +1000 Subject: [PATCH 032/380] Add region support for aws element --- config/p10k-classic.zsh | 6 ++++++ config/p10k-lean-8colors.zsh | 6 ++++++ config/p10k-lean.zsh | 6 ++++++ config/p10k-rainbow.zsh | 6 ++++++ internal/p10k.zsh | 23 ++++++++++++++++++++++- 5 files changed, 46 insertions(+), 1 deletion(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 5f167063..20d1e5b6 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1291,6 +1291,12 @@ # Tip: Remove the next line to always show aws. typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' + # Include AWS region in prompt. (default: false) + # typeset -g POWERLEVEL9K_AWS_SHOW_REGION=false + + # Shorten AWS region. (default: true) + # typeset -g POWERLEVEL9K_AWS_SHOW_REGION_SHORT=true + # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element # in each pair defines a pattern against which the current AWS profile gets matched. # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 6cce4418..b2825b8d 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1272,6 +1272,12 @@ # Tip: Remove the next line to always show aws. typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' + # Include AWS region in prompt. (default: false) + # typeset -g POWERLEVEL9K_AWS_SHOW_REGION=false + + # Shorten AWS region. (default: true) + # typeset -g POWERLEVEL9K_AWS_SHOW_REGION_SHORT=true + # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element # in each pair defines a pattern against which the current AWS profile gets matched. # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index fe97961c..30a3a274 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1268,6 +1268,12 @@ # Tip: Remove the next line to always show aws. typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' + # Include AWS region in prompt. (default: false) + # typeset -g POWERLEVEL9K_AWS_SHOW_REGION=false + + # Shorten AWS region. (default: true) + # typeset -g POWERLEVEL9K_AWS_SHOW_REGION_SHORT=true + # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element # in each pair defines a pattern against which the current AWS profile gets matched. # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 9ea3e561..9411b090 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1360,6 +1360,12 @@ # Tip: Remove the next line to always show aws. typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' + # Include AWS region in prompt. (default: false) + # typeset -g POWERLEVEL9K_AWS_SHOW_REGION=false + + # Shorten AWS region. (default: true) + # typeset -g POWERLEVEL9K_AWS_SHOW_REGION_SHORT=true + # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element # in each pair defines a pattern against which the current AWS profile gets matched. # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 8ceaaffb..424eb9b3 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1131,6 +1131,25 @@ _p9k_prompt_anaconda_init() { # AWS Profile prompt_aws() { local aws_profile="${AWS_VAULT:-${AWSUME_PROFILE:-${AWS_PROFILE:-$AWS_DEFAULT_PROFILE}}}" + local text="${aws_profile//\%/%%}" + if (( _POWERLEVEL9K_AWS_SHOW_REGION )); then + local region_full + if [[ -v $AWS_DEFAULT_REGION ]]; then + region_full=$AWS_DEFAULT_REGION + else + if ! _p9k_cache_get "$0-$aws_profile-full"; then + _p9k_cache_set $(aws configure get region) + fi + region_full=$_p9k__cache_val[1] + fi + if (( _POWERLEVEL9K_AWS_SHOW_REGION_SHORT )); then + local region_short=${${${${${${region_full//-}//north/n}//south/s}//east/e}//west/w}//gov/g} + text="$text ($region_short)" + else + text="$text ($region_full)" + fi + fi + local pat class for pat class in "${_POWERLEVEL9K_AWS_CLASSES[@]}"; do if [[ $aws_profile == ${~pat} ]]; then @@ -1138,7 +1157,7 @@ prompt_aws() { break fi done - _p9k_prompt_segment "$0$state" red white 'AWS_ICON' 0 '' "${aws_profile//\%/%%}" + _p9k_prompt_segment "$0$state" red white 'AWS_ICON' 0 '' "$text" } _p9k_prompt_aws_init() { @@ -7379,6 +7398,8 @@ _p9k_init_params() { # POWERLEVEL9K_KUBECONTEXT_OTHER_BACKGROUND=yellow _p9k_declare -a POWERLEVEL9K_KUBECONTEXT_CLASSES -- _p9k_declare -a POWERLEVEL9K_AWS_CLASSES -- + _p9k_declare -b POWERLEVEL9K_AWS_SHOW_REGION 0 + _p9k_declare -b POWERLEVEL9K_AWS_SHOW_REGION_SHORT 1 _p9k_declare -a POWERLEVEL9K_AZURE_CLASSES -- _p9k_declare -a POWERLEVEL9K_TERRAFORM_CLASSES -- _p9k_declare -b POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT 0 From c7ad00b5a5ec92c9b6edf8051502f42659f820b5 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 28 May 2021 14:53:50 +0200 Subject: [PATCH 033/380] add P9K_AWS_PROFILE and P9K_AWS_REGION and use it in default configs --- config/p10k-classic.zsh | 12 +++--- config/p10k-lean-8colors.zsh | 12 +++--- config/p10k-lean.zsh | 12 +++--- config/p10k-rainbow.zsh | 12 +++--- internal/p10k.zsh | 71 ++++++++++++++++++++++++------------ 5 files changed, 71 insertions(+), 48 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 20d1e5b6..a3013932 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1291,12 +1291,6 @@ # Tip: Remove the next line to always show aws. typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' - # Include AWS region in prompt. (default: false) - # typeset -g POWERLEVEL9K_AWS_SHOW_REGION=false - - # Shorten AWS region. (default: true) - # typeset -g POWERLEVEL9K_AWS_SHOW_REGION_SHORT=true - # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element # in each pair defines a pattern against which the current AWS profile gets matched. # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) @@ -1327,6 +1321,12 @@ typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=208 # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # AWS segment format. The following parameters are available within the expansion. + # + # - P9K_AWS_PROFILE The name of the current AWS profile. + # - P9K_AWS_REGION The region associated with the current AWS profile. + typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}' + #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]# # AWS Elastic Beanstalk environment color. typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=70 diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index b2825b8d..57f1bd12 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1272,12 +1272,6 @@ # Tip: Remove the next line to always show aws. typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' - # Include AWS region in prompt. (default: false) - # typeset -g POWERLEVEL9K_AWS_SHOW_REGION=false - - # Shorten AWS region. (default: true) - # typeset -g POWERLEVEL9K_AWS_SHOW_REGION_SHORT=true - # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element # in each pair defines a pattern against which the current AWS profile gets matched. # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) @@ -1308,6 +1302,12 @@ typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=3 # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # AWS segment format. The following parameters are available within the expansion. + # + # - P9K_AWS_PROFILE The name of the current AWS profile. + # - P9K_AWS_REGION The region associated with the current AWS profile. + typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}' + #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]# # AWS Elastic Beanstalk environment color. typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=2 diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 30a3a274..f843f99a 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1268,12 +1268,6 @@ # Tip: Remove the next line to always show aws. typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' - # Include AWS region in prompt. (default: false) - # typeset -g POWERLEVEL9K_AWS_SHOW_REGION=false - - # Shorten AWS region. (default: true) - # typeset -g POWERLEVEL9K_AWS_SHOW_REGION_SHORT=true - # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element # in each pair defines a pattern against which the current AWS profile gets matched. # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) @@ -1304,6 +1298,12 @@ typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=208 # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # AWS segment format. The following parameters are available within the expansion. + # + # - P9K_AWS_PROFILE The name of the current AWS profile. + # - P9K_AWS_REGION The region associated with the current AWS profile. + typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}' + #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]# # AWS Elastic Beanstalk environment color. typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=70 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 9411b090..722acbdd 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1360,12 +1360,6 @@ # Tip: Remove the next line to always show aws. typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' - # Include AWS region in prompt. (default: false) - # typeset -g POWERLEVEL9K_AWS_SHOW_REGION=false - - # Shorten AWS region. (default: true) - # typeset -g POWERLEVEL9K_AWS_SHOW_REGION_SHORT=true - # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element # in each pair defines a pattern against which the current AWS profile gets matched. # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) @@ -1397,6 +1391,12 @@ typeset -g POWERLEVEL9K_AWS_DEFAULT_BACKGROUND=1 # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # AWS segment format. The following parameters are available within the expansion. + # + # - P9K_AWS_PROFILE The name of the current AWS profile. + # - P9K_AWS_REGION The region associated with the current AWS profile. + typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}' + #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]# # AWS Elastic Beanstalk environment color. typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=2 diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 424eb9b3..ea0f25ff 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1127,37 +1127,62 @@ _p9k_prompt_anaconda_init() { typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${CONDA_PREFIX:-$CONDA_ENV_PATH}' } +# Populates array `reply` with "$#profile:$profile:$region" where $profile and $region +# come from the AWS config (~/.aws/config). +function _p9k_parse_aws_config() { + local cfg=$1 + typeset -ga reply=() + [[ -f $cfg && -r $cfg ]] || return + + local -a lines + lines=(${(f)"$(<$cfg)"}) || return + + local line profile + local -a match mbegin mend + for line in $lines; do + if [[ $line == [[:space:]]#'[default]'[[:space:]]#(|'#'*) ]]; then + # example: [default] + profile=default + elif [[ $line == (#b)'[profile'[[:space:]]##([^[:space:]]|[^[:space:]]*[^[:space:]])[[:space:]]#']'[[:space:]]#(|'#'*) ]]; then + # example: [profile prod] + profile=${(Q)match[1]} + elif [[ $line == (#b)[[:space:]]#region[[:space:]]#=[[:space:]]#([^[:space:]]|[^[:space:]]*[^[:space:]])[[:space:]]# ]]; then + # example: region = eu-west-1 + if [[ -n $profile ]]; then + reply+=$#profile:$profile:$match[1] + profile= + fi + fi + done +} + ################################################################ # AWS Profile prompt_aws() { - local aws_profile="${AWS_VAULT:-${AWSUME_PROFILE:-${AWS_PROFILE:-$AWS_DEFAULT_PROFILE}}}" - local text="${aws_profile//\%/%%}" - if (( _POWERLEVEL9K_AWS_SHOW_REGION )); then - local region_full - if [[ -v $AWS_DEFAULT_REGION ]]; then - region_full=$AWS_DEFAULT_REGION - else - if ! _p9k_cache_get "$0-$aws_profile-full"; then - _p9k_cache_set $(aws configure get region) - fi - region_full=$_p9k__cache_val[1] - fi - if (( _POWERLEVEL9K_AWS_SHOW_REGION_SHORT )); then - local region_short=${${${${${${region_full//-}//north/n}//south/s}//east/e}//west/w}//gov/g} - text="$text ($region_short)" - else - text="$text ($region_full)" - fi - fi - + typeset -g P9K_AWS_PROFILE="${AWS_VAULT:-${AWSUME_PROFILE:-${AWS_PROFILE:-$AWS_DEFAULT_PROFILE}}}" local pat class for pat class in "${_POWERLEVEL9K_AWS_CLASSES[@]}"; do - if [[ $aws_profile == ${~pat} ]]; then + if [[ $P9K_AWS_PROFILE == ${~pat} ]]; then [[ -n $class ]] && state=_${${(U)class}//İ/I} break fi done - _p9k_prompt_segment "$0$state" red white 'AWS_ICON' 0 '' "$text" + + if [[ -n $AWS_DEFAULT_REGION ]]; then + typeset -g P9K_AWS_REGION=$AWS_DEFAULT_REGION + else + local cfg=${AWS_CONFIG_FILE:-~/.aws/config} + if ! _p9k_cache_stat_get $0 $cfg; then + local -a reply + _p9k_parse_aws_config $cfg + _p9k_cache_stat_set $reply + fi + local prefix=$#P9K_AWS_PROFILE:$P9K_AWS_PROFILE: + local kv=$_p9k__cache_val[(r)${(b)prefix}*] + typeset -g P9K_AWS_REGION=${kv#$prefix} + fi + + _p9k_prompt_segment "$0$state" red white 'AWS_ICON' 0 '' "${P9K_AWS_PROFILE//\%/%%}" } _p9k_prompt_aws_init() { @@ -7398,8 +7423,6 @@ _p9k_init_params() { # POWERLEVEL9K_KUBECONTEXT_OTHER_BACKGROUND=yellow _p9k_declare -a POWERLEVEL9K_KUBECONTEXT_CLASSES -- _p9k_declare -a POWERLEVEL9K_AWS_CLASSES -- - _p9k_declare -b POWERLEVEL9K_AWS_SHOW_REGION 0 - _p9k_declare -b POWERLEVEL9K_AWS_SHOW_REGION_SHORT 1 _p9k_declare -a POWERLEVEL9K_AZURE_CLASSES -- _p9k_declare -a POWERLEVEL9K_TERRAFORM_CLASSES -- _p9k_declare -b POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT 0 From d87d557b0f99a526f71fd8c3831842c70fab8cb7 Mon Sep 17 00:00:00 2001 From: Mark Adamson <3154635+mungojam@users.noreply.github.com> Date: Sat, 29 May 2021 07:39:59 +0100 Subject: [PATCH 034/380] Correct name of Windows Terminal in README (#1424) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b635471..512aced4 100644 --- a/README.md +++ b/README.md @@ -552,7 +552,7 @@ applications on your system. Configure your terminal to use this font: *Custom font* under *Text Appearance* and select `MesloLGS NF Regular`. - **Windows Console Host** (the old thing): Click the icon in the top left corner, then *Properties → Font* and set *Font* to `MesloLGS NF`. -- **Microsoft Terminal** (the new thing): Open *Settings* (`Ctrl+,`), search for `fontFace` and set +- **Windows Terminal** (the new thing): Open *Settings* (`Ctrl+,`), search for `fontFace` and set value to `MesloLGS NF` for every profile. - **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor → Color Scheme → Console Font*. Select *Use console font instead of the default* and set the font From 77fa0e6dcc56d71590967714f9e76bbf2c9ecc17 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 29 May 2021 08:41:20 +0200 Subject: [PATCH 035/380] clarify that Windows Terminal is the one from Microsoft --- README.md | 4 ++-- font.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 512aced4..78fcf39f 100644 --- a/README.md +++ b/README.md @@ -552,8 +552,8 @@ applications on your system. Configure your terminal to use this font: *Custom font* under *Text Appearance* and select `MesloLGS NF Regular`. - **Windows Console Host** (the old thing): Click the icon in the top left corner, then *Properties → Font* and set *Font* to `MesloLGS NF`. -- **Windows Terminal** (the new thing): Open *Settings* (`Ctrl+,`), search for `fontFace` and set - value to `MesloLGS NF` for every profile. +- **Windows Terminal** by Microsoft (the new thing): Open *Settings* (`Ctrl+,`), search for + `fontFace` and set value to `MesloLGS NF` for every profile. - **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor → Color Scheme → Console Font*. Select *Use console font instead of the default* and set the font name to `MesloLGS NF`. diff --git a/font.md b/font.md index 66d8e05a..0ce19c33 100644 --- a/font.md +++ b/font.md @@ -49,8 +49,8 @@ applications on your system. Configure your terminal to use this font: *Custom font* under *Text Appearance* and select `MesloLGS NF Regular`. - **Windows Console Host** (the old thing): Click the icon in the top left corner, then *Properties → Font* and set *Font* to `MesloLGS NF`. -- **Microsoft Terminal** (the new thing): Open *Settings* (`Ctrl+,`), search for `fontFace` and set - value to `MesloLGS NF` for every profile. +- **Windows Terminal** by Microsoft (the new thing): Open *Settings* (`Ctrl+,`), search for + `fontFace` and set value to `MesloLGS NF` for every profile. - **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor → Color Scheme → Console Font*. Select *Use console font instead of the default* and set the font name to `MesloLGS NF`. From ba83466e1da75d9260ebbb145215d9c46d6eadf6 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 30 May 2021 10:35:40 +0200 Subject: [PATCH 036/380] Squashed 'gitstatus/' changes from 6d00edd0..113f1f69 113f1f69 release gitstatusd-linux-x86_64 v1.5.0 e193be52 expose HEAD's commit message 815301f1 do not redefine `exec` and `builtin` in bash bindings (#235) 97c2aa17 Make `--version-glob` to receive an argument (#216) 95e549fd Support building on OpenBSD (#208) b054ddf2 make homebrew instructions work on systems other than darwin-x86_64 (#205) 98f99ade fix brew formula check git-subtree-dir: gitstatus git-subtree-split: 113f1f698667d12906d97e3818aec5d760dc6e3d --- README.md | 16 +++++++------- build | 14 +++++++++++-- build.info | 2 +- gitstatus.plugin.sh | 50 +++++++++++--------------------------------- gitstatus.plugin.zsh | 8 ++++++- install.info | 4 ++-- src/git.cc | 8 +++++++ src/git.h | 9 ++++++++ src/gitstatus.cc | 9 ++++++++ src/options.cc | 34 +++++++++++++++++++++++------- src/options.h | 2 ++ 11 files changed, 97 insertions(+), 59 deletions(-) diff --git a/README.md b/README.md index cbf29c3a..0fcf098b 100644 --- a/README.md +++ b/README.md @@ -43,15 +43,15 @@ git clone --depth=1 https://gitee.com/romkatv/gitstatus.git ~/gitstatus echo 'source ~/gitstatus/gitstatus.prompt.zsh' >>! ~/.zshrc ``` -Alternatively, on macOS you can install with Homebrew: +Alternatively, if you have Homebrew installed: ```zsh brew install romkatv/gitstatus/gitstatus -echo 'source /usr/local/opt/gitstatus/gitstatus.prompt.zsh' >>! ~/.zshrc +echo "source $(brew --prefix)/opt/gitstatus/gitstatus.prompt.zsh" >>! ~/.zshrc ``` -(If you choose this option, replace `~/gitstatus` with `/usr/local/opt/gitstatus` in all code -snippets below.) +(If you choose this option, replace `~/gitstatus` with `$(brew --prefix)/opt/gitstatus/gitstatus` +in all code snippets below.) _Make sure to disable your current theme if you have one._ @@ -144,15 +144,15 @@ git clone --depth=1 https://gitee.com/romkatv/gitstatus.git ~/gitstatus echo 'source ~/gitstatus/gitstatus.prompt.sh' >> ~/.bashrc ``` -Alternatively, on macOS you can install with Homebrew: +Alternatively, if you have Homebrew installed: ```zsh brew install romkatv/gitstatus/gitstatus -echo 'source /usr/local/opt/gitstatus/gitstatus.prompt.sh' >> ~/.bashrc +echo "source $(brew --prefix)/opt/gitstatus/gitstatus.prompt.sh" >> ~/.bashrc ``` -(If you choose this option, replace `~/gitstatus` with `/usr/local/opt/gitstatus` in all code -snippets below.) +(If you choose this option, replace `~/gitstatus` with `$(brew --prefix)/opt/gitstatus/gitstatus` +in all code snippets below.) This will give you a basic yet functional prompt with git status in it. It's [over 10x faster](#benchmarks) than any alternative that can give you comparable prompt. diff --git a/build b/build index ad1d1484..667def9f 100755 --- a/build +++ b/build @@ -90,6 +90,9 @@ if [ -n "$gitstatus_install_tools" ]; then freebsd) command pkg install -y cmake gmake binutils gcc git perl5 ;; + openbsd) + command pkg_add install cmake gmake gcc git wget + ;; netbsd) command pkgin -y install cmake gmake binutils git ;; @@ -102,7 +105,7 @@ if [ -n "$gitstatus_install_tools" ]; then sudo port -N install libiconv cmake wget elif command -v brew >/dev/null 2>&1; then for formula in libiconv cmake git wget; do - if command brew list "$formula" &>/dev/null; then + if command brew ls --version "$formula" &>/dev/null; then command brew upgrade "$formula" else command brew install "$formula" @@ -160,6 +163,13 @@ case "$gitstatus_kernel" in gitstatus_ldflags="$gitstatus_ldflags -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" ;; + openbsd) + gitstatus_cxx=eg++ + gitstatus_make=gmake + gitstatus_ldflags="$gitstatus_ldflags -static" + gitstatus_ldflags="$gitstatus_ldflags -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" + libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" + ;; netbsd) gitstatus_make=gmake gitstatus_ldflags="$gitstatus_ldflags -static" @@ -473,7 +483,7 @@ case "$gitstatus_kernel" in fi fi ;; - freebsd|netbsd|darwin) + freebsd|openbsd|netbsd|darwin) if [ -n "$docker_cmd" ]; then >&2 echo "[error] docker (-d) is not supported on $gitstatus_kernel" exit 1 diff --git a/build.info b/build.info index aa52263b..ec19ff74 100644 --- a/build.info +++ b/build.info @@ -3,7 +3,7 @@ # # This value is also read by shell bindings (indirectly, through # ./install) when using GITSTATUS_DAEMON or usrbin/gitstatusd. -gitstatus_version="v1.3.1" +gitstatus_version="v1.5.0" # libgit2 is a build time dependency of gitstatusd. The values of # libgit2_version and libgit2_sha256 are read by ./build. diff --git a/gitstatus.plugin.sh b/gitstatus.plugin.sh index 61b81e6a..95c5402e 100644 --- a/gitstatus.plugin.sh +++ b/gitstatus.plugin.sh @@ -264,50 +264,18 @@ function gitstatus_start() { return 1 fi + export _GITSTATUS_CLIENT_PID _GITSTATUS_REQ_FD _GITSTATUS_RESP_FD GITSTATUS_DAEMON_PID unset -f gitstatus_start_impl - - if [[ "${GITSTATUS_STOP_ON_EXEC:-1}" == 1 ]]; then - type -t _gitstatus_exec &>/dev/null || function _gitstatus_exec() { exec "$@"; } - type -t _gitstatus_builtin &>/dev/null || function _gitstatus_builtin() { builtin "$@"; } - - function _gitstatus_exec_wrapper() { - (( ! $# )) || gitstatus_stop - local ret=0 - _gitstatus_exec "$@" || ret=$? - [[ -n "${GITSTATUS_DAEMON_PID:-}" ]] || gitstatus_start || true - return $ret - } - - function _gitstatus_builtin_wrapper() { - while [[ "${1:-}" == builtin ]]; do shift; done - if [[ "${1:-}" == exec ]]; then - _gitstatus_exec_wrapper "${@:2}" - else - _gitstatus_builtin "$@" - fi - } - - alias exec=_gitstatus_exec_wrapper - alias builtin=_gitstatus_builtin_wrapper - - _GITSTATUS_EXEC_HOOK=1 - else - unset _GITSTATUS_EXEC_HOOK - fi } # Stops gitstatusd if it's running. function gitstatus_stop() { - [[ "${_GITSTATUS_CLIENT_PID:-$BASHPID}" == "$BASHPID" ]] || return 0 - [[ -z "${_GITSTATUS_REQ_FD:-}" ]] || exec {_GITSTATUS_REQ_FD}>&- || true - [[ -z "${_GITSTATUS_RESP_FD:-}" ]] || exec {_GITSTATUS_RESP_FD}>&- || true - [[ -z "${GITSTATUS_DAEMON_PID:-}" ]] || kill "$GITSTATUS_DAEMON_PID" &>/dev/null || true - if [[ -n "${_GITSTATUS_EXEC_HOOK:-}" ]]; then - unalias exec builtin &>/dev/null || true - function _gitstatus_exec_wrapper() { _gitstatus_exec "$@"; } - function _gitstatus_builtin_wrapper() { _gitstatus_builtin "$@"; } + if [[ "${_GITSTATUS_CLIENT_PID:-$BASHPID}" == "$BASHPID" ]]; then + [[ -z "${_GITSTATUS_REQ_FD:-}" ]] || exec {_GITSTATUS_REQ_FD}>&- || true + [[ -z "${_GITSTATUS_RESP_FD:-}" ]] || exec {_GITSTATUS_RESP_FD}>&- || true + [[ -z "${GITSTATUS_DAEMON_PID:-}" ]] || kill "$GITSTATUS_DAEMON_PID" &>/dev/null || true fi - unset _GITSTATUS_REQ_FD _GITSTATUS_RESP_FD GITSTATUS_DAEMON_PID _GITSTATUS_EXEC_HOOK + unset _GITSTATUS_REQ_FD _GITSTATUS_RESP_FD GITSTATUS_DAEMON_PID unset _GITSTATUS_DIRTY_MAX_INDEX_SIZE _GITSTATUS_CLIENT_PID } @@ -332,6 +300,8 @@ function gitstatus_stop() { # VCS_STATUS_WORKDIR Git repo working directory. Not empty. # VCS_STATUS_COMMIT Commit hash that HEAD is pointing to. Either 40 hex digits or # empty if there is no HEAD (empty repo). +# VCS_STATUS_COMMIT_ENCODING Encoding of the HEAD's commit message. Empty value means UTF-8. +# VCS_STATUS_COMMIT_SUMMARY The first paragraph of the HEAD's commit message as one line. # VCS_STATUS_LOCAL_BRANCH Local branch name or empty if not on a branch. # VCS_STATUS_REMOTE_NAME The remote name, e.g. "upstream" or "origin". # VCS_STATUS_REMOTE_BRANCH Upstream branch name. Can be empty. @@ -435,6 +405,8 @@ function gitstatus_query() { VCS_STATUS_PUSH_COMMITS_BEHIND="${resp[24]:-0}" VCS_STATUS_NUM_SKIP_WORKTREE="${resp[25]:-0}" VCS_STATUS_NUM_ASSUME_UNCHANGED="${resp[26]:-0}" + VCS_STATUS_COMMIT_ENCODING="${resp[27]-}" + VCS_STATUS_COMMIT_SUMMARY="${resp[28]-}" VCS_STATUS_HAS_STAGED=$((VCS_STATUS_NUM_STAGED > 0)) if (( _GITSTATUS_DIRTY_MAX_INDEX_SIZE >= 0 && VCS_STATUS_INDEX_SIZE > _GITSTATUS_DIRTY_MAX_INDEX_SIZE_ )); then @@ -477,6 +449,8 @@ function gitstatus_query() { unset VCS_STATUS_PUSH_COMMITS_BEHIND unset VCS_STATUS_NUM_SKIP_WORKTREE unset VCS_STATUS_NUM_ASSUME_UNCHANGED + unset VCS_STATUS_COMMIT_ENCODING + unset VCS_STATUS_COMMIT_SUMMARY fi } diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index ca0fb311..c37af1d7 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -15,6 +15,8 @@ # VCS_STATUS_COMMIT=c000eddcff0fb38df2d0137efe24d9d2d900f209 # VCS_STATUS_COMMITS_AHEAD=0 # VCS_STATUS_COMMITS_BEHIND=0 +# VCS_STATUS_COMMIT_ENCODING='' +# VCS_STATUS_COMMIT_SUMMARY='pull upstream changes from gitstatus' # VCS_STATUS_HAS_CONFLICTED=0 # VCS_STATUS_HAS_STAGED=0 # VCS_STATUS_HAS_UNSTAGED=1 @@ -88,6 +90,8 @@ typeset -g _gitstatus_plugin_dir"${1:-}"="${${(%):-%x}:A:h}" # VCS_STATUS_WORKDIR Git repo working directory. Not empty. # VCS_STATUS_COMMIT Commit hash that HEAD is pointing to. Either 40 hex digits or # empty if there is no HEAD (empty repo). +# VCS_STATUS_COMMIT_ENCODING Encoding of the HEAD's commit message. Empty value means UTF-8. +# VCS_STATUS_COMMIT_SUMMARY The first paragraph of the HEAD's commit message as one line. # VCS_STATUS_LOCAL_BRANCH Local branch name or empty if not on a branch. # VCS_STATUS_REMOTE_NAME The remote name, e.g. "upstream" or "origin". # VCS_STATUS_REMOTE_BRANCH Upstream branch name. Can be empty. @@ -329,7 +333,9 @@ function _gitstatus_process_response"${1:-}"() { VCS_STATUS_PUSH_COMMITS_AHEAD \ VCS_STATUS_PUSH_COMMITS_BEHIND \ VCS_STATUS_NUM_SKIP_WORKTREE \ - VCS_STATUS_NUM_ASSUME_UNCHANGED in "${(@)resp[3,27]}"; do + VCS_STATUS_NUM_ASSUME_UNCHANGED \ + VCS_STATUS_COMMIT_ENCODING \ + VCS_STATUS_COMMIT_SUMMARY in "${(@)resp[3,29]}"; do done typeset -gi VCS_STATUS_{INDEX_SIZE,NUM_STAGED,NUM_UNSTAGED,NUM_CONFLICTED,NUM_UNTRACKED,COMMITS_AHEAD,COMMITS_BEHIND,STASHES,NUM_UNSTAGED_DELETED,NUM_STAGED_NEW,NUM_STAGED_DELETED,PUSH_COMMITS_AHEAD,PUSH_COMMITS_BEHIND,NUM_SKIP_WORKTREE,NUM_ASSUME_UNCHANGED} typeset -gi VCS_STATUS_HAS_STAGED=$((VCS_STATUS_NUM_STAGED > 0)) diff --git a/install.info b/install.info index e71a03ef..8214e938 100644 --- a/install.info +++ b/install.info @@ -1,4 +1,4 @@ -# 0 +# 1 # # This file is used by ./install and indirectly by shell bindings. # @@ -19,7 +19,7 @@ uname_s_glob="linux"; uname_m_glob="armv7l"; file="gitstatusd-${uname_ uname_s_glob="linux"; uname_m_glob="armv8l"; file="gitstatusd-${uname_s}-aarch64"; version="v1.3.1"; sha256="4e0a506eafb14b009cf6670f0e11399ac7e765cad17b9fcf38ef65516d248bfa"; uname_s_glob="linux"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="ba506fbecf4a4430533e661bb63c7b77f6b4836ea013bdf8a6eabeace456f3b9"; uname_s_glob="linux"; uname_m_glob="ppc64le"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="1bf907db28ac7d6516add51be47b73b1854b84ecf46de56ccb1479e6a7e29ed2"; -uname_s_glob="linux"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="91bcc1efafff8c896e8f172ff624d9407494f7a26b4ad1bf573f52623be2ca91"; +uname_s_glob="linux"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.0"; sha256="d88e33e6174b205d76eaa6f6a88129d5854f9f52348983807dede2e81caae844"; uname_s_glob="msys_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="618d2425c6a22fa3762fe6fe252f9ddb4ed9138df1377e48b2f119cd4875f400"; uname_s_glob="msys_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="bdfae7a7c0fd83d0214a7eabde3b7d8709336bd08697a74d48bea4a04c352676"; diff --git a/src/git.cc b/src/git.cc index 029b02bf..552100cb 100644 --- a/src/git.cc +++ b/src/git.cc @@ -239,4 +239,12 @@ PushRemotePtr GetPushRemote(git_repository* repo, const git_reference* local) { return PushRemotePtr(res.release()); } +CommitMessage GetCommitMessage(git_repository* repo, const git_oid& id) { + git_commit* commit; + VERIFY(!git_commit_lookup(&commit, repo, &id)) << GitError(); + ON_SCOPE_EXIT(=) { git_commit_free(commit); }; + return {.encoding = git_commit_message_encoding(commit) ?: "", + .summary = git_commit_summary(commit) ?: ""}; +} + } // namespace gitstatus diff --git a/src/git.h b/src/git.h index 7e5a6f9d..b85f09f7 100644 --- a/src/git.h +++ b/src/git.h @@ -48,6 +48,15 @@ git_reference* Head(git_repository* repo); // Returns the name of the local branch, or an empty string. const char* LocalBranchName(const git_reference* ref); +struct CommitMessage { + // Can be empty, meaning "UTF-8". + std::string encoding; + // The first paragraph of the commit's message as a one-liner. + std::string summary; +}; + +CommitMessage GetCommitMessage(git_repository* repo, const git_oid& id); + struct Remote { // Tip of the remote branch. git_reference* ref; diff --git a/src/gitstatus.cc b/src/gitstatus.cc index 5560ca8d..81399ea7 100644 --- a/src/gitstatus.cc +++ b/src/gitstatus.cc @@ -41,6 +41,10 @@ namespace { using namespace std::string_literals; +void Truncate(std::string& s, size_t max_len) { + if (s.size() > max_len) s.resize(max_len); +} + void ProcessRequest(const Options& opts, RepoCache& cache, Request req) { Timer timer; ON_SCOPE_EXIT(&) { timer.Report("request"); }; @@ -167,6 +171,11 @@ void ProcessRequest(const Options& opts, RepoCache& cache, Request req) { // The number of files in the index with assume-unchanged bit set. resp.Print(stats.num_assume_unchanged); + CommitMessage msg = head_target ? GetCommitMessage(repo->repo(), *head_target) : CommitMessage(); + Truncate(msg.summary, opts.max_commit_summary_length); + resp.Print(msg.encoding); + resp.Print(msg.summary); + resp.Dump("with git status"); } diff --git a/src/options.cc b/src/options.cc index 421e5854..1879c424 100644 --- a/src/options.cc +++ b/src/options.cc @@ -53,6 +53,12 @@ long ParseInt(const char* s) { return res; } +size_t ParseSizeT(const char* s) { + static_assert(sizeof(long) <= sizeof(size_t)); + long res = ParseLong(s); + return res >= 0 ? res : -1; +} + void PrintUsage() { std::cout << "Usage: gitstatusd [OPTION]...\n" << "Print machine-readable status of the git repos for directores in stdin.\n" @@ -81,12 +87,18 @@ void PrintUsage() { << " repo that's been closed is much slower than for a repo that hasn't been.\n" << " Negative value means infinity.\n" << "\n" + << " -z, --max-commit-summary-length=NUM [default=256]\n" + << " Truncate commit summary if it's longer than this many bytes.\n" + << "\n" << " -s, --max-num-staged=NUM [default=1]\n" << " Report at most this many staged changes; negative value means infinity.\n" << "\n" << " -u, --max-num-unstaged=NUM [default=1]\n" << " Report at most this many unstaged changes; negative value means infinity.\n" << "\n" + << " -c, --max-num-conflicted=NUM [default=1]\n" + << " Report at most this many conflicted changes; negative value means infinity.\n" + << "\n" << " -d, --max-num-untracked=NUM [default=1]\n" << " Report at most this many untracked files; negative value means infinity.\n" << "\n" @@ -170,6 +182,8 @@ void PrintUsage() { << " 25. Number of commits the current branch is behind push remote.\n" << " 26. Number of files in the index with skip-worktree bit set.\n" << " 27. Number of files in the index with assume-unchanged bit set.\n" + << " 28. Encoding of the HEAD's commit message. Empty value means UTF-8.\n" + << " 29. The first paragraph of the HEAD's commit message as one line.\n" << "\n" << "Note: Renamed files are reported as deleted plus new.\n" << "\n" @@ -212,6 +226,8 @@ void PrintUsage() { << " '0'\n" << " '0'\n" << " '0'\n" + << " ''\n" + << " 'add a build server for darwin-arm64'\n" << "\n" << "EXIT STATUS\n" << "\n" @@ -239,12 +255,13 @@ const char* Version() { Options ParseOptions(int argc, char** argv) { const struct option opts[] = {{"help", no_argument, nullptr, 'h'}, {"version", no_argument, nullptr, 'V'}, - {"version-glob", no_argument, nullptr, 'G'}, + {"version-glob", required_argument, nullptr, 'G'}, {"lock-fd", required_argument, nullptr, 'l'}, {"parent-pid", required_argument, nullptr, 'p'}, {"num-threads", required_argument, nullptr, 't'}, {"log-level", required_argument, nullptr, 'v'}, {"repo-ttl-seconds", required_argument, nullptr, 'r'}, + {"max-commit-summary-length", required_argument, nullptr, 'z'}, {"max-num-staged", required_argument, nullptr, 's'}, {"max-num-unstaged", required_argument, nullptr, 'u'}, {"max-num-conflicted", required_argument, nullptr, 'c'}, @@ -257,7 +274,7 @@ Options ParseOptions(int argc, char** argv) { {}}; Options res; while (true) { - switch (getopt_long(argc, argv, "hVG:l:p:t:v:r:s:u:c:d:m:eUWD", opts, nullptr)) { + switch (getopt_long(argc, argv, "hVG:l:p:t:v:r:z:s:u:c:d:m:eUWD", opts, nullptr)) { case -1: if (optind != argc) { std::cerr << "unexpected positional argument: " << argv[optind] << std::endl; @@ -306,20 +323,23 @@ Options ParseOptions(int argc, char** argv) { res.num_threads = n; break; } + case 'z': + res.max_commit_summary_length = ParseSizeT(optarg); + break; case 's': - res.max_num_staged = ParseLong(optarg); + res.max_num_staged = ParseSizeT(optarg); break; case 'u': - res.max_num_unstaged = ParseLong(optarg); + res.max_num_unstaged = ParseSizeT(optarg); break; case 'c': - res.max_num_conflicted = ParseLong(optarg); + res.max_num_conflicted = ParseSizeT(optarg); break; case 'd': - res.max_num_untracked = ParseLong(optarg); + res.max_num_untracked = ParseSizeT(optarg); break; case 'm': - res.dirty_max_index_size = ParseLong(optarg); + res.dirty_max_index_size = ParseSizeT(optarg); break; case 'e': res.recurse_untracked_dirs = true; diff --git a/src/options.h b/src/options.h index 7cbfeed8..fd561e11 100644 --- a/src/options.h +++ b/src/options.h @@ -27,6 +27,8 @@ namespace gitstatus { struct Limits { + // Truncate commit summary if it's longer than this many bytes. + size_t max_commit_summary_length = 256; // Report at most this many staged changes. size_t max_num_staged = 1; // Report at most this many unstaged changes. From b9c62ca02827c828fb544033950232e5426930ad Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 4 Jun 2021 15:02:36 +0200 Subject: [PATCH 037/380] cleanup --- internal/p10k.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index ea0f25ff..4dabb40e 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -301,7 +301,7 @@ function _p9k_upglob() { # _p9k_prompt_length $'%{a\b%Gb%}' => 1 function _p9k_prompt_length() { local -i COLUMNS=1024 - local -i x y=$#1 m + local -i x y=${#1} m if (( y )); then while (( ${${(%):-$1%$y(l.1.0)}[-1]} )); do x=y @@ -5886,7 +5886,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=38 +typeset -gri __p9k_instant_prompt_version=39 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -6135,7 +6135,7 @@ _p9k_dump_instant_prompt() { local _p9k__ret function _p9k_prompt_length() { local -i COLUMNS=1024 - local -i x y=$#1 m + local -i x y=${#1} m if (( y )); then while (( ${${(%):-$1%$y(l.1.0)}[-1]} )); do x=y From 4ba3c010f6fa66dcf7d785251c80c416454b6e90 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 8 Jun 2021 11:47:19 +0200 Subject: [PATCH 038/380] display "wip" in git status if the latest commit's summary contains "wip" or "WIP" (#1425) --- README.md | 3 ++- config/p10k-classic.zsh | 7 ++++++- config/p10k-lean-8colors.zsh | 7 ++++++- config/p10k-lean.zsh | 7 ++++++- config/p10k-rainbow.zsh | 7 ++++++- 5 files changed, 26 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 78fcf39f..a670871a 100644 --- a/README.md +++ b/README.md @@ -899,13 +899,14 @@ Zsh but it won't do anything. When using Lean, Classic or Rainbow style, Git status may look like this: ```text -feature:master ⇣42⇡42 ⇠42⇢42 *42 merge ~42 +42 !42 ?42 +feature:master wip ⇣42⇡42 ⇠42⇢42 *42 merge ~42 +42 !42 ?42 ``` | Symbol | Meaning | Source | | --------- | -------------------------------------------------------------------- | ------------------------------------------------------ | | `feature` | current branch; replaced with `#tag` or `@commit` if not on a branch | `git status --ignore-submodules=dirty` | | `master` | remote tracking branch; only shown if different from local branch | `git rev-parse --abbrev-ref --symbolic-full-name @{u}` | +| `wip` | the latest commit's summary contains "wip" or "WIP" | `git show --pretty=%s --no-patch HEAD` | | `⇣42` | this many commits behind the remote | `git status --ignore-submodules=dirty` | | `⇡42` | this many commits ahead of the remote | `git status --ignore-submodules=dirty` | | `⇠42` | this many commits behind the push remote | `git rev-list --left-right --count HEAD...@{push}` | diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index a3013932..5be4bd86 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -347,7 +347,7 @@ # Formatter for Git status. # - # Example output: master ⇣42⇡42 *42 merge ~42 +42 !42 ?42. + # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42. # # You can edit the function to customize how Git status looks. # @@ -413,6 +413,11 @@ res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" fi + # Display "wip" if the latest commit's summary contains "wip" or "WIP". + if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then + res+=" ${modified}wip" + fi + # ⇣42 if behind the remote. (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 57f1bd12..d02e3a39 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -345,7 +345,7 @@ # Formatter for Git status. # - # Example output: master ⇣42⇡42 *42 merge ~42 +42 !42 ?42. + # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42. # # You can edit the function to customize how Git status looks. # @@ -411,6 +411,11 @@ res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" fi + # Display "wip" if the latest commit's summary contains "wip" or "WIP". + if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then + res+=" ${modified}wip" + fi + # ⇣42 if behind the remote. (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index f843f99a..aac1cc81 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -341,7 +341,7 @@ # Formatter for Git status. # - # Example output: master ⇣42⇡42 *42 merge ~42 +42 !42 ?42. + # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42. # # You can edit the function to customize how Git status looks. # @@ -407,6 +407,11 @@ res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" fi + # Display "wip" if the latest commit's summary contains "wip" or "WIP". + if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then + res+=" ${modified}wip" + fi + # ⇣42 if behind the remote. (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 722acbdd..7671a785 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -357,7 +357,7 @@ # Formatter for Git status. # - # Example output: master ⇣42⇡42 *42 merge ~42 +42 !42 ?42. + # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42. # # You can edit the function to customize how Git status looks. # @@ -414,6 +414,11 @@ res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" fi + # Display "wip" if the latest commit's summary contains "wip" or "WIP". + if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then + res+=" ${modified}wip" + fi + # ⇣42 if behind the remote. (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. From 96f3ca173331c5dba505d2ef5106cb0d605ec3be Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 10 Jun 2021 10:15:02 +0200 Subject: [PATCH 039/380] Squashed 'gitstatus/' changes from 113f1f69..96b520b2 96b520b2 build v1.5.1 binaries for all platforms ffeb0507 bump version to v1.5.1 1bcbea07 mbuild: disable pacman upgrades on msys 39dbb92f log a warning if unable to parse packed-refs a9d70ec0 add `-r` flag to gitstatus_start in bash bindings (#241) abbf9a79 don't use static_assert with one argument as it's not available prior to c++17 (#239) f8c396e4 drop all tags if packed-refs doesn't have a header line (https://github.com/romkatv/powerlevel10k/issues/1428) git-subtree-dir: gitstatus git-subtree-split: 96b520b248ca872646e27b3df4535898356e4637 --- build.info | 2 +- gitstatus.plugin.sh | 11 +++++++++-- install.info | 44 ++++++++++++++++++++++---------------------- mbuild | 7 +++++-- src/options.cc | 2 +- src/tag_db.cc | 33 ++++++++++++++++++++++++++------- 6 files changed, 64 insertions(+), 35 deletions(-) diff --git a/build.info b/build.info index ec19ff74..74300e43 100644 --- a/build.info +++ b/build.info @@ -3,7 +3,7 @@ # # This value is also read by shell bindings (indirectly, through # ./install) when using GITSTATUS_DAEMON or usrbin/gitstatusd. -gitstatus_version="v1.5.0" +gitstatus_version="v1.5.1" # libgit2 is a build time dependency of gitstatusd. The values of # libgit2_version and libgit2_sha256 are read by ./build. diff --git a/gitstatus.plugin.sh b/gitstatus.plugin.sh index 95c5402e..9a75cb5f 100644 --- a/gitstatus.plugin.sh +++ b/gitstatus.plugin.sh @@ -35,6 +35,11 @@ # # -D Unless this option is specified, report zero staged, unstaged and conflicted # changes for repositories with bash.showDirtyState = false. +# +# -r INT Close git repositories that haven't been used for this many seconds. This is +# meant to release resources such as memory and file descriptors. The next request +# for a repo that's been closed is much slower than for a repo that hasn't been. +# Negative value means infinity. The default is 3600 (one hour). function gitstatus_start() { if [[ "$BASH_VERSION" < 4 ]]; then >&2 printf 'gitstatus_start: need bash version >= 4.0, found %s\n' "$BASH_VERSION" @@ -48,10 +53,10 @@ function gitstatus_start() { fi unset OPTIND - local opt timeout=5 max_dirty=-1 extra_flags + local opt timeout=5 max_dirty=-1 ttl=3600 extra_flags local max_num_staged=1 max_num_unstaged=1 max_num_conflicted=1 max_num_untracked=1 local ignore_status_show_untracked_files - while getopts "t:s:u:c:d:m:eUWD" opt; do + while getopts "t:s:u:c:d:m:r:eUWD" opt; do case "$opt" in t) timeout=$OPTARG;; s) max_num_staged=$OPTARG;; @@ -59,6 +64,7 @@ function gitstatus_start() { c) max_num_conflicted=$OPTARG;; d) max_num_untracked=$OPTARG;; m) max_dirty=$OPTARG;; + r) ttl=$OPTARG;; e) extra_flags+='--recurse-untracked-dirs ';; U) extra_flags+='--ignore-status-show-untracked-files ';; W) extra_flags+='--ignore-bash-show-untracked-files ';; @@ -113,6 +119,7 @@ function gitstatus_start() { --max-num-conflicted="$max_num_conflicted" --max-num-untracked="$max_num_untracked" --dirty-max-index-size="$max_dirty" + --repo-ttl-seconds="$ttl" $extra_flags) tmpdir="$(command mktemp -d "${TMPDIR:-/tmp}"/gitstatus.bash.$$.XXXXXXXXXX)" || return diff --git a/install.info b/install.info index 8214e938..7ed4b15f 100644 --- a/install.info +++ b/install.info @@ -8,27 +8,27 @@ # work fine. # Official gitstatusd binaries. -uname_s_glob="cygwin_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="c96baef70b81b5a1d46adcc9e93721eaf4bdc295562bdd2baf210a6b416b9911"; -uname_s_glob="cygwin_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="18b5be49f6eb9ff1cf25e76d6f2333c7402e686e05ce5b88ca107c80504210d8"; -uname_s_glob="darwin"; uname_m_glob="arm64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="0394e2ac880c1e190ace0346499d4670861297ecc2f84315ecb8ba3c98aa68d9"; -uname_s_glob="darwin"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="26d582fe9a0b2090c28e84e5e32a6d42d6988cedff51e41ec5f789512c53b0fc"; -uname_s_glob="freebsd"; uname_m_glob="amd64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="54a823373458a0908187ba8d1c5b8921015c844811916451674cc09fbdff88bb"; -uname_s_glob="linux"; uname_m_glob="aarch64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="4e0a506eafb14b009cf6670f0e11399ac7e765cad17b9fcf38ef65516d248bfa"; -uname_s_glob="linux"; uname_m_glob="armv6l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="4cc78bf24c6cfb4580ae48b13e1f26b6b00869c612b5d662632f7561f7475252"; -uname_s_glob="linux"; uname_m_glob="armv7l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="80f5ebc8efe62a0c322e92d15d469e80f9d3ce967c5d5118138674c47f96747b"; -uname_s_glob="linux"; uname_m_glob="armv8l"; file="gitstatusd-${uname_s}-aarch64"; version="v1.3.1"; sha256="4e0a506eafb14b009cf6670f0e11399ac7e765cad17b9fcf38ef65516d248bfa"; -uname_s_glob="linux"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="ba506fbecf4a4430533e661bb63c7b77f6b4836ea013bdf8a6eabeace456f3b9"; -uname_s_glob="linux"; uname_m_glob="ppc64le"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="1bf907db28ac7d6516add51be47b73b1854b84ecf46de56ccb1479e6a7e29ed2"; -uname_s_glob="linux"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.0"; sha256="d88e33e6174b205d76eaa6f6a88129d5854f9f52348983807dede2e81caae844"; -uname_s_glob="msys_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="618d2425c6a22fa3762fe6fe252f9ddb4ed9138df1377e48b2f119cd4875f400"; -uname_s_glob="msys_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="bdfae7a7c0fd83d0214a7eabde3b7d8709336bd08697a74d48bea4a04c352676"; +uname_s_glob="cygwin_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="fe132c412c460c2889d731012d280207fe2b4a3c94d077fb4f1c06ed5d319a42"; +uname_s_glob="cygwin_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="c84cade0d6b86e04c27a6055f45851f6b46d6b88ba58772f7ca8ef4d295c800f"; +uname_s_glob="darwin"; uname_m_glob="arm64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="ad973948cca4bdcf83b7fcdda70c489a404488ea7304712721f1100b73ec7cbe"; +uname_s_glob="darwin"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="b13455d56cf7b6f07efb7da088057bbc1212847c88b59493918d6f9c0c157160"; +uname_s_glob="freebsd"; uname_m_glob="amd64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="b738c0967ba7a851bd758cd9fd836cddeec9fb4246afddc66ab4fed40c03e426"; +uname_s_glob="linux"; uname_m_glob="aarch64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="89b87181b2005527a558cdbc32b12b0f15a1a12bb69865ec216ca5a0266a6c4f"; +uname_s_glob="linux"; uname_m_glob="armv6l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="4bf5a0d0a082f544a48536ad3675930d5d2cc6a8cf906710045e0788f51192b3"; +uname_s_glob="linux"; uname_m_glob="armv7l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="2b9deb29f86c8209114b71b94fc2e1ed936a1658808a1bee46f4a82fd6a1f8cc"; +uname_s_glob="linux"; uname_m_glob="armv8l"; file="gitstatusd-${uname_s}-aarch64"; version="v1.5.1"; sha256="89b87181b2005527a558cdbc32b12b0f15a1a12bb69865ec216ca5a0266a6c4f"; +uname_s_glob="linux"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="4998bf7889f625df71f1da5757915b678e04039cc8cba00ae10950352c7329f9"; +uname_s_glob="linux"; uname_m_glob="ppc64le"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="e5336dc8e23406c649bafeea83ff17df1726b05ee490f67bae549e55a9a7a7c4"; +uname_s_glob="linux"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="0e8bbc46c17f5cd6e0db98b74c48f4b68f464f98550c8254f6cfcfd936ad1fcf"; +uname_s_glob="msys_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="7f9b849fc52e7a95b9b933e25121ad5ae990a1871aad6616922ad7bcf1eebf20"; +uname_s_glob="msys_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="5d3c626b5ee564dbc13ddba89752dc58b0efe925b26dbd8b2304849d9ba01732"; # Fallbacks to official gitstatusd binaries. -uname_s_glob="cygwin_nt-*"; uname_m_glob="i686"; file="gitstatusd-cygwin_nt-10.0-${uname_m}"; version="v1.3.1"; sha256="c96baef70b81b5a1d46adcc9e93721eaf4bdc295562bdd2baf210a6b416b9911"; -uname_s_glob="cygwin_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-cygwin_nt-10.0-${uname_m}"; version="v1.3.1"; sha256="18b5be49f6eb9ff1cf25e76d6f2333c7402e686e05ce5b88ca107c80504210d8"; -uname_s_glob="mingw32_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.3.1"; sha256="618d2425c6a22fa3762fe6fe252f9ddb4ed9138df1377e48b2f119cd4875f400"; -uname_s_glob="mingw32_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.3.1"; sha256="bdfae7a7c0fd83d0214a7eabde3b7d8709336bd08697a74d48bea4a04c352676"; -uname_s_glob="mingw64_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.3.1"; sha256="618d2425c6a22fa3762fe6fe252f9ddb4ed9138df1377e48b2f119cd4875f400"; -uname_s_glob="mingw64_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.3.1"; sha256="bdfae7a7c0fd83d0214a7eabde3b7d8709336bd08697a74d48bea4a04c352676"; -uname_s_glob="msys_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.3.1"; sha256="618d2425c6a22fa3762fe6fe252f9ddb4ed9138df1377e48b2f119cd4875f400"; -uname_s_glob="msys_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.3.1"; sha256="bdfae7a7c0fd83d0214a7eabde3b7d8709336bd08697a74d48bea4a04c352676"; +uname_s_glob="cygwin_nt-*"; uname_m_glob="i686"; file="gitstatusd-cygwin_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="fe132c412c460c2889d731012d280207fe2b4a3c94d077fb4f1c06ed5d319a42"; +uname_s_glob="cygwin_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-cygwin_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="c84cade0d6b86e04c27a6055f45851f6b46d6b88ba58772f7ca8ef4d295c800f"; +uname_s_glob="mingw32_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="7f9b849fc52e7a95b9b933e25121ad5ae990a1871aad6616922ad7bcf1eebf20"; +uname_s_glob="mingw32_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="5d3c626b5ee564dbc13ddba89752dc58b0efe925b26dbd8b2304849d9ba01732"; +uname_s_glob="mingw64_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="7f9b849fc52e7a95b9b933e25121ad5ae990a1871aad6616922ad7bcf1eebf20"; +uname_s_glob="mingw64_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="5d3c626b5ee564dbc13ddba89752dc58b0efe925b26dbd8b2304849d9ba01732"; +uname_s_glob="msys_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="7f9b849fc52e7a95b9b933e25121ad5ae990a1871aad6616922ad7bcf1eebf20"; +uname_s_glob="msys_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="5d3c626b5ee564dbc13ddba89752dc58b0efe925b26dbd8b2304849d9ba01732"; diff --git a/mbuild b/mbuild index 608e3aba..ab096e8b 100755 --- a/mbuild +++ b/mbuild @@ -212,10 +212,11 @@ function build-windows() { tmp='/cygdrive/c/tmp' ;| msys_nt-10.0-*) - flags+=(-s) tmp='/c/tmp' env='MSYSTEM=MSYS' - intro='pacman -Syu --noconfirm; pacman -S --needed --noconfirm git; ' + # TODO: fix this (some errors about PGP keys). + # flags+=(-s) + # intro='pacman -S --needed --noconfirm git; ' intro+='PATH="$PATH:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl"' while true; do # TODO: run autorebase only when getting an error that can be fixed by autorebasing. @@ -230,6 +231,8 @@ function build-windows() { done () { while true; do + # TODO: fix this (some errors about PGP keys). + break local -i fd exec {fd}< <( ssh $1 $c/$bin/env.exe $env c:/$bin/bash.exe -l 2>&1 <<<" diff --git a/src/options.cc b/src/options.cc index 1879c424..46f3845c 100644 --- a/src/options.cc +++ b/src/options.cc @@ -54,7 +54,7 @@ long ParseInt(const char* s) { } size_t ParseSizeT(const char* s) { - static_assert(sizeof(long) <= sizeof(size_t)); + static_assert(sizeof(long) <= sizeof(size_t), ""); long res = ParseLong(s); return res >= 0 ? res : -1; } diff --git a/src/tag_db.cc b/src/tag_db.cc index 0e440791..31b150bd 100644 --- a/src/tag_db.cc +++ b/src/tag_db.cc @@ -212,14 +212,30 @@ void TagDb::ParsePack() { char* p = &pack_[0]; char* e = p + pack_.size(); - if (*p == '#') { - char* eol = std::strchr(p, '\n'); - if (!eol) return; - *eol = 0; - if (!std::strstr(p, " fully-peeled") || !std::strstr(p, " sorted")) return; - p = eol + 1; + // Usually packed-refs starts with the following line: + // + // # pack-refs with: peeled fully-peeled sorted + // + // However, some users can produce pack-refs without this line. + // See https://github.com/romkatv/powerlevel10k/issues/1428. + // I don't know how they do it. Without the header line we cannot + // assume that refs are sorted, which isn't a big deal because we + // can just sort them. What's worse is that refs cannot be assumed + // to be fully-peeled. We don't want to peel them, so we just drop + // all tags. + if (*p != '#') { + LOG(WARN) << "packed-refs doesn't have a header. Won't resolve tags."; + return; } + char* eol = std::strchr(p, '\n'); + if (!eol) return; + *eol = 0; + if (!std::strstr(p, " fully-peeled") || !std::strstr(p, " sorted")) { + LOG(WARN) << "packed-refs has unexpected header. Won't resolve tags."; + } + p = eol + 1; + name2id_.reserve(pack_.size() / 128); id2name_.reserve(pack_.size() / 128); @@ -249,7 +265,10 @@ void TagDb::ParsePack() { id2name_.push_back(tag); } - VERIFY(std::is_sorted(name2id_.begin(), name2id_.end(), ByName)); + if (!std::is_sorted(name2id_.begin(), name2id_.end(), ByName)) { + // "sorted" in the header of packed-refs promisses that this won't trigger. + std::sort(name2id_.begin(), name2id_.end(), ByName); + } id2name_dirty_ = true; GlobalThreadPool()->Schedule([this] { From 038de6f78b21171615d0b4628471e71efe10d77e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 11 Jun 2021 09:23:27 +0200 Subject: [PATCH 040/380] Squashed 'gitstatus/' changes from 96b520b2..260a5f4b 260a5f4b fix a bug in the build script that prevented it from working when using a newer git with init.defaultBranch override in the global config (#242) git-subtree-dir: gitstatus git-subtree-split: 260a5f4bc9776d41d500a51464249ce5e555a99e --- build | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/build b/build index 667def9f..f77f1982 100755 --- a/build +++ b/build @@ -316,16 +316,33 @@ app="$outdir"/usrbin/"$appname" command strip "$app".tmp command mkdir -- "$workdir"/repo -command git -C "$workdir"/repo init -command git -C "$workdir"/repo config user.name "Your Name" -command git -C "$workdir"/repo config user.email "you@example.com" -command git -C "$workdir"/repo commit --allow-empty --allow-empty-message --no-gpg-sign -m '' +printf '[init]\n defaultBranch = master\n' >"$workdir"/.gitconfig +( + cd -- "$workdir"/repo + GIT_CONFIG_NOSYSTEM=1 HOME="$workdir" command git init + GIT_CONFIG_NOSYSTEM=1 HOME="$workdir" command git config user.name "Your Name" + GIT_CONFIG_NOSYSTEM=1 HOME="$workdir" command git config user.email "you@example.com" + GIT_CONFIG_NOSYSTEM=1 HOME="$workdir" command git commit \ + --allow-empty --allow-empty-message --no-gpg-sign -m '' +) resp="$(printf "hello\037$workdir/repo\036" | "$app".tmp)" -[ -n "$resp" -a -z "${resp##hello*1*$workdir/repo*master*}" ] +case "$resp" in + hello*1*/repo*master*);; + *) + >&2 echo 'error: invalid gitstatusd response for a git repo' + exit 1 + ;; +esac resp="$(printf 'hello\037\036' | "$app".tmp)" -[ -n "$resp" -a -z "${resp##hello*0*}" ] +case "$resp" in + hello*0*);; + *) + >&2 echo 'error: invalid gitstatusd response for a non-repo' + exit 1 + ;; +esac command mv -f -- "$app".tmp "$app" From 4e4c14927fe45a8280b60c547a864175f2e92ac2 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 11 Jun 2021 10:17:23 +0200 Subject: [PATCH 041/380] update windows terminal font instructions to accound for the fact that they've changed the default settings.json (#1443) --- README.md | 7 +++++-- font.md | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a670871a..1e1ee77d 100644 --- a/README.md +++ b/README.md @@ -552,8 +552,11 @@ applications on your system. Configure your terminal to use this font: *Custom font* under *Text Appearance* and select `MesloLGS NF Regular`. - **Windows Console Host** (the old thing): Click the icon in the top left corner, then *Properties → Font* and set *Font* to `MesloLGS NF`. -- **Windows Terminal** by Microsoft (the new thing): Open *Settings* (`Ctrl+,`), search for - `fontFace` and set value to `MesloLGS NF` for every profile. +- **Windows Terminal** by Microsoft (the new thing): Open `settings.json` (Ctrl+Shift+,), + search for `fontFace` and set the value to `MesloLGS NF` for every profile. If you don't find + `fontFace`, add it under *profiles → default*. See [this settings.json]( + https://raw.githubusercontent.com/romkatv/dotfiles-public/aba0e6c4657d705ed6c344d700d659977385f25c/dotfiles/microsoft-terminal-settings.json) + for example. - **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor → Color Scheme → Console Font*. Select *Use console font instead of the default* and set the font name to `MesloLGS NF`. diff --git a/font.md b/font.md index 0ce19c33..cc36ecbd 100644 --- a/font.md +++ b/font.md @@ -49,8 +49,11 @@ applications on your system. Configure your terminal to use this font: *Custom font* under *Text Appearance* and select `MesloLGS NF Regular`. - **Windows Console Host** (the old thing): Click the icon in the top left corner, then *Properties → Font* and set *Font* to `MesloLGS NF`. -- **Windows Terminal** by Microsoft (the new thing): Open *Settings* (`Ctrl+,`), search for - `fontFace` and set value to `MesloLGS NF` for every profile. +- **Windows Terminal** by Microsoft (the new thing): Open `settings.json` (Ctrl+Shift+,), + search for `fontFace` and set the value to `MesloLGS NF` for every profile. If you don't find + `fontFace`, add it under *profiles → default*. See [this settings.json]( + https://raw.githubusercontent.com/romkatv/dotfiles-public/aba0e6c4657d705ed6c344d700d659977385f25c/dotfiles/microsoft-terminal-settings.json) + for example. - **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor → Color Scheme → Console Font*. Select *Use console font instead of the default* and set the font name to `MesloLGS NF`. From a49f90d3ba7e8f89ab69c2ba846b81cd6f784dc0 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 11 Jun 2021 10:19:09 +0200 Subject: [PATCH 042/380] cleanup --- README.md | 2 +- font.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1e1ee77d..3a012285 100644 --- a/README.md +++ b/README.md @@ -554,7 +554,7 @@ applications on your system. Configure your terminal to use this font: *Properties → Font* and set *Font* to `MesloLGS NF`. - **Windows Terminal** by Microsoft (the new thing): Open `settings.json` (Ctrl+Shift+,), search for `fontFace` and set the value to `MesloLGS NF` for every profile. If you don't find - `fontFace`, add it under *profiles → default*. See [this settings.json]( + `fontFace`, add it under *profiles → default*. See [this settings file]( https://raw.githubusercontent.com/romkatv/dotfiles-public/aba0e6c4657d705ed6c344d700d659977385f25c/dotfiles/microsoft-terminal-settings.json) for example. - **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor → diff --git a/font.md b/font.md index cc36ecbd..1e2807b6 100644 --- a/font.md +++ b/font.md @@ -51,7 +51,7 @@ applications on your system. Configure your terminal to use this font: *Properties → Font* and set *Font* to `MesloLGS NF`. - **Windows Terminal** by Microsoft (the new thing): Open `settings.json` (Ctrl+Shift+,), search for `fontFace` and set the value to `MesloLGS NF` for every profile. If you don't find - `fontFace`, add it under *profiles → default*. See [this settings.json]( + `fontFace`, add it under *profiles → default*. See [this settings file]( https://raw.githubusercontent.com/romkatv/dotfiles-public/aba0e6c4657d705ed6c344d700d659977385f25c/dotfiles/microsoft-terminal-settings.json) for example. - **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor → From 717573d845944c32e8a42059d21052e72972b4f2 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 11 Jun 2021 14:09:52 +0200 Subject: [PATCH 043/380] presume that `node --version` may depend on package.json (#1388) --- internal/p10k.zsh | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 4dabb40e..2e537a4f 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1096,7 +1096,7 @@ function _p9k_python_version() { fi ;& # fall through *) - _p9k_cached_cmd 1 python --version || return + _p9k_cached_cmd 1 '' python --version || return [[ $_p9k__ret == (#b)Python\ ([[:digit:].]##)* ]] && _p9k__ret=$match[1] ;; esac @@ -2129,7 +2129,7 @@ _p9k_prompt_docker_machine_init() { ################################################################ # GO prompt prompt_go_version() { - _p9k_cached_cmd 0 go version || return + _p9k_cached_cmd 0 '' go version || return [[ $_p9k__ret == (#b)*go([[:digit:].]##)* ]] || return local v=$match[1] if (( _POWERLEVEL9K_GO_VERSION_PROJECT_ONLY )); then @@ -2354,18 +2354,20 @@ _p9k_prompt_load_sync() { _p9k_worker_reply $REPLY } -# Usage: _p9k_cached_cmd <0|1> [args...] +# Usage: _p9k_cached_cmd <0|1> [args...] # # The first argument says whether to capture stderr (1) or ignore it (0). +# The second argument can be empty or a file. If it's a file, the +# output of the command is presumed to potentially depend on it. function _p9k_cached_cmd() { - local cmd=$commands[$2] + local cmd=$commands[$3] [[ -n $cmd ]] || return - if ! _p9k_cache_stat_get $0" ${(q)*}" $cmd; then + if ! _p9k_cache_stat_get $0" ${(q)*}" $2 $cmd; then local out if (( $1 )); then - out="$($cmd "${@:3}" 2>&1)" + out="$($cmd "${@:4}" 2>&1)" else - out="$($cmd "${@:3}" 2>/dev/null)" + out="$($cmd "${@:4}" 2>/dev/null)" fi _p9k_cache_stat_set $(( ! $? )) "$out" fi @@ -2376,10 +2378,15 @@ function _p9k_cached_cmd() { ################################################################ # Segment to diplay Node version prompt_node_version() { - if (( _POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY )); then - _p9k_upglob package.json && return + _p9k_upglob package.json + local -i idx=$? + if (( idx )); then + _p9k_cached_cmd 0 $_p9k__parent_dirs[idx]/package.json node --version || return + else + (( _POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY )) && return + _p9k_cached_cmd 0 '' node --version || return fi - _p9k_cached_cmd 0 node --version && [[ $_p9k__ret == v?* ]] || return + [[ $_p9k__ret == v?* ]] || return _p9k_prompt_segment "$0" "green" "white" 'NODE_ICON' 0 '' "${_p9k__ret#v}" } @@ -2473,10 +2480,10 @@ _p9k_nvm_ls_current() { local nvm_dir=${NVM_DIR:A} if [[ -n $nvm_dir && $node_path == $nvm_dir/versions/io.js/* ]]; then - _p9k_cached_cmd 0 iojs --version || return + _p9k_cached_cmd 0 '' iojs --version || return _p9k__ret=iojs-v${_p9k__ret#v} elif [[ -n $nvm_dir && $node_path == $nvm_dir/* ]]; then - _p9k_cached_cmd 0 node --version || return + _p9k_cached_cmd 0 '' node --version || return _p9k__ret=v${_p9k__ret#v} else _p9k__ret=system @@ -2501,7 +2508,7 @@ _p9k_prompt_nvm_init() { # Segment to display NodeEnv prompt_nodeenv() { local msg - if (( _POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION )) && _p9k_cached_cmd 0 node --version; then + if (( _POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION )) && _p9k_cached_cmd 0 '' node --version; then msg="${_p9k__ret//\%/%%} " fi msg+="$_POWERLEVEL9K_NODEENV_LEFT_DELIMITER${${NODE_VIRTUAL_ENV:t}//\%/%%}$_POWERLEVEL9K_NODEENV_RIGHT_DELIMITER" @@ -2589,7 +2596,7 @@ prompt_dotnet_version() { if (( _POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY )); then _p9k_upglob 'project.json|global.json|packet.dependencies|*.csproj|*.fsproj|*.xproj|*.sln' && return fi - _p9k_cached_cmd 0 dotnet --version || return + _p9k_cached_cmd 0 '' dotnet --version || return _p9k_prompt_segment "$0" "magenta" "white" 'DOTNET_ICON' 0 '' "$_p9k__ret" } @@ -2613,7 +2620,7 @@ prompt_php_version() { if (( _POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY )); then _p9k_upglob 'composer.json|*.php' && return fi - _p9k_cached_cmd 0 php --version || return + _p9k_cached_cmd 0 '' php --version || return [[ $_p9k__ret == (#b)(*$'\n')#'PHP '([[:digit:].]##)* ]] || return local v=$match[2] _p9k_prompt_segment "$0" "fuchsia" "grey93" 'PHP_ICON' 0 '' "${v//\%/%%}" @@ -4362,7 +4369,7 @@ _p9k_prompt_openfoam_init() { ################################################################ # Segment to display Swift version prompt_swift_version() { - _p9k_cached_cmd 0 swift --version || return + _p9k_cached_cmd 0 '' swift --version || return [[ $_p9k__ret == (#b)[^[:digit:]]#([[:digit:].]##)* ]] || return _p9k_prompt_segment "$0" "magenta" "white" 'SWIFT_ICON' 0 '' "${match[1]//\%/%%}" } @@ -8094,7 +8101,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v122\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v123\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$GITSTATUS_CACHE_DIR\1$GITSTATUS_AUTO_INSTALL\1${ZLE_RPROMPT_INDENT:-1}\1' From 606d4a85a9b8f4a29d5e9b1bce31f22fe6f7fb30 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 17 Jun 2021 15:20:14 +0200 Subject: [PATCH 044/380] readme: update git commands for ahead/behind arrows --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3a012285..6a18965a 100644 --- a/README.md +++ b/README.md @@ -910,10 +910,10 @@ feature:master wip ⇣42⇡42 ⇠42⇢42 *42 merge ~42 +42 !42 ?42 | `feature` | current branch; replaced with `#tag` or `@commit` if not on a branch | `git status --ignore-submodules=dirty` | | `master` | remote tracking branch; only shown if different from local branch | `git rev-parse --abbrev-ref --symbolic-full-name @{u}` | | `wip` | the latest commit's summary contains "wip" or "WIP" | `git show --pretty=%s --no-patch HEAD` | -| `⇣42` | this many commits behind the remote | `git status --ignore-submodules=dirty` | -| `⇡42` | this many commits ahead of the remote | `git status --ignore-submodules=dirty` | -| `⇠42` | this many commits behind the push remote | `git rev-list --left-right --count HEAD...@{push}` | -| `⇢42` | this many commits ahead of the push remote | `git rev-list --left-right --count HEAD...@{push}` | +| `⇣42` | this many commits behind the remote | `git rev-list --right-only --count HEAD...@{upstream}` | +| `⇡42` | this many commits ahead of the remote | `git rev-list --left-only --count HEAD...@{upstream}` | +| `⇠42` | this many commits behind the push remote | `git rev-list --right-only --count HEAD...@{push}` | +| `⇢42` | this many commits ahead of the push remote | `git rev-list --left-only --count HEAD...@{push}` | | `*42` | this many stashes | `git stash list` | | `merge` | repository state | `git status --ignore-submodules=dirty` | | `~42` | this many merge conflicts | `git status --ignore-submodules=dirty` | From 67f494cf54372af576296407f02f862ae0a057bc Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 17 Jun 2021 17:59:17 +0200 Subject: [PATCH 045/380] docs: cross-link two faq entries --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 6a18965a..38c1cf7a 100644 --- a/README.md +++ b/README.md @@ -1091,6 +1091,10 @@ To see how different colors look in your terminal, run the following command: for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done ``` +*Related:* + - [Directory is difficult to see in prompt when using Rainbow style.]( + #directory-is-difficult-to-see-in-prompt-when-using-rainbow-style) + ### Why does Powerlevel10k spawn extra processes? Powerlevel10k uses [gitstatus](https://github.com/romkatv/gitstatus) as the backend behind `vcs` From 515422c727539c39caf1f46eb8823c1454fd7fb6 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 24 Jun 2021 21:42:00 +0200 Subject: [PATCH 046/380] fix a bug that can cause instant prompt to be duplicated in z4h --- internal/p10k.zsh | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 2e537a4f..913092be 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5893,7 +5893,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=39 +typeset -gri __p9k_instant_prompt_version=40 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -6162,18 +6162,29 @@ _p9k_dump_instant_prompt() { local -i fill=$((COLUMNS > _p9k__ret ? COLUMNS - _p9k__ret : 0)) out+="${(%):-%b%k%f%s%u$mark${(pl.$fill.. .)}$cr%b%k%f%s%u%E}" fi - (( _z4h_can_save_restore_screen == 1 )) || out+="${(pl.$height..$lf.)}$esc${height}A$terminfo[sc]" + if (( _z4h_can_save_restore_screen != 1 )); then + (( height )) && out+="${(pl.$height..$lf.)}$esc${height}A" + out+="$terminfo[sc]" + fi out+=${(%):-"$__p9k_used_instant_prompt[1]$__p9k_used_instant_prompt[2]"} if [[ -n $__p9k_used_instant_prompt[3] ]]; then _p9k_prompt_length "$__p9k_used_instant_prompt[2]" local -i left_len=_p9k__ret _p9k_prompt_length "$__p9k_used_instant_prompt[3]" - local -i gap=$((COLUMNS - left_len - _p9k__ret - ZLE_RPROMPT_INDENT)) - if (( gap >= 40 )); then - out+="${(pl.$gap.. .)}${(%):-${__p9k_used_instant_prompt[3]}%b%k%f%s%u}$cr$esc${left_len}C" + if (( _p9k__ret )); then + local -i gap=$((COLUMNS - left_len - _p9k__ret - ZLE_RPROMPT_INDENT)) + if (( gap >= 40 )); then + out+="${(pl.$gap.. .)}${(%):-${__p9k_used_instant_prompt[3]}%b%k%f%s%u}$cr$esc${left_len}C" + fi + fi + fi + if (( _z4h_can_save_restore_screen == 1 )); then + if (( height )); then + out+="$cr$esc${height}A$terminfo[sc]$out" + else + out+="$cr$terminfo[sc]$out" fi fi - (( _z4h_can_save_restore_screen == 1 )) && out+="$cr$esc${height}A$terminfo[sc]$out" typeset -g __p9k_instant_prompt_output=${TMPDIR:-/tmp}/p10k-instant-prompt-output-${(%):-%n}-$$ { echo -n > $__p9k_instant_prompt_output } || return print -rn -- "$out" || return From c003c253e8f4b3afde76d09c95691f77178b7cc8 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 24 Jun 2021 22:40:23 +0200 Subject: [PATCH 047/380] respect POWERLEVEL9K_INSTANT_PROMPT_COMMAND_LINES if it is explicitly set even when using z4h --- internal/p10k.zsh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 913092be..935a86d9 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5893,7 +5893,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=40 +typeset -gri __p9k_instant_prompt_version=41 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -5937,10 +5937,13 @@ _p9k_dump_instant_prompt() { local PROMPT_EOL_MARK=${(q)PROMPT_EOL_MARK-%B%S%#%s%b} [[ -n \$SSH_CLIENT || -n \$SSH_TTY || -n \$SSH_CONNECTION ]] && local ssh=1 || local ssh=0 local cr=\$'\r' lf=\$'\n' esc=\$'\e[' rs=$'\x1e' us=$'\x1f' - local -i height=$_POWERLEVEL9K_INSTANT_PROMPT_COMMAND_LINES + local -i height=${_POWERLEVEL9K_INSTANT_PROMPT_COMMAND_LINES-1} local prompt_dir=${(q)prompt_dir}" + if (( ! ${+_POWERLEVEL9K_INSTANT_PROMPT_COMMAND_LINES} )); then + >&$fd print -r -- ' + (( _z4h_can_save_restore_screen == 1 )) && height=0' + fi >&$fd print -r -- ' - (( _z4h_can_save_restore_screen == 1 )) && height=0 local real_gitstatus_header if [[ -r $gitstatus_dir/install.info ]]; then IFS= read -r real_gitstatus_header <$gitstatus_dir/install.info || real_gitstatus_header=borked @@ -6138,7 +6141,8 @@ _p9k_dump_instant_prompt() { (( __p9k_ksh_arrays )) && >&$fd print -r -- ' unsetopt ksh_arrays' (( __p9k_sh_glob )) && >&$fd print -r -- ' unsetopt sh_glob' >&$fd print -r -- ' - (( height += ${#${__p9k_used_instant_prompt[1]//[^$lf]}} )) + local -i prompt_height=${#${__p9k_used_instant_prompt[1]//[^$lf]}} + (( height += prompt_height )) local _p9k__ret function _p9k_prompt_length() { local -i COLUMNS=1024 @@ -6180,9 +6184,9 @@ _p9k_dump_instant_prompt() { fi if (( _z4h_can_save_restore_screen == 1 )); then if (( height )); then - out+="$cr$esc${height}A$terminfo[sc]$out" + out+="$cr${(pl:$((height-prompt_height))::\n:)}$esc${height}A$terminfo[sc]$out" else - out+="$cr$terminfo[sc]$out" + out+="$cr${(pl:$((height-prompt_height))::\n:)}$terminfo[sc]$out" fi fi typeset -g __p9k_instant_prompt_output=${TMPDIR:-/tmp}/p10k-instant-prompt-output-${(%):-%n}-$$ @@ -7129,7 +7133,7 @@ _p9k_init_params() { _p9k_declare -b POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED 0 _p9k_declare -b POWERLEVEL9K_DISABLE_HOT_RELOAD 0 _p9k_declare -F POWERLEVEL9K_NEW_TTY_MAX_AGE_SECONDS 5 - _p9k_declare -i POWERLEVEL9K_INSTANT_PROMPT_COMMAND_LINES 1 + _p9k_declare -i POWERLEVEL9K_INSTANT_PROMPT_COMMAND_LINES _p9k_declare -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS -- context dir vcs _p9k_declare -a POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS -- status root_indicator background_jobs history time _p9k_declare -b POWERLEVEL9K_DISABLE_RPROMPT 0 @@ -8112,7 +8116,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v123\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v124\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$GITSTATUS_CACHE_DIR\1$GITSTATUS_AUTO_INSTALL\1${ZLE_RPROMPT_INDENT:-1}\1' From f1ff6804871d47381b9bd398a60f4c77174fd1d3 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 27 Jun 2021 18:48:35 +0200 Subject: [PATCH 048/380] Squashed 'gitstatus/' changes from 260a5f4b..76182238 76182238 add zwc make target ea398d90 update libgit2 ref (https://github.com/romkatv/powerlevel10k/issues/1428) git-subtree-dir: gitstatus git-subtree-split: 7618223859f614a76ed8019f1a60ee3df18984cf --- Makefile | 3 +++ build.info | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0141dd90..b3001c34 100644 --- a/Makefile +++ b/Makefile @@ -38,4 +38,7 @@ pkg: GITSTATUS_DAEMON= GITSTATUS_CACHE_DIR=$(shell pwd)/usrbin ./install -f $(or $(ZSH),:) -fc 'for f in *.zsh install; do zcompile -R -- $$f.zwc $$f || exit; done' +zwc: + $(or $(ZSH),:) -fc 'for f in *.zsh install; do zcompile -R -- $$f.zwc $$f || exit; done' + -include $(OBJS:.o=.dep) diff --git a/build.info b/build.info index 74300e43..fa6f6340 100644 --- a/build.info +++ b/build.info @@ -18,5 +18,5 @@ gitstatus_version="v1.5.1" # # If sha256 of ./deps/libgit2-${libgit2_version}.tar.gz doesn't match, # build gets aborted. -libgit2_version="tag-82cefe2b42300224ad3c148f8b1a569757cc617a" -libgit2_sha256="dc701c4e2080f7901f5d599d642b629569e5581086b9838d481d09f284dc7621" +libgit2_version="tag-5860a42d19bcd226cb6eff2dcbfcbf155d570c73" +libgit2_sha256="2289203eda19913a2f6d2b26a15384cc43872bffd70e87a7659f9a22da79058e" From 0c862a130710b351e34720fcbc90684239bd9d6c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 27 Jun 2021 18:49:57 +0200 Subject: [PATCH 049/380] add zwc make target --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 116ae41d..aaf7d74c 100644 --- a/Makefile +++ b/Makefile @@ -5,3 +5,7 @@ all: pkg: $(MAKE) -C gitstatus pkg $(or $(ZSH),:) -fc 'for f in *.zsh-theme internal/*.zsh; do zcompile -R -- $$f.zwc $$f || exit; done' + +zwc: + $(MAKE) -C gitstatus zwc + $(or $(ZSH),:) -fc 'for f in *.zsh-theme internal/*.zsh; do zcompile -R -- $$f.zwc $$f || exit; done' From fd7313a5e7bf2d781ca27edc5e10c00798862e69 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 30 Jun 2021 18:44:10 +0200 Subject: [PATCH 050/380] replace @{u} with @{upstream} in the docs (it's the same thing but clearer) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 38c1cf7a..fde6bf75 100644 --- a/README.md +++ b/README.md @@ -908,7 +908,7 @@ feature:master wip ⇣42⇡42 ⇠42⇢42 *42 merge ~42 +42 !42 ?42 | Symbol | Meaning | Source | | --------- | -------------------------------------------------------------------- | ------------------------------------------------------ | | `feature` | current branch; replaced with `#tag` or `@commit` if not on a branch | `git status --ignore-submodules=dirty` | -| `master` | remote tracking branch; only shown if different from local branch | `git rev-parse --abbrev-ref --symbolic-full-name @{u}` | +| `master` | remote tracking branch; only shown if different from local branch | `git rev-parse --abbrev-ref --symbolic-full-name @{upstream}` | | `wip` | the latest commit's summary contains "wip" or "WIP" | `git show --pretty=%s --no-patch HEAD` | | `⇣42` | this many commits behind the remote | `git rev-list --right-only --count HEAD...@{upstream}` | | `⇡42` | this many commits ahead of the remote | `git rev-list --left-only --count HEAD...@{upstream}` | From 3213e2e17f1695c88959e3b74e3302d628520382 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 1 Jul 2021 12:05:46 +0200 Subject: [PATCH 051/380] docs: grammar --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fde6bf75..8255c31e 100644 --- a/README.md +++ b/README.md @@ -1131,7 +1131,7 @@ times faster than powerlevel9k/master and 17 times faster than powerlevel9k/next Powerlevel10k was forked from Powerlevel9k in March 2019 after a week-long discussion in [powerlevel9k#1170](https://github.com/Powerlevel9k/powerlevel9k/issues/1170). Powerlevel9k was -already a mature project with large user base and release cycle measured in months. Powerlevel10k +already a mature project with a large user base and a release cycle measured in months. Powerlevel10k was spun off to iterate on performance improvements and new features at much higher pace. Powerlevel9k and Powerlevel10k are independent projects. When using one, you shouldn't install the From 7759063b7485ca0701fc8ba1961d0e53568ddd59 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 2 Jul 2021 11:02:41 +0200 Subject: [PATCH 052/380] Squashed 'gitstatus/' changes from 76182238..68bf9e0d 68bf9e0d build: generate byte-for-byte identical gitstatusd if the compiler supports -ffile-prefix-map d03e8edc add support for s390x architecture b32bea51 add a few architectures to the build script 7001409e bash: escape non-printable ANSI sequences (#247) git-subtree-dir: gitstatus git-subtree-split: 68bf9e0da3695ae989d523527643bef3f88e86ea --- build | 28 ++++++++++++++++++++-------- gitstatus.prompt.sh | 10 +++++----- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/build b/build index f77f1982..8190f478 100755 --- a/build +++ b/build @@ -55,7 +55,7 @@ workdir="$(command pwd)" narg() { echo $#; } -if [ "$(narg $workdir)" != 1 -o -z "${workdir##*:*}" ]; then +if [ "$(narg $workdir)" != 1 -o -z "${workdir##*:*}" -o -z "${workdir##*=*}" ]; then >&2 echo "[error] cannot build in this directory: $workdir" exit 1 fi @@ -138,6 +138,14 @@ esac cflags="$archflag=$gitstatus_cpu -fno-plt" +command touch "$workdir"/file-prefix-map-test.c +if 2>/dev/null "${CC:-/bin/cc}" \ + -ffile-prefix-map=x=y \ + -c "$workdir"/file-prefix-map-test.c \ + -o "$workdir"/file-prefix-map-test.o; then + cflags="$cflags -ffile-prefix-map=$workdir/=" +fi + if [ "$gitstatus_cpu" = x86-64 ]; then cflags="$cflags -mtune=generic" fi @@ -450,13 +458,16 @@ fi if [ -z "$gitstatus_cpu" ]; then case "$gitstatus_arch" in - armv6l) gitstatus_cpu=armv6;; + armel) gitstatus_cpu=armv5;; + armv6l|armhf) gitstatus_cpu=armv6;; armv7l) gitstatus_cpu=armv7;; arm64) gitstatus_cpu=armv8;; aarch64) gitstatus_cpu=armv8-a;; ppc64le) gitstatus_cpu=powerpc64le;; riscv64) gitstatus_cpu=rv64imafdc;; x86_64|amd64) gitstatus_cpu=x86-64;; + x86) gitstatus_cpu=i586;; + s390x) gitstatus_cpu=z900;; i386|i586|i686) gitstatus_cpu="$gitstatus_arch";; *) >&2 echo '[error] unable to infer target CPU architecture' @@ -485,12 +496,13 @@ case "$gitstatus_kernel" in fi if [ -z "$docker_image" ]; then case "$gitstatus_arch" in - x86_64) docker_image=alpine:3.11.6;; - i386|i586|i686) docker_image=i386/alpine:3.11.6;; - armv6l) docker_image=arm32v6/alpine:3.11.6;; - armv7l) docker_image=arm32v7/alpine:3.11.6;; - aarch64) docker_image=arm64v8/alpine:3.11.6;; - ppc64le) docker_image=ppc64le/alpine:3.11.6;; + x86_64) docker_image=alpine:3.11.6;; + x86|i386|i586|i686) docker_image=i386/alpine:3.11.6;; + armv6l|armhf) docker_image=arm32v6/alpine:3.11.6;; + armv7l) docker_image=arm32v7/alpine:3.11.6;; + aarch64) docker_image=arm64v8/alpine:3.11.6;; + ppc64le) docker_image=ppc64le/alpine:3.11.6;; + s390x) docker_image=s390x/alpine:3.11.6;; *) >&2 echo '[error] unable to infer docker image' >&2 echo 'Please specify explicitly with `-i IMAGE`.' diff --git a/gitstatus.prompt.sh b/gitstatus.prompt.sh index 9c1a2138..f27bcc39 100644 --- a/gitstatus.prompt.sh +++ b/gitstatus.prompt.sh @@ -33,11 +33,11 @@ function gitstatus_prompt_update() { gitstatus_query "$@" || return 1 # error [[ "$VCS_STATUS_RESULT" == ok-sync ]] || return 0 # not a git repo - local reset=$'\e[0m' # no color - local clean=$'\e[38;5;076m' # green foreground - local untracked=$'\e[38;5;014m' # teal foreground - local modified=$'\e[38;5;011m' # yellow foreground - local conflicted=$'\e[38;5;196m' # red foreground + local reset=$'\001\e[0m\002' # no color + local clean=$'\001\e[38;5;076m\002' # green foreground + local untracked=$'\001\e[38;5;014m\002' # teal foreground + local modified=$'\001\e[38;5;011m\002' # yellow foreground + local conflicted=$'\001\e[38;5;196m\002' # red foreground local p From 63a009669a7ed6aa6040f0af008adfb62829188c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 2 Jul 2021 14:28:20 +0200 Subject: [PATCH 053/380] Squashed 'gitstatus/' changes from 68bf9e0d..4b4226ca 4b4226ca add 'minify' make target and invoke it from 'pkg' git-subtree-dir: gitstatus git-subtree-split: 4b4226ca86fef6d0491ab9e863c9df6864dc9642 --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index b3001c34..6040cbb1 100644 --- a/Makefile +++ b/Makefile @@ -34,11 +34,13 @@ $(OBJDIR)/%.o: src/%.cc Makefile build.info | $(OBJDIR) clean: rm -rf -- $(OBJDIR) -pkg: - GITSTATUS_DAEMON= GITSTATUS_CACHE_DIR=$(shell pwd)/usrbin ./install -f - $(or $(ZSH),:) -fc 'for f in *.zsh install; do zcompile -R -- $$f.zwc $$f || exit; done' - zwc: $(or $(ZSH),:) -fc 'for f in *.zsh install; do zcompile -R -- $$f.zwc $$f || exit; done' +minify: + rm -rf -- .git .vscode deps docs src usrbin/.gitkeep .clang-format .gitattributes .gitignore LICENSE Makefile README.md build mbuild + +pkg: zwc minify + GITSTATUS_DAEMON= GITSTATUS_CACHE_DIR=$(shell pwd)/usrbin ./install -f + -include $(OBJS:.o=.dep) From 077abf95e0a3c6325a6cdd9761cab75b2f5468c6 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 2 Jul 2021 14:37:14 +0200 Subject: [PATCH 054/380] Squashed 'gitstatus/' changes from 4b4226ca..0440e38b 0440e38b sort files lexicographically 1c3157e9 don't minify from pkg target git-subtree-dir: gitstatus git-subtree-split: 0440e38b336aaf992aabf3649bf4a7f65f396c0a --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6040cbb1..450d5ea0 100644 --- a/Makefile +++ b/Makefile @@ -38,9 +38,9 @@ zwc: $(or $(ZSH),:) -fc 'for f in *.zsh install; do zcompile -R -- $$f.zwc $$f || exit; done' minify: - rm -rf -- .git .vscode deps docs src usrbin/.gitkeep .clang-format .gitattributes .gitignore LICENSE Makefile README.md build mbuild + rm -rf -- .clang-format .git .gitattributes .gitignore .vscode deps docs src usrbin/.gitkeep LICENSE Makefile README.md build mbuild -pkg: zwc minify +pkg: zwc GITSTATUS_DAEMON= GITSTATUS_CACHE_DIR=$(shell pwd)/usrbin ./install -f -include $(OBJS:.o=.dep) From 4bcc51954714ce89bcb11a2f07e26f9188cb542b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 2 Jul 2021 14:39:26 +0200 Subject: [PATCH 055/380] add 'minify' make target --- Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index aaf7d74c..86e55ee4 100644 --- a/Makefile +++ b/Makefile @@ -2,10 +2,13 @@ ZSH := $(shell command -v zsh 2> /dev/null) all: -pkg: - $(MAKE) -C gitstatus pkg - $(or $(ZSH),:) -fc 'for f in *.zsh-theme internal/*.zsh; do zcompile -R -- $$f.zwc $$f || exit; done' - zwc: $(MAKE) -C gitstatus zwc $(or $(ZSH),:) -fc 'for f in *.zsh-theme internal/*.zsh; do zcompile -R -- $$f.zwc $$f || exit; done' + +minify: + $(MAKE) -C gitstatus minify + rm -rf -- .git .gitattributes .gitignore LICENSE Makefile README.md font.md powerlevel10k.png + +pkg: zwc + $(MAKE) -C gitstatus pkg From 1e7be00e04a6e34bdcc7574297413fd6a48be51f Mon Sep 17 00:00:00 2001 From: Chris Williams Date: Fri, 9 Jul 2021 11:46:18 -0400 Subject: [PATCH 056/380] show kubecontext show for 'flux' (#1480) Support for flux v2 CLI Co-authored-by: Chris Williams --- README.md | 14 +++++++------- config/p10k-classic.zsh | 2 +- config/p10k-lean-8colors.zsh | 2 +- config/p10k-lean.zsh | 2 +- config/p10k-rainbow.zsh | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8255c31e..bed47878 100644 --- a/README.md +++ b/README.md @@ -183,8 +183,8 @@ Here's the relevant parameter for kubernetes context: ```zsh # Show prompt segment "kubecontext" only when the command you are typing -# invokes kubectl, helm, kubens, kubectx, oc, istioctl, kogito, k9s, helmfile, fluxctl or stern. -typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|fluxctl|stern' +# invokes kubectl, helm, kubens, kubectx, oc, istioctl, kogito, k9s, helmfile, flux, fluxctl or stern. +typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' ``` To customize when different prompt segments are shown, open `~/.p10k.zsh`, search for @@ -598,13 +598,13 @@ applications on your system. Configure your terminal to use this font: font = wezterm.font("MesloLGS NF"), } ``` - If the file already exists, only add the line with the font to the existing return. + If the file already exists, only add the line with the font to the existing return. Also add the first line if it is not already present. - **urxvt**: Create or open `~/.Xresources` and add the following line to it: ```text URxvt.font: xft:MesloLGS NF:size=11 ``` - You can adjust the font size to your preference. After changing the configuration use `xrdb ~/.Xresources` to reload the config. + You can adjust the font size to your preference. After changing the configuration use `xrdb ~/.Xresources` to reload the config. The new config is applied for all new terminals. **IMPORTANT:** Run `p10k configure` after changing terminal font. The old `~/.p10k.zsh` may work @@ -1015,8 +1015,8 @@ a relevant tool. ```zsh # Show prompt segment "kubecontext" only when the command you are typing -# invokes kubectl, helm, kubens, kubectx, oc, istioctl, kogito, k9s, helmfile, fluxctl or stern. -typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|fluxctl|stern' +# invokes kubectl, helm, kubens, kubectx, oc, istioctl, kogito, k9s, helmfile, flux, fluxctl or stern. +typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' ``` Configs created by `p10k configure` may contain parameters of this kind. To customize when different @@ -1032,7 +1032,7 @@ function kube-toggle() { if (( ${+POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND} )); then unset POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND else - POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|fluxctl|stern' + POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' fi p10k reload if zle; then diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 5be4bd86..19c602bc 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1207,7 +1207,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|fluxctl|stern' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index d02e3a39..9d0ab9a1 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1155,7 +1155,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|fluxctl|stern' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index aac1cc81..9d9dcf75 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1151,7 +1151,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|fluxctl|stern' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 7671a785..42b69929 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1274,7 +1274,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|fluxctl|stern' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. From f717a91f55f4d5dfb89d8828dc5b36fcc45548c2 Mon Sep 17 00:00:00 2001 From: Alejandro Gandara Date: Wed, 14 Jul 2021 22:52:22 +0100 Subject: [PATCH 057/380] =?UTF-8?q?*=20Added=20new=20module=20for=20showin?= =?UTF-8?q?g=20in=20prompt=20the=20active=20terraform=20version.=20*=20Pro?= =?UTF-8?q?mpt=20shows,=20the=20terraform=20version=20in=20this=20format:?= =?UTF-8?q?=20Terraform=20v0.12.13=20=EF=86=BB.=20If=20only=20if=20a=20val?= =?UTF-8?q?id=20terraform=20command=20is=20used,=20or=20an=20alias=20to=20?= =?UTF-8?q?it.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The use case: We have a need to constantly change between terraform versions depending on what project we are working on, it is easy to by mistake upgrade the wrong project to the latest terraform version. This is why the prompt is shown in red as soon as you type terraform, this is a good way to remind you to double check this is the terraform version you want to use. Future improvements: Detect current terraform version by checking the terraform workspace state version, and change the terraform color prompt from red to green if you're using the same version. --- config/p10k-classic.zsh | 1 + config/p10k-lean-8colors.zsh | 1 + config/p10k-lean.zsh | 1 + config/p10k-rainbow.zsh | 1 + internal/p10k.zsh | 9 +++++++++ 5 files changed, 13 insertions(+) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 19c602bc..53dc0e66 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -70,6 +70,7 @@ haskell_stack # haskell version from stack (https://haskellstack.org/) kubecontext # current kubernetes context (https://kubernetes.io/) terraform # terraform workspace (https://www.terraform.io) + terraform_version # It shows current active terraform version aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 9d0ab9a1..93a454d2 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -70,6 +70,7 @@ haskell_stack # haskell version from stack (https://haskellstack.org/) kubecontext # current kubernetes context (https://kubernetes.io/) terraform # terraform workspace (https://www.terraform.io) + terraform_version # It shows current active terraform version aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 9d9dcf75..f6e48806 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -70,6 +70,7 @@ haskell_stack # haskell version from stack (https://haskellstack.org/) kubecontext # current kubernetes context (https://kubernetes.io/) terraform # terraform workspace (https://www.terraform.io) + terraform_version # It shows current active terraform version aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 42b69929..71a1bfba 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -70,6 +70,7 @@ haskell_stack # haskell version from stack (https://haskellstack.org/) kubecontext # current kubernetes context (https://kubernetes.io/) terraform # terraform workspace (https://www.terraform.io) + terraform_version # It shows current active terraform version aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 935a86d9..07cc280a 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4887,6 +4887,15 @@ _p9k_prompt_terraform_init() { typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$commands[terraform]' } +function prompt_terraform_version() { + local terraform_version="$(command terraform --version)" + _p9k_prompt_segment "$0$state" $_p9k_color1 red TERRAFORM_ICON 0 '' $terraform_version +} + +_p9k_prompt_terraform_version_init() { + typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$commands[terraform]' +} + function prompt_proxy() { local -U p=( $all_proxy $http_proxy $https_proxy $ftp_proxy From 9f98915167b35bc045090c106b8249f6dadfaf01 Mon Sep 17 00:00:00 2001 From: Alejandro Gandara Date: Thu, 15 Jul 2021 00:44:37 +0100 Subject: [PATCH 058/380] =?UTF-8?q?*=20Added=20new=20module=20for=20showin?= =?UTF-8?q?g=20in=20prompt=20the=20active=20terraform=20version.=20*=20Pro?= =?UTF-8?q?mpt=20shows,=20the=20terraform=20version=20in=20this=20format:?= =?UTF-8?q?=20Terraform=20v0.12.13=20=EF=86=BB.=20If=20only=20if=20a=20val?= =?UTF-8?q?id=20terraform=20command=20is=20used,=20or=20an=20alias=20to=20?= =?UTF-8?q?it.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The use case: We have a need to constantly change between terraform versions depending on what project we are working on, it is easy to by mistake upgrade the wrong project to the latest terraform version. This is why the prompt is shown in red as soon as you type terraform, this is a good way to remind you to double check this is the terraform version you want to use. Future improvements: Detect current terraform version by checking the terraform workspace state version, and change the terraform color prompt from red to green if you're using the same version. --- config/p10k-classic.zsh | 3 +++ config/p10k-rainbow.zsh | 3 +++ 2 files changed, 6 insertions(+) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 53dc0e66..0407c354 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1205,6 +1205,9 @@ typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=38 # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' + ################[ terraform_version: It shows active terraform version (https://www.terraform.io) ]################# + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_SHOW_ON_COMMAND='terraform|tf' + #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 71a1bfba..f0d800bd 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1272,6 +1272,9 @@ typeset -g POWERLEVEL9K_TERRAFORM_OTHER_BACKGROUND=0 # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' + ################[ terraform_version: It shows active terraform version (https://www.terraform.io) ]################# + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_SHOW_ON_COMMAND='terraform|tf' + #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. From dae5f7f1c9ef5116b046f1f9b31a9bdf2154e76b Mon Sep 17 00:00:00 2001 From: Alejandro Gandara Date: Fri, 16 Jul 2021 20:39:23 +0100 Subject: [PATCH 059/380] * Added cache to terraform --version --- internal/p10k.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 07cc280a..510bf3c5 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4888,8 +4888,10 @@ _p9k_prompt_terraform_init() { } function prompt_terraform_version() { - local terraform_version="$(command terraform --version)" - _p9k_prompt_segment "$0$state" $_p9k_color1 red TERRAFORM_ICON 0 '' $terraform_version + _p9k_cached_cmd 0 '' terraform --version + [[ $_p9k__ret == (#b)Terraform\ v([[:digit:].]##)* ]] + local terraform_version=$match[1] + _p9k_prompt_segment "$0$state" $_p9k_color1 red TERRAFORM_ICON 0 '' "tf:$terraform_version" } _p9k_prompt_terraform_version_init() { From 2c135dd631019a251e073a0f4e86267cf12c50c0 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 17 Jul 2021 10:27:01 +0200 Subject: [PATCH 060/380] make terraform_version consistent with other *_version segments (#1487) --- config/p10k-classic.zsh | 9 ++++++--- config/p10k-lean-8colors.zsh | 8 +++++++- config/p10k-lean.zsh | 8 +++++++- config/p10k-rainbow.zsh | 9 ++++++++- internal/p10k.zsh | 10 ++++++---- 5 files changed, 34 insertions(+), 10 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 0407c354..592d8a7b 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -70,7 +70,7 @@ haskell_stack # haskell version from stack (https://haskellstack.org/) kubecontext # current kubernetes context (https://kubernetes.io/) terraform # terraform workspace (https://www.terraform.io) - terraform_version # It shows current active terraform version + # terraform_version # terraform version (https://www.terraform.io) aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) @@ -1205,8 +1205,11 @@ typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=38 # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' - ################[ terraform_version: It shows active terraform version (https://www.terraform.io) ]################# - typeset -g POWERLEVEL9K_TERRAFORM_VERSION_SHOW_ON_COMMAND='terraform|tf' + #############[ terraform_version: terraform version (https://www.terraform.io) ]############## + # Terraform version color. + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=38 + # Custom icon. + # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the the command you are typing invokes one of these tools. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 93a454d2..8e98757a 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -70,7 +70,7 @@ haskell_stack # haskell version from stack (https://haskellstack.org/) kubecontext # current kubernetes context (https://kubernetes.io/) terraform # terraform workspace (https://www.terraform.io) - terraform_version # It shows current active terraform version + # terraform_version # terraform version (https://www.terraform.io) aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) @@ -1273,6 +1273,12 @@ typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=4 # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' + #############[ terraform_version: terraform version (https://www.terraform.io) ]############## + # Terraform version color. + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# # Show aws only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show aws. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index f6e48806..5bfd77cc 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -70,7 +70,7 @@ haskell_stack # haskell version from stack (https://haskellstack.org/) kubecontext # current kubernetes context (https://kubernetes.io/) terraform # terraform workspace (https://www.terraform.io) - terraform_version # It shows current active terraform version + # terraform_version # terraform version (https://www.terraform.io) aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) @@ -1269,6 +1269,12 @@ typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=38 # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' + #############[ terraform_version: terraform version (https://www.terraform.io) ]############## + # Terraform version color. + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=38 + # Custom icon. + # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# # Show aws only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show aws. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index f0d800bd..a580f300 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -70,7 +70,7 @@ haskell_stack # haskell version from stack (https://haskellstack.org/) kubecontext # current kubernetes context (https://kubernetes.io/) terraform # terraform workspace (https://www.terraform.io) - terraform_version # It shows current active terraform version + # terraform_version # terraform version (https://www.terraform.io) aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) @@ -1272,6 +1272,13 @@ typeset -g POWERLEVEL9K_TERRAFORM_OTHER_BACKGROUND=0 # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' + #############[ terraform_version: terraform version (https://www.terraform.io) ]############## + # Terraform version color. + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=4 + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + ################[ terraform_version: It shows active terraform version (https://www.terraform.io) ]################# typeset -g POWERLEVEL9K_TERRAFORM_VERSION_SHOW_ON_COMMAND='terraform|tf' diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 510bf3c5..6fc78f31 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4888,10 +4888,12 @@ _p9k_prompt_terraform_init() { } function prompt_terraform_version() { - _p9k_cached_cmd 0 '' terraform --version - [[ $_p9k__ret == (#b)Terraform\ v([[:digit:].]##)* ]] - local terraform_version=$match[1] - _p9k_prompt_segment "$0$state" $_p9k_color1 red TERRAFORM_ICON 0 '' "tf:$terraform_version" + _p9k_cached_cmd 0 '' terraform --version || return + local v=${_p9k__ret#Terraform v} + (( $#v < $#_p9k__ret )) || return + v=${v%%$'\n'*} + [[ -n $v ]] || return + _p9k_prompt_segment $0 $_p9k_color1 blue TERRAFORM_ICON 0 '' $v } _p9k_prompt_terraform_version_init() { From 83d80fa308f6f8a496205a1ad5cb2ae4c4be55a6 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 17 Jul 2021 10:38:22 +0200 Subject: [PATCH 061/380] don't leak 'state' local parameter --- internal/p10k.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 6fc78f31..2099c32f 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1160,7 +1160,7 @@ function _p9k_parse_aws_config() { # AWS Profile prompt_aws() { typeset -g P9K_AWS_PROFILE="${AWS_VAULT:-${AWSUME_PROFILE:-${AWS_PROFILE:-$AWS_DEFAULT_PROFILE}}}" - local pat class + local pat class state for pat class in "${_POWERLEVEL9K_AWS_CLASSES[@]}"; do if [[ $P9K_AWS_PROFILE == ${~pat} ]]; then [[ -n $class ]] && state=_${${(U)class}//İ/I} @@ -4536,7 +4536,7 @@ prompt_azure() { fi _p9k_cache_stat_set "$name" fi - local pat class + local pat class state for pat class in "${_POWERLEVEL9K_AZURE_CLASSES[@]}"; do if [[ $name == ${~pat} ]]; then [[ -n $class ]] && state=_${${(U)class}//İ/I} @@ -4873,7 +4873,7 @@ function prompt_terraform() { _p9k_read_word ${${TF_DATA_DIR:-.terraform}:A}/environment && ws=$_p9k__ret fi [[ -z $ws || $ws == default && $_POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT == 0 ]] && return - local pat class + local pat class state for pat class in "${_POWERLEVEL9K_TERRAFORM_CLASSES[@]}"; do if [[ $ws == ${~pat} ]]; then [[ -n $class ]] && state=_${${(U)class}//İ/I} From 70ae5810d81f941a93e2077a2aa080f341deb96e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 22 Jul 2021 11:19:22 +0200 Subject: [PATCH 062/380] Squashed 'gitstatus/' changes from 0440e38b..1edd9e62 1edd9e62 build: respect standard compiler/linker env vars and fortify by default git-subtree-dir: gitstatus git-subtree-split: 1edd9e621ec5c8bf038767e529194b5c53b36352 --- build | 66 +++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 46 insertions(+), 20 deletions(-) diff --git a/build b/build index 8190f478..d3e96d74 100755 --- a/build +++ b/build @@ -136,52 +136,78 @@ case "$gitstatus_cpu" in *) archflag="-march";; esac -cflags="$archflag=$gitstatus_cpu -fno-plt" +cflags="$archflag=$gitstatus_cpu -fno-plt -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fpie" +ldflags= +static_pie= -command touch "$workdir"/file-prefix-map-test.c -if 2>/dev/null "${CC:-/bin/cc}" \ - -ffile-prefix-map=x=y \ - -c "$workdir"/file-prefix-map-test.c \ - -o "$workdir"/file-prefix-map-test.o; then +printf 'int main() {}\n' >"$workdir"/cc-test.c +if 2>/dev/null "${CC:-cc}" \ + -ffile-prefix-map=x=y \ + -Werror \ + -c "$workdir"/cc-test.c \ + -o "$workdir"/cc-test.o; then cflags="$cflags -ffile-prefix-map=$workdir/=" fi +command rm -f -- "$workdir"/cc-test "$workdir"/cc-test.o +if 2>/dev/null "${CC:-cc}" \ + -fstack-clash-protection -fcf-protection \ + -Werror \ + -c "$workdir"/cc-test.c \ + -o "$workdir"/cc-test.o; then + cflags="$cflags -fstack-clash-protection -fcf-protection" +fi + +command rm -f -- "$workdir"/cc-test "$workdir"/cc-test.o +if 2>/dev/null "${CC:-cc}" \ + -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now \ + -Werror \ + "$workdir"/cc-test.c \ + -o "$workdir"/cc-test; then + ldflags="$ldflags -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" +fi + +command rm -f -- "$workdir"/cc-test "$workdir"/cc-test.o +if 2>/dev/null "${CC:-cc}" \ + -fpie -static-pie \ + -Werror \ + "$workdir"/cc-test.c \ + -o "$workdir"/cc-test; then + static_pie='-static-pie' +fi + if [ "$gitstatus_cpu" = x86-64 ]; then cflags="$cflags -mtune=generic" fi libgit2_cmake_flags= -libgit2_cflags="$cflags" +libgit2_cflags="${CFLAGS-} $cflags -O3 -DNDEBUG" gitstatus_cxx=g++ -gitstatus_cxxflags="$cflags -I${workdir}/libgit2/include -DGITSTATUS_ZERO_NSEC -D_GNU_SOURCE" -gitstatus_ldflags="-L${workdir}/libgit2/build" +gitstatus_cxxflags="${CXXFLAGS-} $cflags -I${workdir}/libgit2/include -DGITSTATUS_ZERO_NSEC -D_GNU_SOURCE -D_GLIBCXX_ASSERTIONS" +gitstatus_ldflags="${LDFLAGS-} $ldflags -L${workdir}/libgit2/build" gitstatus_ldlibs= gitstatus_make=make case "$gitstatus_kernel" in linux) - gitstatus_ldflags="$gitstatus_ldflags -static" - gitstatus_ldflags="$gitstatus_ldflags -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" + gitstatus_ldflags="$gitstatus_ldflags ${static_pie:--static}" libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" ;; freebsd) gitstatus_make=gmake - gitstatus_ldflags="$gitstatus_ldflags -static" - gitstatus_ldflags="$gitstatus_ldflags -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" + gitstatus_ldflags="$gitstatus_ldflags ${static_pie:--static}" libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" ;; openbsd) gitstatus_cxx=eg++ gitstatus_make=gmake - gitstatus_ldflags="$gitstatus_ldflags -static" - gitstatus_ldflags="$gitstatus_ldflags -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" + gitstatus_ldflags="$gitstatus_ldflags ${static_pie:--static}" libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" ;; netbsd) gitstatus_make=gmake - gitstatus_ldflags="$gitstatus_ldflags -static" - gitstatus_ldflags="$gitstatus_ldflags -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" + gitstatus_ldflags="$gitstatus_ldflags ${static_pie:--static}" libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" ;; darwin) @@ -202,11 +228,11 @@ case "$gitstatus_kernel" in libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=OFF" ;; msys*|mingw*) - gitstatus_ldflags="$gitstatus_ldflags -static" + gitstatus_ldflags="$gitstatus_ldflags ${static_pie:--static}" libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" ;; cygwin*) - gitstatus_ldflags="$gitstatus_ldflags -static" + gitstatus_ldflags="$gitstatus_ldflags ${static_pie:--static}" libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" ;; *) @@ -295,7 +321,7 @@ command mkdir libgit2/build cd libgit2/build CFLAGS="$libgit2_cflags" command cmake \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=None \ -DZERO_NSEC=ON \ -DTHREADSAFE=ON \ -DUSE_BUNDLED_ZLIB=ON \ From 5e1c1caeb1ac178a3460bf209f56bdf9ced2b9ff Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 22 Jul 2021 12:01:06 +0200 Subject: [PATCH 063/380] doc: spello --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bed47878..922baf8e 100644 --- a/README.md +++ b/README.md @@ -437,7 +437,7 @@ referenced above is the official Powerlevel10k package. There is also [zsh-theme-powerlevel10k]( https://www.archlinux.org/packages/community/x86_64/zsh-theme-powerlevel10k/) community package. -Historicaly, [it has been breaking often and for extended periods of time]( +Historically, [it has been breaking often and for extended periods of time]( https://github.com/romkatv/powerlevel10k/pull/786). **Do not use it.** ## Configuration From c23f3c3c1074041a572b32b49820b00797f36ca5 Mon Sep 17 00:00:00 2001 From: NickVeld Date: Thu, 22 Jul 2021 21:29:54 +0300 Subject: [PATCH 064/380] README: Windows Terminal "default"->"defaults" key (#1499) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 922baf8e..b999d93a 100644 --- a/README.md +++ b/README.md @@ -554,7 +554,7 @@ applications on your system. Configure your terminal to use this font: *Properties → Font* and set *Font* to `MesloLGS NF`. - **Windows Terminal** by Microsoft (the new thing): Open `settings.json` (Ctrl+Shift+,), search for `fontFace` and set the value to `MesloLGS NF` for every profile. If you don't find - `fontFace`, add it under *profiles → default*. See [this settings file]( + `fontFace`, add it under *profiles → defaults*. See [this settings file]( https://raw.githubusercontent.com/romkatv/dotfiles-public/aba0e6c4657d705ed6c344d700d659977385f25c/dotfiles/microsoft-terminal-settings.json) for example. - **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor → From e3c8529052bb8c73fdde48a28ed9f6a8b4a4408b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 23 Jul 2021 09:09:40 +0200 Subject: [PATCH 065/380] doc: typo --- font.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/font.md b/font.md index 1e2807b6..1715019e 100644 --- a/font.md +++ b/font.md @@ -51,7 +51,7 @@ applications on your system. Configure your terminal to use this font: *Properties → Font* and set *Font* to `MesloLGS NF`. - **Windows Terminal** by Microsoft (the new thing): Open `settings.json` (Ctrl+Shift+,), search for `fontFace` and set the value to `MesloLGS NF` for every profile. If you don't find - `fontFace`, add it under *profiles → default*. See [this settings file]( + `fontFace`, add it under *profiles → defaults*. See [this settings file]( https://raw.githubusercontent.com/romkatv/dotfiles-public/aba0e6c4657d705ed6c344d700d659977385f25c/dotfiles/microsoft-terminal-settings.json) for example. - **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor → From 799c22f63b93e9d1ab8f01473bf9ebd2e9750f43 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 25 Jul 2021 09:31:56 +0200 Subject: [PATCH 066/380] Squashed 'gitstatus/' changes from 1edd9e62..845f492f 845f492f build: target march armv8-a instead of armv8 cf21109b build: respect CXX environment variable git-subtree-dir: gitstatus git-subtree-split: 845f492f777af84e50b9a4820c7b08729c841f0c --- build | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build b/build index d3e96d74..8f0892f2 100755 --- a/build +++ b/build @@ -339,7 +339,7 @@ command make -j "$cpus" VERBOSE=1 APPNAME="$appname".tmp \ OBJDIR="$workdir"/gitstatus \ - CXX="$gitstatus_cxx" \ + CXX="${CXX:-$gitstatus_cxx}" \ CXXFLAGS="$gitstatus_cxxflags" \ LDFLAGS="$gitstatus_ldflags" \ LDLIBS="$gitstatus_ldlibs" \ @@ -487,8 +487,7 @@ if [ -z "$gitstatus_cpu" ]; then armel) gitstatus_cpu=armv5;; armv6l|armhf) gitstatus_cpu=armv6;; armv7l) gitstatus_cpu=armv7;; - arm64) gitstatus_cpu=armv8;; - aarch64) gitstatus_cpu=armv8-a;; + arm64|aarch64) gitstatus_cpu=armv8-a;; ppc64le) gitstatus_cpu=powerpc64le;; riscv64) gitstatus_cpu=rv64imafdc;; x86_64|amd64) gitstatus_cpu=x86-64;; From 46a3e51896d72ea4e2246d3207df9acc5049b5a3 Mon Sep 17 00:00:00 2001 From: ahillio Date: Sun, 8 Aug 2021 14:22:22 -0400 Subject: [PATCH 067/380] readme: make 2steps for oh-my-zsh installation explicit. (#1526) --- README.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index b999d93a..239737e6 100644 --- a/README.md +++ b/README.md @@ -366,18 +366,17 @@ make sure to disable the current theme in your plugin manager. See ### Oh My Zsh -```zsh -git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k -``` +1. Clone the repository: + ```zsh + git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k + ``` + Users in mainland China can use the official mirror on gitee.com for faster download.
+ 中国大陆用户可以使用 gitee.com 上的官方镜像加速下载. -Users in mainland China can use the official mirror on gitee.com for faster download.
-中国大陆用户可以使用 gitee.com 上的官方镜像加速下载. - -```zsh -git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k -``` - -Set `ZSH_THEME="powerlevel10k/powerlevel10k"` in `~/.zshrc`. + ```zsh + git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k + ``` +2. Set `ZSH_THEME="powerlevel10k/powerlevel10k"` in `~/.zshrc`. ### Prezto From 32e76e772173f1d2856ee4002f21607523221ce7 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Tue, 10 Aug 2021 12:03:29 -0500 Subject: [PATCH 068/380] Update README.md (#1532) with new changed from version 1.5.0 of Zim. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 239737e6..ddff77f6 100644 --- a/README.md +++ b/README.md @@ -384,7 +384,7 @@ Add `zstyle :prezto:module:prompt theme powerlevel10k` to `~/.zpreztorc`. ### Zim -Add `zmodule romkatv/powerlevel10k` to `~/.zimrc` and run `zimfw install`. +Add `zmodule romkatv/powerlevel10k --use degit` to `~/.zimrc` and run `zimfw install`. ### Antibody From 20b87731de26638f40dce1bfc89f5b5a207e090f Mon Sep 17 00:00:00 2001 From: Patrick Tavares Date: Mon, 16 Aug 2021 18:46:46 +0200 Subject: [PATCH 069/380] add availability to display or not Terraform version Show Terraform version segment only when *.tf files are present in current directory --- config/p10k-classic.zsh | 2 ++ config/p10k-lean-8colors.zsh | 2 ++ config/p10k-lean.zsh | 2 ++ config/p10k-rainbow.zsh | 2 ++ internal/p10k.zsh | 5 ++++- 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 592d8a7b..3ccd335f 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1206,6 +1206,8 @@ # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' #############[ terraform_version: terraform version (https://www.terraform.io) ]############## + # Don't show terraform version if there is no "*.tf" files + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_ALWAYS=false # Terraform version color. typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=38 # Custom icon. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 8e98757a..123a42c7 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1274,6 +1274,8 @@ # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' #############[ terraform_version: terraform version (https://www.terraform.io) ]############## + # Don't show terraform version if there is no "*.tf" files + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_ALWAYS=false # Terraform version color. typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=4 # Custom icon. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 5bfd77cc..698ffa78 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1270,6 +1270,8 @@ # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' #############[ terraform_version: terraform version (https://www.terraform.io) ]############## + # Don't show terraform version if there is no "*.tf" files + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_ALWAYS=false # Terraform version color. typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=38 # Custom icon. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index a580f300..1535cb39 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1273,6 +1273,8 @@ # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' #############[ terraform_version: terraform version (https://www.terraform.io) ]############## + # Don't show terraform version if there is no "*.tf" files + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_ALWAYS=false # Terraform version color. typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=4 typeset -g POWERLEVEL9K_TERRAFORM_VERSION_BACKGROUND=0 diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 2099c32f..2e1fa9e8 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3,7 +3,7 @@ if [[ $__p9k_sourced != 13 ]]; then >&2 print -P "[%F{1}ERROR%f]: Corrupted powerlevel10k installation." >&2 print -P "" if (( ${+functions[antigen]} )); then - >&2 print -P "If using %Bantigen%b, run the folowing command to fix:" + >&2 print -P "If using %Bantigen%b, run the following command to fix:" >&2 print -P "" >&2 print -P " %F{2}antigen%f reset" if [[ -d ~/.antigen ]]; then @@ -4888,6 +4888,9 @@ _p9k_prompt_terraform_init() { } function prompt_terraform_version() { + if [[ $_POWERLEVEL9K_TERRAFORM_VERSION_ALWAYS ]]; then + _p9k_upglob "*.tf" && return 1 + fi _p9k_cached_cmd 0 '' terraform --version || return local v=${_p9k__ret#Terraform v} (( $#v < $#_p9k__ret )) || return From 6aeb13b08aab0b35f0c9b0212f1c0cba89eaa5d3 Mon Sep 17 00:00:00 2001 From: Patrick Tavares Date: Mon, 16 Aug 2021 18:47:40 +0200 Subject: [PATCH 070/380] add terraform_version segment to the list of available segments --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ddff77f6..679c4f04 100644 --- a/README.md +++ b/README.md @@ -299,6 +299,7 @@ enable as many segments as you like. It won't slow down your prompt or Zsh start | `package` | `name@version` from [package.json](https://docs.npmjs.com/files/package.json) | | `kubecontext` | current [kubernetes](https://kubernetes.io/) context | | `terraform` | [terraform](https://www.terraform.io) workspace | +| `terraform_version` | [terraform](https://www.terraform.io) version | | `aws` | [aws profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) | | `aws_eb_env` | [aws elastic beanstalk](https://aws.amazon.com/elasticbeanstalk/) environment | | `azure` | [azure](https://docs.microsoft.com/en-us/cli/azure) account name | From e7629449c62918ccb0ce1bee1fec12226f38a7f2 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 17 Aug 2021 19:41:15 +0200 Subject: [PATCH 071/380] spello --- internal/p10k.zsh | 3 --- 1 file changed, 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 2e1fa9e8..80b5d5b1 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4888,9 +4888,6 @@ _p9k_prompt_terraform_init() { } function prompt_terraform_version() { - if [[ $_POWERLEVEL9K_TERRAFORM_VERSION_ALWAYS ]]; then - _p9k_upglob "*.tf" && return 1 - fi _p9k_cached_cmd 0 '' terraform --version || return local v=${_p9k__ret#Terraform v} (( $#v < $#_p9k__ret )) || return From 5669c12c6659e888de9d0093f95a8fc91d0dba8d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 17 Aug 2021 19:41:29 +0200 Subject: [PATCH 072/380] Revert "add availability to display or not Terraform version" This reverts commit 20b87731de26638f40dce1bfc89f5b5a207e090f. --- config/p10k-classic.zsh | 2 -- config/p10k-lean-8colors.zsh | 2 -- config/p10k-lean.zsh | 2 -- config/p10k-rainbow.zsh | 2 -- internal/p10k.zsh | 2 +- 5 files changed, 1 insertion(+), 9 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 3ccd335f..592d8a7b 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1206,8 +1206,6 @@ # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' #############[ terraform_version: terraform version (https://www.terraform.io) ]############## - # Don't show terraform version if there is no "*.tf" files - typeset -g POWERLEVEL9K_TERRAFORM_VERSION_ALWAYS=false # Terraform version color. typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=38 # Custom icon. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 123a42c7..8e98757a 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1274,8 +1274,6 @@ # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' #############[ terraform_version: terraform version (https://www.terraform.io) ]############## - # Don't show terraform version if there is no "*.tf" files - typeset -g POWERLEVEL9K_TERRAFORM_VERSION_ALWAYS=false # Terraform version color. typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=4 # Custom icon. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 698ffa78..5bfd77cc 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1270,8 +1270,6 @@ # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' #############[ terraform_version: terraform version (https://www.terraform.io) ]############## - # Don't show terraform version if there is no "*.tf" files - typeset -g POWERLEVEL9K_TERRAFORM_VERSION_ALWAYS=false # Terraform version color. typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=38 # Custom icon. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 1535cb39..a580f300 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1273,8 +1273,6 @@ # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' #############[ terraform_version: terraform version (https://www.terraform.io) ]############## - # Don't show terraform version if there is no "*.tf" files - typeset -g POWERLEVEL9K_TERRAFORM_VERSION_ALWAYS=false # Terraform version color. typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=4 typeset -g POWERLEVEL9K_TERRAFORM_VERSION_BACKGROUND=0 diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 80b5d5b1..2099c32f 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3,7 +3,7 @@ if [[ $__p9k_sourced != 13 ]]; then >&2 print -P "[%F{1}ERROR%f]: Corrupted powerlevel10k installation." >&2 print -P "" if (( ${+functions[antigen]} )); then - >&2 print -P "If using %Bantigen%b, run the following command to fix:" + >&2 print -P "If using %Bantigen%b, run the folowing command to fix:" >&2 print -P "" >&2 print -P " %F{2}antigen%f reset" if [[ -d ~/.antigen ]]; then From 25e5f5985f0b977461c0d14663a910363684014e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 17 Aug 2021 19:42:05 +0200 Subject: [PATCH 073/380] spello --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 2099c32f..80b5d5b1 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3,7 +3,7 @@ if [[ $__p9k_sourced != 13 ]]; then >&2 print -P "[%F{1}ERROR%f]: Corrupted powerlevel10k installation." >&2 print -P "" if (( ${+functions[antigen]} )); then - >&2 print -P "If using %Bantigen%b, run the folowing command to fix:" + >&2 print -P "If using %Bantigen%b, run the following command to fix:" >&2 print -P "" >&2 print -P " %F{2}antigen%f reset" if [[ -d ~/.antigen ]]; then From 80ec734a953d930838ea6839923c97c3da880a0d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 18 Aug 2021 17:05:04 +0200 Subject: [PATCH 074/380] Squashed 'gitstatus/' changes from 845f492f..2ecd9907 2ecd9907 add logging to debug https://github.com/romkatv/powerlevel10k/issues/1477 74010456 add a TODO to fix #254 864f1caf Trim '\w' part of bash prompt. (#253) git-subtree-dir: gitstatus git-subtree-split: 2ecd990706255d2000fedbde3b2d2353f63d69a1 --- build | 9 ++++++++- gitstatus.prompt.sh | 1 + src/dir.cc | 14 +++++++------- src/dir.h | 8 ++++---- src/index.cc | 1 + src/tag_db.cc | 2 ++ 6 files changed, 23 insertions(+), 12 deletions(-) diff --git a/build b/build index 8f0892f2..7adae0a9 100755 --- a/build +++ b/build @@ -275,7 +275,14 @@ if [ ! -e "$libgit2_tarball" ]; then fi fi libgit2_url=https://github.com/romkatv/libgit2/archive/"$libgit2_version".tar.gz - command wget -O "$libgit2_tmp" -- "$libgit2_url" + if ! command wget -O "$libgit2_tmp" -- "$libgit2_url"; then + command which wget + command ls -lAd -- "$outdir" + command ls -lA -- "$outdir" + command ls -lAd -- "$outdir"/deps + command ls -lA -- "$outdir"/deps + exit 1 + fi command mv -f -- "$libgit2_tmp" "$libgit2_tarball" else >&2 echo "[error] file not found: deps/libgit2-"$libgit2_version".tar.gz" diff --git a/gitstatus.prompt.sh b/gitstatus.prompt.sh index f27bcc39..8ee28de0 100644 --- a/gitstatus.prompt.sh +++ b/gitstatus.prompt.sh @@ -86,6 +86,7 @@ gitstatus_stop && gitstatus_start -s -1 -u -1 -c -1 -d -1 # On every prompt, fetch git status and set GITSTATUS_PROMPT. PROMPT_COMMAND=gitstatus_prompt_update +PROMPT_DIRTRIM=3 # Enable promptvars so that ${GITSTATUS_PROMPT} in PS1 is expanded. shopt -s promptvars diff --git a/src/dir.cc b/src/dir.cc index e7ce7141..39cf1c2c 100644 --- a/src/dir.cc +++ b/src/dir.cc @@ -106,14 +106,14 @@ bool ListDir(int dir_fd, Arena& arena, std::vector& entries, bool precomp }; constexpr size_t kBufSize = 8 << 10; - entries.clear(); + const size_t orig_size = entries.size(); while (true) { char* buf = static_cast(arena.Allocate(kBufSize, alignof(linux_dirent64))); // Save 256 bytes for the rainy day. int n = syscall(SYS_getdents64, dir_fd, buf, kBufSize - 256); if (n < 0) { - entries.clear(); + entries.resize(orig_size); return false; } for (int pos = 0; pos < n;) { @@ -131,9 +131,9 @@ bool ListDir(int dir_fd, Arena& arena, std::vector& entries, bool precomp } if (case_sensitive) { - SortEntries(entries.data(), entries.data() + entries.size()); + SortEntries(entries.data() + orig_size, entries.data() + entries.size()); } else { - SortEntries(entries.data(), entries.data() + entries.size()); + SortEntries(entries.data() + orig_size, entries.data() + entries.size()); } return true; @@ -211,7 +211,7 @@ char* DirenvConvert(Arena& arena, struct dirent& ent, bool do_convert) { bool ListDir(int dir_fd, Arena& arena, std::vector& entries, bool precompose_unicode, bool case_sensitive) { - entries.clear(); + const size_t orig_size = entries.size(); dir_fd = dup(dir_fd); if (dir_fd < 0) return false; DIR* dir = fdopendir(dir_fd); @@ -225,10 +225,10 @@ bool ListDir(int dir_fd, Arena& arena, std::vector& entries, bool precomp entries.push_back(DirenvConvert(arena, *ent, precompose_unicode)); } if (errno) { - entries.clear(); + entries.resize(orig_size); return false; } - StrSort(entries.data(), entries.data() + entries.size(), case_sensitive); + StrSort(entries.data() + orig_size, entries.data() + entries.size(), case_sensitive); return true; } diff --git a/src/dir.h b/src/dir.h index 42ab29bb..4d4cf3da 100644 --- a/src/dir.h +++ b/src/dir.h @@ -25,11 +25,11 @@ namespace gitstatus { -// On error, clears entries and returns false. Does not throw. +// On error, leaves entries unchaged and returns false. Does not throw. // -// On success, fills entries with the names of files from the specified directory and returns true. -// Every entry is a null-terminated string. At -1 offset is its d_type. All elements point into the -// arena. They are sorted either by strcmp or strcasecmp depending on case_sensitive. +// On success, appends names of files from the specified directory to entries and returns true. +// Every appended entry is a null-terminated string. At -1 offset is its d_type. All elements +// point into the arena. They are sorted either by strcmp or strcasecmp depending on case_sensitive. // // Does not close dir_fd. // diff --git a/src/index.cc b/src/index.cc index ae8ca54c..4d66876b 100644 --- a/src/index.cc +++ b/src/index.cc @@ -242,6 +242,7 @@ std::vector ScanDirs(git_index* index, int root_fd, IndexDir* const dir.st = st; } + entries.clear(); arena.Reuse(); if (!ListDir(*dir_fd, arena, entries, caps.precompose_unicode, caps.case_sensitive)) { AddUnmached(""); diff --git a/src/tag_db.cc b/src/tag_db.cc index 31b150bd..52cbaede 100644 --- a/src/tag_db.cc +++ b/src/tag_db.cc @@ -155,6 +155,8 @@ void TagDb::ReadLooseTags() { int dir_fd = open(dirname.c_str(), O_RDONLY | O_DIRECTORY | O_CLOEXEC); if (dir_fd < 0) return; ON_SCOPE_EXIT(&) { CHECK(!close(dir_fd)) << Errno(); }; + // TODO: recursively traverse directories so that the file refs/tags/foo/bar gets interpreted + // as the tag foo/bar. See https://github.com/romkatv/gitstatus/issues/254. (void)ListDir(dir_fd, loose_arena_, loose_tags_, /* precompose_unicode = */ false, /* case_sensitive = */ true); } From 277ff8b414a595902981b95199d0ffbc4498f808 Mon Sep 17 00:00:00 2001 From: elProxy Date: Thu, 19 Aug 2021 09:27:05 +0200 Subject: [PATCH 075/380] Add support for AWS_REGION with fallback to AWS_DEFAULT_REGION (#1544) See https://fossies.org/linux/aws-cli/CHANGELOG.rst#section-133 --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 80b5d5b1..f4c032d7 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1168,8 +1168,8 @@ prompt_aws() { fi done - if [[ -n $AWS_DEFAULT_REGION ]]; then - typeset -g P9K_AWS_REGION=$AWS_DEFAULT_REGION + if [[ -n ${AWS_REGION:-AWS_DEFAULT_REGION} ]]; then + typeset -g P9K_AWS_REGION=${AWS_REGION:-AWS_DEFAULT_REGION} else local cfg=${AWS_CONFIG_FILE:-~/.aws/config} if ! _p9k_cache_stat_get $0 $cfg; then From 379b97e4e71cf311ebe1dfa11b2e0432c678a43d Mon Sep 17 00:00:00 2001 From: elProxy Date: Thu, 19 Aug 2021 10:16:12 +0200 Subject: [PATCH 076/380] Fix after #1544 (#1547) Well, that's embarassing... --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index f4c032d7..85c7f93d 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1168,8 +1168,8 @@ prompt_aws() { fi done - if [[ -n ${AWS_REGION:-AWS_DEFAULT_REGION} ]]; then - typeset -g P9K_AWS_REGION=${AWS_REGION:-AWS_DEFAULT_REGION} + if [[ -n ${AWS_REGION:-$AWS_DEFAULT_REGION} ]]; then + typeset -g P9K_AWS_REGION=${AWS_REGION:-$AWS_DEFAULT_REGION} else local cfg=${AWS_CONFIG_FILE:-~/.aws/config} if ! _p9k_cache_stat_get $0 $cfg; then From 0a1946b9651c037a1266ce88cadf8f30fe8d1cac Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 21 Aug 2021 10:08:59 +0200 Subject: [PATCH 077/380] bug fix: display the intended battery icon when using legacy configs (#1530) --- internal/p10k.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 85c7f93d..46326f35 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7191,6 +7191,7 @@ _p9k_init_params() { case $parameters[POWERLEVEL9K_BATTERY_STAGES] in scalar*) typeset -ga _POWERLEVEL9K_BATTERY_STAGES=("${(@s::)${(g::)POWERLEVEL9K_BATTERY_STAGES}}");; array*) typeset -ga _POWERLEVEL9K_BATTERY_STAGES=("${(@g::)POWERLEVEL9K_BATTERY_STAGES}");; + *) typeset -ga _POWERLEVEL9K_BATTERY_STAGES=();; esac local state for state in CHARGED CHARGING LOW DISCONNECTED; do @@ -8129,7 +8130,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v124\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v125\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$GITSTATUS_CACHE_DIR\1$GITSTATUS_AUTO_INSTALL\1${ZLE_RPROMPT_INDENT:-1}\1' From 10ad57cc6b73b9ed51474edbd5235e6b5f2fd16b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 23 Aug 2021 10:30:28 +0200 Subject: [PATCH 078/380] Squashed 'gitstatus/' changes from 2ecd9907..edd92f62 edd92f62 build: more debug info in case wget fails 1cfcb46c build: add a workaround for systems with broken wget git-subtree-dir: gitstatus git-subtree-split: edd92f6210afb16411274e1d6060c6a68bd1e999 --- build | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/build b/build index 7adae0a9..036a12ad 100755 --- a/build +++ b/build @@ -275,12 +275,16 @@ if [ ! -e "$libgit2_tarball" ]; then fi fi libgit2_url=https://github.com/romkatv/libgit2/archive/"$libgit2_version".tar.gz - if ! command wget -O "$libgit2_tmp" -- "$libgit2_url"; then - command which wget - command ls -lAd -- "$outdir" - command ls -lA -- "$outdir" - command ls -lAd -- "$outdir"/deps - command ls -lA -- "$outdir"/deps + if ! >"$libgit2_tmp" command wget --no-config -qO- -- "$libgit2_url" && + ! >"$libgit2_tmp" command wget -qO- -- "$libgit2_url"; then + set -x + >&2 command which wget + >&2 command ls -lAd -- "$(command which wget)" + >&2 command ls -lAd -- "$outdir" + >&2 command ls -lA -- "$outdir" + >&2 command ls -lAd -- "$outdir"/deps + >&2 command ls -lA -- "$outdir"/deps + set +x exit 1 fi command mv -f -- "$libgit2_tmp" "$libgit2_tarball" From b3b0efb69f5b7817490aa9163ca44b40699b2bcc Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 28 Aug 2021 10:14:37 +0200 Subject: [PATCH 079/380] work around bugs in terminals and window managers by essentially disabling prompt_sp (but keeping prompt_cr) in instant prompt for new TTYs --- internal/p10k.zsh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 46326f35..c50292f2 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5906,7 +5906,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=41 +typeset -gri __p9k_instant_prompt_version=42 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -6172,12 +6172,14 @@ _p9k_dump_instant_prompt() { fi typeset -g _p9k__ret=$x } - local out - if [[ $+VTE_VERSION == 0 && $TERM_PROGRAM != Hyper ]] || (( ! $+_p9k__g )); then + local out=${(%):-%b%k%f%s%u} + if [[ $P9K_TTY == old && ( $+VTE_VERSION == 0 && $TERM_PROGRAM != Hyper || $+_p9k__g == 0 ) ]]; then local mark=${(e)PROMPT_EOL_MARK} [[ $mark == "%B%S%#%s%b" ]] && _p9k__ret=1 || _p9k_prompt_length $mark local -i fill=$((COLUMNS > _p9k__ret ? COLUMNS - _p9k__ret : 0)) - out+="${(%):-%b%k%f%s%u$mark${(pl.$fill.. .)}$cr%b%k%f%s%u%E}" + out+="${(%):-$mark${(pl.$fill.. .)}$cr%b%k%f%s%u%E}" + else + out+="${(%):-$cr%E}" fi if (( _z4h_can_save_restore_screen != 1 )); then (( height )) && out+="${(pl.$height..$lf.)}$esc${height}A" From 2c7241c43de9aa200498e1cd55cf4926de31ffe4 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 2 Sep 2021 13:47:29 +0200 Subject: [PATCH 080/380] add an extra step to the uninstallation instructions to delete cache files (#1561) --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 679c4f04..46d20309 100644 --- a/README.md +++ b/README.md @@ -707,7 +707,11 @@ The command to update Powerlevel10k depends on how it was installed. | [Zinit](#zinit) | `zinit delete romkatv/powerlevel10k` | | [Homebrew](#homebrew) | `brew uninstall powerlevel10k; brew untap romkatv/powerlevel10k` | | [Arch Linux](#arch-linux) | `yay -R --noconfirm zsh-theme-powerlevel10k-git` | -5. Restart Zsh. [Do not use `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc). +6. Restart Zsh. [Do not use `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc). +7. Delete Powerlevel10k cache files. + ```zsh + rm -rf -- "${XDG_CACHE_HOME:-$HOME/.cache}"/p10k-*(N) "${XDG_CACHE_HOME:-$HOME/.cache}"/gitstatus + ``` ### How do I install Powerlevel10k on a machine without Internet access? From b5f4d27c745a5e678900a6872cd4ef4c0788367a Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 3 Sep 2021 09:42:31 +0200 Subject: [PATCH 081/380] add a screenshot of vscode font settings --- README.md | 3 +++ font.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 46d20309..4f823f99 100644 --- a/README.md +++ b/README.md @@ -543,6 +543,9 @@ applications on your system. Configure your terminal to use this font: `module.exports.config` to `MesloLGS NF`. - **Visual Studio Code**: Open *File → Preferences → Settings*, enter `terminal.integrated.fontFamily` in the search box and set the value to `MesloLGS NF`. + Consult [this screenshot]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/95a96c1555866350feb3ae2e86c3d5c101725174/visual-studio-code-font-settings.jpg) + to see how it should look like. - **GNOME Terminal** (the default Ubuntu terminal): Open *Terminal → Preferences* and click on the selected profile under *Profiles*. Check *Custom font* under *Text Appearance* and select `MesloLGS NF Regular`. diff --git a/font.md b/font.md index 1715019e..9bbf293d 100644 --- a/font.md +++ b/font.md @@ -40,6 +40,9 @@ applications on your system. Configure your terminal to use this font: `module.exports.config` to `MesloLGS NF`. - **Visual Studio Code**: Open *File → Preferences → Settings*, enter `terminal.integrated.fontFamily` in the search box and set the value to `MesloLGS NF`. + Consult [this screenshot]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/95a96c1555866350feb3ae2e86c3d5c101725174/visual-studio-code-font-settings.jpg) + to see how it should look like. - **GNOME Terminal** (the default Ubuntu terminal): Open *Terminal → Preferences* and click on the selected profile under *Profiles*. Check *Custom font* under *Text Appearance* and select `MesloLGS NF Regular`. From c2c3171927639b4da22972cbab817c08954d8d67 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 3 Sep 2021 10:10:11 +0200 Subject: [PATCH 082/380] extra verbose instructions for vscode font changes --- README.md | 8 +++++--- font.md | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4f823f99..8f69fca8 100644 --- a/README.md +++ b/README.md @@ -541,11 +541,13 @@ applications on your system. Configure your terminal to use this font: and select `MesloLGS NF` family. - **Hyper**: Open *Hyper → Edit → Preferences* and change the value of `fontFamily` under `module.exports.config` to `MesloLGS NF`. -- **Visual Studio Code**: Open *File → Preferences → Settings*, enter - `terminal.integrated.fontFamily` in the search box and set the value to `MesloLGS NF`. +- **Visual Studio Code**: Open *File → Preferences → Settings* (PC) or + *Code → Preferences → Settings* (Mac), enter `terminal.integrated.fontFamily` in the search box at + the top of *Settings* tab and set the value below to `MesloLGS NF`. Consult [this screenshot]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/95a96c1555866350feb3ae2e86c3d5c101725174/visual-studio-code-font-settings.jpg) - to see how it should look like. + to see how it should look like or see [this issue]( + https://github.com/romkatv/powerlevel10k/issues/671) for extra information. - **GNOME Terminal** (the default Ubuntu terminal): Open *Terminal → Preferences* and click on the selected profile under *Profiles*. Check *Custom font* under *Text Appearance* and select `MesloLGS NF Regular`. diff --git a/font.md b/font.md index 9bbf293d..6cc74c2d 100644 --- a/font.md +++ b/font.md @@ -38,11 +38,13 @@ applications on your system. Configure your terminal to use this font: and select `MesloLGS NF` family. - **Hyper**: Open *Hyper → Edit → Preferences* and change the value of `fontFamily` under `module.exports.config` to `MesloLGS NF`. -- **Visual Studio Code**: Open *File → Preferences → Settings*, enter - `terminal.integrated.fontFamily` in the search box and set the value to `MesloLGS NF`. +- **Visual Studio Code**: Open *File → Preferences → Settings* (PC) or + *Code → Preferences → Settings* (Mac), enter `terminal.integrated.fontFamily` in the search box at + the top of *Settings* tab and set the value below to `MesloLGS NF`. Consult [this screenshot]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/95a96c1555866350feb3ae2e86c3d5c101725174/visual-studio-code-font-settings.jpg) - to see how it should look like. + to see how it should look like or see [this issue]( + https://github.com/romkatv/powerlevel10k/issues/671) for extra information. - **GNOME Terminal** (the default Ubuntu terminal): Open *Terminal → Preferences* and click on the selected profile under *Profiles*. Check *Custom font* under *Text Appearance* and select `MesloLGS NF Regular`. From c5c9178341da88d0d55bad9bb3daa5e90d52411d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 3 Sep 2021 10:27:01 +0200 Subject: [PATCH 083/380] update a link to visual-studio-code-font-settings.jpg (now with annotations) --- README.md | 2 +- font.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8f69fca8..0c2ef357 100644 --- a/README.md +++ b/README.md @@ -545,7 +545,7 @@ applications on your system. Configure your terminal to use this font: *Code → Preferences → Settings* (Mac), enter `terminal.integrated.fontFamily` in the search box at the top of *Settings* tab and set the value below to `MesloLGS NF`. Consult [this screenshot]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/95a96c1555866350feb3ae2e86c3d5c101725174/visual-studio-code-font-settings.jpg) + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/389133fb8c9a2347929a23702ce3039aacc46c3d/visual-studio-code-font-settings.jpg) to see how it should look like or see [this issue]( https://github.com/romkatv/powerlevel10k/issues/671) for extra information. - **GNOME Terminal** (the default Ubuntu terminal): Open *Terminal → Preferences* and click on the diff --git a/font.md b/font.md index 6cc74c2d..5c8042de 100644 --- a/font.md +++ b/font.md @@ -42,7 +42,7 @@ applications on your system. Configure your terminal to use this font: *Code → Preferences → Settings* (Mac), enter `terminal.integrated.fontFamily` in the search box at the top of *Settings* tab and set the value below to `MesloLGS NF`. Consult [this screenshot]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/95a96c1555866350feb3ae2e86c3d5c101725174/visual-studio-code-font-settings.jpg) + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/389133fb8c9a2347929a23702ce3039aacc46c3d/visual-studio-code-font-settings.jpg) to see how it should look like or see [this issue]( https://github.com/romkatv/powerlevel10k/issues/671) for extra information. - **GNOME Terminal** (the default Ubuntu terminal): Open *Terminal → Preferences* and click on the From 4f3d2ffe7251a17aa10e00ed30d55f6fd9d65002 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 10 Sep 2021 13:21:31 +0200 Subject: [PATCH 084/380] new prompt segment: toolbox (https://github.com/containers/toolbox) #1560 --- config/p10k-classic.zsh | 11 +++++++++++ config/p10k-lean-8colors.zsh | 11 +++++++++++ config/p10k-lean.zsh | 11 +++++++++++ config/p10k-rainbow.zsh | 12 ++++++++++++ internal/icons.zsh | 6 ++++++ internal/p10k.zsh | 35 ++++++++++++++++++++++++++++++++--- internal/wizard.zsh | 2 ++ 7 files changed, 85 insertions(+), 3 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 592d8a7b..e58108bd 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -76,6 +76,7 @@ azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) gcloud # google cloud cli account and project (https://cloud.google.com/) google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) + toolbox # toolbox name (https://github.com/containers/toolbox) context # user@hostname nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) @@ -1449,6 +1450,16 @@ # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' + ##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]############### + # Toolbox color. + typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=178 + # Don't display the name of the toolbox if it matches fedora-toolbox-*. + typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}' + # Custom icon. + # typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='%248Fin ' + ###############################[ public_ip: public IP address ]############################### # Public IP color. typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=94 diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 8e98757a..e0e6cc7f 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -76,6 +76,7 @@ azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) gcloud # google cloud cli account and project (https://cloud.google.com/) google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) + toolbox # toolbox name (https://github.com/containers/toolbox) context # user@hostname nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) @@ -1430,6 +1431,16 @@ # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' + ##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]############### + # Toolbox color. + typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=3 + # Don't display the name of the toolbox if it matches fedora-toolbox-*. + typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}' + # Custom icon. + # typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='%fin ' + ###############################[ public_ip: public IP address ]############################### # Public IP color. typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=6 diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 5bfd77cc..af802d16 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -76,6 +76,7 @@ azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) gcloud # google cloud cli account and project (https://cloud.google.com/) google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) + toolbox # toolbox name (https://github.com/containers/toolbox) context # user@hostname nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) @@ -1426,6 +1427,16 @@ # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' + ##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]############### + # Toolbox color. + typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=178 + # Don't display the name of the toolbox if it matches fedora-toolbox-*. + typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}' + # Custom icon. + # typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='%fin ' + ###############################[ public_ip: public IP address ]############################### # Public IP color. typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=94 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index a580f300..0c90ff98 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -76,6 +76,7 @@ azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) gcloud # google cloud cli account and project (https://cloud.google.com/) google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) + toolbox # toolbox name (https://github.com/containers/toolbox) context # user@hostname nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) @@ -1527,6 +1528,17 @@ # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' + ##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]############### + # Toolbox color. + typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=0 + typeset -g POWERLEVEL9K_TOOLBOX_BACKGROUND=3 + # Don't display the name of the toolbox if it matches fedora-toolbox-*. + typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}' + # Custom icon. + # typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='in ' + ###############################[ public_ip: public IP address ]############################### # Public IP color. typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=7 diff --git a/internal/icons.zsh b/internal/icons.zsh index bf5a1a11..dfbe0a00 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -145,6 +145,7 @@ function _p9k_init_icons() { PACKAGE_ICON 'pkg' JULIA_ICON 'jl' SCALA_ICON 'scala' + TOOLBOX_ICON '\u2B22' # ⬢ ) ;; 'awesome-fontconfig') @@ -274,6 +275,7 @@ function _p9k_init_icons() { PACKAGE_ICON 'pkg' JULIA_ICON 'jl' SCALA_ICON 'scala' + TOOLBOX_ICON '\u2B22' # ⬢ ) ;; 'awesome-mapped-fontconfig') @@ -406,6 +408,7 @@ function _p9k_init_icons() { PACKAGE_ICON 'pkg' JULIA_ICON 'jl' SCALA_ICON 'scala' + TOOLBOX_ICON '\u2B22' # ⬢ ) ;; 'nerdfont-complete'|'nerdfont-fontconfig') @@ -536,6 +539,7 @@ function _p9k_init_icons() { PACKAGE_ICON '\uF8D6' #  JULIA_ICON '\uE624' #  SCALA_ICON '\uE737' #  + TOOLBOX_ICON '\uE20F'$s #  ) ;; ascii) @@ -663,6 +667,7 @@ function _p9k_init_icons() { PACKAGE_ICON 'pkg' JULIA_ICON 'jl' SCALA_ICON 'scala' + TOOLBOX_ICON 'toolbox' ) ;; *) @@ -792,6 +797,7 @@ function _p9k_init_icons() { PACKAGE_ICON 'pkg' JULIA_ICON 'jl' SCALA_ICON 'scala' + TOOLBOX_ICON '\u2B22' # ⬢ ) ;; esac diff --git a/internal/p10k.zsh b/internal/p10k.zsh index c50292f2..98090d99 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1651,6 +1651,20 @@ prompt_host() { instant_prompt_host() { prompt_host; } +################################################################ +# Toolbox: https://github.com/containers/toolbox +function prompt_toolbox() { + _p9k_prompt_segment $0 $_p9k_color1 yellow TOOLBOX_ICON 0 '' $P9K_TOOLBOX_NAME +} + +_p9k_prompt_toolbox_init() { + typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$P9K_TOOLBOX_NAME' +} + +function instant_prompt_toolbox() { + _p9k_prompt_segment prompt_toolbox $_p9k_color1 yellow TOOLBOX_ICON 1 '$P9K_TOOLBOX_NAME' '$P9K_TOOLBOX_NAME' +} + ################################################################ # The 'custom` prompt provides a way for users to invoke commands and display # the output in a segment. @@ -5906,7 +5920,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=42 +typeset -gri __p9k_instant_prompt_version=43 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -6117,6 +6131,9 @@ _p9k_dump_instant_prompt() { unfunction p10k-on-post-widget' fi >&$fd print -r -- ' + () { +'$functions[_p9k_init_toolbox]' + } trap "unset -m _p9k__\*; unfunction p10k" EXIT local -a _p9k_t=("${(@ps:$us:)${tail%%$rs*}}") if [[ $+VTE_VERSION == 1 || $TERM_PROGRAM == Hyper ]] && (( $+commands[stty] )); then @@ -8123,6 +8140,17 @@ _p9k_init_ssh() { [[ $w =~ "\(?($ipv4|$ipv6|$hostname)\)?\$" ]] && P9K_SSH=1 } +_p9k_init_toolbox() { + [[ -z $P9K_TOOLBOX_NAME && + -e /run/.toolboxenv && + -f /run/.containerenv && + -r /run/.containerenv ]] || return 0 + local name=(${(Q)${${(@M)${(f)"$( Date: Sun, 12 Sep 2021 10:40:43 +0200 Subject: [PATCH 085/380] Squashed 'gitstatus/' changes from edd92f621..cd98a3c28 cd98a3c28 rebuild gitstatusd-freebsd-amd64 on freebsd 13 b03580cb0 rebuild gitstatusd-freebsd-amd64 (now with proper version) 3c95a47dc update version to v1.5.3 e3a3cd122 rebuild gitstatusd-freebsd-amd64 with clang (#262) 6aed2ae95 compile with clang on freebsd by default (#262) git-subtree-dir: gitstatus git-subtree-split: cd98a3c2849600982aa1b7d03f66784710106291 --- build | 20 ++++++++++++++------ build.info | 2 +- install.info | 4 ++-- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/build b/build index 036a12ad..d23f8fc1 100755 --- a/build +++ b/build @@ -88,7 +88,7 @@ if [ -n "$gitstatus_install_tools" ]; then fi ;; freebsd) - command pkg install -y cmake gmake binutils gcc git perl5 + command pkg install -y cmake gmake binutils git perl5 wget ;; openbsd) command pkg_add install cmake gmake gcc git wget @@ -140,8 +140,15 @@ cflags="$archflag=$gitstatus_cpu -fno-plt -D_FORTIFY_SOURCE=2 -Wformat -Werror=f ldflags= static_pie= +if [ -z "${CC-}" ]; then + case "$gitstatus_kernel" in + freebsd) export CC=clang;; + *) export CC=cc;; + esac +fi + printf 'int main() {}\n' >"$workdir"/cc-test.c -if 2>/dev/null "${CC:-cc}" \ +if 2>/dev/null "$CC" \ -ffile-prefix-map=x=y \ -Werror \ -c "$workdir"/cc-test.c \ @@ -150,7 +157,7 @@ if 2>/dev/null "${CC:-cc}" \ fi command rm -f -- "$workdir"/cc-test "$workdir"/cc-test.o -if 2>/dev/null "${CC:-cc}" \ +if 2>/dev/null "$CC" \ -fstack-clash-protection -fcf-protection \ -Werror \ -c "$workdir"/cc-test.c \ @@ -159,7 +166,7 @@ if 2>/dev/null "${CC:-cc}" \ fi command rm -f -- "$workdir"/cc-test "$workdir"/cc-test.o -if 2>/dev/null "${CC:-cc}" \ +if 2>/dev/null "$CC" \ -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now \ -Werror \ "$workdir"/cc-test.c \ @@ -168,7 +175,7 @@ if 2>/dev/null "${CC:-cc}" \ fi command rm -f -- "$workdir"/cc-test "$workdir"/cc-test.o -if 2>/dev/null "${CC:-cc}" \ +if 2>/dev/null "$CC" \ -fpie -static-pie \ -Werror \ "$workdir"/cc-test.c \ @@ -195,6 +202,7 @@ case "$gitstatus_kernel" in libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" ;; freebsd) + gitstatus_cxx=clang++ gitstatus_make=gmake gitstatus_ldflags="$gitstatus_ldflags ${static_pie:--static}" libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" @@ -241,7 +249,7 @@ case "$gitstatus_kernel" in ;; esac -for cmd in cat cmake gcc g++ git ld ln mkdir rm strip tar "$gitstatus_make"; do +for cmd in cat cmake git ld ln mkdir rm strip tar "$gitstatus_make"; do if ! command -v "$cmd" >/dev/null 2>&1; then if [ -n "$gitstatus_install_tools" ]; then >&2 echo "[internal error] $cmd not found" diff --git a/build.info b/build.info index fa6f6340..6defef24 100644 --- a/build.info +++ b/build.info @@ -3,7 +3,7 @@ # # This value is also read by shell bindings (indirectly, through # ./install) when using GITSTATUS_DAEMON or usrbin/gitstatusd. -gitstatus_version="v1.5.1" +gitstatus_version="v1.5.3" # libgit2 is a build time dependency of gitstatusd. The values of # libgit2_version and libgit2_sha256 are read by ./build. diff --git a/install.info b/install.info index 7ed4b15f..dab50b9b 100644 --- a/install.info +++ b/install.info @@ -1,4 +1,4 @@ -# 1 +# 2 # # This file is used by ./install and indirectly by shell bindings. # @@ -12,7 +12,7 @@ uname_s_glob="cygwin_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_ uname_s_glob="cygwin_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="c84cade0d6b86e04c27a6055f45851f6b46d6b88ba58772f7ca8ef4d295c800f"; uname_s_glob="darwin"; uname_m_glob="arm64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="ad973948cca4bdcf83b7fcdda70c489a404488ea7304712721f1100b73ec7cbe"; uname_s_glob="darwin"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="b13455d56cf7b6f07efb7da088057bbc1212847c88b59493918d6f9c0c157160"; -uname_s_glob="freebsd"; uname_m_glob="amd64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="b738c0967ba7a851bd758cd9fd836cddeec9fb4246afddc66ab4fed40c03e426"; +uname_s_glob="freebsd"; uname_m_glob="amd64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.3"; sha256="73b5622ec9737e93f3fafe117b47ce8de33037be3e2bff283f36668f5852668a"; uname_s_glob="linux"; uname_m_glob="aarch64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="89b87181b2005527a558cdbc32b12b0f15a1a12bb69865ec216ca5a0266a6c4f"; uname_s_glob="linux"; uname_m_glob="armv6l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="4bf5a0d0a082f544a48536ad3675930d5d2cc6a8cf906710045e0788f51192b3"; uname_s_glob="linux"; uname_m_glob="armv7l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="2b9deb29f86c8209114b71b94fc2e1ed936a1658808a1bee46f4a82fd6a1f8cc"; From 0745592886e778b50c299ff8a267529848b29407 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 13 Sep 2021 09:05:43 +0200 Subject: [PATCH 086/380] fix a spello in comments in the generated .p10k.zsh --- internal/wizard.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index c4c7a87c..7e91a1c7 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1057,7 +1057,7 @@ function ask_use_rprompt() { case $choice in r) return 1;; 1) ;; - 2) pure_use_rprompt=; options+=rpromt;; + 2) pure_use_rprompt=; options+=rprompt;; esac return 0 } From 543e2d59cf107af4e96727aa70d9f1ca93149f14 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 13 Sep 2021 10:31:34 +0200 Subject: [PATCH 087/380] change formatting in the font installation instructions to make it more obvious where each step begins and ends --- README.md | 185 +++++++++++++++++++++++++++--------------------------- font.md | 174 ++++++++++++++++++++++++++------------------------ 2 files changed, 184 insertions(+), 175 deletions(-) diff --git a/README.md b/README.md index 0c2ef357..ce34728b 100644 --- a/README.md +++ b/README.md @@ -520,100 +520,97 @@ If you are using a different terminal, proceed with manual font installation. #### Manual font installation -Download these four ttf files: - -- [MesloLGS NF Regular.ttf]( - https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf) -- [MesloLGS NF Bold.ttf]( - https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf) -- [MesloLGS NF Italic.ttf]( - https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf) -- [MesloLGS NF Bold Italic.ttf]( - https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf) - -Double-click on each file and click "Install". This will make `MesloLGS NF` font available to all -applications on your system. Configure your terminal to use this font: - -- **iTerm2**: Type `p10k configure` and answer `Yes` when asked whether to install - *Meslo Nerd Font*. Alternatively, open *iTerm2 → Preferences → Profiles → Text* and set *Font* to - `MesloLGS NF`. -- **Apple Terminal**: Open *Terminal → Preferences → Profiles → Text*, click *Change* under *Font* - and select `MesloLGS NF` family. -- **Hyper**: Open *Hyper → Edit → Preferences* and change the value of `fontFamily` under - `module.exports.config` to `MesloLGS NF`. -- **Visual Studio Code**: Open *File → Preferences → Settings* (PC) or - *Code → Preferences → Settings* (Mac), enter `terminal.integrated.fontFamily` in the search box at - the top of *Settings* tab and set the value below to `MesloLGS NF`. - Consult [this screenshot]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/389133fb8c9a2347929a23702ce3039aacc46c3d/visual-studio-code-font-settings.jpg) - to see how it should look like or see [this issue]( - https://github.com/romkatv/powerlevel10k/issues/671) for extra information. -- **GNOME Terminal** (the default Ubuntu terminal): Open *Terminal → Preferences* and click on the - selected profile under *Profiles*. Check *Custom font* under *Text Appearance* and select - `MesloLGS NF Regular`. -- **Konsole**: Open *Settings → Edit Current Profile → Appearance*, click *Select Font* and select - `MesloLGS NF Regular`. -- **Tilix**: Open *Tilix → Preferences* and click on the selected profile under *Profiles*. Check - *Custom font* under *Text Appearance* and select `MesloLGS NF Regular`. -- **Windows Console Host** (the old thing): Click the icon in the top left corner, then - *Properties → Font* and set *Font* to `MesloLGS NF`. -- **Windows Terminal** by Microsoft (the new thing): Open `settings.json` (Ctrl+Shift+,), - search for `fontFace` and set the value to `MesloLGS NF` for every profile. If you don't find - `fontFace`, add it under *profiles → defaults*. See [this settings file]( - https://raw.githubusercontent.com/romkatv/dotfiles-public/aba0e6c4657d705ed6c344d700d659977385f25c/dotfiles/microsoft-terminal-settings.json) - for example. -- **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor → - Color Scheme → Console Font*. Select *Use console font instead of the default* and set the font - name to `MesloLGS NF`. -- **Termux**: Type `p10k configure` and answer `Yes` when asked whether to install - *Meslo Nerd Font*. -- **Blink**: Type `config`, go to *Appearance*, tap *Add a new font*, tap *Open Gallery*, select - *MesloLGS NF.css*, tap *import* and type `exit` in the home view to reload the font. -- **Terminus**: Open *Settings → Appearance* and set *Font* to `MesloLGS NF`. -- **Terminator**: Open *Preferences* using the context menu. Under *Profiles* select the *General* - tab (should be selected already), uncheck *Use the system fixed width font* (if not already) - and select `MesloLGS NF Regular`. Exit the Preferences dialog by clicking *Close*. -- **Guake**: Right Click on an open terminal and open *Preferences*. Under *Appearance* - tab, uncheck *Use the system fixed width font* (if not already) and select `MesloLGS NF Regular`. - Exit the Preferences dialog by clicking *Close*. -- **MobaXterm**: Open *Settings* → *Configuration* → *Terminal* → (under *Terminal look and feel*) - and change *Font* to `MesloLGS NF`. -- **Asbrú Connection Manager**: Open *Preferences → Local Shell Options → Look and Feel*, enable - *Use these personal options* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`. - To change the font for the remote host connections, go to *Preferences → Terminal Options → - Look and Feel* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`. -- **WSLtty**: Right click on an open terminal and then on *Options*. In the *Text* section, under - *Font*, click *"Select..."* and set Font to `MesloLGS NF Regular`. -- **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and add the following section - to it: - ```yaml - font: - normal: - family: "MesloLGS NF" - ``` - - **Kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following line to it: - ```text - font_family MesloLGS NF - ``` - Restart Kitty by closing all sessions and opening a new session. -- **WezTerm**: Create or open `$HOME/.config/wezterm/wezterm.lua` and add the following: - ```lua - local wezterm = require 'wezterm'; - return { - font = wezterm.font("MesloLGS NF"), - } - ``` - If the file already exists, only add the line with the font to the existing return. - Also add the first line if it is not already present. -- **urxvt**: Create or open `~/.Xresources` and add the following line to it: - ```text - URxvt.font: xft:MesloLGS NF:size=11 - ``` - You can adjust the font size to your preference. After changing the configuration use `xrdb ~/.Xresources` to reload the config. - The new config is applied for all new terminals. - -**IMPORTANT:** Run `p10k configure` after changing terminal font. The old `~/.p10k.zsh` may work -incorrectly with the new font. +1. Download these four ttf files: + - [MesloLGS NF Regular.ttf]( + https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf) + - [MesloLGS NF Bold.ttf]( + https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf) + - [MesloLGS NF Italic.ttf]( + https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf) + - [MesloLGS NF Bold Italic.ttf]( + https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf) +1. Double-click on each file and click "Install". This will make `MesloLGS NF` font available to all + applications on your system. +1. Configure your terminal to use this font: + - **iTerm2**: Type `p10k configure` and answer `Yes` when asked whether to install + *Meslo Nerd Font*. Alternatively, open *iTerm2 → Preferences → Profiles → Text* and set *Font* to + `MesloLGS NF`. + - **Apple Terminal**: Open *Terminal → Preferences → Profiles → Text*, click *Change* under *Font* + and select `MesloLGS NF` family. + - **Hyper**: Open *Hyper → Edit → Preferences* and change the value of `fontFamily` under + `module.exports.config` to `MesloLGS NF`. + - **Visual Studio Code**: Open *File → Preferences → Settings* (PC) or + *Code → Preferences → Settings* (Mac), enter `terminal.integrated.fontFamily` in the search box at + the top of *Settings* tab and set the value below to `MesloLGS NF`. + Consult [this screenshot]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/389133fb8c9a2347929a23702ce3039aacc46c3d/visual-studio-code-font-settings.jpg) + to see how it should look like or see [this issue]( + https://github.com/romkatv/powerlevel10k/issues/671) for extra information. + - **GNOME Terminal** (the default Ubuntu terminal): Open *Terminal → Preferences* and click on the + selected profile under *Profiles*. Check *Custom font* under *Text Appearance* and select + `MesloLGS NF Regular`. + - **Konsole**: Open *Settings → Edit Current Profile → Appearance*, click *Select Font* and select + `MesloLGS NF Regular`. + - **Tilix**: Open *Tilix → Preferences* and click on the selected profile under *Profiles*. Check + *Custom font* under *Text Appearance* and select `MesloLGS NF Regular`. + - **Windows Console Host** (the old thing): Click the icon in the top left corner, then + *Properties → Font* and set *Font* to `MesloLGS NF`. + - **Windows Terminal** by Microsoft (the new thing): Open `settings.json` (Ctrl+Shift+,), + search for `fontFace` and set the value to `MesloLGS NF` for every profile. If you don't find + `fontFace`, add it under *profiles → defaults*. See [this settings file]( + https://raw.githubusercontent.com/romkatv/dotfiles-public/aba0e6c4657d705ed6c344d700d659977385f25c/dotfiles/microsoft-terminal-settings.json) + for example. + - **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor → + Color Scheme → Console Font*. Select *Use console font instead of the default* and set the font + name to `MesloLGS NF`. + - **Termux**: Type `p10k configure` and answer `Yes` when asked whether to install + *Meslo Nerd Font*. + - **Blink**: Type `config`, go to *Appearance*, tap *Add a new font*, tap *Open Gallery*, select + *MesloLGS NF.css*, tap *import* and type `exit` in the home view to reload the font. + - **Terminus**: Open *Settings → Appearance* and set *Font* to `MesloLGS NF`. + - **Terminator**: Open *Preferences* using the context menu. Under *Profiles* select the *General* + tab (should be selected already), uncheck *Use the system fixed width font* (if not already) + and select `MesloLGS NF Regular`. Exit the Preferences dialog by clicking *Close*. + - **Guake**: Right Click on an open terminal and open *Preferences*. Under *Appearance* + tab, uncheck *Use the system fixed width font* (if not already) and select `MesloLGS NF Regular`. + Exit the Preferences dialog by clicking *Close*. + - **MobaXterm**: Open *Settings* → *Configuration* → *Terminal* → (under *Terminal look and feel*) + and change *Font* to `MesloLGS NF`. + - **Asbrú Connection Manager**: Open *Preferences → Local Shell Options → Look and Feel*, enable + *Use these personal options* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`. + To change the font for the remote host connections, go to *Preferences → Terminal Options → + Look and Feel* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`. + - **WSLtty**: Right click on an open terminal and then on *Options*. In the *Text* section, under + *Font*, click *"Select..."* and set Font to `MesloLGS NF Regular`. + - **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and add the following section + to it: + ```yaml + font: + normal: + family: "MesloLGS NF" + ``` + - **Kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following line to it: + ```text + font_family MesloLGS NF + ``` + Restart Kitty by closing all sessions and opening a new session. + - **WezTerm**: Create or open `$HOME/.config/wezterm/wezterm.lua` and add the following: + ```lua + local wezterm = require 'wezterm'; + return { + font = wezterm.font("MesloLGS NF"), + } + ``` + If the file already exists, only add the line with the font to the existing return. + Also add the first line if it is not already present. + - **urxvt**: Create or open `~/.Xresources` and add the following line to it: + ```text + URxvt.font: xft:MesloLGS NF:size=11 + ``` + You can adjust the font size to your preference. After changing the configuration use `xrdb ~/.Xresources` to reload the config. + The new config is applied for all new terminals. +1. Run `p10k configure` to generate a new `~/.p10k.zsh`. The old config may work + incorrectly with the new font. _Using a different terminal and know how to set the font for it? Share your knowledge by sending a PR to expand the list!_ diff --git a/font.md b/font.md index 5c8042de..57ece772 100644 --- a/font.md +++ b/font.md @@ -8,94 +8,106 @@ systems. *FAQ*: [How was the recommended font created?](README.md#how-was-the-recommended-font-created) -#### Automatic font installation +## Automatic font installation If you are using iTerm2 or Termux, `p10k configure` can install the recommended font for you. Simply answer `Yes` when asked whether to install *Meslo Nerd Font*. If you are using a different terminal, proceed with manual font installation. 👇 -#### Manual font installation +## Manual font installation -Download these four ttf files: - -- [MesloLGS NF Regular.ttf]( - https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf) -- [MesloLGS NF Bold.ttf]( - https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf) -- [MesloLGS NF Italic.ttf]( - https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf) -- [MesloLGS NF Bold Italic.ttf]( - https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf) - -Double-click on each file and click "Install". This will make `MesloLGS NF` font available to all -applications on your system. Configure your terminal to use this font: - -- **iTerm2**: Type `p10k configure` and answer `Yes` when asked whether to install - *Meslo Nerd Font*. Alternatively, open *iTerm2 → Preferences → Profiles → Text* and set *Font* to - `MesloLGS NF`. -- **Apple Terminal**: Open *Terminal → Preferences → Profiles → Text*, click *Change* under *Font* - and select `MesloLGS NF` family. -- **Hyper**: Open *Hyper → Edit → Preferences* and change the value of `fontFamily` under - `module.exports.config` to `MesloLGS NF`. -- **Visual Studio Code**: Open *File → Preferences → Settings* (PC) or - *Code → Preferences → Settings* (Mac), enter `terminal.integrated.fontFamily` in the search box at - the top of *Settings* tab and set the value below to `MesloLGS NF`. - Consult [this screenshot]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/389133fb8c9a2347929a23702ce3039aacc46c3d/visual-studio-code-font-settings.jpg) - to see how it should look like or see [this issue]( - https://github.com/romkatv/powerlevel10k/issues/671) for extra information. -- **GNOME Terminal** (the default Ubuntu terminal): Open *Terminal → Preferences* and click on the - selected profile under *Profiles*. Check *Custom font* under *Text Appearance* and select - `MesloLGS NF Regular`. -- **Konsole**: Open *Settings → Edit Current Profile → Appearance*, click *Select Font* and select - `MesloLGS NF Regular`. -- **Tilix**: Open *Tilix → Preferences* and click on the selected profile under *Profiles*. Check - *Custom font* under *Text Appearance* and select `MesloLGS NF Regular`. -- **Windows Console Host** (the old thing): Click the icon in the top left corner, then - *Properties → Font* and set *Font* to `MesloLGS NF`. -- **Windows Terminal** by Microsoft (the new thing): Open `settings.json` (Ctrl+Shift+,), - search for `fontFace` and set the value to `MesloLGS NF` for every profile. If you don't find - `fontFace`, add it under *profiles → defaults*. See [this settings file]( - https://raw.githubusercontent.com/romkatv/dotfiles-public/aba0e6c4657d705ed6c344d700d659977385f25c/dotfiles/microsoft-terminal-settings.json) - for example. -- **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor → - Color Scheme → Console Font*. Select *Use console font instead of the default* and set the font - name to `MesloLGS NF`. -- **Termux**: Type `p10k configure` and answer `Yes` when asked whether to install - *Meslo Nerd Font*. -- **Blink**: Type `config`, go to *Appearance*, tap *Add a new font*, tap *Open Gallery*, select - *MesloLGS NF.css*, tap *import* and type `exit` in the home view to reload the font. -- **Terminus**: Open *Settings → Appearance* and set *Font* to `MesloLGS NF`. -- **Terminator**: Open *Preferences* using the context menu. Under *Profiles* select the *General* - tab (should be selected already), uncheck *Use the system fixed width font* (if not already) - and select `MesloLGS NF Regular`. Exit the Preferences dialog by clicking *Close*. -- **Guake**: Right Click on an open terminal and open *Preferences*. Under *Appearance* - tab, uncheck *Use the system fixed width font* (if not already) and select `MesloLGS NF Regular`. - Exit the Preferences dialog by clicking *Close*. -- **MobaXterm**: Open *Settings* → *Configuration* → *Terminal* → (under *Terminal look and feel*) - and change *Font* to `MesloLGS NF`. -- **Asbrú Connection Manager**: Open *Preferences → Local Shell Options → Look and Feel*, enable - *Use these personal options* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`. - To change the font for the remote host connections, go to *Preferences → Terminal Options → - Look and Feel* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`. -- **WSLtty**: Right click on an open terminal and then on *Options*. In the *Text* section, under - *Font*, click *"Select..."* and set Font to `MesloLGS NF Regular`. -- **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and add the following section - to it: - ```yaml - font: - normal: - family: "MesloLGS NF" - ``` - - **Kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following line to it: - ```text - font_family MesloLGS NF - ``` - Restart Kitty by closing all sessions and opening a new session. - -**IMPORTANT:** Run `p10k configure` after changing terminal font. The old `~/.p10k.zsh` may work -incorrectly with the new font. +1. Download these four ttf files: + - [MesloLGS NF Regular.ttf]( + https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf) + - [MesloLGS NF Bold.ttf]( + https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf) + - [MesloLGS NF Italic.ttf]( + https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf) + - [MesloLGS NF Bold Italic.ttf]( + https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf) +1. Double-click on each file and click "Install". This will make `MesloLGS NF` font available to all + applications on your system. +1. Configure your terminal to use this font: + - **iTerm2**: Type `p10k configure` and answer `Yes` when asked whether to install + *Meslo Nerd Font*. Alternatively, open *iTerm2 → Preferences → Profiles → Text* and set *Font* to + `MesloLGS NF`. + - **Apple Terminal**: Open *Terminal → Preferences → Profiles → Text*, click *Change* under *Font* + and select `MesloLGS NF` family. + - **Hyper**: Open *Hyper → Edit → Preferences* and change the value of `fontFamily` under + `module.exports.config` to `MesloLGS NF`. + - **Visual Studio Code**: Open *File → Preferences → Settings* (PC) or + *Code → Preferences → Settings* (Mac), enter `terminal.integrated.fontFamily` in the search box at + the top of *Settings* tab and set the value below to `MesloLGS NF`. + Consult [this screenshot]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/389133fb8c9a2347929a23702ce3039aacc46c3d/visual-studio-code-font-settings.jpg) + to see how it should look like or see [this issue]( + https://github.com/romkatv/powerlevel10k/issues/671) for extra information. + - **GNOME Terminal** (the default Ubuntu terminal): Open *Terminal → Preferences* and click on the + selected profile under *Profiles*. Check *Custom font* under *Text Appearance* and select + `MesloLGS NF Regular`. + - **Konsole**: Open *Settings → Edit Current Profile → Appearance*, click *Select Font* and select + `MesloLGS NF Regular`. + - **Tilix**: Open *Tilix → Preferences* and click on the selected profile under *Profiles*. Check + *Custom font* under *Text Appearance* and select `MesloLGS NF Regular`. + - **Windows Console Host** (the old thing): Click the icon in the top left corner, then + *Properties → Font* and set *Font* to `MesloLGS NF`. + - **Windows Terminal** by Microsoft (the new thing): Open `settings.json` (Ctrl+Shift+,), + search for `fontFace` and set the value to `MesloLGS NF` for every profile. If you don't find + `fontFace`, add it under *profiles → defaults*. See [this settings file]( + https://raw.githubusercontent.com/romkatv/dotfiles-public/aba0e6c4657d705ed6c344d700d659977385f25c/dotfiles/microsoft-terminal-settings.json) + for example. + - **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor → + Color Scheme → Console Font*. Select *Use console font instead of the default* and set the font + name to `MesloLGS NF`. + - **Termux**: Type `p10k configure` and answer `Yes` when asked whether to install + *Meslo Nerd Font*. + - **Blink**: Type `config`, go to *Appearance*, tap *Add a new font*, tap *Open Gallery*, select + *MesloLGS NF.css*, tap *import* and type `exit` in the home view to reload the font. + - **Terminus**: Open *Settings → Appearance* and set *Font* to `MesloLGS NF`. + - **Terminator**: Open *Preferences* using the context menu. Under *Profiles* select the *General* + tab (should be selected already), uncheck *Use the system fixed width font* (if not already) + and select `MesloLGS NF Regular`. Exit the Preferences dialog by clicking *Close*. + - **Guake**: Right Click on an open terminal and open *Preferences*. Under *Appearance* + tab, uncheck *Use the system fixed width font* (if not already) and select `MesloLGS NF Regular`. + Exit the Preferences dialog by clicking *Close*. + - **MobaXterm**: Open *Settings* → *Configuration* → *Terminal* → (under *Terminal look and feel*) + and change *Font* to `MesloLGS NF`. + - **Asbrú Connection Manager**: Open *Preferences → Local Shell Options → Look and Feel*, enable + *Use these personal options* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`. + To change the font for the remote host connections, go to *Preferences → Terminal Options → + Look and Feel* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`. + - **WSLtty**: Right click on an open terminal and then on *Options*. In the *Text* section, under + *Font*, click *"Select..."* and set Font to `MesloLGS NF Regular`. + - **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and add the following section + to it: + ```yaml + font: + normal: + family: "MesloLGS NF" + ``` + - **Kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following line to it: + ```text + font_family MesloLGS NF + ``` + Restart Kitty by closing all sessions and opening a new session. + - **WezTerm**: Create or open `$HOME/.config/wezterm/wezterm.lua` and add the following: + ```lua + local wezterm = require 'wezterm'; + return { + font = wezterm.font("MesloLGS NF"), + } + ``` + If the file already exists, only add the line with the font to the existing return. + Also add the first line if it is not already present. + - **urxvt**: Create or open `~/.Xresources` and add the following line to it: + ```text + URxvt.font: xft:MesloLGS NF:size=11 + ``` + You can adjust the font size to your preference. After changing the configuration use `xrdb ~/.Xresources` to reload the config. + The new config is applied for all new terminals. +1. Run `p10k configure` to generate a new `~/.p10k.zsh`. The old config may work + incorrectly with the new font. _Using a different terminal and know how to set the font for it? Share your knowledge by sending a PR to expand the list!_ From 0122a63834183f32568942338454a83830e21d0b Mon Sep 17 00:00:00 2001 From: Isaac Lebwohl-Steiner Date: Mon, 13 Sep 2021 18:25:55 -0700 Subject: [PATCH 088/380] Add instructions to manually set font on Yakuake --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ce34728b..f00be12a 100644 --- a/README.md +++ b/README.md @@ -582,6 +582,7 @@ If you are using a different terminal, proceed with manual font installation. Look and Feel* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`. - **WSLtty**: Right click on an open terminal and then on *Options*. In the *Text* section, under *Font*, click *"Select..."* and set Font to `MesloLGS NF Regular`. + - **Yakuake**: Go to ≡ → *Manage Profiles*. Create a new profile. Click on *Appearance*. Click *Choose* next to the *Font* dropdown. Select `MesloLGS NF` and click *OK*. Click *Ok* or *Apply* to save. Optionally, select the new profile and click *Set as Default* and then *OK*. - **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and add the following section to it: ```yaml From 7a72acf5635cfc09aa544bfb70e13ad46faa432b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 14 Sep 2021 10:18:27 +0200 Subject: [PATCH 089/380] clean up font instructions for yakuake --- README.md | 4 +++- font.md | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f00be12a..f4fc114a 100644 --- a/README.md +++ b/README.md @@ -582,7 +582,9 @@ If you are using a different terminal, proceed with manual font installation. Look and Feel* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`. - **WSLtty**: Right click on an open terminal and then on *Options*. In the *Text* section, under *Font*, click *"Select..."* and set Font to `MesloLGS NF Regular`. - - **Yakuake**: Go to ≡ → *Manage Profiles*. Create a new profile. Click on *Appearance*. Click *Choose* next to the *Font* dropdown. Select `MesloLGS NF` and click *OK*. Click *Ok* or *Apply* to save. Optionally, select the new profile and click *Set as Default* and then *OK*. + - **Yakuake**: Click *≡* → *Manage Profiles* → *New* → *Appearance*. Click *Choose* next to the + *Font* dropdown, select `MesloLGS NF` and click *OK*. Click *OK* to save the profile. Select the + new profile and click *Set as Default*. - **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and add the following section to it: ```yaml diff --git a/font.md b/font.md index 57ece772..20a1bb99 100644 --- a/font.md +++ b/font.md @@ -79,6 +79,9 @@ If you are using a different terminal, proceed with manual font installation. Look and Feel* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`. - **WSLtty**: Right click on an open terminal and then on *Options*. In the *Text* section, under *Font*, click *"Select..."* and set Font to `MesloLGS NF Regular`. + - **Yakuake**: Click *≡* → *Manage Profiles* → *New* → *Appearance*. Click *Choose* next to the + *Font* dropdown, select `MesloLGS NF` and click *OK*. Click *OK* to save the profile. Select the + new profile and click *Set as Default*. - **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and add the following section to it: ```yaml From 0ce9df66d2cffb860a7c48a8d4f3639cf581f908 Mon Sep 17 00:00:00 2001 From: Charles Timko Date: Wed, 22 Sep 2021 13:49:39 -0400 Subject: [PATCH 090/380] Add RHEL to the OS Icon lists (#1581) * Add RHEL to the OS Icon lists --- internal/icons.zsh | 6 ++++++ internal/p10k.zsh | 1 + internal/wizard.zsh | 1 + 3 files changed, 8 insertions(+) diff --git a/internal/icons.zsh b/internal/icons.zsh index dfbe0a00..60de3444 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -69,6 +69,7 @@ function _p9k_init_icons() { LINUX_SLACKWARE_ICON '\uE271'$s #  LINUX_VOID_ICON '\uE271'$s #  LINUX_ARTIX_ICON '\uE271'$s #  + LINUX_RHEL_ICON '\uE271'$s #  SUNOS_ICON '\U1F31E'$q # 🌞 HOME_ICON '\uE12C'$s #  HOME_SUB_ICON '\uE18D'$s #  @@ -203,6 +204,7 @@ function _p9k_init_icons() { LINUX_SLACKWARE_ICON '\uF17C'$s #  LINUX_VOID_ICON '\uF17C'$s #  LINUX_ARTIX_ICON '\uF17C'$s #  + LINUX_RHEL_ICON '\uF17C'$s #  SUNOS_ICON '\uF185 ' #  HOME_ICON '\uF015'$s #  HOME_SUB_ICON '\uF07C'$s #  @@ -338,6 +340,7 @@ function _p9k_init_icons() { LINUX_SLACKWARE_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" LINUX_VOID_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" LINUX_ARTIX_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" + LINUX_RHEL_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" SUNOS_ICON "${CODEPOINT_OF_AWESOME_SUN_O:+\\u$CODEPOINT_OF_AWESOME_SUN_O }" HOME_ICON "${CODEPOINT_OF_AWESOME_HOME:+\\u$CODEPOINT_OF_AWESOME_HOME$s}" HOME_SUB_ICON "${CODEPOINT_OF_AWESOME_FOLDER_OPEN:+\\u$CODEPOINT_OF_AWESOME_FOLDER_OPEN$s}" @@ -466,6 +469,7 @@ function _p9k_init_icons() { LINUX_VOID_ICON '\uF17C' #  LINUX_ARTIX_ICON '\uF17C' #  LINUX_UBUNTU_ICON '\uF31b'$s #  + LINUX_RHEL_ICON '\uF316'$s #  LINUX_ICON '\uF17C' #  SUNOS_ICON '\uF185 ' #  HOME_ICON '\uF015'$s #  @@ -595,6 +599,7 @@ function _p9k_init_icons() { LINUX_SLACKWARE_ICON 'slack' LINUX_VOID_ICON 'void' LINUX_ARTIX_ICON 'artix' + LINUX_RHEL_ICON 'rhel' SUNOS_ICON 'sunos' HOME_ICON '' HOME_SUB_ICON '' @@ -725,6 +730,7 @@ function _p9k_init_icons() { LINUX_SLACKWARE_ICON 'Sla' LINUX_VOID_ICON 'Vo' LINUX_ARTIX_ICON 'Art' + LINUX_RHEL_ICON 'RH' SUNOS_ICON 'Sun' HOME_ICON '' HOME_SUB_ICON '' diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 98090d99..6928b8fc 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8286,6 +8286,7 @@ function _p9k_init_cacheable() { *manjaro*) _p9k_set_os Linux LINUX_MANJARO_ICON;; *void*) _p9k_set_os Linux LINUX_VOID_ICON;; *artix*) _p9k_set_os Linux LINUX_ARTIX_ICON;; + *rhel*) _p9k_set_os Linux LINUX_RHEL_ICON;; *) _p9k_set_os Linux LINUX_ICON;; esac ;; diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 7e91a1c7..9dbfe81d 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1103,6 +1103,7 @@ function os_icon_name() { *manjaro*) echo LINUX_MANJARO_ICON;; *void*) echo LINUX_VOID_ICON;; *artix*) echo LINUX_ARTIX_ICON;; + *rhel*) echo LINUX_RHEL_ICON;; *) echo LINUX_ICON;; esac ;; From ed45177e19bbfc4ffe65cc36bdf25e41cb7cf35b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 6 Oct 2021 12:51:07 +0200 Subject: [PATCH 091/380] fix nordvpn; it was broken by the latest upstream update (#1590) --- internal/p10k.zsh | 78 +++++++++++++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 29 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 6928b8fc..d9e08912 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4695,34 +4695,60 @@ typeset -gra __p9k_nordvpn_tag=( ) function _p9k_fetch_nordvpn_status() { - setopt err_return + setopt err_return no_multi_byte local REPLY - zsocket $1 - local -i fd=$REPLY + zsocket /run/nordvpn/nordvpnd.sock + local -i fd=REPLY { - >&$fd echo -nE - $'PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n\0\0\0\4\1\0\0\0\0\0\0N\1\4\0\0\0\1\203\206E\221bA\226\223\325\\k\337\31i=LnH\323j?A\223\266\243y\270\303\fYmLT{$\357]R.\203\223\257_\213\35u\320b\r&=LMedz\212\232\312\310\264\307`+\210K\203@\2te\206M\2035\5\261\37\0\0\5\0\1\0\0\0\1\0\0\0\0\0' - local tag len val - local -i n + print -nu $fd 'PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n\0\0\0\4\1\0\0\0\0\0\0;\1\4\0\0\0\1\203\206E\213b\270\327\2762\322z\230\326j\246A\206\240\344\35\23\235\t_\213\35u\320b\r&=LMedz\212\232\312\310\264\307`+\262\332\340@\2te\206M\2035\5\261\37\0\0\5\0\1\0\0\0\1\0\0\0\0\0\0\0\25\1\4\0\0\0\3\203\206E\215b\270\327\2762\322z\230\334\221\246\324\177\302\301\300\277\0\0\5\0\1\0\0\0\3\0\0\0\0\0' + local val + local -i len n wire tag { - IFS='' read -t 0.25 -r tag - tag=$'\n' + IFS='' read -t 0.25 -r val + val=$'\n' while true; do - tag=$((#tag)) + tag=$((#val)) + wire='tag & 7' (( (tag >>= 3) && tag <= $#__p9k_nordvpn_tag )) || break - tag=$__p9k_nordvpn_tag[tag] - [[ -t $fd ]] || true # https://www.zsh.org/mla/workers/2020/msg00207.html - sysread -s 1 -t 0.25 len - len=$((#len)) - val= - while true; do - (( len )) || break + if (( wire == 0 )); then + # varint + sysread -s 1 -t 0.25 val + n=$((#val)) + (( n < 128 )) || break # bail on multi-byte varints + if (( tag == 2 )); then + # P9K_NORDVPN_TECHNOLOGY + case $n in + 1) typeset -g P9K_NORDVPN_TECHNOLOGY=OPENVPN;; + 2) typeset -g P9K_NORDVPN_TECHNOLOGY=NORDLYNX;; + 3) typeset -g P9K_NORDVPN_TECHNOLOGY=SKYLARK;; + *) typeset -g P9K_NORDVPN_TECHNOLOGY=UNKNOWN;; + esac + elif (( tag == 3 )); then + # P9K_NORDVPN_PROTOCOL + case $n in + 1) typeset -g P9K_NORDVPN_PROTOCOL=UDP;; + 2) typeset -g P9K_NORDVPN_PROTOCOL=TCP;; + *) typeset -g P9K_NORDVPN_PROTOCOL=UNKNOWN;; + esac + else + break + fi + else + # length-delimited + (( wire == 2 )) || break + (( tag != 2 && tag != 3 )) || break [[ -t $fd ]] || true # https://www.zsh.org/mla/workers/2020/msg00207.html - sysread -c n -s $len -t 0.25 'val[$#val+1]' - len+=-n - done - typeset -g $tag=$val + sysread -s 1 -t 0.25 val + len=$((#val)) + val= + while (( $#val < len )); do + [[ -t $fd ]] || true # https://www.zsh.org/mla/workers/2020/msg00207.html + sysread -s $(( len - $#val )) -t 0.25 'val[$#val+1]' + done + typeset -g $__p9k_nordvpn_tag[tag]=$val + fi [[ -t $fd ]] || true # https://www.zsh.org/mla/workers/2020/msg00207.html - sysread -s 1 -t 0.25 tag + sysread -s 1 -t 0.25 val done } <&$fd } always { @@ -4773,14 +4799,8 @@ function _p9k_fetch_nordvpn_status() { # POWERLEVEL9K_NORDVPN_CONNECTING_BACKGROUND=cyan function prompt_nordvpn() { unset $__p9k_nordvpn_tag P9K_NORDVPN_COUNTRY_CODE - if [[ -e /run/nordvpn/nordvpnd.sock ]]; then - sock=/run/nordvpn/nordvpnd.sock - elif [[ -e /run/nordvpnd.sock ]]; then - sock=/run/nordvpnd.sock - else - return - fi - _p9k_fetch_nordvpn_status $sock 2>/dev/null + [[ -e /run/nordvpn/nordvpnd.sock ]] || return + _p9k_fetch_nordvpn_status 2>/dev/null || return if [[ $P9K_NORDVPN_SERVER == (#b)([[:alpha:]]##)[[:digit:]]##.nordvpn.com ]]; then typeset -g P9K_NORDVPN_COUNTRY_CODE=${${(U)match[1]}//İ/I} fi From 3e515a75d2d197da30a998fa8fd7737430958fba Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 6 Oct 2021 13:04:28 +0200 Subject: [PATCH 092/380] remove obsolete nordvpn comments --- internal/p10k.zsh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index d9e08912..8126b6d1 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4758,13 +4758,6 @@ function _p9k_fetch_nordvpn_status() { # Shows the state of NordVPN connection. Works only on Linux. Can be in the following 5 states. # -# MISSING: NordVPN is not installed or nordvpnd is not running. By default the segment is not -# shown in this state. To make it visible, override POWERLEVEL9K_NORDVPN_MISSING_CONTENT_EXPANSION -# and/or POWERLEVEL9K_NORDVPN_MISSING_VISUAL_IDENTIFIER_EXPANSION. -# -# # Display this icon when NordVPN is not installed or nordvpnd is not running -# POWERLEVEL9K_NORDVPN_MISSING_VISUAL_IDENTIFIER_EXPANSION='⭐' -# # CONNECTED: NordVPN is connected. By default shows NORDVPN_ICON as icon and country code as # content. In addition, the following variables are set for the use by # POWERLEVEL9K_NORDVPN_CONNECTED_VISUAL_IDENTIFIER_EXPANSION and From 5acedce0b04bca7d2e633d15fb4d8c911cb27268 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 8 Oct 2021 12:39:30 +0200 Subject: [PATCH 093/380] speed up pre-redraw hook --- internal/p10k.zsh | 50 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 8126b6d1..af56ef77 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7693,19 +7693,25 @@ function _p9k_widget() { res=$? } } - (( ! __p9k_enabled )) || [[ $CONTEXT != start ]] || { - [[ $1 == zle-line-pre-redraw ]] && (( PENDING || KEYS_QUEUED_COUNT )) && { - (( _p9k__redraw_fd )) || { - sysopen -o cloexec -ru _p9k__redraw_fd /dev/null - zle -F $_p9k__redraw_fd _p9k_redraw - } - return res - } - _p9k_widget_hook "$@" - } + (( ! __p9k_enabled )) || [[ $CONTEXT != start ]] || _p9k_widget_hook "$@" return res } +function _p9k_widget_zle-line-pre-redraw-impl() { + (( __p9k_enabled )) && [[ $CONTEXT == start ]] || return 0 + ! (( ${+functions[p10k-on-post-widget]} || ${#_p9k_show_on_command} || _p9k__restore_prompt_fd || _p9k__redraw_fd )) && + [[ ${KEYMAP:-} != vicmd ]] && + return + (( PENDING || KEYS_QUEUED_COUNT )) && { + (( _p9k__redraw_fd )) || { + sysopen -o cloexec -ru _p9k__redraw_fd /dev/null + zle -F $_p9k__redraw_fd _p9k_redraw + } + return + } + _p9k_widget_hook zle-line-pre-redraw +} + function _p9k_widget_send-break() { (( ! __p9k_enabled )) || [[ $CONTEXT != start ]] || { _p9k_widget_hook send-break "$@" @@ -7718,6 +7724,7 @@ typeset -gi __p9k_widgets_wrapped=0 function _p9k_wrap_widgets() { (( __p9k_widgets_wrapped )) && return + typeset -gir __p9k_widgets_wrapped=1 local -a widget_list if is-at-least 5.3; then @@ -7759,6 +7766,7 @@ function _p9k_wrap_widgets() { zf_rm -f -- $tmp } fi + local widget for widget in $widget_list; do if (( ! $+functions[_p9k_widget_$widget] )); then @@ -7774,6 +7782,28 @@ function _p9k_wrap_widgets() { zle -N $widget _p9k_widget_$widget fi done 2>/dev/null # `zle -A` fails for inexisting widgets and complains to stderr + + case ${widgets[._p9k_orig_zle-line-pre-redraw]:-} in + user:-z4h-zle-line-pre-redraw) + function _p9k_widget_zle-line-pre-redraw() { + -z4h-zle-line-pre-redraw "$@" + _p9k_widget_zle-line-pre-redraw-impl + } + ;; + ?*) + function _p9k_widget_zle-line-pre-redraw() { + zle ._p9k_orig_zle-line-pre-redraw -- "$@" + local -i res=$? + _p9k_widget_zle-line-pre-redraw-impl + return res + } + ;; + '') + function _p9k_widget_zle-line-pre-redraw() { + _p9k_widget_zle-line-pre-redraw-impl + } + ;; + esac } function _p9k_restore_prompt() { From edd98053cc96a8d2bd50f2b5f18a97fec0a96b26 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 10 Oct 2021 10:34:54 +0200 Subject: [PATCH 094/380] disable icanon on the tty after printing instant prompt; this way keys like Ctrl-R and Ctrl-D will get through to zle --- internal/p10k.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index af56ef77..976f6e8b 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5933,7 +5933,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=43 +typeset -gri __p9k_instant_prompt_version=44 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -6237,6 +6237,9 @@ _p9k_dump_instant_prompt() { typeset -g __p9k_instant_prompt_output=${TMPDIR:-/tmp}/p10k-instant-prompt-output-${(%):-%n}-$$ { echo -n > $__p9k_instant_prompt_output } || return print -rn -- "$out" || return + if (( $+commands[stty] )); then + command stty -icanon 2>/dev/null + fi local fd_null sysopen -ru fd_null /dev/null || return exec {__p9k_fd_0}<&0 {__p9k_fd_1}>&1 {__p9k_fd_2}>&2 0<&$fd_null 1>$__p9k_instant_prompt_output From 6441a01dd361c2b8aee7f95801fb896fc35f066b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 14 Oct 2021 14:38:27 +0200 Subject: [PATCH 095/380] survive non-writable $TTY --- internal/p10k.zsh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 976f6e8b..3afac53f 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8645,6 +8645,13 @@ _p9k_init() { if (( $+__p9k_instant_prompt_erased )); then unset __p9k_instant_prompt_erased + if [[ -w $TTY ]]; then + local tty=$TTY + elif [[ -w /dev/tty ]]; then + local tty=/dev/tty + else + local tty=/dev/null + fi { >&2 echo -E - "" >&2 echo -E - "${(%):-[%1FERROR%f]: When using instant prompt, Powerlevel10k must be loaded before the first prompt.}" @@ -8684,7 +8691,7 @@ _p9k_init() { >&2 echo -E - "${(%):- * You %Bwill%b see this error message every time you start zsh.}" >&2 echo -E - "${(%):- * Zsh will start %Bslowly%b.}" >&2 echo -E - "" - } 2>>$TTY + } 2>>$tty fi } From 1af638543631f2e7db64829c7412ed007047fa81 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 20 Oct 2021 14:05:33 +0200 Subject: [PATCH 096/380] Squashed 'gitstatus/' changes from cd98a3c2..eaf43011 eaf43011 when downloading gitstatusd, try curl/wget with user configs before trying without (https://github.com/romkatv/powerlevel10k/issues/1606) git-subtree-dir: gitstatus git-subtree-split: eaf43011246e359881931647747e8756a73a143a --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index 86824ece..981d280a 100755 --- a/install +++ b/install @@ -340,7 +340,7 @@ END fi fi local cmd part url ret - for cmd in 'curl -q -kfsSL' 'wget --no-config -qO-' 'wget -qO-' 'curl -kfsSL'; do + for cmd in 'curl -kfsSL' 'wget -qO-' 'curl -q -kfsSL' 'wget --no-config -qO-'; do part=0 while true; do if [ "$part" = 2 ]; then From b4615f5e008c496791c1ea37981ee18f15d464ed Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 27 Oct 2021 09:55:43 +0200 Subject: [PATCH 097/380] add _p9k__raw_msg for direnv notifications in zsh4humans --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 3afac53f..6df571f0 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5777,7 +5777,7 @@ function _p9k_set_prompt() { PROMPT= RPROMPT= - [[ $1 == instant_ ]] || PROMPT+='${$((_p9k_on_expand()))+}' + [[ $1 == instant_ ]] || PROMPT+='${$((_p9k_on_expand()))+}%{${_p9k__raw_msg-}${_p9k__raw_msg::=}%}' PROMPT+=$_p9k_prompt_prefix_left local -i _p9k__has_upglob From faddef4a226f8b07eebe059389a1ddd756eba4a9 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 27 Oct 2021 10:52:59 +0200 Subject: [PATCH 098/380] add faq entries about enabling direnv and exporting GPG_TTY (#702) --- README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/README.md b/README.md index f4fc114a..ec75354b 100644 --- a/README.md +++ b/README.md @@ -906,6 +906,54 @@ initialization and you don't know how to fix it. *Note*: Instant prompt requires Zsh >= 5.4. It's OK to enable it even when using an older version of Zsh but it won't do anything. +*FAQ*: + +- [How do I initialize direnv when using instant prompt?]( + #how-do-i-initialize-direnv-when-using-instant-prompt) +- [How do I export GPG_TTY when using instant prompt?]( + #how-do-i-export-gpg_tty-when-using-instant-prompt) + +### How do I initialize direnv when using instant prompt? + +If you've enabled [instant prompt](#instant-prompt), you should have these lines at the top of +`~/.zshrc`: + +```zsh +if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +fi +``` + +To initialize direnv you need to add one line above that block and one line below it. + +```zsh +(( ${+commands[direnv]} )) && emulate zsh -c "$(direnv export zsh)" + +if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +fi + +(( ${+commands[direnv]} )) && emulate zsh -c "$(direnv hook zsh)" +``` + +*Related*: [How do I export GPG_TTY when using instant prompt?]( + #how-do-i-export-gpg_tty-when-using-instant-prompt) + +### How do I export GPG_TTY when using instant prompt? + +You can set `GPG_TTY` like this anywhere in `~/.zshrc`: + +```zsh +export GPG_TTY=$TTY +``` + +This works whether you are using [instant prompt](#instant-prompt) or not. It works even if you +aren't using powerlevel10k. As an extra bonus, it's much faster than the commonly used +`export GPG_TTY=$(tty)`. + +*Related*: [How do I initialize direnv when using instant prompt?]( + #how-do-i-initialize-direnv-when-using-instant-prompt) + ### What do different symbols in Git status mean? When using Lean, Classic or Rainbow style, Git status may look like this: @@ -1835,6 +1883,8 @@ typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='${P9K_CONTENT}' # not bold - [I'm using Powerlevel9k with Oh My Zsh. How do I migrate?](#im-using-powerlevel9k-with-oh-my-zsh-how-do-i-migrate) - [Is it really fast?](#is-it-really-fast) - [How do I enable instant prompt?](#how-do-i-enable-instant-prompt) + - [How do I initialize direnv when using instant prompt?](#how-do-i-initialize-direnv-when-using-instant-prompt) + - [How do I export GPG_TTY when using instant prompt?](#how-do-i-export-gpg_tty-when-using-instant-prompt) - [What do different symbols in Git status mean?](#what-do-different-symbols-in-git-status-mean) - [How do I change the format of Git status?](#how-do-i-change-the-format-of-git-status) - [Why is Git status from `$HOME/.git` not displayed in prompt?](#why-is-git-status-from-homegit-not-displayed-in-prompt) From 99edd12e00b8c1a38635a28eb33d6454c1ba09b2 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 27 Oct 2021 10:53:59 +0200 Subject: [PATCH 099/380] grammar --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ec75354b..5acd6111 100644 --- a/README.md +++ b/README.md @@ -941,7 +941,7 @@ fi ### How do I export GPG_TTY when using instant prompt? -You can set `GPG_TTY` like this anywhere in `~/.zshrc`: +You can export `GPG_TTY` like this anywhere in `~/.zshrc`: ```zsh export GPG_TTY=$TTY From 85e31542dd8cf902afd564846adfef7c8187350d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 27 Oct 2021 16:31:33 +0200 Subject: [PATCH 100/380] wizard: underline paths instead of bolding in the success message --- internal/wizard.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 9dbfe81d..9fcb36e3 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -2093,12 +2093,12 @@ restore_screen if (( !in_z4h_wizard )); then print - flowing +c New config: "%B${__p9k_cfg_path_u//\\/\\\\}%b." + flowing +c New config: "%U${__p9k_cfg_path_u//\\/\\\\}%u." if [[ -n $config_backup ]]; then - flowing +c Backup of the old config: "%B${config_backup_u//\\/\\\\}%b." + flowing +c Backup of the old config: "%U${config_backup_u//\\/\\\\}%u." fi if [[ -n $zshrc_backup ]]; then - flowing +c Backup of "%B${__p9k_zshrc_u//\\/\\\\}%b:" "%B${zshrc_backup_u//\\/\\\\}%b." + flowing +c Backup of "%U${__p9k_zshrc_u//\\/\\\\}%u:" "%U${zshrc_backup_u//\\/\\\\}%u." fi fi From dce00cdb5daaa8a519df234a7012ba3257b644d4 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 28 Oct 2021 07:19:53 +0200 Subject: [PATCH 101/380] docs: typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5acd6111..e9512333 100644 --- a/README.md +++ b/README.md @@ -1645,7 +1645,7 @@ There are several ways to fix this. The parameters you are looking for are called `POWERLEVEL9K_DIR_BACKGROUND`, `POWERLEVEL9K_DIR_FOREGROUND`, `POWERLEVEL9K_DIR_SHORTENED_FOREGROUND`, `POWERLEVEL9K_DIR_ANCHOR_FOREGROUND` and `POWERLEVEL9K_DIR_ANCHOR_BOLD`. You can find them in - in `~/.p10k.zsh`. + `~/.p10k.zsh`. ### Horrific mess when resizing terminal window From a55955c5cfb360c6088fd0141c6157533f3e1481 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 28 Oct 2021 10:47:14 +0200 Subject: [PATCH 102/380] enable bracketed paste when printing instant prompt --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 6df571f0..90191b95 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5933,7 +5933,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=44 +typeset -gri __p9k_instant_prompt_version=45 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -6236,7 +6236,7 @@ _p9k_dump_instant_prompt() { fi typeset -g __p9k_instant_prompt_output=${TMPDIR:-/tmp}/p10k-instant-prompt-output-${(%):-%n}-$$ { echo -n > $__p9k_instant_prompt_output } || return - print -rn -- "$out" || return + print -rn -- "${out}${esc}?2004h" || return if (( $+commands[stty] )); then command stty -icanon 2>/dev/null fi From e2447322e0be4eddb84196f05952f91fa3c6f37e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 2 Nov 2021 07:23:57 +0100 Subject: [PATCH 103/380] Squashed 'gitstatus/' changes from eaf430112..e26996460 e26996460 survive broken shasum b1825b29a make bash bindings work with nounset git-subtree-dir: gitstatus git-subtree-split: e269964607042ef0fdbda2d7af74ef9c8f618cf4 --- gitstatus.plugin.sh | 7 +++---- install | 44 +++++++++++++++++++++++--------------------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/gitstatus.plugin.sh b/gitstatus.plugin.sh index 9a75cb5f..0c660967 100644 --- a/gitstatus.plugin.sh +++ b/gitstatus.plugin.sh @@ -53,9 +53,8 @@ function gitstatus_start() { fi unset OPTIND - local opt timeout=5 max_dirty=-1 ttl=3600 extra_flags + local opt timeout=5 max_dirty=-1 ttl=3600 extra_flags= local max_num_staged=1 max_num_unstaged=1 max_num_conflicted=1 max_num_untracked=1 - local ignore_status_show_untracked_files while getopts "t:s:u:c:d:m:r:eUWD" opt; do case "$opt" in t) timeout=$OPTARG;; @@ -356,7 +355,7 @@ function gitstatus_stop() { # shell or the call had failed. function gitstatus_query() { unset OPTIND - local opt dir timeout=() no_diff=0 + local opt dir= timeout=() no_diff=0 while getopts "d:c:t:p" opt "$@"; do case "$opt" in d) dir=$OPTARG;; @@ -367,7 +366,7 @@ function gitstatus_query() { done (( OPTIND == $# + 1 )) || { echo "usage: gitstatus_query [OPTION]..." >&2; return 1; } - [[ -n "$GITSTATUS_DAEMON_PID" ]] || return # not started + [[ -n "${GITSTATUS_DAEMON_PID-}" ]] || return # not started local req_id="$RANDOM.$RANDOM.$RANDOM.$RANDOM" if [[ -z "${GIT_DIR:-}" ]]; then diff --git a/install b/install index 981d280a..a0142b2b 100755 --- a/install +++ b/install @@ -304,27 +304,29 @@ END local data_file="$tmpdir"/"$1".tar.gz local hash_file="$tmpdir"/"$1".tar.gz.sha256 local hash= - if command -v shasum >/dev/null 2>/dev/null; then - if run_cmd shasum -b -a 256 -- "$data_file" >"$hash_file"; then - IFS= read -r hash <"$hash_file" || hash= - hash="${hash%% *}" - fi - elif command -v sha256sum >/dev/null 2>/dev/null; then - if run_cmd sha256sum -b -- "$data_file" >"$hash_file"; then - IFS= read -r hash <"$hash_file" || hash= - hash="${hash%% *}" - fi - elif command -v sha256 >/dev/null 2>/dev/null; then - if run_cmd sha256 -- "$data_file" "$hash_file"; then - IFS= read -r hash <"$hash_file" || hash= - # Ignore sha256 output if it's from hashalot. It's incompatible. - if [ ${#hash} -lt 64 ]; then - hash= - else - hash="${hash##* }" - fi - fi - fi + { + command -v shasum >/dev/null 2>/dev/null && + run_cmd shasum -b -a 256 -- "$data_file" >"$hash_file" /dev/null 2>/dev/null && + run_cmd sha256sum -b -- "$data_file" >"$hash_file" /dev/null 2>/dev/null && + run_cmd sha256 -- "$data_file" >"$hash_file" Date: Thu, 4 Nov 2021 02:46:59 +0400 Subject: [PATCH 104/380] Delete duplicate word "using using" Hi, I removed duplicate word in the default configuration file --- config/p10k-classic.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index e58108bd..5daf34f3 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -140,7 +140,7 @@ # Filler between left and right prompt on the first prompt line. You can set it to ' ', '·' or # '─'. The last two make it easier to see the alignment between left and right prompt and to # separate prompt from command output. You might want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false - # for more compact prompt if using using this option. + # for more compact prompt if using this option. typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND= typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_GAP_BACKGROUND= From a9f208c8fc509b9c591169dd9758c48ad4325f76 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 15 Nov 2021 07:25:17 +0100 Subject: [PATCH 105/380] don't auto-start configuration wizard if it's likely that zshrc is broken This change is an attempt to automate this: https://github.com/romkatv/powerlevel10k#configuration-wizard-runs-automatically-every-time-zsh-is-started --- internal/configure.zsh | 5 +- internal/wizard.zsh | 114 ++++++++++++++++++++++++++--------------- 2 files changed, 76 insertions(+), 43 deletions(-) diff --git a/internal/configure.zsh b/internal/configure.zsh index 4fb7cb6e..3e880f23 100644 --- a/internal/configure.zsh +++ b/internal/configure.zsh @@ -59,7 +59,10 @@ function _p9k_can_configure() { $0_error "terminal size too small; must be at least $__p9k_wizard_columns columns by $__p9k_wizard_lines lines" return 1 } - [[ -t 0 && -t 1 ]] || { $0_error "no TTY"; return 2 } + [[ -t 0 && -t 1 ]] || { + $0_error "no TTY" + return 2 + } return 0 } always { unfunction $0_error diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 9fcb36e3..0b81417a 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -14,22 +14,11 @@ if (( OPTIND <= ARGC )); then return 1 fi -if (( $+terminfo[smcup] && $+terminfo[rmcup] )) && echoti smcup 2>/dev/null; then - function restore_screen() { - echoti rmcup 2>/dev/null - function restore_screen() {} - } -else - function restore_screen() {} -fi - local -i in_z4h_wizard=0 [[ $force == 0 && $+functions[z4h] == 1 && -n $Z4H && -e $Z4H/welcome ]] && in_z4h_wizard=1 local -i success=0 -{ # always - local -ri force local -r font_base_url='https://github.com/romkatv/powerlevel10k-media/raw/master' @@ -1566,40 +1555,12 @@ function ask_zshrc_edit() { if (( $+functions[z4h] )); then zshrc_has_cfg=1 zshrc_has_instant_prompt=1 + return fi + check_zshrc_integration || quit -c [[ $instant_prompt == off ]] && zshrc_has_instant_prompt=1 - - if [[ -e $__p9k_zshrc ]]; then - zshrc_content="$(<$__p9k_zshrc)" || quit -c - local lines=(${(f)zshrc_content}) - local f0=$__p9k_cfg_path_o - local f1=${(q)f0} - local f2=${(q-)f0} - local f3=${(qq)f0} - local f4=${(qqq)f0} - local g1=${${(q)__p9k_cfg_path_o}/#(#b)${(q)HOME}\//'~/'} - local h0='${ZDOTDIR:-~}/.p10k.zsh' - local h1='${ZDOTDIR:-$HOME}/.p10k.zsh' - local h2='"${ZDOTDIR:-$HOME}/.p10k.zsh"' - local h3='"${ZDOTDIR:-$HOME}"/.p10k.zsh' - local h4='${ZDOTDIR}/.p10k.zsh' - local h5='"${ZDOTDIR}/.p10k.zsh"' - local h6='"${ZDOTDIR}"/.p10k.zsh' - local h7='$ZDOTDIR/.p10k.zsh' - local h8='"$ZDOTDIR/.p10k.zsh"' - local h9='"$ZDOTDIR"/.p10k.zsh' - local h10='$POWERLEVEL9K_CONFIG_FILE' - local h11='"$POWERLEVEL9K_CONFIG_FILE"' - if [[ -n ${(@M)lines:#(#b)[^#]#([^[:IDENT:]]|)source[[:space:]]##($f1|$f2|$f3|$f4|$g1|$h0|$h1|$h2|$h3|$h4|$h5|$h6|$h7|$h8|$h9|$h10|$h11)(|[[:space:]]*|'#'*)} ]]; then - zshrc_has_cfg=1 - fi - local pre='${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh' - if [[ -n ${(@M)lines:#(#b)[^#]#([^[:IDENT:]]|)source[[:space:]]##($pre|\"$pre\")(|[[:space:]]*|'#'*)} ]]; then - zshrc_has_instant_prompt=1 - fi - (( zshrc_has_cfg && zshrc_has_instant_prompt )) && return - fi + (( zshrc_has_cfg && zshrc_has_instant_prompt )) && return add_widget 0 flowing -c %BApply changes to "%b%2F${__p9k_zshrc_u//\\/\\\\}%f%B?%b" add_widget 0 print -P "" @@ -1951,6 +1912,75 @@ fi" || return return 0 } +function check_zshrc_integration() { + typeset -g zshrc_content= + typeset -gi zshrc_has_cfg=0 zshrc_has_instant_prompt=0 + [[ -e $__p9k_zshrc ]] || return 0 + zshrc_content="$(<$__p9k_zshrc)" || return + local lines=(${(f)zshrc_content}) + local f0=$__p9k_cfg_path_o + local f1=${(q)f0} + local f2=${(q-)f0} + local f3=${(qq)f0} + local f4=${(qqq)f0} + local g1=${${(q)__p9k_cfg_path_o}/#(#b)${(q)HOME}\//'~/'} + local h0='${ZDOTDIR:-~}/.p10k.zsh' + local h1='${ZDOTDIR:-$HOME}/.p10k.zsh' + local h2='"${ZDOTDIR:-$HOME}/.p10k.zsh"' + local h3='"${ZDOTDIR:-$HOME}"/.p10k.zsh' + local h4='${ZDOTDIR}/.p10k.zsh' + local h5='"${ZDOTDIR}/.p10k.zsh"' + local h6='"${ZDOTDIR}"/.p10k.zsh' + local h7='$ZDOTDIR/.p10k.zsh' + local h8='"$ZDOTDIR/.p10k.zsh"' + local h9='"$ZDOTDIR"/.p10k.zsh' + local h10='$POWERLEVEL9K_CONFIG_FILE' + local h11='"$POWERLEVEL9K_CONFIG_FILE"' + if [[ -n ${(@M)lines:#(#b)[^#]#([^[:IDENT:]]|)source[[:space:]]##($f1|$f2|$f3|$f4|$g1|$h0|$h1|$h2|$h3|$h4|$h5|$h6|$h7|$h8|$h9|$h10|$h11)(|[[:space:]]*|'#'*)} ]]; then + zshrc_has_cfg=1 + fi + local pre='${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh' + if [[ -n ${(@M)lines:#(#b)[^#]#([^[:IDENT:]]|)source[[:space:]]##($pre|\"$pre\")(|[[:space:]]*|'#'*)} ]]; then + zshrc_has_instant_prompt=1 + fi + return 0 +} + +() { + (( force )) && return + _p9k_can_configure -q || return 0 + local zshrc_content zshrc_has_cfg zshrc_has_instant_prompt + check_zshrc_integration 2>/dev/null || return 0 + (( zshrc_has_cfg )) || return 0 + [[ -s $__p9k_cfg_path ]] || return 0 + print -P "" + flowing \ + Powerlevel10k configuration file "($__p9k_cfg_path_u)" was not sourced. This \ + might have been caused by errors in zsh startup files, most likely in \ + $__p9k_zshrc_u. See above for any indication of such errors and fix them. If \ + there are no errors, try running Powerlevel10k configuration wizard: + print -P '' + print -P ' %2Fp10k%f %Bconfigure%b' + print -P '' + flowing \ + If you do nothing, you will see this message again when you start zsh. You can \ + suppress it by defining %BPOWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true%b in \ + $__p9k_zshrc_u. + print -P '' + return 1 +} || return + +if (( $+terminfo[smcup] && $+terminfo[rmcup] )) && echoti smcup 2>/dev/null; then + function restore_screen() { + echoti rmcup 2>/dev/null + function restore_screen() {} + } +else + function restore_screen() {} +fi + +{ # always + if (( force )); then _p9k_can_configure || return else From e181bc0653ae15ba5730a65b253d499bf22a31bf Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 5 Dec 2021 09:28:30 +0100 Subject: [PATCH 106/380] Squashed 'gitstatus/' changes from e26996460..f1cf61b24 f1cf61b24 work around a bug in IP-guard git-subtree-dir: gitstatus git-subtree-split: f1cf61b241a2a34514a8ff5f71dfb79a99d85c7c --- gitstatus.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index c37af1d7..cef78974 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -458,7 +458,7 @@ function _gitstatus_daemon"${1:-}"() { (( lock_fd == -1 )) && return { - if zsystem flock -- $file_prefix.lock && [[ -e $file_prefix.lock ]]; then + if zsystem flock -- $file_prefix.lock && command sleep 5 && [[ -e $file_prefix.lock ]]; then zf_rm -f -- $file_prefix.lock $file_prefix.fifo kill -- -$pgid fi From abc5df446d28b64a7c792b867da6d0357a675e39 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 8 Dec 2021 12:12:15 +0100 Subject: [PATCH 107/380] attempt to fix asdf when some files have windows line endings (#1653) --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 90191b95..dfd1c1ba 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5348,7 +5348,7 @@ function _p9k_asdf_init_meta() { files+=$parse [[ -x $parse ]] && has_parse=1 local name - for name in $($list_names 2>/dev/null); do + for name in ${$($list_names 2>/dev/null)%$'\r'}; do [[ $name == (*/*|.tool-versions) ]] && continue _p9k_asdf_file_info[$name]+="${plugin:t} $has_parse " done @@ -5402,8 +5402,8 @@ function _p9k_asdf_parse_version_file() { local v=($(${ASDF_DATA_DIR:-~/.asdf}/plugins/$plugin/bin/parse-legacy-file $file 2>/dev/null)) else { local v=($(<$file)) } 2>/dev/null - v=(${v%$'\r'}) fi + v=(${v%$'\r'}) v=${v[(r)$_p9k_asdf_plugins[$plugin]]:-$v[1]} _p9k_asdf_file2versions[$plugin:$file]=$stat[1]:"$v" _p9k__state_dump_scheduled=1 From fde8bf62d451c621fb1bc05f9564140ffdc1672a Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 10 Dec 2021 23:34:10 +0100 Subject: [PATCH 108/380] fix prefix-based formatting of numbers that are slightly below the boundary (#1664) --- internal/p10k.zsh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index dfd1c1ba..754c312e 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -317,16 +317,24 @@ function _p9k_prompt_length() { typeset -gr __p9k_byte_suffix=('B' 'K' 'M' 'G' 'T' 'P' 'E' 'Z' 'Y') -# 42 => 42B -# 1536 => 1.5K +# 512 => 512B +# 1800 => 1.76K +# 18000 => 17.6K function _p9k_human_readable_bytes() { - typeset -F 2 n=$1 + typeset -F n=$1 local suf for suf in $__p9k_byte_suffix; do - (( n < 100 )) && break + (( n < 1024 )) && break (( n /= 1024 )) done - _p9k__ret=${${n%%0#}%.}$suf + if (( n >= 100 )); then + printf -v _p9k__ret '%.0f.' $n + elif (( n >= 10 )); then + printf -v _p9k__ret '%.1f' $n + else + printf -v _p9k__ret '%.2f' $n + fi + _p9k__ret=${${_p9k__ret%%0#}%.}$suf } if is-at-least 5.4; then From 3091ffbd8657a0d4df645a7336700a242af855f7 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 10 Dec 2021 23:38:24 +0100 Subject: [PATCH 109/380] bust caches --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 754c312e..e243a5a2 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8214,7 +8214,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v126\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v127\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$GITSTATUS_CACHE_DIR\1$GITSTATUS_AUTO_INSTALL\1${ZLE_RPROMPT_INDENT:-1}\1' From 4543076483f4c98c3b03d61d1e6f0313b8fbd21c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 17 Dec 2021 17:10:52 +0100 Subject: [PATCH 110/380] when using tmux, write unwrapped OSC 133 in addition to wrapped; the new integrated tmux uses them when resizing --- internal/p10k.zsh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index e243a5a2..a0f0cf28 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8089,12 +8089,11 @@ _p9k_init_prompt() { fi if [[ $ITERM_SHELL_INTEGRATION_INSTALLED == Yes ]]; then + _p9k_prompt_prefix_left+=$'%{\e]133;A\a%}' + _p9k_prompt_suffix_left+=$'%{\e]133;B\a%}' if (( $+_z4h_iterm_cmd && _z4h_can_save_restore_screen == 1 )); then _p9k_prompt_prefix_left+=$'%{\ePtmux;\e\e]133;A\a\e\\%}' _p9k_prompt_suffix_left+=$'%{\ePtmux;\e\e]133;B\a\e\\%}' - else - _p9k_prompt_prefix_left+=$'%{\e]133;A\a%}' - _p9k_prompt_suffix_left+=$'%{\e]133;B\a%}' fi fi @@ -8214,7 +8213,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v127\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v128\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$GITSTATUS_CACHE_DIR\1$GITSTATUS_AUTO_INSTALL\1${ZLE_RPROMPT_INDENT:-1}\1' @@ -8288,10 +8287,9 @@ function _p9k_init_cacheable() { _p9k_transient_prompt+='${:-"'$_p9k__ret'"}' _p9k_transient_prompt+=')%b%k%f%s%u ' if [[ $ITERM_SHELL_INTEGRATION_INSTALLED == Yes ]]; then + _p9k_transient_prompt=$'%{\e]133;A\a%}'$_p9k_transient_prompt$'%{\e]133;B\a%}' if (( $+_z4h_iterm_cmd && _z4h_can_save_restore_screen == 1 )); then _p9k_transient_prompt=$'%{\ePtmux;\e\e]133;A\a\e\\%}'$_p9k_transient_prompt$'%{\ePtmux;\e\e]133;B\a\e\\%}' - else - _p9k_transient_prompt=$'%{\e]133;A\a%}'$_p9k_transient_prompt$'%{\e]133;B\a%}' fi fi fi From a23c4314a1498c026167d2095d207d418201a98d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 17 Dec 2021 19:01:44 +0100 Subject: [PATCH 111/380] doc: update "horrific mess when resizing terminal window" section - Don't say it's a bug in Zsh. It's more complicated than that. - Mention that the the issue can be avoided by using Kitty. - Do not mention that the issue can also be avoided by using zsh4humans (even though it's true). If you, dear reader, see this, give zsh4humans a try. --- README.md | 68 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index e9512333..4f011821 100644 --- a/README.md +++ b/README.md @@ -1649,19 +1649,25 @@ There are several ways to fix this. ### Horrific mess when resizing terminal window -When you resize terminal window horizontally back and forth a few times, you might see this ugly +When you resize a terminal window horizontally back and forth a few times, you might see this ugly picture. ![Powerlevel10k Resizing Mess]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resizing-mess.png) -tl;dr: This is a bug in Zsh that isn't specific to Powerlevel10k. See [mitigation](#mitigation). +tl;dr: This issue arises when a terminal reflows Zsh prompt upon resizing. It isn't specific to +Powerlevel10k. See [mitigation](#mitigation). -#### Zsh bug +*Note: This section [used to say]( + https://github.com/romkatv/powerlevel10k/blob/dce00cdb5daaa8a519df234a7012ba3257b644d4/README.md#horrific-mess-when-resizing-terminal-window) +that the problem is caused by a bug in Zsh. While it's true that it's possible to avoid the problem +in many circumstances by modifying Zsh, it cannot be completely resolved this way. Thus it's unfair +to pin the blame on Zsh.* -This issue is caused by a bug in Zsh that gets triggered when the vertical distance between the -start of the current prompt and the cursor (henceforth `VD`) changes when the terminal window is -resized. This bug is not specific to Powerlevel10k. +#### The anatomy of the problem + +The issue is manifested when the vertical distance between the start of the current prompt and the +cursor (henceforth `VD`) changes when the terminal window is resized. When a terminal window gets shrunk horizontally, there are two ways for a terminal to handle long lines that no longer fit: *reflow* or *truncate*. @@ -1683,9 +1689,9 @@ Terminal truncates text when shrinking: Reflowing strategy can change the height of terminal content. If such content happens to be between the start of the current prompt and the cursor, Zsh will print prompt on the wrong line. Truncation -strategy never changes the height of terminal content, so it doesn't trigger this bug in Zsh. +strategy never changes the height of terminal content, so it doesn't trigger this issue. -Let's see how the bug plays out in slow motion. We'll start by launching `zsh -df` and pasting +Let's see how the issue plays out in slow motion. We'll start by launching `zsh -f` and pasting the following code: ```zsh @@ -1701,13 +1707,13 @@ PROMPT=$'${$((pause()))+}left>${(pl.$((COLUMNS-12))..-.)} ' When `PROMPT` gets expanded, it calls `pause` to let us observe the state of the terminal. Here's the initial state: -![Zsh Resizing Bug 1]( +![Terminal Resizing Bug 1]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-bug-1.png) Zsh keeps track of the cursor position relative to the start of the current prompt. In this case it knows that the cursor is one line below. When we shrink the terminal window, it looks like this: -![Zsh Resizing Bug 2]( +![Terminal Resizing Bug 2]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-bug-2.png) At this point the terminal sends `SIGWINCH` to Zsh to notify it about changes in the terminal @@ -1719,7 +1725,7 @@ terminal content that follows and prints reexpanded prompt there. However, after no longer one line above the cursor. It's two lines above! Zsh ends up printing new prompt one line too low. -![Zsh Resizing Bug 3]( +![Terminal Resizing Bug 3]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-bug-3.png) In this case we ended up with unwanted junk content because `VD` has *increased*. When you make @@ -1728,33 +1734,30 @@ higher than intended, potentially erasing useful content in the process. Here are a few more examples where shrinking terminal window increased `VD`. -Simple one-line left prompt with right prompt. No `prompt_subst`. Note that the cursor is below the -prompt line (hit *ESC-ENTER* to get it there). - -![Zsh Prompt That Breaks on Terminal Shrinking 1]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-breakable-1.png) - -Simple one-line left prompt. No `prompt_subst`, no right prompt. Here `VD` is bound to increase -upon terminal shrinking due to the command line wrapping around. - -![Zsh Prompt That Breaks on Terminal Shrinking 2]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-breakable-2.png) +- Simple one-line left prompt with right prompt. No `prompt_subst`. Note that the cursor is below + the prompt line (hit *ESC-ENTER* to get it there). + ![Zsh Prompt That Breaks on Terminal Shrinking 1]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-breakable-1.png) +- Simple one-line left prompt. No `prompt_subst`, no right prompt. Here `VD` is bound to increase + upon terminal shrinking due to the command line wrapping around. + ![Zsh Prompt That Breaks on Terminal Shrinking 2]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-breakable-2.png) #### Zsh patch -The bug described above has been partially fixed (only for some terminals) in [this branch]( - https://github.com/romkatv/zsh/tree/fix-winchanged). The idea behind the fix is to use `sc` (save -cursor) terminal capability before printing prompt and `rc` (restore cursor) to move cursor back -to the original position when prompt needs to be refreshed. +[This Zsh patch](https://github.com/romkatv/zsh/tree/fix-winchanged) fixes the issue on some +terminals. The idea behind the patch is to use `sc` (save cursor) terminal capability before +printing prompt and `rc` (restore cursor) to move cursor back to the original position when prompt +needs to be refreshed. The patch works only on terminals that reflow saved cursor position together with text when the terminal window is resized. The patch has no observable effect on terminals that don't reflow text on resize (both patched and unpatched Zsh behave correctly) and on terminals that reflow text but -not saved cursor position (both patched and unpatched Zsh redraw prompt at the same incorrect +not the saved cursor position (both patched and unpatched Zsh redraw prompt at the same incorrect position). In other words, the patch fixes the resizing issue on some terminals while keeping the behavior unchanged on others. -There are two alternative approaches to fixing the bug that may seem to work at first glance but in +There are two alternative approaches to patching Zsh that may seem to work at first glance but in fact don't: - Instead of `sc`, use `u7` terminal capability to query the current cursor position and then `cup` @@ -1773,6 +1776,15 @@ There is no ETA for the patch making its way into upstream Zsh. See [discussion] There are a few mitigation options for this issue. +- Use [Kitty](https://sw.kovidgoyal.net/kitty/) and enable terminal-shell integration in + Powerlevel10k. The latter can be done by appending these lines to `~/.zshrc`: + ```zsh + unset KITTY_SHELL_INTEGRATION + ITERM_SHELL_INTEGRATION_INSTALLED=Yes + ``` + At the time of this writing (Dec 2021) the latest release of Kitty (0.23.1) doesn't have the + necessary code to fix the issue. If by the time you are reading this there is no newer version, + you'll have to build from source. - Apply [the patch](#zsh-patch) and [rebuild Zsh from source]( https://github.com/zsh-users/zsh/blob/master/INSTALL). It won't help if you are using Alacritty, Kitty or some other terminal that reflows text on resize but doesn't reflow saved cursor position. From 2e8a8f1d6393318e200860fbdc43f23e788ac671 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 21 Dec 2021 09:33:52 +0100 Subject: [PATCH 112/380] fix a bug that causes VISUAL_IDENTIFIER_COLOR to leak into content --- internal/p10k.zsh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index a0f0cf28..4aca98dc 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -767,8 +767,12 @@ _p9k_left_prompt_segment() { _p9k_foreground $_p9k__ret _p9k__ret=%b$bg$_p9k__ret _p9k__ret=${_p9k__ret//\}/\\\}} - [[ $_p9k__ret != $style_ || $need_style == 1 ]] && p+=$_p9k__ret - p+='${_p9k__v}' + if [[ $_p9k__ret != $style_ ]]; then + p+=$_p9k__ret'${_p9k__v}'$style_ + else + (( need_style )) && p+=$style_ + p+='${_p9k__v}' + fi _p9k_get_icon $1 LEFT_MIDDLE_WHITESPACE ' ' if [[ -n $_p9k__ret ]]; then @@ -1019,8 +1023,12 @@ _p9k_right_prompt_segment() { _p9k_foreground $_p9k__ret _p9k__ret=%b$bg$_p9k__ret _p9k__ret=${_p9k__ret//\}/\\\}} - [[ $_p9k__ret != $style_ || $need_style == 1 ]] && p+=$_p9k__ret - p+='${_p9k__v}' + if [[ $_p9k__ret != $style_ ]]; then + p+=$_p9k__ret'${_p9k__v}'$style_ + else + (( need_style )) && p+=$style_ + p+='${_p9k__v}' + fi _p9k_get_icon $1 RIGHT_MIDDLE_WHITESPACE ' ' if [[ -n $_p9k__ret ]]; then @@ -8213,7 +8221,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v128\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v129\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$GITSTATUS_CACHE_DIR\1$GITSTATUS_AUTO_INSTALL\1${ZLE_RPROMPT_INDENT:-1}\1' From 57d0274b8892158b8f6fedaf9946e7f3f89d56e9 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 22 Dec 2021 11:24:46 +0100 Subject: [PATCH 113/380] fix bugs in dir and several other segments when cwd contains control characters --- internal/p10k.zsh | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 4aca98dc..4afa965f 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -200,7 +200,7 @@ function _p9k_read_word() { } function _p9k_fetch_cwd() { - _p9k__cwd=${(%):-%/} + _p9k__cwd=${(g:oce:)${(%):-%/}} _p9k__cwd_a=${${_p9k__cwd:A}:-.} case $_p9k__cwd in @@ -1748,10 +1748,10 @@ function _p9k_shorten_delim_len() { # Dir: current working directory prompt_dir() { if (( _POWERLEVEL9K_DIR_PATH_ABSOLUTE )); then - local p=$_p9k__cwd + local p=${(V)_p9k__cwd} local -a parts=("${(s:/:)p}") elif [[ -o auto_name_dirs ]]; then - local p=${_p9k__cwd/#(#b)$HOME(|\/*)/'~'$match[1]} + local p=${(V)${_p9k__cwd/#(#b)$HOME(|\/*)/'~'$match[1]}} local -a parts=("${(s:/:)p}") else local p=${(%):-%~} @@ -1765,15 +1765,15 @@ prompt_dir() { local -a parts=() for func in zsh_directory_name $zsh_directory_name_functions; do local reply=() - if (( $+functions[$func] )) && $func d $_p9k__cwd && [[ $p == '~['$reply[1]']'* ]]; then - parts+='~['$reply[1]']' + if (( $+functions[$func] )) && $func d $_p9k__cwd && [[ $p == '~['${(V)reply[1]}']'* ]]; then + parts+='~['${(V)reply[1]}']' break fi done if (( $#parts )); then parts+=(${(s:/:)${p#$parts[1]}}) else - p=$_p9k__cwd + p=${(V)_p9k__cwd} parts=("${(s:/:)p}") fi else @@ -1880,6 +1880,9 @@ prompt_dir() { delim=${_POWERLEVEL9K_SHORTEN_DELIMITER-'*'} shortenlen=${_POWERLEVEL9K_SHORTEN_DIR_LENGTH:-1} (( shortenlen >= 0 )) || shortenlen=1 + local rp=${(g:oce:)p} + local rparts=("${(@s:/:)rp}") + local -i i=2 e=$(($#parts - shortenlen)) if [[ -n $_POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER ]]; then (( e += shortenlen )) @@ -1894,8 +1897,8 @@ prompt_dir() { local key= fi if ! _p9k_cache_ephemeral_get $0 $e $i $_p9k__cwd || [[ $key != $_p9k__cache_val[1] ]]; then - local tail=${(j./.)parts[i,-1]} - local parent=$_p9k__cwd[1,-2-$#tail] + local rtail=${(j./.)rparts[i,-1]} + local parent=$_p9k__cwd[1,-2-$#rtail] _p9k_prompt_length $delim local -i real_delim_len=_p9k__ret [[ -n $parts[i-1] ]] && parts[i-1]="\${(Q)\${:-${(qqq)${(q)parts[i-1]}}}}"$'\2' @@ -1904,7 +1907,8 @@ prompt_dir() { local -i m=1 for (( ; i <= e; ++i, ++m )); do local sub=$parts[i] - local dir=$parent/$sub mtime=$mtimes[m] + local rsub=$rparts[i] + local dir=$parent/$rsub mtime=$mtimes[m] local pair=$_p9k__dir_stat_cache[$dir] if [[ $pair == ${mtime:-x}:* ]]; then parts[i]=${pair#*:} @@ -1912,22 +1916,22 @@ prompt_dir() { [[ $sub != *["~!#\`\$^&*()\\\"'<>?{}[]"]* ]] local -i q=$? if [[ -n $_POWERLEVEL9K_SHORTEN_FOLDER_MARKER && - -n $parent/$sub/${~_POWERLEVEL9K_SHORTEN_FOLDER_MARKER}(#qN) ]]; then + -n $dir/${~_POWERLEVEL9K_SHORTEN_FOLDER_MARKER}(#qN) ]]; then (( q )) && parts[i]="\${(Q)\${:-${(qqq)${(q)sub}}}}" parts[i]+=$'\2' else - local -i j=$sub[(i)[^.]] - for (( ; j + d < $#sub; ++j )); do - local -a matching=($parent/$sub[1,j]*/(N)) + local -i j=$rsub[(i)[^.]] + for (( ; j + d < $#rsub; ++j )); do + local -a matching=($parent/$rsub[1,j]*/(N)) (( $#matching == 1 )) && break done - local -i saved=$(($#sub - j - d)) + local -i saved=$((${(m)#${(V)${rsub:$j}}} - d)) if (( saved > 0 )); then if (( q )); then parts[i]='${${${_p9k__d:#-*}:+${(Q)${:-'${(qqq)${(q)sub}}'}}}:-${(Q)${:-' - parts[i]+=$'\3'${(qqq)${(q)sub[1,j]}}$'}}\1\3''${$((_p9k__d+='$saved'))+}}' + parts[i]+=$'\3'${(qqq)${(q)${(V)${rsub[1,j]}}}}$'}}\1\3''${$((_p9k__d+='$saved'))+}}' else - parts[i]='${${${_p9k__d:#-*}:+'$sub$'}:-\3'$sub[1,j]$'\1\3''${$((_p9k__d+='$saved'))+}}' + parts[i]='${${${_p9k__d:#-*}:+'$sub$'}:-\3'${(V)${rsub[1,j]}}$'\1\3''${$((_p9k__d+='$saved'))+}}' fi else (( q )) && parts[i]="\${(Q)\${:-${(qqq)${(q)sub}}}}" @@ -1935,7 +1939,7 @@ prompt_dir() { fi [[ -n $mtime ]] && _p9k__dir_stat_cache[$dir]="$mtime:$parts[i]" fi - parent+=/$sub + parent+=/$rsub done if [[ -n $_POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER ]]; then local _2=$'\2' @@ -8221,7 +8225,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v129\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v130\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$GITSTATUS_CACHE_DIR\1$GITSTATUS_AUTO_INSTALL\1${ZLE_RPROMPT_INDENT:-1}\1' From 469baa6221c98a2b3991647adf3e74d653528ed3 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 22 Dec 2021 12:53:18 +0100 Subject: [PATCH 114/380] url-escape dir properly when POWERLEVEL9K_DIR_HYPERLINK is set --- internal/p10k.zsh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 4afa965f..ced5b350 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1744,6 +1744,19 @@ function _p9k_shorten_delim_len() { (( _p9k__ret >= 0 )) || _p9k_prompt_length $1 } +function _p9k_url_escape() { + if [[ $1 == [a-zA-Z0-9"/:_.-!'()~ "]# ]]; then + _p9k__ret=${1// /%20} + else + local c + _p9k__ret= + for c in ${(s::)1}; do + [[ $c == [a-zA-Z0-9"/:_.-!'()~"] ]] || printf -v c '%%%02X' $(( #c )) + _p9k__ret+=$c + done + fi +} + ################################################################ # Dir: current working directory prompt_dir() { @@ -2121,7 +2134,8 @@ prompt_dir() { local content="${(pj.$sep.)parts}" if (( _POWERLEVEL9K_DIR_HYPERLINK && _p9k_term_has_href )) && [[ $_p9k__cwd == /* ]]; then - local header=$'%{\e]8;;file://'${${_p9k__cwd//\%/%%25}//'#'/%%23}$'\a%}' + _p9k_url_escape $_p9k__cwd + local header=$'%{\e]8;;file://'$_p9k__ret$'\a%}' local footer=$'%{\e]8;;\a%}' if (( expand )); then _p9k_escape $header From 608bd2c88b576627f6f3c9cc4fb5cc94bf51eef6 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 23 Dec 2021 08:05:47 +0100 Subject: [PATCH 115/380] expand instant prompt faq --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4f011821..8b15218a 100644 --- a/README.md +++ b/README.md @@ -157,13 +157,13 @@ Powerlevel10k can remove Zsh startup lag **even if it's not caused by a theme**. https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/instant-prompt.gif) This feature is called *Instant Prompt*. You need to explicitly enable it through `p10k configure` -or [manually](#how-do-i-enable-instant-prompt). It does what it says on the tin -- prints prompt +or [manually](#how-do-i-configure-instant-prompt). It does what it says on the tin -- prints prompt instantly upon Zsh startup allowing you to start typing while plugins are still loading. Other themes *increase* Zsh startup lag -- some by a lot, others by a just a little. Powerlevel10k *removes* it outright. -*FAQ:* [How do I enable instant prompt?](#how-do-i-enable-instant-prompt) +*FAQ:* [How do I configure instant prompt?](#how-do-i-configure-instant-prompt) ### Show on command @@ -834,10 +834,10 @@ Powerlevel10k, on the other hand, doesn't require trading latency for utility -- instant with any configuration. It stays well below the 50 ms mark, leaving most of the latency budget for other plugins you might install. -### How do I enable instant prompt? +### How do I configure instant prompt? See [instant prompt](#instant-prompt) to learn about instant prompt. This section explains how you -can enable it and lists caveats that you should be aware of. +can enable and configure it and lists caveats that you should be aware of. Instant prompt can be enabled either through `p10k configure` or by manually adding the following code snippet at the top of `~/.zshrc`: @@ -903,6 +903,10 @@ to move it above the instant prompt preamble or to suppress its output. You can instant prompt with `POWERLEVEL9K_INSTANT_PROMPT=off`. Do this if instant prompt breaks Zsh initialization and you don't know how to fix it. +The value of `POWERLEVEL9K_INSTANT_PROMPT` can be changed by `p10k configure` and selecting the +appropriate option on the *Instant Prompt* screen. Alternatively, search for +`POWERLEVEL9K_INSTANT_PROMPT` in the existing `~/.p10k.zsh` and change its value there. + *Note*: Instant prompt requires Zsh >= 5.4. It's OK to enable it even when using an older version of Zsh but it won't do anything. @@ -1894,7 +1898,7 @@ typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='${P9K_CONTENT}' # not bold - [Which aspects of shell and terminal does Powerlevel10k affect?](#which-aspects-of-shell-and-terminal-does-powerlevel10k-affect) - [I'm using Powerlevel9k with Oh My Zsh. How do I migrate?](#im-using-powerlevel9k-with-oh-my-zsh-how-do-i-migrate) - [Is it really fast?](#is-it-really-fast) - - [How do I enable instant prompt?](#how-do-i-enable-instant-prompt) + - [How do I configure instant prompt?](#how-do-i-configure-instant-prompt) - [How do I initialize direnv when using instant prompt?](#how-do-i-initialize-direnv-when-using-instant-prompt) - [How do I export GPG_TTY when using instant prompt?](#how-do-i-export-gpg_tty-when-using-instant-prompt) - [What do different symbols in Git status mean?](#what-do-different-symbols-in-git-status-mean) From 09ece9601f781e582919eb76155cc2a957199e5d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 23 Dec 2021 08:09:47 +0100 Subject: [PATCH 116/380] grammar in the instant prompt faq --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8b15218a..561b71ca 100644 --- a/README.md +++ b/README.md @@ -903,8 +903,8 @@ to move it above the instant prompt preamble or to suppress its output. You can instant prompt with `POWERLEVEL9K_INSTANT_PROMPT=off`. Do this if instant prompt breaks Zsh initialization and you don't know how to fix it. -The value of `POWERLEVEL9K_INSTANT_PROMPT` can be changed by `p10k configure` and selecting the -appropriate option on the *Instant Prompt* screen. Alternatively, search for +The value of `POWERLEVEL9K_INSTANT_PROMPT` can be changed by running `p10k configure` and selecting +the appropriate option on the *Instant Prompt* screen. Alternatively, you can search for `POWERLEVEL9K_INSTANT_PROMPT` in the existing `~/.p10k.zsh` and change its value there. *Note*: Instant prompt requires Zsh >= 5.4. It's OK to enable it even when using an older version of From 6692245f3e0977789669baa6e6bd64fd730a1529 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 23 Dec 2021 08:21:26 +0100 Subject: [PATCH 117/380] hide all screen recordings under
in the hope that #anchors will work properly --- README.md | 88 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 66 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 561b71ca..91763872 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,12 @@ See the [table of contents](#table-of-contents) at the bottom. Type `p10k configure` to access the builtin configuration wizard right from your terminal. -![Powerlevel10k Configuration Wizard]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/configuration-wizard.gif) +
+ Screen recording + + ![Powerlevel10k Configuration Wizard]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/configuration-wizard.gif) +
All styles except [Pure](#pure-compatibility) are functionally equivalent. They display the same information and differ only in presentation. @@ -82,8 +86,12 @@ segments to fill four prompt lines on both sides of the screen... wait, that's j one ever does that. Probably impossible, too. The point is, Powerlevel10k prompt is always fast, no matter what you do! -![Powerlevel10k Performance]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/performance.gif) +
+ Screen recording + + ![Powerlevel10k Performance]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/performance.gif) +
Note how the effect of every command is instantly reflected by the very next prompt. @@ -105,8 +113,12 @@ Powerlevel10k you get fast prompt *and* up-to-date information. Powerlevel10k understands all [Powerlevel9k](https://github.com/Powerlevel9k/powerlevel9k) configuration parameters. -![Powerlevel10k Compatibility with 9k]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/9k-compatibility.gif) +
+ Screen recording + + ![Powerlevel10k Compatibility with 9k]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/9k-compatibility.gif) +
[Migration](#installation) from Powerlevel9k to Powerlevel10k is a straightforward process. All your `POWERLEVEL9K` configuration parameters will still work. Prompt will look the same as before @@ -128,8 +140,12 @@ but it will be [much faster](#uncompromising-performance) ([certainly](#is-it-re Powerlevel10k can produce the same prompt as [Pure](https://github.com/sindresorhus/pure). Type `p10k configure` and select *Pure* style. -![Powerlevel10k Pure Style]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/pure-style.gif) +
+ Screen recording + + ![Powerlevel10k Pure Style]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/pure-style.gif) +
You can still use Powerlevel10k features such as [transient prompt](#transient-prompt) or [instant prompt](#instant-prompt) when sporting Pure style. @@ -148,13 +164,21 @@ If your `~/.zshrc` loads many plugins, or perhaps just a few slow ones (for example, [pyenv](https://github.com/pyenv/pyenv) or [nvm](https://github.com/nvm-sh/nvm)), you may have noticed that it takes some time for Zsh to start. -![Powerlevel10k No Instant Prompt]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/no-instant-prompt.gif) +
+ Screen recording + + ![Powerlevel10k No Instant Prompt]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/no-instant-prompt.gif) +
Powerlevel10k can remove Zsh startup lag **even if it's not caused by a theme**. -![Powerlevel10k Instant Prompt]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/instant-prompt.gif) +
+ Screen recording + + ![Powerlevel10k Instant Prompt]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/instant-prompt.gif) +
This feature is called *Instant Prompt*. You need to explicitly enable it through `p10k configure` or [manually](#how-do-i-configure-instant-prompt). It does what it says on the tin -- prints prompt @@ -175,8 +199,12 @@ likewise for AWS, Azure and Google Cloud credentials, prompt will get pretty cro Enter *Show On Command*. This feature makes prompt segments appear only when they are relevant to the command you are currently typing. -![Powerlevel10k Show On Command]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/show-on-command.gif) +
+ Screen recording + + ![Powerlevel10k Show On Command]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/show-on-command.gif) +
Configs created by `p10k configure` enable show on command for several prompt segments by default. Here's the relevant parameter for kubernetes context: @@ -196,8 +224,12 @@ or change their values. When *Transient Prompt* is enabled through `p10k configure`, Powerlevel10k will trim down every prompt when accepting a command line. -![Powerlevel10k Transient Prompt]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/transient-prompt.gif) +
+ Screen recording + + ![Powerlevel10k Transient Prompt]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/transient-prompt.gif) +
Transient prompt makes it much easier to copy-paste series of commands from the terminal scrollback. @@ -211,8 +243,12 @@ The current working directory is perhaps the most important prompt segment. Powe great length to highlight its important parts and to truncate it with the least loss of information when horizontal space gets scarce. -![Powerlevel10k Directory Truncation]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/directory-truncation.gif) +
+ Screen recording + + ![Powerlevel10k Directory Truncation]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/directory-truncation.gif) +
When the full directory doesn't fit, the leftmost segment gets truncated to its shortest unique prefix. In the screencast, `~/work` becomes `~/wo`. It couldn't be truncated to `~/w` because it @@ -235,8 +271,12 @@ Directory segments are shown in one of three colors: Powerlevel10k can be configured to look like any other Zsh theme out there. -![Powerlevel10k Other Theme Emulation]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/other-theme-emulation.gif) +
+ Screen recording + + ![Powerlevel10k Other Theme Emulation]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/other-theme-emulation.gif) +
[Pure](#pure-compatibility), [Powerlevel9k](#powerlevel9k-compatibility) and [robbyrussell]( #how-to-make-powerlevel10k-look-like-robbyrussell-oh-my-zsh-theme) emulations are built-in. @@ -331,8 +371,12 @@ enable as many segments as you like. It won't slow down your prompt or Zsh start If there is no prompt segment that does what you need, implement your own. Powerlevel10k provides public API for defining segments that are as fast and as flexible as built-in ones. -![Powerlevel10k Custom Segment]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/custom-segment.gif) +
+ Screen recording + + ![Powerlevel10k Custom Segment]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/custom-segment.gif) +
On Linux you can fetch current CPU temperature by reading `/sys/class/thermal/thermal_zone0/temp`. The screencast shows how to define a prompt segment to display this value. Once the segment is From 356ce68f695ead155263687863a4d61a56731358 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 23 Dec 2021 08:35:10 +0100 Subject: [PATCH 118/380] doc: remove most content from "is it really fast" section --- README.md | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 91763872..09dc7a90 100644 --- a/README.md +++ b/README.md @@ -852,31 +852,9 @@ exec zsh ### Is it really fast? -Yes. - -[![asciicast](https://asciinema.org/a/NHRjK3BMePw66jtRVY2livHwZ.svg)]( - https://asciinema.org/a/NHRjK3BMePw66jtRVY2livHwZ) - -Benchmark results obtained with -[zsh-prompt-benchmark](https://github.com/romkatv/zsh-prompt-benchmark) on an Intel i9-7900X -running Ubuntu 18.04 with the config from the demo. - -| Theme | Prompt Latency | -|---------------------|---------------:| -| powerlevel9k/master | 1046 ms | -| powerlevel9k/next | 1005 ms | -| **powerlevel10k** | **8.7 ms** | - -Powerlevel10k is over 100 times faster than Powerlevel9k in this benchmark. - -In fairness, Powerlevel9k has acceptable latency when given a spartan configuration. If all you need -is the current directory without truncation or shortening, Powerlevel9k can render it for you in -17 ms. Powerlevel10k can do the same 30 times faster but it won't matter in practice because 17 ms -is fast enough (the threshold where latency becomes noticeable is around 50 ms). You have to be -careful with Powerlevel9k configuration as it's all too easy to make prompt frustratingly slow. -Powerlevel10k, on the other hand, doesn't require trading latency for utility -- it's virtually -instant with any configuration. It stays well below the 50 ms mark, leaving most of the latency -budget for other plugins you might install. +Yes. See [zsh-bench](https://github.com/romkatv/zsh-bench) or a direct comparison with +[Powerlevel9k](https://asciinema.org/a/NHRjK3BMePw66jtRVY2livHwZ) and +[Spaceship](https://asciinema.org/a/253094). ### How do I configure instant prompt? From 83f773caaedf46c6a3fe0adfcee1142ca302cf39 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 23 Dec 2021 08:40:12 +0100 Subject: [PATCH 119/380] doc: remove most content from "is it fast to load" section --- README.md | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/README.md b/README.md index 09dc7a90..ce80eacb 100644 --- a/README.md +++ b/README.md @@ -1195,20 +1195,7 @@ prompt latency when using Powerlevel10k, please ### Is Powerlevel10k fast to load? -Yes, provided that you are using Zsh >= 5.4. - -Loading time, or time to first prompt, can be measured with the following benchmark: - -```zsh -time (repeat 1000 zsh -dfis <<< 'source ~/powerlevel10k/powerlevel10k.zsh-theme') -``` - -*Note:* This measures time to first complete prompt. Powerlevel10k can also display a -[limited prompt](#instant-prompt) before the full-featured prompt is ready. - -Running this command with `~/powerlevel10k` as the current directory on the same machine as in the -[prompt benchmark](#is-it-really-fast) takes 29 seconds (29 ms per invocation). This is about 6 -times faster than powerlevel9k/master and 17 times faster than powerlevel9k/next. +Yes. See [zsh-bench](https://github.com/romkatv/zsh-bench). ### What is the relationship between Powerlevel9k and Powerlevel10k? From da5a4cdbec0cf1039ca2614c1912f0778ed16e53 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 23 Dec 2021 08:52:08 +0100 Subject: [PATCH 120/380] add high-level table of contents at the top and low-level table of contents in each section; remove the full table of contents from the bottom --- README.md | 188 ++++++++++++++++++++++++++---------------------------- 1 file changed, 90 insertions(+), 98 deletions(-) diff --git a/README.md b/README.md index ce80eacb..49c198ee 100644 --- a/README.md +++ b/README.md @@ -8,15 +8,17 @@ Powerlevel10k is a theme for Zsh. It emphasizes [speed](#uncompromising-performa ![Powerlevel10k]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/prompt-styles-high-contrast.png) -Ready to [get started](#get-started)? See below. +- [Getting started](#getting-started) +- [Features](#features) +- [Installation](#installation) +- [Configuration](#configuration) +- [Fonts](#fonts) +- [Try it in Docker](#try-it-in-docker) +- [License](#license) +- [FAQ](#faq) +- [Troubleshooting](#troubleshooting) -To see what Powerlevel10k is about go to [features](#features). - -Powerlevel9k users, go [here](#powerlevel9k-compatibility). - -See the [table of contents](#table-of-contents) at the bottom. - -## Get Started +## Getting started 1. Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). *Optional but highly recommended.* @@ -33,11 +35,23 @@ See the [table of contents](#table-of-contents) at the bottom. - [Zinit](#zinit) - [Homebrew](#homebrew) - [Arch Linux](#arch-linux) -1. Restart Zsh. +1. Restart Zsh with `exec zsh`. 1. Type `p10k configure` if the configuration wizard doesn't start automatically. ## Features +- [Configuration wizard](#configuration-wizard) +- [Uncompromising performance](#uncompromising-performance) +- [Powerlevel9k compatibility](#powerlevel9k-compatibility) +- [Pure compatibility](#pure-compatibility) +- [Instant prompt](#instant-prompt) +- [Show on command](#show-on-command) +- [Transient prompt](#transient-prompt) +- [Current directory that just works](#current-directory-that-just-works) +- [Extremely customizable](#extremely-customizable) +- [Batteries included](#batteries-included) +- [Extensible](#extensible) + ### Configuration wizard Type `p10k configure` to access the builtin configuration wizard right from your terminal. @@ -390,6 +404,19 @@ Powerlevel10k. ## Installation +- [Manual](#manual) +- [Oh My Zsh](#oh-my-zsh) +- [Prezto](#prezto) +- [Zim](#zim) +- [Antibody](#antibody) +- [Antigen](#antigen) +- [Zplug](#zplug) +- [Zgen](#zgen) +- [Zplugin](#zplugin) +- [Zinit](#zinit) +- [Homebrew](#homebrew) +- [Arch Linux](#arch-linux) + ### Manual ```zsh @@ -486,6 +513,9 @@ Historically, [it has been breaking often and for extended periods of time]( ## Configuration +- [For new users](#for-new-users) +- [For Powerlevel9k users](#for-powerlevel9k-users) + ### For new users On the first run, Powerlevel10k [configuration wizard](#configuration-wizard) will ask you a few @@ -669,7 +699,6 @@ the theme. Once you exit Zsh, the image is deleted. ```zsh docker run -e TERM -e COLORTERM -it --rm alpine sh -uec ' - apk update apk add git zsh nano vim git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k echo "source ~/powerlevel10k/powerlevel10k.zsh-theme" >>~/.zshrc @@ -689,6 +718,36 @@ Powerlevel10k is released under the ## FAQ +- [How do I update Powerlevel10k?](#how-do-i-update-powerlevel10k) +- [How do I uninstall Powerlevel10k?](#how-do-i-uninstall-powerlevel10k) +- [How do I install Powerlevel10k on a machine without Internet access?](#how-do-i-install-powerlevel10k-on-a-machine-without-internet-access) +- [Where can I ask for help and report bugs?](#where-can-i-ask-for-help-and-report-bugs) +- [Which aspects of shell and terminal does Powerlevel10k affect?](#which-aspects-of-shell-and-terminal-does-powerlevel10k-affect) +- [I'm using Powerlevel9k with Oh My Zsh. How do I migrate?](#im-using-powerlevel9k-with-oh-my-zsh-how-do-i-migrate) +- [Is it really fast?](#is-it-really-fast) +- [How do I configure instant prompt?](#how-do-i-configure-instant-prompt) +- [How do I initialize direnv when using instant prompt?](#how-do-i-initialize-direnv-when-using-instant-prompt) +- [How do I export GPG_TTY when using instant prompt?](#how-do-i-export-gpg_tty-when-using-instant-prompt) +- [What do different symbols in Git status mean?](#what-do-different-symbols-in-git-status-mean) +- [How do I change the format of Git status?](#how-do-i-change-the-format-of-git-status) +- [Why is Git status from `$HOME/.git` not displayed in prompt?](#why-is-git-status-from-homegit-not-displayed-in-prompt) +- [Why does Git status sometimes appear grey and then gets colored after a short period of time?](#why-does-git-status-sometimes-appear-grey-and-then-gets-colored-after-a-short-period-of-time) +- [How do I add username and/or hostname to prompt?](#how-do-i-add-username-andor-hostname-to-prompt) +- [Why some prompt segments appear and disappear as I'm typing?](#why-some-prompt-segments-appear-and-disappear-as-im-typing) +- [How do I change prompt colors?](#how-do-i-change-prompt-colors) +- [Why does Powerlevel10k spawn extra processes?](#why-does-powerlevel10k-spawn-extra-processes) +- [Are there configuration options that make Powerlevel10k slow?](#are-there-configuration-options-that-make-powerlevel10k-slow) +- [Is Powerlevel10k fast to load?](#is-powerlevel10k-fast-to-load) +- [What is the relationship between Powerlevel9k and Powerlevel10k?](#what-is-the-relationship-between-powerlevel9k-and-powerlevel10k) +- [Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config?](#does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config) +- [What is the best prompt style in the configuration wizard?](#what-is-the-best-prompt-style-in-the-configuration-wizard) +- [How to make Powerlevel10k look like robbyrussell Oh My Zsh theme?](#how-to-make-powerlevel10k-look-like-robbyrussell-oh-my-zsh-theme) +- [Can prompts for completed commands display error status for *those* commands instead of the commands preceding them?](#can-prompts-for-completed-commands-display-error-status-for-those-commands-instead-of-the-commands-preceding-them) +- [What is the minimum supported Zsh version?](#what-is-the-minimum-supported-zsh-version) +- [How were these screenshots and animated gifs created?](#how-were-these-screenshots-and-animated-gifs-created) +- [How was the recommended font created?](#how-was-the-recommended-font-created) +- [How to package Powerlevel10k for distribution?](#how-to-package-powerlevel10k-for-distribution) + ### How do I update Powerlevel10k? The command to update Powerlevel10k depends on how it was installed. @@ -1348,6 +1407,27 @@ Powerlevel10k are released. This may change in the future but not soon. ## Troubleshooting +- [Question mark in prompt](#question-mark-in-prompt) +- [Icons, glyphs or powerline symbols don't render](#icons-glyphs-or-powerline-symbols-dont-render) +- [Sub-pixel imperfections around powerline symbols](#sub-pixel-imperfections-around-powerline-symbols) +- [Error: character not in range](#error-character-not-in-range) +- [Cursor is in the wrong place](#cursor-is-in-the-wrong-place) +- [Prompt wrapping around in a weird way](#prompt-wrapping-around-in-a-weird-way) +- [Right prompt is in the wrong place](#right-prompt-is-in-the-wrong-place) +- [Configuration wizard runs automatically every time Zsh is started](#configuration-wizard-runs-automatically-every-time-zsh-is-started) +- [Some prompt styles are missing from the configuration wizard](#some-prompt-styles-are-missing-from-the-configuration-wizard) +- [Cannot install the recommended font](#cannot-install-the-recommended-font) +- [Extra or missing spaces in prompt compared to Powerlevel9k](#extra-or-missing-spaces-in-prompt-compared-to-powerlevel9k) + - [Extra space without background on the right side of right prompt](#extra-space-without-background-on-the-right-side-of-right-prompt) + - [Extra or missing spaces around icons](#extra-or-missing-spaces-around-icons) +- [Weird things happen after typing `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc) +- [Transient prompt stops working after some time](#transient-prompt-stops-working-after-some-time) +- [Cannot make Powerlevel10k work with my plugin manager](#cannot-make-powerlevel10k-work-with-my-plugin-manager) +- [Directory is difficult to see in prompt when using Rainbow style](#directory-is-difficult-to-see-in-prompt-when-using-rainbow-style) +- [Horrific mess when resizing terminal window](#horrific-mess-when-resizing-terminal-window) +- [Icons cut off in Konsole](#icons-cut-off-in-konsole) +- [Arch Linux logo has a dot in the bottom right corner](#arch-linux-logo-has-a-dot-in-the-bottom-right-corner) + ### Question mark in prompt If it looks like a regular `?`, that's normal. It means you have untracked files in the current Git @@ -1862,91 +1942,3 @@ Some fonts have this incorrect dotted icon in bold typeface. There are two ways ```zsh typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='${P9K_CONTENT}' # not bold ``` - -## Table of contents - -- [Features](#features) - - [Configuration wizard](#configuration-wizard) - - [Uncompromising performance](#uncompromising-performance) - - [Powerlevel9k compatibility](#powerlevel9k-compatibility) - - [Pure compatibility](#pure-compatibility) - - [Instant prompt](#instant-prompt) - - [Show on command](#show-on-command) - - [Transient prompt](#transient-prompt) - - [Current directory that just works](#current-directory-that-just-works) - - [Extremely customizable](#extremely-customizable) - - [Batteries included](#batteries-included) - - [Extensible](#extensible) -- [Installation](#installation) - - [Manual](#manual) - - [Oh My Zsh](#oh-my-zsh) - - [Prezto](#prezto) - - [Zim](#zim) - - [Antibody](#antibody) - - [Antigen](#antigen) - - [Zplug](#zplug) - - [Zgen](#zgen) - - [Zplugin](#zplugin) - - [Zinit](#zinit) - - [Homebrew](#homebrew) - - [Arch Linux](#arch-linux) -- [Configuration](#configuration) - - [For new users](#for-new-users) - - [For Powerlevel9k users](#for-powerlevel9k-users) -- [Fonts](#fonts) - - [Meslo Nerd Font patched for Powerlevel10k](#meslo-nerd-font-patched-for-powerlevel10k) - - [Automatic font installation](#automatic-font-installation) - - [Manual font installation](#manual-font-installation) -- [Try it in Docker](#try-it-in-docker) -- [License](#license) -- [FAQ](#faq) - - [How do I update Powerlevel10k?](#how-do-i-update-powerlevel10k) - - [How do I uninstall Powerlevel10k?](#how-do-i-uninstall-powerlevel10k) - - [How do I install Powerlevel10k on a machine without Internet access?](#how-do-i-install-powerlevel10k-on-a-machine-without-internet-access) - - [Where can I ask for help and report bugs?](#where-can-i-ask-for-help-and-report-bugs) - - [Which aspects of shell and terminal does Powerlevel10k affect?](#which-aspects-of-shell-and-terminal-does-powerlevel10k-affect) - - [I'm using Powerlevel9k with Oh My Zsh. How do I migrate?](#im-using-powerlevel9k-with-oh-my-zsh-how-do-i-migrate) - - [Is it really fast?](#is-it-really-fast) - - [How do I configure instant prompt?](#how-do-i-configure-instant-prompt) - - [How do I initialize direnv when using instant prompt?](#how-do-i-initialize-direnv-when-using-instant-prompt) - - [How do I export GPG_TTY when using instant prompt?](#how-do-i-export-gpg_tty-when-using-instant-prompt) - - [What do different symbols in Git status mean?](#what-do-different-symbols-in-git-status-mean) - - [How do I change the format of Git status?](#how-do-i-change-the-format-of-git-status) - - [Why is Git status from `$HOME/.git` not displayed in prompt?](#why-is-git-status-from-homegit-not-displayed-in-prompt) - - [Why does Git status sometimes appear grey and then gets colored after a short period of time?](#why-does-git-status-sometimes-appear-grey-and-then-gets-colored-after-a-short-period-of-time) - - [How do I add username and/or hostname to prompt?](#how-do-i-add-username-andor-hostname-to-prompt) - - [Why some prompt segments appear and disappear as I'm typing?](#why-some-prompt-segments-appear-and-disappear-as-im-typing) - - [How do I change prompt colors?](#how-do-i-change-prompt-colors) - - [Why does Powerlevel10k spawn extra processes?](#why-does-powerlevel10k-spawn-extra-processes) - - [Are there configuration options that make Powerlevel10k slow?](#are-there-configuration-options-that-make-powerlevel10k-slow) - - [Is Powerlevel10k fast to load?](#is-powerlevel10k-fast-to-load) - - [What is the relationship between Powerlevel9k and Powerlevel10k?](#what-is-the-relationship-between-powerlevel9k-and-powerlevel10k) - - [Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config?](#does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config) - - [What is the best prompt style in the configuration wizard?](#what-is-the-best-prompt-style-in-the-configuration-wizard) - - [How to make Powerlevel10k look like robbyrussell Oh My Zsh theme?](#how-to-make-powerlevel10k-look-like-robbyrussell-oh-my-zsh-theme) - - [Can prompts for completed commands display error status for *those* commands instead of the commands preceding them?](#can-prompts-for-completed-commands-display-error-status-for-those-commands-instead-of-the-commands-preceding-them) - - [What is the minimum supported Zsh version?](#what-is-the-minimum-supported-zsh-version) - - [How were these screenshots and animated gifs created?](#how-were-these-screenshots-and-animated-gifs-created) - - [How was the recommended font created?](#how-was-the-recommended-font-created) - - [How to package Powerlevel10k for distribution?](#how-to-package-powerlevel10k-for-distribution) -- [Troubleshooting](#troubleshooting) - - [Question mark in prompt](#question-mark-in-prompt) - - [Icons, glyphs or powerline symbols don't render](#icons-glyphs-or-powerline-symbols-dont-render) - - [Sub-pixel imperfections around powerline symbols](#sub-pixel-imperfections-around-powerline-symbols) - - [Error: character not in range](#error-character-not-in-range) - - [Cursor is in the wrong place](#cursor-is-in-the-wrong-place) - - [Prompt wrapping around in a weird way](#prompt-wrapping-around-in-a-weird-way) - - [Right prompt is in the wrong place](#right-prompt-is-in-the-wrong-place) - - [Configuration wizard runs automatically every time Zsh is started](#configuration-wizard-runs-automatically-every-time-zsh-is-started) - - [Some prompt styles are missing from the configuration wizard](#some-prompt-styles-are-missing-from-the-configuration-wizard) - - [Cannot install the recommended font](#cannot-install-the-recommended-font) - - [Extra or missing spaces in prompt compared to Powerlevel9k](#extra-or-missing-spaces-in-prompt-compared-to-powerlevel9k) - - [Extra space without background on the right side of right prompt](#extra-space-without-background-on-the-right-side-of-right-prompt) - - [Extra or missing spaces around icons](#extra-or-missing-spaces-around-icons) - - [Weird things happen after typing `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc) - - [Transient prompt stops working after some time](#transient-prompt-stops-working-after-some-time) - - [Cannot make Powerlevel10k work with my plugin manager](#cannot-make-powerlevel10k-work-with-my-plugin-manager) - - [Directory is difficult to see in prompt when using Rainbow style](#directory-is-difficult-to-see-in-prompt-when-using-rainbow-style) - - [Horrific mess when resizing terminal window](#horrific-mess-when-resizing-terminal-window) - - [Icons cut off in Konsole](#icons-cut-off-in-konsole) - - [Arch Linux logo has a dot in the bottom right corner](#arch-linux-logo-has-a-dot-in-the-bottom-right-corner) From 370535af455f49e6e194c169475774caeaf9414b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 23 Dec 2021 08:52:19 +0100 Subject: [PATCH 121/380] explicitly set LC_ALL when starting docker --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 49c198ee..2545024d 100644 --- a/README.md +++ b/README.md @@ -698,7 +698,7 @@ Try Powerlevel10k in Docker. You can safely make any changes to the file system the theme. Once you exit Zsh, the image is deleted. ```zsh -docker run -e TERM -e COLORTERM -it --rm alpine sh -uec ' +docker run -e TERM -e COLORTERM -e LC_ALL=C.UTF-8 -it --rm alpine sh -uec ' apk add git zsh nano vim git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k echo "source ~/powerlevel10k/powerlevel10k.zsh-theme" >>~/.zshrc From 00dd4ae009a6b79e886cb8ae1e04889d704ac511 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 23 Dec 2021 08:56:34 +0100 Subject: [PATCH 122/380] docs: shrink "getting started" --- README.md | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 2545024d..f2013d5a 100644 --- a/README.md +++ b/README.md @@ -20,21 +20,9 @@ https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/prompt-styl ## Getting started -1. Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). *Optional but highly +1. [Install the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). *Optional but highly recommended.* -1. Install Powerlevel10k for your plugin manager. - - [Manual](#manual) 👈 **choose this if confused or uncertain** - - [Oh My Zsh](#oh-my-zsh) - - [Prezto](#prezto) - - [Zim](#zim) - - [Antibody](#antibody) - - [Antigen](#antigen) - - [Zplug](#zplug) - - [Zgen](#zgen) - - [Zplugin](#zplugin) - - [Zinit](#zinit) - - [Homebrew](#homebrew) - - [Arch Linux](#arch-linux) +1. [Install Powerlevel10k](#installation) itself. 1. Restart Zsh with `exec zsh`. 1. Type `p10k configure` if the configuration wizard doesn't start automatically. @@ -404,7 +392,7 @@ Powerlevel10k. ## Installation -- [Manual](#manual) +- [Manual](#manual) 👈 **choose this if confused or uncertain** - [Oh My Zsh](#oh-my-zsh) - [Prezto](#prezto) - [Zim](#zim) From cde05cfa7bf857e5822847e762d1995e624388f5 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 23 Dec 2021 09:11:45 +0100 Subject: [PATCH 123/380] add a link to romkatv/zsh-bench#instant-prompt (should really copy some of that content over to p10k; maybe later) --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index f2013d5a..efdc9aa4 100644 --- a/README.md +++ b/README.md @@ -189,6 +189,9 @@ instantly upon Zsh startup allowing you to start typing while plugins are still Other themes *increase* Zsh startup lag -- some by a lot, others by a just a little. Powerlevel10k *removes* it outright. +If you are curious about how *Instant Prompt* works, see +[this section in zsh-bench](https://github.com/romkatv/zsh-bench#instant-prompt). + *FAQ:* [How do I configure instant prompt?](#how-do-i-configure-instant-prompt) ### Show on command From 2e58e3888efe9bc9214803e615f72510fb4b8155 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 23 Dec 2021 09:52:23 +0100 Subject: [PATCH 124/380] add POWERLEVEL9K_TERM_SHELL_INTEGRATION parameter that enables OSC 133 marks --- internal/p10k.zsh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index ced5b350..52df7f4a 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7208,6 +7208,8 @@ _p9k_init_params() { _p9k_declare -s POWERLEVEL9K_TRANSIENT_PROMPT off [[ $_POWERLEVEL9K_TRANSIENT_PROMPT == (off|always|same-dir) ]] || _POWERLEVEL9K_TRANSIENT_PROMPT=off + _p9k_declare -b POWERLEVEL9K_TERM_SHELL_INTEGRATION 0 + _p9k_declare -s POWERLEVEL9K_WORKER_LOG_LEVEL _p9k_declare -i POWERLEVEL9K_COMMANDS_MAX_TOKEN_COUNT 64 _p9k_declare -a POWERLEVEL9K_HOOK_WIDGETS -- @@ -8114,7 +8116,8 @@ _p9k_init_prompt() { _p9k_prompt_prefix_left+='${${_p9k__ind::=${${ZLE_RPROMPT_INDENT:-1}/#-*/0}}+}' fi - if [[ $ITERM_SHELL_INTEGRATION_INSTALLED == Yes ]]; then + if (( _POWERLEVEL9K_TERM_SHELL_INTEGRATION || __p9k_force_term_shell_integration )) || + [[ $ITERM_SHELL_INTEGRATION_INSTALLED == Yes ]]; then _p9k_prompt_prefix_left+=$'%{\e]133;A\a%}' _p9k_prompt_suffix_left+=$'%{\e]133;B\a%}' if (( $+_z4h_iterm_cmd && _z4h_can_save_restore_screen == 1 )); then @@ -8762,6 +8765,15 @@ fi _p9k_do_nothing() { true; } +_p9k_precmd_first() { + eval "$__p9k_intro" + if [[ -n $KITTY_SHELL_INTEGRATION && KITTY_SHELL_INTEGRATION[(wIe)no-prompt-mark] -eq 0 ]]; then + KITTY_SHELL_INTEGRATION+=' no-prompt-mark' + (( $+__p9k_force_term_shell_integration )) || typeset -gri __p9k_force_term_shell_integration=1 + fi + typeset -ga precmd_functions=(${precmd_functions:#_p9k_precmd_first}) +} + _p9k_setup() { (( __p9k_enabled )) && return @@ -8774,7 +8786,7 @@ _p9k_setup() { prompt_powerlevel9k_teardown __p9k_enabled=1 typeset -ga preexec_functions=(_p9k_preexec1 $preexec_functions _p9k_preexec2) - typeset -ga precmd_functions=(_p9k_do_nothing $precmd_functions _p9k_precmd) + typeset -ga precmd_functions=(_p9k_do_nothing _p9k_precmd_first $precmd_functions _p9k_precmd) } prompt_powerlevel9k_setup() { From c9bc2f5a329448b4955985fddfb24011ba90b9fa Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 23 Dec 2021 10:01:27 +0100 Subject: [PATCH 125/380] fix POWERLEVEL9K_TERM_SHELL_INTEGRATION --- internal/p10k.zsh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 52df7f4a..4ec1df12 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7209,6 +7209,9 @@ _p9k_init_params() { [[ $_POWERLEVEL9K_TRANSIENT_PROMPT == (off|always|same-dir) ]] || _POWERLEVEL9K_TRANSIENT_PROMPT=off _p9k_declare -b POWERLEVEL9K_TERM_SHELL_INTEGRATION 0 + if [[ __p9k_force_term_shell_integration -eq 1 || $ITERM_SHELL_INTEGRATION_INSTALLED == Yes ]]; then + _POWERLEVEL9K_TERM_SHELL_INTEGRATION=1 + fi _p9k_declare -s POWERLEVEL9K_WORKER_LOG_LEVEL _p9k_declare -i POWERLEVEL9K_COMMANDS_MAX_TOKEN_COUNT 64 @@ -8116,8 +8119,7 @@ _p9k_init_prompt() { _p9k_prompt_prefix_left+='${${_p9k__ind::=${${ZLE_RPROMPT_INDENT:-1}/#-*/0}}+}' fi - if (( _POWERLEVEL9K_TERM_SHELL_INTEGRATION || __p9k_force_term_shell_integration )) || - [[ $ITERM_SHELL_INTEGRATION_INSTALLED == Yes ]]; then + if (( _POWERLEVEL9K_TERM_SHELL_INTEGRATION )); then _p9k_prompt_prefix_left+=$'%{\e]133;A\a%}' _p9k_prompt_suffix_left+=$'%{\e]133;B\a%}' if (( $+_z4h_iterm_cmd && _z4h_can_save_restore_screen == 1 )); then @@ -8243,6 +8245,7 @@ _p9k_must_init() { _p9k_deinit fi _p9k__param_pat=$'v130\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat+=$__p9k_force_term_shell_integration$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$GITSTATUS_CACHE_DIR\1$GITSTATUS_AUTO_INSTALL\1${ZLE_RPROMPT_INDENT:-1}\1' @@ -8315,7 +8318,7 @@ function _p9k_init_cacheable() { _p9k_param prompt_prompt_char_ERROR_VIINS CONTENT_EXPANSION '${P9K_CONTENT}' _p9k_transient_prompt+='${:-"'$_p9k__ret'"}' _p9k_transient_prompt+=')%b%k%f%s%u ' - if [[ $ITERM_SHELL_INTEGRATION_INSTALLED == Yes ]]; then + if (( _POWERLEVEL9K_TERM_SHELL_INTEGRATION )); then _p9k_transient_prompt=$'%{\e]133;A\a%}'$_p9k_transient_prompt$'%{\e]133;B\a%}' if (( $+_z4h_iterm_cmd && _z4h_can_save_restore_screen == 1 )); then _p9k_transient_prompt=$'%{\ePtmux;\e\e]133;A\a\e\\%}'$_p9k_transient_prompt$'%{\ePtmux;\e\e]133;B\a\e\\%}' From ed70c90c2d6354a38b4528df231ffd599277c548 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 27 Dec 2021 08:15:08 +0100 Subject: [PATCH 126/380] fix a bug with URL-escaping for directory links (#1687) --- internal/p10k.zsh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 4ec1df12..275cf023 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1744,14 +1744,16 @@ function _p9k_shorten_delim_len() { (( _p9k__ret >= 0 )) || _p9k_prompt_length $1 } +# Percents are duplicated because this function is currently used only +# where the result is going to be percent-expanded. function _p9k_url_escape() { if [[ $1 == [a-zA-Z0-9"/:_.-!'()~ "]# ]]; then - _p9k__ret=${1// /%20} + _p9k__ret=${1// /%%20} else local c _p9k__ret= for c in ${(s::)1}; do - [[ $c == [a-zA-Z0-9"/:_.-!'()~"] ]] || printf -v c '%%%02X' $(( #c )) + [[ $c == [a-zA-Z0-9"/:_.-!'()~"] ]] || printf -v c '%%%%%02X' $(( #c )) _p9k__ret+=$c done fi @@ -8244,7 +8246,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v130\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v131\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$__p9k_force_term_shell_integration$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' From 0d6202c07749e18c9f90fc331cb21e538ccb9f60 Mon Sep 17 00:00:00 2001 From: Andrew Janian Date: Wed, 29 Dec 2021 14:25:16 -0500 Subject: [PATCH 127/380] add puTTY to the install section including not about a bug in versions prior to 0.75 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index efdc9aa4..73d7bcb2 100644 --- a/README.md +++ b/README.md @@ -662,6 +662,8 @@ If you are using a different terminal, proceed with manual font installation. font_family MesloLGS NF ``` Restart Kitty by closing all sessions and opening a new session. + - **puTTY**: puTTY only works in version >= 0.75 due to a unicode display [bug](https://github.com/romkatv/powerlevel10k/issues/674#issuecomment-835416130) + fixed in 0.75. Set Window -> Appearance -> Font to `MesloLGS NF` - **WezTerm**: Create or open `$HOME/.config/wezterm/wezterm.lua` and add the following: ```lua local wezterm = require 'wezterm'; From ab321a2a03388272cbf00fb6eda52e1cee87a02c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 1 Jan 2022 07:52:01 +0100 Subject: [PATCH 128/380] docs: clean up puTTY font instructions --- README.md | 4 ++-- font.md | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 73d7bcb2..ae57d0f5 100644 --- a/README.md +++ b/README.md @@ -662,8 +662,8 @@ If you are using a different terminal, proceed with manual font installation. font_family MesloLGS NF ``` Restart Kitty by closing all sessions and opening a new session. - - **puTTY**: puTTY only works in version >= 0.75 due to a unicode display [bug](https://github.com/romkatv/powerlevel10k/issues/674#issuecomment-835416130) - fixed in 0.75. Set Window -> Appearance -> Font to `MesloLGS NF` + - **puTTY**: Set *Window* → *Appearance* → *Font* to `MesloLGS NF`. Requires puTTY + version >= 0.75. - **WezTerm**: Create or open `$HOME/.config/wezterm/wezterm.lua` and add the following: ```lua local wezterm = require 'wezterm'; diff --git a/font.md b/font.md index 20a1bb99..d63597da 100644 --- a/font.md +++ b/font.md @@ -94,6 +94,8 @@ If you are using a different terminal, proceed with manual font installation. font_family MesloLGS NF ``` Restart Kitty by closing all sessions and opening a new session. + - **puTTY**: Set *Window* → *Appearance* → *Font* to `MesloLGS NF`. Requires puTTY + version >= 0.75. - **WezTerm**: Create or open `$HOME/.config/wezterm/wezterm.lua` and add the following: ```lua local wezterm = require 'wezterm'; From ced77880120dc8073f5781fc7994942ff5ebbfae Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 1 Jan 2022 07:54:06 +0100 Subject: [PATCH 129/380] docs: fix indentation --- font.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/font.md b/font.md index d63597da..bbfe1eb2 100644 --- a/font.md +++ b/font.md @@ -89,11 +89,11 @@ If you are using a different terminal, proceed with manual font installation. normal: family: "MesloLGS NF" ``` - - **Kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following line to it: - ```text - font_family MesloLGS NF - ``` - Restart Kitty by closing all sessions and opening a new session. + - **Kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following line to it: + ```text + font_family MesloLGS NF + ``` + Restart Kitty by closing all sessions and opening a new session. - **puTTY**: Set *Window* → *Appearance* → *Font* to `MesloLGS NF`. Requires puTTY version >= 0.75. - **WezTerm**: Create or open `$HOME/.config/wezterm/wezterm.lua` and add the following: @@ -106,9 +106,9 @@ If you are using a different terminal, proceed with manual font installation. If the file already exists, only add the line with the font to the existing return. Also add the first line if it is not already present. - **urxvt**: Create or open `~/.Xresources` and add the following line to it: - ```text - URxvt.font: xft:MesloLGS NF:size=11 - ``` + ```text + URxvt.font: xft:MesloLGS NF:size=11 + ``` You can adjust the font size to your preference. After changing the configuration use `xrdb ~/.Xresources` to reload the config. The new config is applied for all new terminals. 1. Run `p10k configure` to generate a new `~/.p10k.zsh`. The old config may work From dd3dcfaf51d2f12ea208c0c96b2f039c0435ec00 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 2 Jan 2022 07:51:53 +0100 Subject: [PATCH 130/380] make `toolbox` segment work with distrobox (#1696) --- internal/p10k.zsh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 275cf023..20417687 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8227,14 +8227,17 @@ _p9k_init_ssh() { } _p9k_init_toolbox() { - [[ -z $P9K_TOOLBOX_NAME && - -e /run/.toolboxenv && - -f /run/.containerenv && - -r /run/.containerenv ]] || return 0 - local name=(${(Q)${${(@M)${(f)"$( Date: Sun, 2 Jan 2022 15:14:26 +0100 Subject: [PATCH 131/380] fix cwd handling when the current dir is '/foo\bar' (#1697) --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 20417687..591cff18 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -200,7 +200,7 @@ function _p9k_read_word() { } function _p9k_fetch_cwd() { - _p9k__cwd=${(g:oce:)${(%):-%/}} + _p9k__cwd=${${${:-.}:a}:-.} _p9k__cwd_a=${${_p9k__cwd:A}:-.} case $_p9k__cwd in From 3d3b24c419a3b35b632e96fe9de34641e06f8521 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 4 Jan 2022 12:05:05 +0100 Subject: [PATCH 132/380] work around bugs in WSL where it /proc/pid/cwd reports an alias drive --- internal/p10k.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 591cff18..db3495e9 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -200,7 +200,11 @@ function _p9k_read_word() { } function _p9k_fetch_cwd() { - _p9k__cwd=${${${:-.}:a}:-.} + if [[ $PWD == /* && $PWD -ef . ]]; then + _p9k__cwd=$PWD + else + _p9k__cwd=${${${:-.}:a}:-.} + fi _p9k__cwd_a=${${_p9k__cwd:A}:-.} case $_p9k__cwd in From c8160f29543a2f57ae7149103deefa029fd4e861 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 4 Jan 2022 12:14:19 +0100 Subject: [PATCH 133/380] Squashed 'gitstatus/' changes from f1cf61b24..e02d9eedd e02d9eedd fix cwd detection when it has weird characters 78c171590 Loongarch support (#290) be6396b1a fix pkg_add command on openbsd (#282) f1c89585a avoid ksh if possible (it's broken; see #282) 22407d6fd bug fix: correctly resolve pwd when it contains control chars git-subtree-dir: gitstatus git-subtree-split: e02d9eedd9d8f3689e6a6cdccec70b55cf87dca6 --- build | 16 +++++++++++++++- gitstatus.plugin.zsh | 16 ++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/build b/build index d23f8fc1..ad39910a 100755 --- a/build +++ b/build @@ -12,11 +12,24 @@ fi export LC_ALL=C if [ -z "${ZSH_VERSION-}" ] && command -v zsh >/dev/null 2>&1; then + # Avoid bash 3.*. case "${BASH_VERSION-}" in [0-3].*) exec zsh "$0" "$@";; esac fi +# Avoid ksh: https://github.com/romkatv/gitstatus/issues/282. +if [ -n "${KSH_VERSION-}" ]; then + if [ -z "${ZSH_VERSION-}" ] && command -v zsh >/dev/null 2>&1; then + exec zsh "$0" "$@" + elif [ -z "${BASH_VERSION-}" ] && command -v bash >/dev/null 2>&1 && + bash_version="$(bash --version 2>&1)"; then + case "$bash_version" in + *version\ [4-9]*|*version\ [1-9][0-9]*) exec bash "$0" "$@";; + esac + fi +fi + usage="$(command cat <<\END Usage: build [-m ARCH] [-c CPU] [-d CMD] [-i IMAGE] [-s] [-w] @@ -91,7 +104,7 @@ if [ -n "$gitstatus_install_tools" ]; then command pkg install -y cmake gmake binutils git perl5 wget ;; openbsd) - command pkg_add install cmake gmake gcc git wget + command pkg_add cmake gmake gcc g++ git wget ;; netbsd) command pkgin -y install cmake gmake binutils git @@ -509,6 +522,7 @@ if [ -z "$gitstatus_cpu" ]; then arm64|aarch64) gitstatus_cpu=armv8-a;; ppc64le) gitstatus_cpu=powerpc64le;; riscv64) gitstatus_cpu=rv64imafdc;; + loongarch64) gitstatus_cpu=loongarch64;; x86_64|amd64) gitstatus_cpu=x86-64;; x86) gitstatus_cpu=i586;; s390x) gitstatus_cpu=z900;; diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index cef78974..181e756a 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -185,9 +185,21 @@ function gitstatus_query"${1:-}"() { (( _GITSTATUS_STATE_$name == 2 )) || return if [[ -z $GIT_DIR ]]; then - [[ $dir == /* ]] || dir=${(%):-%/}/$dir + if [[ $dir != /* ]]; then + if [[ $PWD == /* && $PWD -ef . ]]; then + dir=$PWD/$dir + else + dir=${dir:a} + fi + fi else - [[ $GIT_DIR == /* ]] && dir=:$GIT_DIR || dir=:${(%):-%/}/$GIT_DIR + if [[ $GIT_DIR == /* ]]; then + dir=:$GIT_DIR + elif [[ $PWD == /* && $PWD -ef . ]]; then + dir=:$PWD/$GIT_DIR + else + dir=:${GIT_DIR:a} + fi fi if [[ $dir != (|:)/* ]]; then From 67ac98d515c2d8c7a85345aa2e3597df364c2f16 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 5 Jan 2022 08:36:29 +0100 Subject: [PATCH 134/380] doc: kitty v0.24.0 has been released (the first version with shell integration) --- README.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index ae57d0f5..72b30a09 100644 --- a/README.md +++ b/README.md @@ -1862,15 +1862,9 @@ There is no ETA for the patch making its way into upstream Zsh. See [discussion] There are a few mitigation options for this issue. -- Use [Kitty](https://sw.kovidgoyal.net/kitty/) and enable terminal-shell integration in - Powerlevel10k. The latter can be done by appending these lines to `~/.zshrc`: - ```zsh - unset KITTY_SHELL_INTEGRATION - ITERM_SHELL_INTEGRATION_INSTALLED=Yes - ``` - At the time of this writing (Dec 2021) the latest release of Kitty (0.23.1) doesn't have the - necessary code to fix the issue. If by the time you are reading this there is no newer version, - you'll have to build from source. +- Use [kitty](https://sw.kovidgoyal.net/kitty/) terminal version >= 0.24.0 and enable terminal-shell + integration in Powerlevel10k by defining `POWERLEVEL9K_TERM_SHELL_INTEGRATION=true` in + `~/.p10k.zsh`. - Apply [the patch](#zsh-patch) and [rebuild Zsh from source]( https://github.com/zsh-users/zsh/blob/master/INSTALL). It won't help if you are using Alacritty, Kitty or some other terminal that reflows text on resize but doesn't reflow saved cursor position. From 66c0181f765185d20386174cad19d7ecee0b97a1 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 5 Jan 2022 08:37:11 +0100 Subject: [PATCH 135/380] doc: s/Kitty/kitty/ --- README.md | 6 +++--- font.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 72b30a09..3d4b8fb1 100644 --- a/README.md +++ b/README.md @@ -657,11 +657,11 @@ If you are using a different terminal, proceed with manual font installation. normal: family: "MesloLGS NF" ``` - - **Kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following line to it: + - **kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following line to it: ```text font_family MesloLGS NF ``` - Restart Kitty by closing all sessions and opening a new session. + Restart kitty by closing all sessions and opening a new session. - **puTTY**: Set *Window* → *Appearance* → *Font* to `MesloLGS NF`. Requires puTTY version >= 0.75. - **WezTerm**: Create or open `$HOME/.config/wezterm/wezterm.lua` and add the following: @@ -1867,7 +1867,7 @@ There are a few mitigation options for this issue. `~/.p10k.zsh`. - Apply [the patch](#zsh-patch) and [rebuild Zsh from source]( https://github.com/zsh-users/zsh/blob/master/INSTALL). It won't help if you are using Alacritty, - Kitty or some other terminal that reflows text on resize but doesn't reflow saved cursor position. + kitty or some other terminal that reflows text on resize but doesn't reflow saved cursor position. On such terminals the patch will have no visible effect. - Disable text reflowing on window resize in terminal settings. If your terminal doesn't have this setting, try a different terminal. diff --git a/font.md b/font.md index bbfe1eb2..4be264f6 100644 --- a/font.md +++ b/font.md @@ -89,11 +89,11 @@ If you are using a different terminal, proceed with manual font installation. normal: family: "MesloLGS NF" ``` - - **Kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following line to it: + - **kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following line to it: ```text font_family MesloLGS NF ``` - Restart Kitty by closing all sessions and opening a new session. + Restart kitty by closing all sessions and opening a new session. - **puTTY**: Set *Window* → *Appearance* → *Font* to `MesloLGS NF`. Requires puTTY version >= 0.75. - **WezTerm**: Create or open `$HOME/.config/wezterm/wezterm.lua` and add the following: From fba50d967184c6b5be15a94c0c960b7f0811585b Mon Sep 17 00:00:00 2001 From: "Andrea Cervesato (TheKoma)" Date: Sun, 26 Dec 2021 16:13:24 +0100 Subject: [PATCH 136/380] Added gsutil as is the main "other command" in GCP --- config/p10k-classic.zsh | 2 +- config/p10k-lean-8colors.zsh | 2 +- config/p10k-lean.zsh | 2 +- config/p10k-rainbow.zsh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 5daf34f3..10bc44e1 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1358,7 +1358,7 @@ ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### # Show gcloud only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show gcloud. - typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs' + typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil' # Google cloud color. typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=32 diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index e0e6cc7f..78c888b6 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1339,7 +1339,7 @@ ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### # Show gcloud only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show gcloud. - typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs' + typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil' # Google cloud color. typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=4 diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index af802d16..e106133e 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1335,7 +1335,7 @@ ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### # Show gcloud only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show gcloud. - typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs' + typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil' # Google cloud color. typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=32 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 0c90ff98..5531a0d1 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1434,7 +1434,7 @@ ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### # Show gcloud only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show gcloud. - typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs' + typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil' # Google cloud color. typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=7 typeset -g POWERLEVEL9K_GCLOUD_BACKGROUND=4 From e1c52e08d43652a513379f7bac7c57664c895d43 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 6 Jan 2022 12:37:06 +0100 Subject: [PATCH 137/380] add an icon for amazon linux (#1706) --- internal/icons.zsh | 6 ++++++ internal/p10k.zsh | 3 ++- internal/wizard.zsh | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/icons.zsh b/internal/icons.zsh index 60de3444..e3d71ffa 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -70,6 +70,7 @@ function _p9k_init_icons() { LINUX_VOID_ICON '\uE271'$s #  LINUX_ARTIX_ICON '\uE271'$s #  LINUX_RHEL_ICON '\uE271'$s #  + LINUX_AMZN_ICON '\uE271'$s #  SUNOS_ICON '\U1F31E'$q # 🌞 HOME_ICON '\uE12C'$s #  HOME_SUB_ICON '\uE18D'$s #  @@ -205,6 +206,7 @@ function _p9k_init_icons() { LINUX_VOID_ICON '\uF17C'$s #  LINUX_ARTIX_ICON '\uF17C'$s #  LINUX_RHEL_ICON '\uF17C'$s #  + LINUX_AMZN_ICON '\uF17C'$s #  SUNOS_ICON '\uF185 ' #  HOME_ICON '\uF015'$s #  HOME_SUB_ICON '\uF07C'$s #  @@ -341,6 +343,7 @@ function _p9k_init_icons() { LINUX_VOID_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" LINUX_ARTIX_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" LINUX_RHEL_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" + LINUX_AMZN_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" SUNOS_ICON "${CODEPOINT_OF_AWESOME_SUN_O:+\\u$CODEPOINT_OF_AWESOME_SUN_O }" HOME_ICON "${CODEPOINT_OF_AWESOME_HOME:+\\u$CODEPOINT_OF_AWESOME_HOME$s}" HOME_SUB_ICON "${CODEPOINT_OF_AWESOME_FOLDER_OPEN:+\\u$CODEPOINT_OF_AWESOME_FOLDER_OPEN$s}" @@ -470,6 +473,7 @@ function _p9k_init_icons() { LINUX_ARTIX_ICON '\uF17C' #  LINUX_UBUNTU_ICON '\uF31b'$s #  LINUX_RHEL_ICON '\uF316'$s #  + LINUX_AMZN_ICON '\uF270'$s #  LINUX_ICON '\uF17C' #  SUNOS_ICON '\uF185 ' #  HOME_ICON '\uF015'$s #  @@ -600,6 +604,7 @@ function _p9k_init_icons() { LINUX_VOID_ICON 'void' LINUX_ARTIX_ICON 'artix' LINUX_RHEL_ICON 'rhel' + LINUX_AMZN_ICON 'amzn' SUNOS_ICON 'sunos' HOME_ICON '' HOME_SUB_ICON '' @@ -731,6 +736,7 @@ function _p9k_init_icons() { LINUX_VOID_ICON 'Vo' LINUX_ARTIX_ICON 'Art' LINUX_RHEL_ICON 'RH' + LINUX_AMZN_ICON 'Amzn' SUNOS_ICON 'Sun' HOME_ICON '' HOME_SUB_ICON '' diff --git a/internal/p10k.zsh b/internal/p10k.zsh index db3495e9..54ab71df 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8253,7 +8253,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v131\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v132\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$__p9k_force_term_shell_integration$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' @@ -8380,6 +8380,7 @@ function _p9k_init_cacheable() { *void*) _p9k_set_os Linux LINUX_VOID_ICON;; *artix*) _p9k_set_os Linux LINUX_ARTIX_ICON;; *rhel*) _p9k_set_os Linux LINUX_RHEL_ICON;; + amzn) _p9k_set_os Linux LINUX_AMZN_ICON;; *) _p9k_set_os Linux LINUX_ICON;; esac ;; diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 0b81417a..62564486 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1093,6 +1093,7 @@ function os_icon_name() { *void*) echo LINUX_VOID_ICON;; *artix*) echo LINUX_ARTIX_ICON;; *rhel*) echo LINUX_RHEL_ICON;; + amzn) echo LINUX_AMZN_ICON;; *) echo LINUX_ICON;; esac ;; From 683a485232d75978a79199a305c4fc4843772a77 Mon Sep 17 00:00:00 2001 From: MenkeTechnologies Date: Sat, 8 Jan 2022 13:43:25 -0500 Subject: [PATCH 138/380] remove duplicate the --- config/p10k-classic.zsh | 10 +++++----- config/p10k-lean-8colors.zsh | 10 +++++----- config/p10k-lean.zsh | 10 +++++----- config/p10k-rainbow.zsh | 10 +++++----- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 10bc44e1..21ca0155 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1213,7 +1213,7 @@ # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# - # Show kubecontext only when the the command you are typing invokes one of these tools. + # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' @@ -1300,7 +1300,7 @@ # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%248Fat ' #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# - # Show aws only when the the command you are typing invokes one of these tools. + # Show aws only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show aws. typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' @@ -1347,7 +1347,7 @@ # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## - # Show azure only when the the command you are typing invokes one of these tools. + # Show azure only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show azure. typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' # Azure account name color. @@ -1356,7 +1356,7 @@ # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### - # Show gcloud only when the the command you are typing invokes one of these tools. + # Show gcloud only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show gcloud. typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil' # Google cloud color. @@ -1397,7 +1397,7 @@ # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# - # Show google_app_cred only when the the command you are typing invokes one of these tools. + # Show google_app_cred only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show google_app_cred. typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 78c888b6..dc96d4df 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1155,7 +1155,7 @@ # typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐' #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# - # Show kubecontext only when the the command you are typing invokes one of these tools. + # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' @@ -1281,7 +1281,7 @@ # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# - # Show aws only when the the command you are typing invokes one of these tools. + # Show aws only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show aws. typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' @@ -1328,7 +1328,7 @@ # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## - # Show azure only when the the command you are typing invokes one of these tools. + # Show azure only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show azure. typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' # Azure account name color. @@ -1337,7 +1337,7 @@ # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### - # Show gcloud only when the the command you are typing invokes one of these tools. + # Show gcloud only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show gcloud. typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil' # Google cloud color. @@ -1378,7 +1378,7 @@ # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# - # Show google_app_cred only when the the command you are typing invokes one of these tools. + # Show google_app_cred only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show google_app_cred. typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index e106133e..fc3f20d7 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1151,7 +1151,7 @@ # typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐' #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# - # Show kubecontext only when the the command you are typing invokes one of these tools. + # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' @@ -1277,7 +1277,7 @@ # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# - # Show aws only when the the command you are typing invokes one of these tools. + # Show aws only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show aws. typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' @@ -1324,7 +1324,7 @@ # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## - # Show azure only when the the command you are typing invokes one of these tools. + # Show azure only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show azure. typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' # Azure account name color. @@ -1333,7 +1333,7 @@ # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### - # Show gcloud only when the the command you are typing invokes one of these tools. + # Show gcloud only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show gcloud. typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil' # Google cloud color. @@ -1374,7 +1374,7 @@ # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# - # Show google_app_cred only when the the command you are typing invokes one of these tools. + # Show google_app_cred only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show google_app_cred. typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 5531a0d1..ef5b444e 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1284,7 +1284,7 @@ typeset -g POWERLEVEL9K_TERRAFORM_VERSION_SHOW_ON_COMMAND='terraform|tf' #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# - # Show kubecontext only when the the command you are typing invokes one of these tools. + # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' @@ -1373,7 +1373,7 @@ # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='at ' #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# - # Show aws only when the the command you are typing invokes one of these tools. + # Show aws only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show aws. typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' @@ -1422,7 +1422,7 @@ # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## - # Show azure only when the the command you are typing invokes one of these tools. + # Show azure only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show azure. typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' # Azure account name color. @@ -1432,7 +1432,7 @@ # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### - # Show gcloud only when the the command you are typing invokes one of these tools. + # Show gcloud only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show gcloud. typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil' # Google cloud color. @@ -1474,7 +1474,7 @@ # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# - # Show google_app_cred only when the the command you are typing invokes one of these tools. + # Show google_app_cred only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show google_app_cred. typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' From 6fae3a169b470ba84ef7f643451e1cac4be58d77 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 11 Jan 2022 12:55:43 +0100 Subject: [PATCH 139/380] add toolbox segment to the docs (#1713) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3d4b8fb1..26f4674d 100644 --- a/README.md +++ b/README.md @@ -350,6 +350,7 @@ enable as many segments as you like. It won't slow down your prompt or Zsh start | `azure` | [azure](https://docs.microsoft.com/en-us/cli/azure) account name | | `gcloud` | [google cloud](https://cloud.google.com/) cli account and project | | `google_app_cred` | [google application credentials](https://cloud.google.com/docs/authentication/production) | +| `toolbox` | [toolbox](https://github.com/containers/toolbox) name | | `nordvpn` | [nordvpn](https://nordvpn.com/) connection status | | `ranger` | [ranger](https://github.com/ranger/ranger) shell | | `nnn` | [nnn](https://github.com/jarun/nnn) shell | From fdbde52c201569afc53229412fea11aae87d6bc8 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 11 Jan 2022 12:56:27 +0100 Subject: [PATCH 140/380] docs: sort the table of segments --- README.md | 106 +++++++++++++++++++++++++++--------------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index 26f4674d..2ab2591b 100644 --- a/README.md +++ b/README.md @@ -308,69 +308,69 @@ enable as many segments as you like. It won't slow down your prompt or Zsh start | Segment | Meaning | |--------:|---------| -| `os_icon` | your OS logo (apple for macOS, swirl for debian, etc.) | -| `dir` | current working directory | -| `vcs` | Git repository status | -| `prompt_char` | multi-functional prompt symbol; changes depending on vi mode: `❯`, `❮`, `V`, `▶` for insert, command, visual and replace mode respectively; turns red on error | -| `context` | user@hostname | -| `status` | exit code of the last command | -| `command_execution_time` | duration (wall time) of the last command | -| `background_jobs` | presence of background jobs | -| `time` | current time | -| `direnv` | [direnv](https://direnv.net/) status | -| `asdf` | tool versions from [asdf](https://github.com/asdf-vm/asdf) | -| `virtualenv` | python environment from [venv](https://docs.python.org/3/library/venv.html) | | `anaconda` | virtual environment from [conda](https://conda.io/) | -| `pyenv` | python environment from [pyenv](https://github.com/pyenv/pyenv) | -| `goenv` | go environment from [goenv](https://github.com/syndbg/goenv) | -| `nodenv` | node.js environment from [nodenv](https://github.com/nodenv/nodenv) | -| `nvm` | node.js environment from [nvm](https://github.com/nvm-sh/nvm) | -| `nodeenv` | node.js environment from [nodeenv](https://github.com/ekalinin/nodeenv) | -| `rbenv` | ruby environment from [rbenv](https://github.com/rbenv/rbenv) | -| `rvm` | ruby environment from [rvm](https://rvm.io) | -| `fvm` | flutter environment from [fvm](https://github.com/leoafarias/fvm) | -| `luaenv` | lua environment from [luaenv](https://github.com/cehoffman/luaenv) | -| `jenv` | java environment from [jenv](https://github.com/jenv/jenv) | -| `plenv` | perl environment from [plenv](https://github.com/tokuhirom/plenv) | -| `phpenv` | php environment from [phpenv](https://github.com/phpenv/phpenv) | -| `haskell_stack` | haskell version from [stack](https://haskellstack.org/) | -| `node_version` | [node.js](https://nodejs.org/) version | -| `go_version` | [go](https://golang.org) version | -| `rust_version` | [rustc](https://www.rust-lang.org) version | -| `dotnet_version` | [dotnet](https://dotnet.microsoft.com) version | -| `php_version` | [php](https://www.php.net/) version | -| `laravel_version` | [laravel php framework](https://laravel.com/) version | -| `java_version` | [java](https://www.java.com/) version | -| `package` | `name@version` from [package.json](https://docs.npmjs.com/files/package.json) | -| `kubecontext` | current [kubernetes](https://kubernetes.io/) context | -| `terraform` | [terraform](https://www.terraform.io) workspace | -| `terraform_version` | [terraform](https://www.terraform.io) version | +| `asdf` | tool versions from [asdf](https://github.com/asdf-vm/asdf) | | `aws` | [aws profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) | | `aws_eb_env` | [aws elastic beanstalk](https://aws.amazon.com/elasticbeanstalk/) environment | | `azure` | [azure](https://docs.microsoft.com/en-us/cli/azure) account name | +| `background_jobs` | presence of background jobs | +| `battery` | internal battery state and charge level (yep, batteries *literally* included) | +| `command_execution_time` | duration (wall time) of the last command | +| `context` | user@hostname | +| `dir` | current working directory | +| `direnv` | [direnv](https://direnv.net/) status | +| `disk_usage` | disk usage | +| `dotnet_version` | [dotnet](https://dotnet.microsoft.com) version | +| `fvm` | flutter environment from [fvm](https://github.com/leoafarias/fvm) | | `gcloud` | [google cloud](https://cloud.google.com/) cli account and project | +| `goenv` | go environment from [goenv](https://github.com/syndbg/goenv) | | `google_app_cred` | [google application credentials](https://cloud.google.com/docs/authentication/production) | -| `toolbox` | [toolbox](https://github.com/containers/toolbox) name | -| `nordvpn` | [nordvpn](https://nordvpn.com/) connection status | -| `ranger` | [ranger](https://github.com/ranger/ranger) shell | -| `nnn` | [nnn](https://github.com/jarun/nnn) shell | -| `xplr` | [xplr](https://github.com/sayanarijit/xplr) shell | -| `vim_shell` | [vim](https://www.vim.org/) shell (`:sh`) | +| `go_version` | [go](https://golang.org) version | +| `haskell_stack` | haskell version from [stack](https://haskellstack.org/) | +| `ip` | IP address and bandwidth usage for a specified network interface | +| `java_version` | [java](https://www.java.com/) version | +| `jenv` | java environment from [jenv](https://github.com/jenv/jenv) | +| `kubecontext` | current [kubernetes](https://kubernetes.io/) context | +| `laravel_version` | [laravel php framework](https://laravel.com/) version | +| `load` | CPU load | +| `luaenv` | lua environment from [luaenv](https://github.com/cehoffman/luaenv) | | `midnight_commander` | [midnight commander](https://midnight-commander.org/) shell | | `nix_shell` | [nix shell](https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) indicator | -| `todo` | [todo](https://github.com/todotxt/todo.txt-cli) items | -| `timewarrior` | [timewarrior](https://timewarrior.net/) tracking status | -| `taskwarrior` | [taskwarrior](https://taskwarrior.org/) task count | -| `vpn_ip` | virtual private network indicator | -| `ip` | IP address and bandwidth usage for a specified network interface | -| `load` | CPU load | -| `disk_usage` | disk usage | -| `ram` | free RAM | -| `swap` | used swap | -| `public_ip` | public IP address | +| `nnn` | [nnn](https://github.com/jarun/nnn) shell | +| `nodeenv` | node.js environment from [nodeenv](https://github.com/ekalinin/nodeenv) | +| `nodenv` | node.js environment from [nodenv](https://github.com/nodenv/nodenv) | +| `node_version` | [node.js](https://nodejs.org/) version | +| `nordvpn` | [nordvpn](https://nordvpn.com/) connection status | +| `nvm` | node.js environment from [nvm](https://github.com/nvm-sh/nvm) | +| `os_icon` | your OS logo (apple for macOS, swirl for debian, etc.) | +| `package` | `name@version` from [package.json](https://docs.npmjs.com/files/package.json) | +| `phpenv` | php environment from [phpenv](https://github.com/phpenv/phpenv) | +| `php_version` | [php](https://www.php.net/) version | +| `plenv` | perl environment from [plenv](https://github.com/tokuhirom/plenv) | +| `prompt_char` | multi-functional prompt symbol; changes depending on vi mode: `❯`, `❮`, `V`, `▶` for insert, command, visual and replace mode respectively; turns red on error | | `proxy` | system-wide http/https/ftp proxy | +| `public_ip` | public IP address | +| `pyenv` | python environment from [pyenv](https://github.com/pyenv/pyenv) | +| `ram` | free RAM | +| `ranger` | [ranger](https://github.com/ranger/ranger) shell | +| `rbenv` | ruby environment from [rbenv](https://github.com/rbenv/rbenv) | +| `rust_version` | [rustc](https://www.rust-lang.org) version | +| `rvm` | ruby environment from [rvm](https://rvm.io) | +| `status` | exit code of the last command | +| `swap` | used swap | +| `taskwarrior` | [taskwarrior](https://taskwarrior.org/) task count | +| `terraform` | [terraform](https://www.terraform.io) workspace | +| `terraform_version` | [terraform](https://www.terraform.io) version | +| `time` | current time | +| `timewarrior` | [timewarrior](https://timewarrior.net/) tracking status | +| `todo` | [todo](https://github.com/todotxt/todo.txt-cli) items | +| `toolbox` | [toolbox](https://github.com/containers/toolbox) name | +| `vcs` | Git repository status | +| `vim_shell` | [vim](https://www.vim.org/) shell (`:sh`) | +| `virtualenv` | python environment from [venv](https://docs.python.org/3/library/venv.html) | +| `vpn_ip` | virtual private network indicator | | `wifi` | WiFi speed | -| `battery` | internal battery state and charge level (yep, batteries *literally* included) | +| `xplr` | [xplr](https://github.com/sayanarijit/xplr) shell | ### Extensible From 69909a7a1f64a91c947417c4bbd8669c6edd5049 Mon Sep 17 00:00:00 2001 From: pstekl Date: Wed, 12 Jan 2022 20:52:44 +0100 Subject: [PATCH 141/380] Add xterm to font configuration section --- font.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/font.md b/font.md index 4be264f6..abc0eae0 100644 --- a/font.md +++ b/font.md @@ -111,6 +111,14 @@ If you are using a different terminal, proceed with manual font installation. ``` You can adjust the font size to your preference. After changing the configuration use `xrdb ~/.Xresources` to reload the config. The new config is applied for all new terminals. + - **xterm**: Create or open `~/.Xresources` and add the following two lines to it: + ```text + xterm*faceName: MesloLGS NF + xterm*faceSize: 11 + ``` + You can adjust the font size to your preference. After changing the configuration use `xrdb ~/.Xresources` to reload the config. + The new config is applied for all new terminals. + 1. Run `p10k configure` to generate a new `~/.p10k.zsh`. The old config may work incorrectly with the new font. From b8ddcd4c17c650c49087b6993383e865206b7212 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 13 Jan 2022 10:08:21 +0100 Subject: [PATCH 142/380] docs: clean up font instructions for xterm and copy them to README.md --- README.md | 16 +++++++++++----- font.md | 12 +++++------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 2ab2591b..a742e7f7 100644 --- a/README.md +++ b/README.md @@ -675,11 +675,17 @@ If you are using a different terminal, proceed with manual font installation. If the file already exists, only add the line with the font to the existing return. Also add the first line if it is not already present. - **urxvt**: Create or open `~/.Xresources` and add the following line to it: - ```text - URxvt.font: xft:MesloLGS NF:size=11 - ``` - You can adjust the font size to your preference. After changing the configuration use `xrdb ~/.Xresources` to reload the config. - The new config is applied for all new terminals. + ```text + URxvt.font: xft:MesloLGS NF:size=11 + ``` + You can adjust the font size to your preference. After changing the config run + `xrdb ~/.Xresources` to reload it. The new config is applied to all new terminals. + - **xterm**: Create or open `~/.Xresources` and add the following line to it: + ```text + xterm*faceName: MesloLGS NF + ``` + After changing the config run `xrdb ~/.Xresources` to reload it. The new config is applied to + all new terminals. 1. Run `p10k configure` to generate a new `~/.p10k.zsh`. The old config may work incorrectly with the new font. diff --git a/font.md b/font.md index abc0eae0..964585a9 100644 --- a/font.md +++ b/font.md @@ -109,16 +109,14 @@ If you are using a different terminal, proceed with manual font installation. ```text URxvt.font: xft:MesloLGS NF:size=11 ``` - You can adjust the font size to your preference. After changing the configuration use `xrdb ~/.Xresources` to reload the config. - The new config is applied for all new terminals. - - **xterm**: Create or open `~/.Xresources` and add the following two lines to it: + You can adjust the font size to your preference. After changing the config run + `xrdb ~/.Xresources` to reload it. The new config is applied to all new terminals. + - **xterm**: Create or open `~/.Xresources` and add the following line to it: ```text xterm*faceName: MesloLGS NF - xterm*faceSize: 11 ``` - You can adjust the font size to your preference. After changing the configuration use `xrdb ~/.Xresources` to reload the config. - The new config is applied for all new terminals. - + After changing the config run `xrdb ~/.Xresources` to reload it. The new config is applied to + all new terminals. 1. Run `p10k configure` to generate a new `~/.p10k.zsh`. The old config may work incorrectly with the new font. From 161f4c1f0475b9370697d31b180e6b097c297ddf Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 14 Jan 2022 13:59:00 +0100 Subject: [PATCH 143/380] respect VIRTUAL_ENV_PROMPT if its value is different from the default (#1718) --- internal/p10k.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 54ab71df..802cdf95 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4224,7 +4224,11 @@ prompt_virtualenv() { msg="${_p9k__ret//\%/%%} " fi local v=${VIRTUAL_ENV:t} - [[ $v == $~_POWERLEVEL9K_VIRTUALENV_GENERIC_NAMES ]] && v=${VIRTUAL_ENV:h:t} + if [[ $VIRTUAL_ENV_PROMPT == '('?*') ' && $VIRTUAL_ENV_PROMPT != "($v) " ]]; then + v=$VIRTUAL_ENV_PROMPT[2,-3] + elif [[ $v == $~_POWERLEVEL9K_VIRTUALENV_GENERIC_NAMES ]]; then + v=${VIRTUAL_ENV:h:t} + fi msg+="$_POWERLEVEL9K_VIRTUALENV_LEFT_DELIMITER${v//\%/%%}$_POWERLEVEL9K_VIRTUALENV_RIGHT_DELIMITER" case $_POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV in false) From 0f8a77d47df744038d7d841b7321b55b6b2db638 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 15 Jan 2022 23:00:17 +0100 Subject: [PATCH 144/380] increase the minimum required zsh version from 5.1 to 5.3 (#1722) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a742e7f7..fbcced45 100644 --- a/README.md +++ b/README.md @@ -1366,7 +1366,7 @@ https://www.reddit.com/r/zsh/comments/eg49ff/powerlevel10k_prompt_history_exit_c ### What is the minimum supported Zsh version? -Zsh 5.1 or newer should work. Fast startup requires Zsh >= 5.4. +Zsh 5.3 or newer should work. Fast startup requires Zsh >= 5.4. ### How were these screenshots and animated gifs created? From 3d994b033b934b6f5d4e021b6e0b4155bf13542b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 17 Jan 2022 15:35:20 +0100 Subject: [PATCH 145/380] work around bugs in WSL where it reports more swap being used than the total available (#1724) --- internal/p10k.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 802cdf95..fed131b5 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3399,6 +3399,8 @@ _p9k_prompt_swap_async() { (( used_bytes *= 1024 )) fi + (( used_bytes >= 0 || (used_bytes = 0) )) + _p9k_human_readable_bytes $used_bytes [[ $_p9k__ret != $_p9k__swap_used ]] || return _p9k__swap_used=$_p9k__ret From e511c36ec6c4746a3f4d68710397efd73d835b81 Mon Sep 17 00:00:00 2001 From: Mehyar Date: Thu, 20 Jan 2022 11:49:58 +0100 Subject: [PATCH 146/380] Add ZeroTier to the list of VPNs ZeroTier users can also see their VPN IP when enabling the vpn_ip option. --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index fed131b5..b2e55cd6 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7404,7 +7404,7 @@ _p9k_init_params() { _p9k_declare -s POWERLEVEL9K_IP_INTERFACE "" : ${_POWERLEVEL9K_IP_INTERFACE:='.*'} _p9k_segment_in_use ip || _POWERLEVEL9K_IP_INTERFACE= - _p9k_declare -s POWERLEVEL9K_VPN_IP_INTERFACE "(gpd|wg|(.*tun)|tailscale)[0-9]*" + _p9k_declare -s POWERLEVEL9K_VPN_IP_INTERFACE "(gpd|wg|(.*tun)|tailscale)[0-9]*)|(zt[a-z]*)" : ${_POWERLEVEL9K_VPN_IP_INTERFACE:='.*'} _p9k_segment_in_use vpn_ip || _POWERLEVEL9K_VPN_IP_INTERFACE= _p9k_declare -b POWERLEVEL9K_VPN_IP_SHOW_ALL 0 From 9e0ef918db426ba7749e56e9a8ba3308c2f00c60 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 20 Jan 2022 12:28:27 +0100 Subject: [PATCH 147/380] fix ZeroTier network interface regex From https://forwardingplane.net/configuration-archive/renaming-interfaces-under-linux/: > ZeroTier has the inconsistency of using zt* on some platforms and ztublkahlah on others. They mean zt[0-9]+ and zt[a-z0-9]+. --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index b2e55cd6..51bcd3da 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7404,7 +7404,7 @@ _p9k_init_params() { _p9k_declare -s POWERLEVEL9K_IP_INTERFACE "" : ${_POWERLEVEL9K_IP_INTERFACE:='.*'} _p9k_segment_in_use ip || _POWERLEVEL9K_IP_INTERFACE= - _p9k_declare -s POWERLEVEL9K_VPN_IP_INTERFACE "(gpd|wg|(.*tun)|tailscale)[0-9]*)|(zt[a-z]*)" + _p9k_declare -s POWERLEVEL9K_VPN_IP_INTERFACE "(gpd|wg|(.*tun)|tailscale)[0-9]*)|(zt.*)" : ${_POWERLEVEL9K_VPN_IP_INTERFACE:='.*'} _p9k_segment_in_use vpn_ip || _POWERLEVEL9K_VPN_IP_INTERFACE= _p9k_declare -b POWERLEVEL9K_VPN_IP_SHOW_ALL 0 @@ -8259,7 +8259,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v132\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v133\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$__p9k_force_term_shell_integration$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' From 6c71862c5f9824dc92273fbe1d0dd0c37210f2af Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 25 Jan 2022 14:32:01 +0100 Subject: [PATCH 148/380] don't set OS, DEFAULT_COLOR and DEFAULT_COLOR_INVERTED See #1735. --- internal/p10k.zsh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 51bcd3da..9d60963c 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6441,7 +6441,7 @@ function _p9k_dump_state() { unset __p9k_cached_param_pat __p9k_cached_param_sig (( $+_p9k_preinit )) && { print -r -- $_p9k_preinit >&$fd || return } print -r -- '_p9k_restore_state_impl() {' >&$fd || return - typeset -pm '_POWERLEVEL9K_*|_p9k_[^_]*|icons|OS|DEFAULT_COLOR|DEFAULT_COLOR_INVERTED' >&$fd || return + typeset -pm '_POWERLEVEL9K_*|_p9k_[^_]*|icons' >&$fd || return print -r -- '}' >&$fd || return } always { exec {fd}>&- @@ -8401,11 +8401,6 @@ function _p9k_init_cacheable() { _p9k_color2=7 fi - # Someone might be using these. - typeset -g OS=$_p9k_os - typeset -g DEFAULT_COLOR=$_p9k_color1 - typeset -g DEFAULT_COLOR_INVERTED=$_p9k_color2 - _p9k_battery_states=( 'LOW' 'red' 'CHARGING' 'yellow' From 5014de0541201716dc4ee6f544321ac4e3d7431e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 26 Jan 2022 14:45:50 +0100 Subject: [PATCH 149/380] Squashed 'gitstatus/' changes from e02d9eed..6eb490ab 6eb490ab survive broken $TMPDIR 94bf4fc2 add ppc64 support to the build script git-subtree-dir: gitstatus git-subtree-split: 6eb490ab86118ad063224e4d50b6b05bea7dd12c --- build | 12 ++++++++---- gitstatus.plugin.sh | 7 ++++++- gitstatus.plugin.zsh | 7 ++++++- install | 25 ++++++++++++++----------- 4 files changed, 34 insertions(+), 17 deletions(-) diff --git a/build b/build index ad39910a..05b3abc5 100755 --- a/build +++ b/build @@ -145,8 +145,12 @@ cpus="$(command getconf _NPROCESSORS_ONLN 2>/dev/null)" || cpus=8 case "$gitstatus_cpu" in - powerpc64le) archflag="-mcpu";; - *) archflag="-march";; + powerpc64|powerpc64le) + archflag="-mcpu" + ;; + *) + archflag="-march" + ;; esac cflags="$archflag=$gitstatus_cpu -fno-plt -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fpie" @@ -520,7 +524,7 @@ if [ -z "$gitstatus_cpu" ]; then armv6l|armhf) gitstatus_cpu=armv6;; armv7l) gitstatus_cpu=armv7;; arm64|aarch64) gitstatus_cpu=armv8-a;; - ppc64le) gitstatus_cpu=powerpc64le;; + ppc64|ppc64le) gitstatus_cpu=powerpc64le;; riscv64) gitstatus_cpu=rv64imafdc;; loongarch64) gitstatus_cpu=loongarch64;; x86_64|amd64) gitstatus_cpu=x86-64;; @@ -559,7 +563,7 @@ case "$gitstatus_kernel" in armv6l|armhf) docker_image=arm32v6/alpine:3.11.6;; armv7l) docker_image=arm32v7/alpine:3.11.6;; aarch64) docker_image=arm64v8/alpine:3.11.6;; - ppc64le) docker_image=ppc64le/alpine:3.11.6;; + ppc64|ppc64le) docker_image=ppc64le/alpine:3.11.6;; s390x) docker_image=s390x/alpine:3.11.6;; *) >&2 echo '[error] unable to infer docker image' diff --git a/gitstatus.plugin.sh b/gitstatus.plugin.sh index 0c660967..37b78f44 100644 --- a/gitstatus.plugin.sh +++ b/gitstatus.plugin.sh @@ -121,7 +121,12 @@ function gitstatus_start() { --repo-ttl-seconds="$ttl" $extra_flags) - tmpdir="$(command mktemp -d "${TMPDIR:-/tmp}"/gitstatus.bash.$$.XXXXXXXXXX)" || return + if [[ -n "$TMPDIR" && ( ( -d "$TMPDIR" && -w "$TMPDIR" ) || ! ( -d /tmp && -w /tmp ) ) ]]; then + local tmpdir=$TMPDIR + else + local tmpdir=/tmp + fi + tmpdir="$(command mktemp -d "$tmpdir"/gitstatus.bash.$$.XXXXXXXXXX)" || return if [[ -n "$log_level" ]]; then GITSTATUS_DAEMON_LOG="$tmpdir"/daemon.log diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index 181e756a..228fea74 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -574,7 +574,12 @@ function gitstatus_start"${1:-}"() { else typeset -gi _GITSTATUS_START_COUNTER local log_level=$GITSTATUS_LOG_LEVEL - local file_prefix=${${TMPDIR:-/tmp}:A}/gitstatus.$name.$EUID + if [[ -n "$TMPDIR" && ( ( -d "$TMPDIR" && -w "$TMPDIR" ) || ! ( -d /tmp && -w /tmp ) ) ]]; then + local tmpdir=$TMPDIR + else + local tmpdir=/tmp + fi + local file_prefix=${tmpdir:A}/gitstatus.$name.$EUID file_prefix+=.$sysparams[pid].$EPOCHSECONDS.$((++_GITSTATUS_START_COUNTER)) (( GITSTATUS_ENABLE_LOGGING )) && : ${log_level:=INFO} if [[ -n $log_level ]]; then diff --git a/install b/install index a0142b2b..6e027a3b 100755 --- a/install +++ b/install @@ -245,27 +245,30 @@ END return 1 fi - local tmpdir + if [ -n "$TMPDIR" -a '(' '(' -d "$TMPDIR" -a -w "$TMPDIR" ')' -o '!' '(' -d /tmp -a -w /tmp ')' ')' ]; then + local tmp="$TMPDIR" + else + local tmp=/tmp + fi if ! command -v mktemp >/dev/null 2>&1 || - ! tmpdir="$(command mktemp -d "${TMPDIR:-/tmp}"/gitstatus-install.XXXXXXXXXX)"; then - tmpdir="${TMPDIR:-/tmp}/gitstatus-install.tmp.$$" + ! tmpdir="$(command mktemp -d "$tmp"/gitstatus-install.XXXXXXXXXX)"; then + tmpdir="$tmp/gitstatus-install.tmp.$$" if ! mkdir -p -- "$tmpdir"; then - local dir="${TMPDIR:-/tmp}" - if [ -z "${TMPDIR:-}" ]; then + if [ "$tmp" = /tmp ]; then local label='directory' else local label='directory (\033[1mTMPDIR\033[m)' fi - if [ ! -e "$dir" ]; then - >&"$e" printf 'Temporary '"$label"' does not exist: \033[4;31m%s\033[0m\n' "$dir" + if [ ! -e "$tmp" ]; then + >&"$e" printf 'Temporary '"$label"' does not exist: \033[4;31m%s\033[0m\n' "$tmp" >&"$e" printf '\n' >&"$e" printf 'Create it, then restart your shell.\n' - elif [ ! -d "$dir" ]; then - >&"$e" printf 'Not a '"$label"': \033[4;31m%s\033[0m\n' "$dir" + elif [ ! -d "$tmp" ]; then + >&"$e" printf 'Not a '"$label"': \033[4;31m%s\033[0m\n' "$tmp" >&"$e" printf '\n' >&"$e" printf 'Make it a directory, then restart your shell.\n' - elif [ ! -w "$dir" ]; then - >&"$e" printf 'Temporary '"$label"' is not writable: \033[4;31m%s\033[0m\n' "$dir" + elif [ ! -w "$tmp" ]; then + >&"$e" printf 'Temporary '"$label"' is not writable: \033[4;31m%s\033[0m\n' "$tmp" >&"$e" printf '\n' >&"$e" printf 'Make it writable, then restart your shell.\n' fi From d6f8c477617d57363d0e2c28977ef815e5a675a2 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 26 Jan 2022 15:03:22 +0100 Subject: [PATCH 150/380] survive broken $TMPDIR --- internal/p10k.zsh | 18 ++++++++++++++---- internal/wizard.zsh | 30 ++++++++++++++++++++++-------- internal/worker.zsh | 8 +++++++- 3 files changed, 43 insertions(+), 13 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 9d60963c..f1c8cd29 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6280,8 +6280,13 @@ _p9k_dump_instant_prompt() { out+="$cr${(pl:$((height-prompt_height))::\n:)}$terminfo[sc]$out" fi fi - typeset -g __p9k_instant_prompt_output=${TMPDIR:-/tmp}/p10k-instant-prompt-output-${(%):-%n}-$$ - { echo -n > $__p9k_instant_prompt_output } || return + if [[ -n "$TMPDIR" && ( ( -d "$TMPDIR" && -w "$TMPDIR" ) || ! ( -d /tmp && -w /tmp ) ) ]]; then + local tmpdir=$TMPDIR + else + local tmpdir=/tmp + fi + typeset -g __p9k_instant_prompt_output=$tmpdir/p10k-instant-prompt-output-${(%):-%n}-$$ + { : > $__p9k_instant_prompt_output } || return print -rn -- "${out}${esc}?2004h" || return if (( $+commands[stty] )); then command stty -icanon 2>/dev/null @@ -7802,7 +7807,12 @@ function _p9k_wrap_widgets() { # There is no zle-line-pre-redraw in zsh < 5.3, so we have to wrap all widgets # with key bindings. This costs extra 3ms: 1.5ms to fetch the list of widgets and # another 1.5ms to wrap them. - local keymap tmp=${TMPDIR:-/tmp}/p10k.bindings.$sysparams[pid] + if [[ -n "$TMPDIR" && ( ( -d "$TMPDIR" && -w "$TMPDIR" ) || ! ( -d /tmp && -w /tmp ) ) ]]; then + local tmpdir=$TMPDIR + else + local tmpdir=/tmp + fi + local keymap tmp=$tmpdir/p10k.bindings.$sysparams[pid] { for keymap in $keymaps; do bindkey -M $keymap; done >$tmp local -aU widget_list=( @@ -8259,7 +8269,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v133\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v134\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$__p9k_force_term_shell_integration$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 62564486..5d6215a7 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1537,9 +1537,16 @@ function ask_config_overwrite() { case $choice in r) return 1;; y) - config_backup="$(mktemp ${TMPDIR:-/tmp}/$__p9k_cfg_basename.XXXXXXXXXX)" || quit -c + if [[ -n "$TMPDIR" && ( ( -d "$TMPDIR" && -w "$TMPDIR" ) || ! ( -d /tmp && -w /tmp ) ) ]]; then + local tmpdir=$TMPDIR + local tmpdir_u='$TMPDIR' + else + local tmpdir=/tmp + local tmpdir_u=/tmp + fi + config_backup="$(mktemp $tmpdir/$__p9k_cfg_basename.XXXXXXXXXX)" || quit -c cp $__p9k_cfg_path $config_backup || quit -c - config_backup_u=${${TMPDIR:+\$TMPDIR}:-/tmp}/${(q-)config_backup:t} + config_backup_u=$tmpdir_u/${(q-)config_backup:t} ;; esac return 0 @@ -1600,16 +1607,23 @@ function ask_zshrc_edit() { y) write_zshrc=1 if [[ -n $zshrc_content ]]; then - zshrc_backup="$(mktemp ${TMPDIR:-/tmp}/.zshrc.XXXXXXXXXX)" || quit -c - cp -p $__p9k_zshrc $zshrc_backup || quit -c + if [[ -n "$TMPDIR" && ( ( -d "$TMPDIR" && -w "$TMPDIR" ) || ! ( -d /tmp && -w /tmp ) ) ]]; then + local tmpdir=$TMPDIR + local tmpdir_u='$TMPDIR' + else + local tmpdir=/tmp + local tmpdir_u=/tmp + fi + zshrc_backup="$(mktemp $tmpdir/.zshrc.XXXXXXXXXX)" || quit -c + cp -p $__p9k_zshrc $zshrc_backup || quit -c local -i writable=1 if [[ ! -w $zshrc_backup ]]; then - chmod u+w -- $zshrc_backup || quit -c + chmod u+w -- $zshrc_backup || quit -c writable=0 fi - print -r -- $zshrc_content >$zshrc_backup || quit -c - (( writable )) || chmod u-w -- $zshrc_backup || quit -c - zshrc_backup_u=${${TMPDIR:+\$TMPDIR}:-/tmp}/${(q-)zshrc_backup:t} + print -r -- $zshrc_content >$zshrc_backup || quit -c + (( writable )) || chmod u-w -- $zshrc_backup || quit -c + zshrc_backup_u=$tmpdir_u/${(q-)zshrc_backup:t} fi ;; esac diff --git a/internal/worker.zsh b/internal/worker.zsh index 8eb21af3..269e8aad 100644 --- a/internal/worker.zsh +++ b/internal/worker.zsh @@ -181,7 +181,13 @@ function _p9k_worker_start() { setopt monitor || return { [[ -n $_p9k__worker_resp_fd ]] && return - _p9k__worker_file_prefix=${TMPDIR:-/tmp}/p10k.worker.$EUID.$sysparams[pid].$EPOCHSECONDS + + if [[ -n "$TMPDIR" && ( ( -d "$TMPDIR" && -w "$TMPDIR" ) || ! ( -d /tmp && -w /tmp ) ) ]]; then + local tmpdir=$TMPDIR + else + local tmpdir=/tmp + fi + _p9k__worker_file_prefix=$tmpdir/p10k.worker.$EUID.$sysparams[pid].$EPOCHSECONDS sysopen -r -o cloexec -u _p9k__worker_resp_fd <( exec 0 Date: Wed, 26 Jan 2022 16:04:09 +0100 Subject: [PATCH 151/380] Squashed 'gitstatus/' changes from 6eb490ab..b226d8e0 b226d8e0 bug fix: don't crap out when TMPDIR is unset git-subtree-dir: gitstatus git-subtree-split: b226d8e060db82ac68f1b00c49d1fc85abdbe56e --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index 6e027a3b..76f339e0 100755 --- a/install +++ b/install @@ -245,7 +245,7 @@ END return 1 fi - if [ -n "$TMPDIR" -a '(' '(' -d "$TMPDIR" -a -w "$TMPDIR" ')' -o '!' '(' -d /tmp -a -w /tmp ')' ')' ]; then + if [ -n "${TMPDIR-}" -a '(' '(' -d "${TMPDIR-}" -a -w "${TMPDIR-}" ')' -o '!' '(' -d /tmp -a -w /tmp ')' ')' ]; then local tmp="$TMPDIR" else local tmp=/tmp From 8a676a9157d2b0e00e88d06456ac7317f11c0317 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 1 Feb 2022 20:39:00 +0100 Subject: [PATCH 152/380] fix shell integration with kitty --- internal/p10k.zsh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index f1c8cd29..e797a874 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5637,6 +5637,7 @@ _p9k_preexec2() { typeset -g _p9k__preexec_cmd=$2 _p9k__timer_start=EPOCHREALTIME P9K_TTY=old + (( ! $+_p9k__iterm_cmd )) || _p9k_iterm2_preexec } function _p9k_prompt_net_iface_init() { @@ -6873,6 +6874,10 @@ _p9k_precmd_impl() { _p9k__zle_state=insert (( ++_p9k__prompt_idx )) + + if (( $+_p9k__iterm_cmd )); then + _p9k_iterm2_precmd $__p9k_new_status + fi fi _p9k_fetch_cwd @@ -8600,6 +8605,20 @@ _p9k_init_vcs() { (( $+GITSTATUS_DAEMON_PID_POWERLEVEL9K )) || _p9k__instant_prompt_disabled=1 } +function _p9k_iterm2_precmd() { + builtin zle && return + if (( _p9k__iterm_cmd )) && [[ -t 1 ]]; then + (( _p9k__iterm_cmd == 1 )) && builtin print -n '\e]133;C;\a' + builtin printf '\e]133;D;%s\a' $1 + fi + typeset -gi _p9k__iterm_cmd=1 +} + +function _p9k_iterm2_preexec() { + [[ -t 1 ]] && builtin print -n '\e]133;C;\a' + typeset -gi _p9k__iterm_cmd=2 +} + _p9k_init() { _p9k_init_vars _p9k_restore_state || _p9k_init_cacheable @@ -8663,6 +8682,13 @@ _p9k_init() { functions[iterm2_precmd]='local _p9k_status=$?; zle && return; () { return $_p9k_status; }; '$_p9k__iterm2_precmd fi + if (( _POWERLEVEL9K_TERM_SHELL_INTEGRATION && + ! $+_z4h_iterm_cmd && + ! $+functions[iterm2_decorate_prompt] && + ! $+functions[iterm2_precmd] )); then + typeset -gi _p9k__iterm_cmd=0 + fi + if _p9k_segment_in_use todo; then if [[ -n ${_p9k__todo_command::=${commands[todo.sh]}} ]]; then local todo_global=/etc/todo/config From c5203a3da2a8814992c91b20f8246b19ea88401c Mon Sep 17 00:00:00 2001 From: brent-moffit <72231013+brent-moffit@users.noreply.github.com> Date: Wed, 2 Feb 2022 17:47:46 -0800 Subject: [PATCH 153/380] Add `arch` prompt for displaying CPU architecture Adds the `arch` prompt to `p10k.zsh`, `ARCH_ICON` to `icons.zsh`, and commented entries in the default configs --- config/p10k-classic.zsh | 5 +++++ config/p10k-lean-8colors.zsh | 5 +++++ config/p10k-lean.zsh | 5 +++++ config/p10k-rainbow.zsh | 5 +++++ internal/icons.zsh | 5 +++++ internal/p10k.zsh | 15 +++++++++++++++ 6 files changed, 40 insertions(+) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 21ca0155..010459b4 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -94,6 +94,7 @@ todo # todo items (https://github.com/todotxt/todo.txt-cli) timewarrior # timewarrior tracking status (https://timewarrior.net/) taskwarrior # taskwarrior task count (https://taskwarrior.org/) + # arch # current CPU Architecture # time # current time # =========================[ Line #2 ]========================= newline # \n @@ -1549,6 +1550,10 @@ # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) + ##############################[ arch: current cup architecture ]############################## + # Default CPU Aricheture (section is hidden when current architecture matches default) + # typeset -g POWERLEVEL9K_ARCH_DEFAULT='i386' + ####################################[ time: current time ]#################################### # Current time color. typeset -g POWERLEVEL9K_TIME_FOREGROUND=66 diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index dc96d4df..a0e3e5bb 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -93,6 +93,7 @@ todo # todo items (https://github.com/todotxt/todo.txt-cli) timewarrior # timewarrior tracking status (https://timewarrior.net/) taskwarrior # taskwarrior task count (https://taskwarrior.org/) + # arch # current CPU Architecture # time # current time # =========================[ Line #2 ]========================= newline # \n @@ -1530,6 +1531,10 @@ # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) + ##############################[ arch: current cup architecture ]############################## + # Default CPU Aricheture (section is hidden when current architecture matches default) + # typeset -g POWERLEVEL9K_ARCH_DEFAULT='i386' + ####################################[ time: current time ]#################################### # Current time color. typeset -g POWERLEVEL9K_TIME_FOREGROUND=6 diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index fc3f20d7..4b6519d7 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -93,6 +93,7 @@ todo # todo items (https://github.com/todotxt/todo.txt-cli) timewarrior # timewarrior tracking status (https://timewarrior.net/) taskwarrior # taskwarrior task count (https://taskwarrior.org/) + # arch # current CPU Architecture # time # current time # =========================[ Line #2 ]========================= newline @@ -1526,6 +1527,10 @@ # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) + ##############################[ arch: current cup architecture ]############################## + # Default CPU Aricheture (section is hidden when current architecture matches default) + # typeset -g POWERLEVEL9K_ARCH_DEFAULT='i386' + ####################################[ time: current time ]#################################### # Current time color. typeset -g POWERLEVEL9K_TIME_FOREGROUND=66 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index ef5b444e..ed850ba4 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -94,6 +94,7 @@ todo # todo items (https://github.com/todotxt/todo.txt-cli) timewarrior # timewarrior tracking status (https://timewarrior.net/) taskwarrior # taskwarrior task count (https://taskwarrior.org/) + # arch # current CPU Architecture # time # current time # =========================[ Line #2 ]========================= newline @@ -1634,6 +1635,10 @@ # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) + ##############################[ arch: current cup architecture ]############################## + # Default CPU Aricheture (section is hidden when current architecture matches default) + # typeset -g POWERLEVEL9K_ARCH_DEFAULT='i386' + ####################################[ time: current time ]#################################### # Current time color. typeset -g POWERLEVEL9K_TIME_FOREGROUND=0 diff --git a/internal/icons.zsh b/internal/icons.zsh index e3d71ffa..c67bc45d 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -148,6 +148,7 @@ function _p9k_init_icons() { JULIA_ICON 'jl' SCALA_ICON 'scala' TOOLBOX_ICON '\u2B22' # ⬢ + ARCH_ICON '\uE205' #  ) ;; 'awesome-fontconfig') @@ -280,6 +281,7 @@ function _p9k_init_icons() { JULIA_ICON 'jl' SCALA_ICON 'scala' TOOLBOX_ICON '\u2B22' # ⬢ + ARCH_ICON '\uE205' #  ) ;; 'awesome-mapped-fontconfig') @@ -415,6 +417,7 @@ function _p9k_init_icons() { JULIA_ICON 'jl' SCALA_ICON 'scala' TOOLBOX_ICON '\u2B22' # ⬢ + ARCH_ICON '\uE205' #  ) ;; 'nerdfont-complete'|'nerdfont-fontconfig') @@ -548,6 +551,7 @@ function _p9k_init_icons() { JULIA_ICON '\uE624' #  SCALA_ICON '\uE737' #  TOOLBOX_ICON '\uE20F'$s #  + ARCH_ICON '\uE266' ) ;; ascii) @@ -810,6 +814,7 @@ function _p9k_init_icons() { JULIA_ICON 'jl' SCALA_ICON 'scala' TOOLBOX_ICON '\u2B22' # ⬢ + ARCH_ICON '\uE205' #  ) ;; esac diff --git a/internal/p10k.zsh b/internal/p10k.zsh index e797a874..26e43eec 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5625,6 +5625,21 @@ _p9k_prompt_haskell_stack_init() { typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$commands[stack]' } +################################################################ +# CPU Architecture +prompt_arch() { + if ! _p9k_cache_ephemeral_get $0 ; then + _p9k_cache_ephemeral_set $(arch) + fi + [[ $_p9k__cache_val[1] == $POWERLEVEL9K_ARCH_DEFAULT ]] && return + _p9k_prompt_segment "$0" "orange1" "black" 'ARCH_ICON' 0 '' "$_p9k__cache_val[1]" +} + +_p9k_prompt_arch_init() { + echo 'arch init' >> ~/p9k_debug.txt + typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$commands[arch]' +} + # Use two preexec hooks to survive https://github.com/MichaelAquilina/zsh-you-should-use with # YSU_HARDCORE=1. See https://github.com/romkatv/powerlevel10k/issues/427. _p9k_preexec1() { From 4b21cd06ffeb5706b017c78b13c2eaf40d7deac1 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 7 Feb 2022 08:38:49 +0100 Subject: [PATCH 154/380] Squashed 'gitstatus/' changes from b226d8e06..f889c13d1 f889c13d1 build: clean up dragonfly support (#297) 2b6366fbd Merge branch 'msvetlik-dragonflybsd-support' 409c791eb Added detection of DragonflyBSD and tested compilation on v6.2.1 git-subtree-dir: gitstatus git-subtree-split: f889c13d18fbf6f3109d6889be34d50af04d99b9 --- build | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/build b/build index 05b3abc5..e116abb2 100755 --- a/build +++ b/build @@ -100,7 +100,7 @@ if [ -n "$gitstatus_install_tools" ]; then exit 1 fi ;; - freebsd) + freebsd|dragonfly) command pkg install -y cmake gmake binutils git perl5 wget ;; openbsd) @@ -141,7 +141,7 @@ if [ -n "$gitstatus_install_tools" ]; then fi cpus="$(command getconf _NPROCESSORS_ONLN 2>/dev/null)" || - cpus="$(command sysctl -n hw.ncpu 2>/dev/null)" || + cpus="$(command sysctl -n hw.ncpu 2>/dev/null)" || cpus=8 case "$gitstatus_cpu" in @@ -174,12 +174,21 @@ if 2>/dev/null "$CC" \ fi command rm -f -- "$workdir"/cc-test "$workdir"/cc-test.o -if 2>/dev/null "$CC" \ - -fstack-clash-protection -fcf-protection \ - -Werror \ - -c "$workdir"/cc-test.c \ +if 2>/dev/null "$CC" \ + -fstack-clash-protection \ + -Werror \ + -c "$workdir"/cc-test.c \ -o "$workdir"/cc-test.o; then - cflags="$cflags -fstack-clash-protection -fcf-protection" + cflags="$cflags -fstack-clash-protection" +fi + +command rm -f -- "$workdir"/cc-test "$workdir"/cc-test.o +if 2>/dev/null "$CC" \ + -fcf-protection \ + -Werror \ + -c "$workdir"/cc-test.c \ + -o "$workdir"/cc-test.o; then + cflags="$cflags -fcf-protection" fi command rm -f -- "$workdir"/cc-test "$workdir"/cc-test.o @@ -224,6 +233,12 @@ case "$gitstatus_kernel" in gitstatus_ldflags="$gitstatus_ldflags ${static_pie:--static}" libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" ;; + dragonfly) + gitstatus_cxx=clang++12 + gitstatus_make=gmake + gitstatus_ldflags="$gitstatus_ldflags ${static_pie:--static}" + libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" + ;; openbsd) gitstatus_cxx=eg++ gitstatus_make=gmake @@ -574,7 +589,7 @@ case "$gitstatus_kernel" in fi fi ;; - freebsd|openbsd|netbsd|darwin) + freebsd|openbsd|netbsd|darwin|dragonfly) if [ -n "$docker_cmd" ]; then >&2 echo "[error] docker (-d) is not supported on $gitstatus_kernel" exit 1 From 5fe28f0a010acd251c25a5bd62dfd8002c37f46c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 14 Feb 2022 10:10:38 +0100 Subject: [PATCH 155/380] bug fix: correctly parse kubectl config when current-context has metacharacters (#1767) --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index e797a874..cc36eb0d 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4464,7 +4464,7 @@ prompt_kubecontext() { { (( pos <= $#cfg )) || return shift $pos cfg - pos=${cfg[(i) name: $name]} + pos=${cfg[(i) name: ${(b)name}]} (( pos <= $#cfg )) || return (( --pos )) for ((; pos > 0; --pos)); do From c0a028351ff9a611c4061938ebd5ec4cafb900eb Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 14 Feb 2022 19:26:12 +0100 Subject: [PATCH 156/380] Squashed 'gitstatus/' changes from f889c13d1..6dc0738c0 6dc0738c0 release v1.5.4 6b3e7cf2f update mbuild script for the new release infra 12b2457ae release v1.5.4 git-subtree-dir: gitstatus git-subtree-split: 6dc0738c0e5199b0ae47d9693874e7d43c7f8f29 --- build.info | 6 +++--- install.info | 22 +++++++++++----------- mbuild | 48 ++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 58 insertions(+), 18 deletions(-) diff --git a/build.info b/build.info index 6defef24..baa30b07 100644 --- a/build.info +++ b/build.info @@ -3,7 +3,7 @@ # # This value is also read by shell bindings (indirectly, through # ./install) when using GITSTATUS_DAEMON or usrbin/gitstatusd. -gitstatus_version="v1.5.3" +gitstatus_version="v1.5.4" # libgit2 is a build time dependency of gitstatusd. The values of # libgit2_version and libgit2_sha256 are read by ./build. @@ -18,5 +18,5 @@ gitstatus_version="v1.5.3" # # If sha256 of ./deps/libgit2-${libgit2_version}.tar.gz doesn't match, # build gets aborted. -libgit2_version="tag-5860a42d19bcd226cb6eff2dcbfcbf155d570c73" -libgit2_sha256="2289203eda19913a2f6d2b26a15384cc43872bffd70e87a7659f9a22da79058e" +libgit2_version="tag-0ad3d776aa86dd607dc86dcd7f77ad3ed7ebec61" +libgit2_sha256="c5d0117ae74d3ef244c26f10cce022019077dbc4563e6251fa9f56d36868ce74" diff --git a/install.info b/install.info index dab50b9b..45807be4 100644 --- a/install.info +++ b/install.info @@ -1,4 +1,4 @@ -# 2 +# 3 # # This file is used by ./install and indirectly by shell bindings. # @@ -8,23 +8,23 @@ # work fine. # Official gitstatusd binaries. -uname_s_glob="cygwin_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="fe132c412c460c2889d731012d280207fe2b4a3c94d077fb4f1c06ed5d319a42"; +uname_s_glob="cygwin_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.4"; sha256="5a8a809dcebdb6aa9b47d37e086c0485424a9d9c136770eec3c26cedf5bb75e3"; uname_s_glob="cygwin_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="c84cade0d6b86e04c27a6055f45851f6b46d6b88ba58772f7ca8ef4d295c800f"; -uname_s_glob="darwin"; uname_m_glob="arm64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="ad973948cca4bdcf83b7fcdda70c489a404488ea7304712721f1100b73ec7cbe"; -uname_s_glob="darwin"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="b13455d56cf7b6f07efb7da088057bbc1212847c88b59493918d6f9c0c157160"; -uname_s_glob="freebsd"; uname_m_glob="amd64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.3"; sha256="73b5622ec9737e93f3fafe117b47ce8de33037be3e2bff283f36668f5852668a"; -uname_s_glob="linux"; uname_m_glob="aarch64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="89b87181b2005527a558cdbc32b12b0f15a1a12bb69865ec216ca5a0266a6c4f"; +uname_s_glob="darwin"; uname_m_glob="arm64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.4"; sha256="eae979e990ca37c56ee39fadd0c3f392cbbd0c6bdfb9a603010be60d9e48910a"; +uname_s_glob="darwin"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.4"; sha256="9fd3913ec1b6b856ab6e08a99a2343f0e8e809eb6b62ca4b0963163656c668e6"; +uname_s_glob="freebsd"; uname_m_glob="amd64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.4"; sha256="8e57ad642251e5acfa430aed82cd4ffe103db0bfadae4a15ccaf462c455d0442"; +uname_s_glob="linux"; uname_m_glob="aarch64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.4"; sha256="32b57eb28bf6d80b280e4020a0045184f8ca897b20b570c12948aa6838673225"; uname_s_glob="linux"; uname_m_glob="armv6l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="4bf5a0d0a082f544a48536ad3675930d5d2cc6a8cf906710045e0788f51192b3"; uname_s_glob="linux"; uname_m_glob="armv7l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="2b9deb29f86c8209114b71b94fc2e1ed936a1658808a1bee46f4a82fd6a1f8cc"; -uname_s_glob="linux"; uname_m_glob="armv8l"; file="gitstatusd-${uname_s}-aarch64"; version="v1.5.1"; sha256="89b87181b2005527a558cdbc32b12b0f15a1a12bb69865ec216ca5a0266a6c4f"; -uname_s_glob="linux"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="4998bf7889f625df71f1da5757915b678e04039cc8cba00ae10950352c7329f9"; -uname_s_glob="linux"; uname_m_glob="ppc64le"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="e5336dc8e23406c649bafeea83ff17df1726b05ee490f67bae549e55a9a7a7c4"; -uname_s_glob="linux"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="0e8bbc46c17f5cd6e0db98b74c48f4b68f464f98550c8254f6cfcfd936ad1fcf"; +uname_s_glob="linux"; uname_m_glob="armv8l"; file="gitstatusd-${uname_s}-aarch64"; version="v1.5.4"; sha256="32b57eb28bf6d80b280e4020a0045184f8ca897b20b570c12948aa6838673225"; +uname_s_glob="linux"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.4"; sha256="56d55e2e9a202d3072fa612d8fa1faa61243ffc86418a7fa64c2c9d9a82e0f64"; +uname_s_glob="linux"; uname_m_glob="ppc64le"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.4"; sha256="1afd072c8c26ef6ec2d9ac11cef96c84cd6f10e859665a6ffcfb6112c758547e"; +uname_s_glob="linux"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.4"; sha256="9633816e7832109e530c9e2532b11a1edae08136d63aa7e40246c0339b7db304"; uname_s_glob="msys_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="7f9b849fc52e7a95b9b933e25121ad5ae990a1871aad6616922ad7bcf1eebf20"; uname_s_glob="msys_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="5d3c626b5ee564dbc13ddba89752dc58b0efe925b26dbd8b2304849d9ba01732"; # Fallbacks to official gitstatusd binaries. -uname_s_glob="cygwin_nt-*"; uname_m_glob="i686"; file="gitstatusd-cygwin_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="fe132c412c460c2889d731012d280207fe2b4a3c94d077fb4f1c06ed5d319a42"; +uname_s_glob="cygwin_nt-*"; uname_m_glob="i686"; file="gitstatusd-cygwin_nt-10.0-${uname_m}"; version="v1.5.2"; sha256="5a8a809dcebdb6aa9b47d37e086c0485424a9d9c136770eec3c26cedf5bb75e3"; uname_s_glob="cygwin_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-cygwin_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="c84cade0d6b86e04c27a6055f45851f6b46d6b88ba58772f7ca8ef4d295c800f"; uname_s_glob="mingw32_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="7f9b849fc52e7a95b9b933e25121ad5ae990a1871aad6616922ad7bcf1eebf20"; uname_s_glob="mingw32_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="5d3c626b5ee564dbc13ddba89752dc58b0efe925b26dbd8b2304849d9ba01732"; diff --git a/mbuild b/mbuild index ab096e8b..d3de3317 100755 --- a/mbuild +++ b/mbuild @@ -184,7 +184,7 @@ function build-unix() { case $2 in linux-ppc64le) ;; linux-*) flags+=(-d docker);; - darwin-arm64) intro='PATH="/opt/local/bin:$PATH"';; + darwin-arm64) intro='PATH="/opt/homebrew/bin:$PATH"';; darwin-*) intro='PATH="/usr/local/bin:$PATH"';; esac ssh $1 -- /bin/sh -uex <<<" @@ -271,16 +271,52 @@ function build-windows() { chmod +x $binaries/gitstatusd-$2 } +if [[ -r /proc/version && "$(/dev/null + ( + trap '' TERM PIPE + local fd + while true; do + sysopen -wo create,excl -u fd -- $1 && break + sleep 1 + done + exec {fd}>&- + while true; do + print || break + done + rm -- $1 + ) &! + ) + local REPLY + IFS= read -ru $fd + } +else + function flock() { + : >>$1 + zsystem flock $1 + } +fi + function build() ( setopt xtrace local platform=$1 local machine=$assets[$platform] - print -n >>$locks/$machine - zsystem flock $locks/$machine + flock $locks/$machine build-${protocol[(k)$platform]} $machine $platform local tmp=gitstatusd-$platform.tmp.$$.tar.gz ( cd -q -- $binaries; tar --owner=0 --group=0 -I 'gzip -9' -cf $tmp gitstatusd-$platform ) mv -f -- $binaries/$tmp $binaries/gitstatusd-$platform.tar.gz + # Make sure the last command is a built-in (important for flock). + : ) function mbuild() { @@ -365,4 +401,8 @@ function run-process-tree() { } mkdir -p -- $logs $locks $binaries -run-process-tree mbuild $@ + +() { + run-process-tree mbuild $@ + exit +} "$@" From 01467fae4f72dd1bf4b73708e6e356b5417dfc68 Mon Sep 17 00:00:00 2001 From: brent-moffit <72231013+brent-moffit@users.noreply.github.com> Date: Mon, 14 Feb 2022 12:27:56 -0800 Subject: [PATCH 157/380] Change arch prompt colors to better match default themes --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 26e43eec..965fd816 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5632,7 +5632,7 @@ prompt_arch() { _p9k_cache_ephemeral_set $(arch) fi [[ $_p9k__cache_val[1] == $POWERLEVEL9K_ARCH_DEFAULT ]] && return - _p9k_prompt_segment "$0" "orange1" "black" 'ARCH_ICON' 0 '' "$_p9k__cache_val[1]" + _p9k_prompt_segment "$0" "$_p9k_color1" "orange1" 'ARCH_ICON' 0 '' "$_p9k__cache_val[1]" } _p9k_prompt_arch_init() { From 59e90bd8b0bee6b00bc9153f13336f6cafeae08a Mon Sep 17 00:00:00 2001 From: brent-moffit <72231013+brent-moffit@users.noreply.github.com> Date: Mon, 14 Feb 2022 12:38:13 -0800 Subject: [PATCH 158/380] Add instant prompt for arch --- internal/p10k.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 965fd816..2adbc40f 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5635,6 +5635,8 @@ prompt_arch() { _p9k_prompt_segment "$0" "$_p9k_color1" "orange1" 'ARCH_ICON' 0 '' "$_p9k__cache_val[1]" } +instant_prompt_arch() { prompt_arch; } + _p9k_prompt_arch_init() { echo 'arch init' >> ~/p9k_debug.txt typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$commands[arch]' From b898d1de150c1dd26da2d0b0376ae7b517b9665f Mon Sep 17 00:00:00 2001 From: Lucas Burns Date: Sat, 26 Feb 2022 20:27:19 -0600 Subject: [PATCH 159/380] feature: added perlbrew --- config/p10k-classic.zsh | 13 +++++++++++++ config/p10k-lean-8colors.zsh | 13 +++++++++++++ config/p10k-lean.zsh | 13 +++++++++++++ config/p10k-rainbow.zsh | 13 +++++++++++++ internal/p10k.zsh | 20 ++++++++++++++++++++ 5 files changed, 72 insertions(+) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 21ca0155..88a8b96d 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -65,6 +65,7 @@ luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) jenv # java version from jenv (https://github.com/jenv/jenv) plenv # perl version from plenv (https://github.com/tokuhirom/plenv) + perlbrew # perl version from perlbrew (https://github.com/gugod/App-perlbrew) phpenv # php version from phpenv (https://github.com/phpenv/phpenv) scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) haskell_stack # haskell version from stack (https://haskellstack.org/) @@ -1133,6 +1134,18 @@ # Custom icon. # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + ###########[ perlbrew: perl version from perlbrew (https://github.com/gugod/App-perlbrew) ]############ + # Perlbrew color. + typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67 + # Show perlbrew version only when in a perl project subdirectory. + typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true + # Don't show perl- at the front. + typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false + # Decide what should show perlbrew + # typeset -g POWERLEVEL9K_PERLBREW_SHOW_ON_UPGLOB='cpanfile|(MY|)META.(yml|json)|.perltidyrc|(Makefile|Build).PL|*.(pl|pm|t|pod)' + # Custom icon. + # typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐' + ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############ # PHP color. typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=99 diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index dc96d4df..1f1e8680 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -65,6 +65,7 @@ luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) jenv # java version from jenv (https://github.com/jenv/jenv) plenv # perl version from plenv (https://github.com/tokuhirom/plenv) + perlbrew # perl version from perlbrew (https://github.com/gugod/App-perlbrew) phpenv # php version from phpenv (https://github.com/phpenv/phpenv) scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) haskell_stack # haskell version from stack (https://haskellstack.org/) @@ -1114,6 +1115,18 @@ # Custom icon. # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + ###########[ perlbrew: perl version from perlbrew (https://github.com/gugod/App-perlbrew) ]############ + # Perlbrew color. + typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67 + # Show perlbrew version only when in a perl project subdirectory. + typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true + # Don't show perl- at the front. + typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false + # Decide what should show perlbrew + # typeset -g POWERLEVEL9K_PERLBREW_SHOW_ON_UPGLOB='cpanfile|(MY|)META.(yml|json)|.perltidyrc|(Makefile|Build).PL|*.(pl|pm|t|pod)' + # Custom icon. + # typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐' + ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############ # PHP color. typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=5 diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index fc3f20d7..d37f5ba3 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -65,6 +65,7 @@ luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) jenv # java version from jenv (https://github.com/jenv/jenv) plenv # perl version from plenv (https://github.com/tokuhirom/plenv) + perlbrew # perl version from perlbrew (https://github.com/gugod/App-perlbrew) phpenv # php version from phpenv (https://github.com/phpenv/phpenv) scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) haskell_stack # haskell version from stack (https://haskellstack.org/) @@ -1110,6 +1111,18 @@ # Custom icon. # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + ###########[ perlbrew: perl version from perlbrew (https://github.com/gugod/App-perlbrew) ]############ + # Perlbrew color. + typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67 + # Show perlbrew version only when in a perl project subdirectory. + typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true + # Don't show perl- at the front. + typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false + # Decide what should show perlbrew + # typeset -g POWERLEVEL9K_PERLBREW_SHOW_ON_UPGLOB='cpanfile|(MY|)META.(yml|json)|.perltidyrc|(Makefile|Build).PL|*.(pl|pm|t|pod)' + # Custom icon. + # typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐' + ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############ # PHP color. typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=99 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index ef5b444e..5545add2 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -65,6 +65,7 @@ luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) jenv # java version from jenv (https://github.com/jenv/jenv) plenv # perl version from plenv (https://github.com/tokuhirom/plenv) + perlbrew # perl version from perlbrew (https://github.com/gugod/App-perlbrew) phpenv # php version from phpenv (https://github.com/phpenv/phpenv) scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) haskell_stack # haskell version from stack (https://haskellstack.org/) @@ -1194,6 +1195,18 @@ # Custom icon. # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + ###########[ perlbrew: perl version from perlbrew (https://github.com/gugod/App-perlbrew) ]############ + # Perlbrew color. + typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67 + # Show perlbrew version only when in a perl project subdirectory. + typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true + # Don't show perl- at the front. + typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false + # Decide what should show perlbrew + # typeset -g POWERLEVEL9K_PERLBREW_SHOW_ON_UPGLOB='cpanfile|(MY|)META.(yml|json)|.perltidyrc|(Makefile|Build).PL|*.(pl|pm|t|pod)' + # Custom icon. + # typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐' + ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############ # PHP color. typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=0 diff --git a/internal/p10k.zsh b/internal/p10k.zsh index cc36eb0d..9f5b4de9 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3115,6 +3115,26 @@ _p9k_prompt_plenv_init() { typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${commands[plenv]:-${${+functions[plenv]}:#0}}' } +################################################################ +# Segment to display perlbrew information +# https://github.com/gugod/App-perlbrew + +prompt_perlbrew() { + [[ -n $PERLBREW_PERL && ( -v commands[perlbrew] || -v functions[perlbrew] ) ]] || return + if (( _POWERLEVEL9K_PERLBREW_PROJECT_ONLY )); then + _p9k_upglob 'cpanfile|(MY|)META.(yml|json)|.perltidyrc|(Makefile|Build).PL|*.(pl|pm|t|pod)' && return + fi + + local v=$PERLBREW_PERL + (( _POWERLEVEL9K_PERLBREW_SHOW_PREFIX )) || v=${v#*-} + [[ -n $v ]] || return + _p9k_prompt_segment "$0" "blue" "$_p9k_color1" 'PERL_ICON' 0 '' "${v//\%/%%}" +} + +_p9k_prompt_perlbrew_init() { + typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${commands[perlbrew]:-${${+functions[perlbrew]}:#0}}' +} + ################################################################ # Segment to display chruby information # see https://github.com/postmodern/chruby/issues/245 for chruby_auto issue with ZSH From 40a5cdfa6cf20af0133f888be095198ea49d41a1 Mon Sep 17 00:00:00 2001 From: Lucas Burns Date: Sat, 26 Feb 2022 20:32:53 -0600 Subject: [PATCH 160/380] chore: forgot to add global variables to main --- internal/p10k.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 9f5b4de9..2cf35ad5 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7451,6 +7451,8 @@ _p9k_init_params() { _p9k_declare -b POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY 1 _p9k_declare -b POWERLEVEL9K_GO_VERSION_PROJECT_ONLY 1 _p9k_declare -b POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY 1 + _p9k_declare -b POWERLEVEL9K_PERLBREW_PROJECT_ONLY 1 + _p9k_declare -b POWERLEVEL9K_PERLBREW_SHOW_PREFIX 0 _p9k_declare -b POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY 0 _p9k_declare -b POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW 0 _p9k_declare -a POWERLEVEL9K_NODENV_SOURCES -- shell local global From f07d7baea36010bfa74708844d404517ea6ac473 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 28 Feb 2022 10:30:39 +0100 Subject: [PATCH 161/380] minor cleanup around perlbrew --- config/p10k-classic.zsh | 4 +--- config/p10k-lean-8colors.zsh | 4 +--- config/p10k-lean.zsh | 4 +--- config/p10k-rainbow.zsh | 4 +--- internal/p10k.zsh | 7 +++---- 5 files changed, 7 insertions(+), 16 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 88a8b96d..c7ba55d0 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1139,10 +1139,8 @@ typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67 # Show perlbrew version only when in a perl project subdirectory. typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true - # Don't show perl- at the front. + # Don't show "perl-" at the front. typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false - # Decide what should show perlbrew - # typeset -g POWERLEVEL9K_PERLBREW_SHOW_ON_UPGLOB='cpanfile|(MY|)META.(yml|json)|.perltidyrc|(Makefile|Build).PL|*.(pl|pm|t|pod)' # Custom icon. # typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 1f1e8680..b78d2032 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1120,10 +1120,8 @@ typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67 # Show perlbrew version only when in a perl project subdirectory. typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true - # Don't show perl- at the front. + # Don't show "perl-" at the front. typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false - # Decide what should show perlbrew - # typeset -g POWERLEVEL9K_PERLBREW_SHOW_ON_UPGLOB='cpanfile|(MY|)META.(yml|json)|.perltidyrc|(Makefile|Build).PL|*.(pl|pm|t|pod)' # Custom icon. # typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index d37f5ba3..a0dc0877 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1116,10 +1116,8 @@ typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67 # Show perlbrew version only when in a perl project subdirectory. typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true - # Don't show perl- at the front. + # Don't show "perl-" at the front. typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false - # Decide what should show perlbrew - # typeset -g POWERLEVEL9K_PERLBREW_SHOW_ON_UPGLOB='cpanfile|(MY|)META.(yml|json)|.perltidyrc|(Makefile|Build).PL|*.(pl|pm|t|pod)' # Custom icon. # typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 5545add2..4ffd4437 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1200,10 +1200,8 @@ typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67 # Show perlbrew version only when in a perl project subdirectory. typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true - # Don't show perl- at the front. + # Don't show "perl-" at the front. typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false - # Decide what should show perlbrew - # typeset -g POWERLEVEL9K_PERLBREW_SHOW_ON_UPGLOB='cpanfile|(MY|)META.(yml|json)|.perltidyrc|(Makefile|Build).PL|*.(pl|pm|t|pod)' # Custom icon. # typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 2cf35ad5..675abaa2 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3120,9 +3120,8 @@ _p9k_prompt_plenv_init() { # https://github.com/gugod/App-perlbrew prompt_perlbrew() { - [[ -n $PERLBREW_PERL && ( -v commands[perlbrew] || -v functions[perlbrew] ) ]] || return if (( _POWERLEVEL9K_PERLBREW_PROJECT_ONLY )); then - _p9k_upglob 'cpanfile|(MY|)META.(yml|json)|.perltidyrc|(Makefile|Build).PL|*.(pl|pm|t|pod)' && return + _p9k_upglob 'cpanfile|.perltidyrc|(|MY)META.(yml|json)|(Makefile|Build).PL|*.(pl|pm|t|pod)' && return fi local v=$PERLBREW_PERL @@ -3132,7 +3131,7 @@ prompt_perlbrew() { } _p9k_prompt_perlbrew_init() { - typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${commands[perlbrew]:-${${+functions[perlbrew]}:#0}}' + typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$PERLBREW_PERL' } ################################################################ @@ -8296,7 +8295,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v134\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v135\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$__p9k_force_term_shell_integration$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' From e13283ec7dd02d97363303d97d7d36f7521a1344 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 20 Mar 2022 14:57:27 +0100 Subject: [PATCH 162/380] bug fix: strip escape sequences in instant prompt output less aggressively --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 675abaa2..8eabcaaf 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6535,7 +6535,7 @@ function _p9k_clear_instant_prompt() { unset _z4h_saved_screen fi print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed] - local unexpected=${${${(S)content//$'\e[?'<->'c'}//$'\e['<->' q'}//$'\e'[^$'\a\e']#($'\a'|$'\e\\')} + local unexpected=${(S)${${content//$'\e[?'<->'c'}//$'\e['<->' q'}//$'\e'[^$'\a\e']#($'\a'|$'\e\\')} if [[ -n $unexpected ]]; then local omz1='[Oh My Zsh] Would you like to update? [Y/n]: ' local omz2='Updating Oh My Zsh' From 65599411ec83505a091f68489617316dec355510 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 20 Mar 2022 14:58:15 +0100 Subject: [PATCH 163/380] ignore garbage printed by vscode --- internal/p10k.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 8eabcaaf..f60f66f3 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6536,6 +6536,8 @@ function _p9k_clear_instant_prompt() { fi print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed] local unexpected=${(S)${${content//$'\e[?'<->'c'}//$'\e['<->' q'}//$'\e'[^$'\a\e']#($'\a'|$'\e\\')} + # Visual Studio Code prints this garbage. + unexpected=${unexpected//$'\033[1;32mShell integration activated\033[0m\n'} if [[ -n $unexpected ]]; then local omz1='[Oh My Zsh] Would you like to update? [Y/n]: ' local omz2='Updating Oh My Zsh' From 657e184e0d01da186f305e51be781ec36191d6bb Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 4 Apr 2022 15:14:55 +0200 Subject: [PATCH 164/380] disable vscode integration; it doesn't work anyway but it makes shell slower Context: https://github.com/microsoft/vscode/pull/145610#issuecomment-1076519194 --- internal/p10k.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index f60f66f3..22b4f49a 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -9242,6 +9242,8 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi +unset VSCODE_SHELL_INTEGRATION + _p9k_init_ssh _p9k_init_toolbox prompt_powerlevel9k_setup From 0b026542699ca0f2de7c5354fe0ff1184e63a3f3 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Fri, 1 Apr 2022 09:53:12 -0500 Subject: [PATCH 165/380] Show kubecontext when using kubeseal or skaffold --- README.md | 10 +++++----- config/p10k-classic.zsh | 2 +- config/p10k-lean-8colors.zsh | 2 +- config/p10k-lean.zsh | 2 +- config/p10k-rainbow.zsh | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index fbcced45..3f36888f 100644 --- a/README.md +++ b/README.md @@ -216,8 +216,8 @@ Here's the relevant parameter for kubernetes context: ```zsh # Show prompt segment "kubecontext" only when the command you are typing -# invokes kubectl, helm, kubens, kubectx, oc, istioctl, kogito, k9s, helmfile, flux, fluxctl or stern. -typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' +# invokes kubectl, helm, kubens, kubectx, oc, istioctl, kogito, k9s, helmfile, flux, fluxctl, stern, kubeseal, or skaffold. +typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold' ``` To customize when different prompt segments are shown, open `~/.p10k.zsh`, search for @@ -1157,8 +1157,8 @@ a relevant tool. ```zsh # Show prompt segment "kubecontext" only when the command you are typing -# invokes kubectl, helm, kubens, kubectx, oc, istioctl, kogito, k9s, helmfile, flux, fluxctl or stern. -typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' +# invokes kubectl, helm, kubens, kubectx, oc, istioctl, kogito, k9s, helmfile, flux, fluxctl, stern, kubeseal, or skaffold. +typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold' ``` Configs created by `p10k configure` may contain parameters of this kind. To customize when different @@ -1174,7 +1174,7 @@ function kube-toggle() { if (( ${+POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND} )); then unset POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND else - POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' + POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold' fi p10k reload if zle; then diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index c7ba55d0..46814ec0 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1226,7 +1226,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index b78d2032..0dc5dbb2 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1168,7 +1168,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index a0dc0877..dbd9acc9 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1164,7 +1164,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 4ffd4437..4b00f3e8 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1297,7 +1297,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. From ff531e5f2cfcb8994daf7a11d6de086c57becdb2 Mon Sep 17 00:00:00 2001 From: AdalZanabria Date: Tue, 3 May 2022 02:28:53 -0500 Subject: [PATCH 166/380] Added missing segments to README. --- README.md | 775 +++++++++++++++++++++++++----------------------------- 1 file changed, 356 insertions(+), 419 deletions(-) diff --git a/README.md b/README.md index 3f36888f..e3069b7b 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,11 @@ # Powerlevel10k -[![Gitter](https://badges.gitter.im/powerlevel10k/community.svg)]( - https://gitter.im/powerlevel10k/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) + +[![Gitter](https://badges.gitter.im/powerlevel10k/community.svg)](https://gitter.im/powerlevel10k/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) Powerlevel10k is a theme for Zsh. It emphasizes [speed](#uncompromising-performance), [flexibility](#extremely-customizable) and [out-of-the-box experience](#configuration-wizard). -![Powerlevel10k]( -https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/prompt-styles-high-contrast.png) +![Powerlevel10k](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/prompt-styles-high-contrast.png) - [Getting started](#getting-started) - [Features](#features) @@ -20,8 +19,8 @@ https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/prompt-styl ## Getting started -1. [Install the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). *Optional but highly - recommended.* +1. [Install the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). _Optional but highly + recommended._ 1. [Install Powerlevel10k](#installation) itself. 1. Restart Zsh with `exec zsh`. 1. Type `p10k configure` if the configuration wizard doesn't start automatically. @@ -47,8 +46,8 @@ Type `p10k configure` to access the builtin configuration wizard right from your
Screen recording - ![Powerlevel10k Configuration Wizard]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/configuration-wizard.gif) +![Powerlevel10k Configuration Wizard](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/configuration-wizard.gif) +
All styles except [Pure](#pure-compatibility) are functionally equivalent. They display the same @@ -58,31 +57,26 @@ Configuration wizard creates `~/.p10k.zsh` based on your preferences. Additional customization can be done by editing this file. It has plenty of comments to help you navigate through configuration options. -*Tip*: Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) before +_Tip_: Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) before running `p10k configure` to unlock all prompt styles. -*FAQ:* +_FAQ:_ -- [What is the best prompt style in the configuration wizard?]( - #what-is-the-best-prompt-style-in-the-configuration-wizard) -- [What do different symbols in Git status mean?]( - #what-do-different-symbols-in-git-status-mean) +- [What is the best prompt style in the configuration wizard?](#what-is-the-best-prompt-style-in-the-configuration-wizard) +- [What do different symbols in Git status mean?](#what-do-different-symbols-in-git-status-mean) - [How do I change prompt colors?](#how-do-i-change-prompt-colors) -*Troubleshooting*: +_Troubleshooting_: -- [Some prompt styles are missing from the configuration wizard]( - #some-prompt-styles-are-missing-from-the-configuration-wizard). +- [Some prompt styles are missing from the configuration wizard](#some-prompt-styles-are-missing-from-the-configuration-wizard). - [Question mark in prompt](#question-mark-in-prompt). - [Icons, glyphs or powerline symbols don't render](#icons-glyphs-or-powerline-symbols-dont-render). -- [Sub-pixel imperfections around powerline symbols]( - #sub-pixel-imperfections-around-powerline-symbols). -- [Directory is difficult to see in prompt when using Rainbow style]( - #directory-is-difficult-to-see-in-prompt-when-using-rainbow-style). +- [Sub-pixel imperfections around powerline symbols](#sub-pixel-imperfections-around-powerline-symbols). +- [Directory is difficult to see in prompt when using Rainbow style](#directory-is-difficult-to-see-in-prompt-when-using-rainbow-style). ### Uncompromising performance -When you hit *ENTER*, the next prompt appears instantly. With Powerlevel10k there is no prompt lag. +When you hit _ENTER_, the next prompt appears instantly. With Powerlevel10k there is no prompt lag. If you install Cygwin on Raspberry Pi, `cd` into a Linux Git repository and activate enough prompt segments to fill four prompt lines on both sides of the screen... wait, that's just crazy and no one ever does that. Probably impossible, too. The point is, Powerlevel10k prompt is always fast, no @@ -91,24 +85,24 @@ matter what you do!
Screen recording - ![Powerlevel10k Performance]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/performance.gif) +![Powerlevel10k Performance](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/performance.gif) +
Note how the effect of every command is instantly reflected by the very next prompt. -| Command | Prompt Indicator | Meaning | -|-------------------------------|:----------------:|----------------------------------------------------------------------:| -| `timew start hack linux` | `⌚ hack linux` | time tracking enabled in [timewarrior](https://timewarrior.net/) | -| `touch x y` | `?2` | 2 untracked files in the Git repo | -| `rm COPYING` | `!1` | 1 unstaged change in the Git repo | -| `echo 3.7.3 >.python-version` | `🐍 3.7.3` | the current python version in [pyenv](https://github.com/pyenv/pyenv) | +| Command | Prompt Indicator | Meaning | +| ----------------------------- | :--------------: | --------------------------------------------------------------------: | +| `timew start hack linux` | `⌚ hack linux` | time tracking enabled in [timewarrior](https://timewarrior.net/) | +| `touch x y` | `?2` | 2 untracked files in the Git repo | +| `rm COPYING` | `!1` | 1 unstaged change in the Git repo | +| `echo 3.7.3 >.python-version` | `🐍 3.7.3` | the current python version in [pyenv](https://github.com/pyenv/pyenv) | Other Zsh themes capable of displaying the same information either produce prompt lag or print prompt that doesn't reflect the current state of the system and then refresh it later. With -Powerlevel10k you get fast prompt *and* up-to-date information. +Powerlevel10k you get fast prompt _and_ up-to-date information. -*FAQ*: [Is it really fast?](#is-it-really-fast) +_FAQ_: [Is it really fast?](#is-it-really-fast) ### Powerlevel9k compatibility @@ -118,35 +112,31 @@ configuration parameters.
Screen recording - ![Powerlevel10k Compatibility with 9k]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/9k-compatibility.gif) +![Powerlevel10k Compatibility with 9k](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/9k-compatibility.gif) +
[Migration](#installation) from Powerlevel9k to Powerlevel10k is a straightforward process. All your `POWERLEVEL9K` configuration parameters will still work. Prompt will look the same as before -([almost]( - #does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config)) +([almost](#does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config)) but it will be [much faster](#uncompromising-performance) ([certainly](#is-it-really-fast)). -*FAQ*: +_FAQ_: -- [I'm using Powerlevel9k with Oh My Zsh. How do I migrate?]( - #im-using-powerlevel9k-with-oh-my-zsh-how-do-i-migrate) -- [Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config?]( - #does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config) -- [What is the relationship between Powerlevel9k and Powerlevel10k?]( - #What-is-the-relationship-between-powerlevel9k-and-powerlevel10k) +- [I'm using Powerlevel9k with Oh My Zsh. How do I migrate?](#im-using-powerlevel9k-with-oh-my-zsh-how-do-i-migrate) +- [Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config?](#does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config) +- [What is the relationship between Powerlevel9k and Powerlevel10k?](#What-is-the-relationship-between-powerlevel9k-and-powerlevel10k) ### Pure compatibility Powerlevel10k can produce the same prompt as [Pure](https://github.com/sindresorhus/pure). Type -`p10k configure` and select *Pure* style. +`p10k configure` and select _Pure_ style.
Screen recording - ![Powerlevel10k Pure Style]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/pure-style.gif) +![Powerlevel10k Pure Style](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/pure-style.gif) +
You can still use Powerlevel10k features such as [transient prompt](#transient-prompt) or @@ -157,8 +147,7 @@ parameters, so you'll need to use `POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD `PURE_CMD_MAX_EXEC_TIME=3`, etc. All relevant parameters are in `~/.p10k.zsh`. This file has plenty of comments to help you navigate through it. -*FAQ:* [What is the best prompt style in the configuration wizard?]( - #what-is-the-best-prompt-style-in-the-configuration-wizard) +_FAQ:_ [What is the best prompt style in the configuration wizard?](#what-is-the-best-prompt-style-in-the-configuration-wizard) ### Instant prompt @@ -169,8 +158,8 @@ may have noticed that it takes some time for Zsh to start.
Screen recording - ![Powerlevel10k No Instant Prompt]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/no-instant-prompt.gif) +![Powerlevel10k No Instant Prompt](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/no-instant-prompt.gif) +
Powerlevel10k can remove Zsh startup lag **even if it's not caused by a theme**. @@ -178,21 +167,21 @@ Powerlevel10k can remove Zsh startup lag **even if it's not caused by a theme**.
Screen recording - ![Powerlevel10k Instant Prompt]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/instant-prompt.gif) +![Powerlevel10k Instant Prompt](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/instant-prompt.gif) +
-This feature is called *Instant Prompt*. You need to explicitly enable it through `p10k configure` +This feature is called _Instant Prompt_. You need to explicitly enable it through `p10k configure` or [manually](#how-do-i-configure-instant-prompt). It does what it says on the tin -- prints prompt instantly upon Zsh startup allowing you to start typing while plugins are still loading. -Other themes *increase* Zsh startup lag -- some by a lot, others by a just a little. Powerlevel10k -*removes* it outright. +Other themes _increase_ Zsh startup lag -- some by a lot, others by a just a little. Powerlevel10k +_removes_ it outright. -If you are curious about how *Instant Prompt* works, see +If you are curious about how _Instant Prompt_ works, see [this section in zsh-bench](https://github.com/romkatv/zsh-bench#instant-prompt). -*FAQ:* [How do I configure instant prompt?](#how-do-i-configure-instant-prompt) +_FAQ:_ [How do I configure instant prompt?](#how-do-i-configure-instant-prompt) ### Show on command @@ -201,14 +190,14 @@ image on the cluster defined by the current kubernetes context. If you frequentl between "prod" and "testing", you might want to display the current context in Zsh prompt. If you do likewise for AWS, Azure and Google Cloud credentials, prompt will get pretty crowded. -Enter *Show On Command*. This feature makes prompt segments appear only when they are relevant to +Enter _Show On Command_. This feature makes prompt segments appear only when they are relevant to the command you are currently typing.
Screen recording - ![Powerlevel10k Show On Command]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/show-on-command.gif) +![Powerlevel10k Show On Command](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/show-on-command.gif) +
Configs created by `p10k configure` enable show on command for several prompt segments by default. @@ -226,19 +215,19 @@ or change their values. ### Transient prompt -When *Transient Prompt* is enabled through `p10k configure`, Powerlevel10k will trim down every +When _Transient Prompt_ is enabled through `p10k configure`, Powerlevel10k will trim down every prompt when accepting a command line.
Screen recording - ![Powerlevel10k Transient Prompt]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/transient-prompt.gif) +![Powerlevel10k Transient Prompt](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/transient-prompt.gif) +
Transient prompt makes it much easier to copy-paste series of commands from the terminal scrollback. -*Tip*: If you enable transient prompt, take advantage of two-line prompt. You'll get the benefit of +_Tip_: If you enable transient prompt, take advantage of two-line prompt. You'll get the benefit of extra space for typing commands without the usual drawback of reduced scrollback density. Sparse prompt (with an empty line before prompt) also works great in combination with transient prompt. @@ -251,8 +240,8 @@ when horizontal space gets scarce.
Screen recording - ![Powerlevel10k Directory Truncation]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/directory-truncation.gif) +![Powerlevel10k Directory Truncation](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/directory-truncation.gif) +
When the full directory doesn't fit, the leftmost segment gets truncated to its shortest unique @@ -267,10 +256,9 @@ Directory segments are shown in one of three colors: roots of Git repositories, etc. - Regular segments (not truncated but can be) use in-between color. -*Tip*: If you copy-paste a truncated directory and hit *TAB*, it'll complete to the original. +_Tip_: If you copy-paste a truncated directory and hit _TAB_, it'll complete to the original. -*Troubleshooting*: [Directory is difficult to see in prompt when using Rainbow style.]( - #directory-is-difficult-to-see-in-prompt-when-using-rainbow-style) +_Troubleshooting_: [Directory is difficult to see in prompt when using Rainbow style.](#directory-is-difficult-to-see-in-prompt-when-using-rainbow-style) ### Extremely customizable @@ -279,25 +267,22 @@ Powerlevel10k can be configured to look like any other Zsh theme out there.
Screen recording - ![Powerlevel10k Other Theme Emulation]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/other-theme-emulation.gif) +![Powerlevel10k Other Theme Emulation](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/other-theme-emulation.gif) +
-[Pure](#pure-compatibility), [Powerlevel9k](#powerlevel9k-compatibility) and [robbyrussell]( - #how-to-make-powerlevel10k-look-like-robbyrussell-oh-my-zsh-theme) emulations are built-in. +[Pure](#pure-compatibility), [Powerlevel9k](#powerlevel9k-compatibility) and [robbyrussell](#how-to-make-powerlevel10k-look-like-robbyrussell-oh-my-zsh-theme) emulations are built-in. To emulate the appearance of other themes, you'll need to write a suitable configuration file. The best way to go about it is to run `p10k configure`, select the style that is the closest to your goal and then edit `~/.p10k.zsh`. The full range of Powerlevel10k appearance spans from spartan: -![Powerlevel10k Spartan Style]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/spartan-style.png) +![Powerlevel10k Spartan Style](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/spartan-style.png) To ~~ridiculous~~ extravagant: -![Powerlevel10k Extravagant Style]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/extravagant-style.png) +![Powerlevel10k Extravagant Style](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/extravagant-style.png) ### Batteries included @@ -306,71 +291,74 @@ and choose any style except [Pure](#pure-compatibility), many of these segments default while others be manually enabled by opening `~/.p10k.zsh` and uncommenting them. You can enable as many segments as you like. It won't slow down your prompt or Zsh startup. -| Segment | Meaning | -|--------:|---------| -| `anaconda` | virtual environment from [conda](https://conda.io/) | -| `asdf` | tool versions from [asdf](https://github.com/asdf-vm/asdf) | -| `aws` | [aws profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) | -| `aws_eb_env` | [aws elastic beanstalk](https://aws.amazon.com/elasticbeanstalk/) environment | -| `azure` | [azure](https://docs.microsoft.com/en-us/cli/azure) account name | -| `background_jobs` | presence of background jobs | -| `battery` | internal battery state and charge level (yep, batteries *literally* included) | -| `command_execution_time` | duration (wall time) of the last command | -| `context` | user@hostname | -| `dir` | current working directory | -| `direnv` | [direnv](https://direnv.net/) status | -| `disk_usage` | disk usage | -| `dotnet_version` | [dotnet](https://dotnet.microsoft.com) version | -| `fvm` | flutter environment from [fvm](https://github.com/leoafarias/fvm) | -| `gcloud` | [google cloud](https://cloud.google.com/) cli account and project | -| `goenv` | go environment from [goenv](https://github.com/syndbg/goenv) | -| `google_app_cred` | [google application credentials](https://cloud.google.com/docs/authentication/production) | -| `go_version` | [go](https://golang.org) version | -| `haskell_stack` | haskell version from [stack](https://haskellstack.org/) | -| `ip` | IP address and bandwidth usage for a specified network interface | -| `java_version` | [java](https://www.java.com/) version | -| `jenv` | java environment from [jenv](https://github.com/jenv/jenv) | -| `kubecontext` | current [kubernetes](https://kubernetes.io/) context | -| `laravel_version` | [laravel php framework](https://laravel.com/) version | -| `load` | CPU load | -| `luaenv` | lua environment from [luaenv](https://github.com/cehoffman/luaenv) | -| `midnight_commander` | [midnight commander](https://midnight-commander.org/) shell | -| `nix_shell` | [nix shell](https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) indicator | -| `nnn` | [nnn](https://github.com/jarun/nnn) shell | -| `nodeenv` | node.js environment from [nodeenv](https://github.com/ekalinin/nodeenv) | -| `nodenv` | node.js environment from [nodenv](https://github.com/nodenv/nodenv) | -| `node_version` | [node.js](https://nodejs.org/) version | -| `nordvpn` | [nordvpn](https://nordvpn.com/) connection status | -| `nvm` | node.js environment from [nvm](https://github.com/nvm-sh/nvm) | -| `os_icon` | your OS logo (apple for macOS, swirl for debian, etc.) | -| `package` | `name@version` from [package.json](https://docs.npmjs.com/files/package.json) | -| `phpenv` | php environment from [phpenv](https://github.com/phpenv/phpenv) | -| `php_version` | [php](https://www.php.net/) version | -| `plenv` | perl environment from [plenv](https://github.com/tokuhirom/plenv) | -| `prompt_char` | multi-functional prompt symbol; changes depending on vi mode: `❯`, `❮`, `V`, `▶` for insert, command, visual and replace mode respectively; turns red on error | -| `proxy` | system-wide http/https/ftp proxy | -| `public_ip` | public IP address | -| `pyenv` | python environment from [pyenv](https://github.com/pyenv/pyenv) | -| `ram` | free RAM | -| `ranger` | [ranger](https://github.com/ranger/ranger) shell | -| `rbenv` | ruby environment from [rbenv](https://github.com/rbenv/rbenv) | -| `rust_version` | [rustc](https://www.rust-lang.org) version | -| `rvm` | ruby environment from [rvm](https://rvm.io) | -| `status` | exit code of the last command | -| `swap` | used swap | -| `taskwarrior` | [taskwarrior](https://taskwarrior.org/) task count | -| `terraform` | [terraform](https://www.terraform.io) workspace | -| `terraform_version` | [terraform](https://www.terraform.io) version | -| `time` | current time | -| `timewarrior` | [timewarrior](https://timewarrior.net/) tracking status | -| `todo` | [todo](https://github.com/todotxt/todo.txt-cli) items | -| `toolbox` | [toolbox](https://github.com/containers/toolbox) name | -| `vcs` | Git repository status | -| `vim_shell` | [vim](https://www.vim.org/) shell (`:sh`) | -| `virtualenv` | python environment from [venv](https://docs.python.org/3/library/venv.html) | -| `vpn_ip` | virtual private network indicator | -| `wifi` | WiFi speed | -| `xplr` | [xplr](https://github.com/sayanarijit/xplr) shell | +| Segment | Meaning | +| -----------------------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `anaconda` | virtual environment from [conda](https://conda.io/) | +| `asdf` | tool versions from [asdf](https://github.com/asdf-vm/asdf) | +| `aws` | [aws profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) | +| `aws_eb_env` | [aws elastic beanstalk](https://aws.amazon.com/elasticbeanstalk/) environment | +| `azure` | [azure](https://docs.microsoft.com/en-us/cli/azure) account name | +| `background_jobs` | presence of background jobs | +| `battery` | internal battery state and charge level (yep, batteries _literally_ included) | +| `command_execution_time` | duration (wall time) of the last command | +| `context` | user@hostname | +| `dir` | current working directory | +| `direnv` | [direnv](https://direnv.net/) status | +| `disk_usage` | disk usage | +| `dotnet_version` | [dotnet](https://dotnet.microsoft.com) version | +| `fvm` | flutter environment from [fvm](https://github.com/leoafarias/fvm) | +| `gcloud` | [google cloud](https://cloud.google.com/) cli account and project | +| `goenv` | go environment from [goenv](https://github.com/syndbg/goenv) | +| `google_app_cred` | [google application credentials](https://cloud.google.com/docs/authentication/production) | +| `go_version` | [go](https://golang.org) version | +| `haskell_stack` | haskell version from [stack](https://haskellstack.org/) | +| `ip` | IP address and bandwidth usage for a specified network interface | +| `java_version` | [java](https://www.java.com/) version | +| `jenv` | java environment from [jenv](https://github.com/jenv/jenv) | +| `kubecontext` | current [kubernetes](https://kubernetes.io/) context | +| `laravel_version` | [laravel php framework](https://laravel.com/) version | +| `load` | CPU load | +| `luaenv` | lua environment from [luaenv](https://github.com/cehoffman/luaenv) | +| `midnight_commander` | [midnight commander](https://midnight-commander.org/) shell | +| `nix_shell` | [nix shell](https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) indicator | +| `nnn` | [nnn](https://github.com/jarun/nnn) shell | +| `nodeenv` | node.js environment from [nodeenv](https://github.com/ekalinin/nodeenv) | +| `nodenv` | node.js environment from [nodenv](https://github.com/nodenv/nodenv) | +| `node_version` | [node.js](https://nodejs.org/) version | +| `nordvpn` | [nordvpn](https://nordvpn.com/) connection status | +| `nvm` | node.js environment from [nvm](https://github.com/nvm-sh/nvm) | +| `os_icon` | your OS logo (apple for macOS, swirl for debian, etc.) | +| `package` | `name@version` from [package.json](https://docs.npmjs.com/files/package.json) | +| `perlbrew` | perl version from [perlbrew](https://github.com/gugod/App-perlbrew) | +| `phpenv` | php environment from [phpenv](https://github.com/phpenv/phpenv) | +| `php_version` | [php](https://www.php.net/) version | +| `plenv` | perl environment from [plenv](https://github.com/tokuhirom/plenv) | +| `prompt_char` | multi-functional prompt symbol; changes depending on vi mode: `❯`, `❮`, `V`, `▶` for insert, command, visual and replace mode respectively; turns red on error | +| `proxy` | system-wide http/https/ftp proxy | +| `public_ip` | public IP address | +| `pyenv` | python environment from [pyenv](https://github.com/pyenv/pyenv) | +| `ram` | free RAM | +| `ranger` | [ranger](https://github.com/ranger/ranger) shell | +| `rbenv` | ruby environment from [rbenv](https://github.com/rbenv/rbenv) | +| `rust_version` | [rustc](https://www.rust-lang.org) version | +| `rvm` | ruby environment from [rvm](https://rvm.io) | +| `scalaenv` | scala version from [scalaenv](https://github.com/scalaenv/scalaenv) | +| `status` | exit code of the last command | +| `swap` | used swap | +| `taskwarrior` | [taskwarrior](https://taskwarrior.org/) task count | +| `terraform` | [terraform](https://www.terraform.io) workspace | +| `terraform_version` | [terraform](https://www.terraform.io) version | +| `time` | current time | +| `timewarrior` | [timewarrior](https://timewarrior.net/) tracking status | +| `todo` | [todo](https://github.com/todotxt/todo.txt-cli) items | +| `toolbox` | [toolbox](https://github.com/containers/toolbox) name | +| `vcs` | Git repository status | +| `vim_shell` | [vim](https://www.vim.org/) shell (`:sh`) | +| `virtualenv` | python environment from [venv](https://docs.python.org/3/library/venv.html) | +| `vi_mode` | vi mode (you don't need this if you've enabled prompt_char) | +| `vpn_ip` | virtual private network indicator | +| `wifi` | WiFi speed | +| `xplr` | [xplr](https://github.com/sayanarijit/xplr) shell | ### Extensible @@ -380,8 +368,8 @@ public API for defining segments that are as fast and as flexible as built-in on
Screen recording - ![Powerlevel10k Custom Segment]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/custom-segment.gif) +![Powerlevel10k Custom Segment](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/custom-segment.gif) +
On Linux you can fetch current CPU temperature by reading `/sys/class/thermal/thermal_zone0/temp`. @@ -391,7 +379,7 @@ it out of the box. Type `p10k help segment` for reference. -*Tip*: Prefix names of your own segments with `my_` to avoid clashes with future versions of +_Tip_: Prefix names of your own segments with `my_` to avoid clashes with future versions of Powerlevel10k. ## Installation @@ -431,15 +419,18 @@ make sure to disable the current theme in your plugin manager. See ### Oh My Zsh 1. Clone the repository: - ```zsh - git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k - ``` - Users in mainland China can use the official mirror on gitee.com for faster download.
- 中国大陆用户可以使用 gitee.com 上的官方镜像加速下载. - ```zsh - git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k - ``` + ```zsh + git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k + ``` + + Users in mainland China can use the official mirror on gitee.com for faster download.
+ 中国大陆用户可以使用 gitee.com 上的官方镜像加速下载. + + ```zsh + git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k + ``` + 2. Set `ZSH_THEME="powerlevel10k/powerlevel10k"` in `~/.zshrc`. ### Prezto @@ -498,10 +489,8 @@ echo 'source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme' >>~/.zs [zsh-theme-powerlevel10k-git](https://aur.archlinux.org/packages/zsh-theme-powerlevel10k-git/) referenced above is the official Powerlevel10k package. -There is also [zsh-theme-powerlevel10k]( - https://www.archlinux.org/packages/community/x86_64/zsh-theme-powerlevel10k/) community package. -Historically, [it has been breaking often and for extended periods of time]( - https://github.com/romkatv/powerlevel10k/pull/786). **Do not use it.** +There is also [zsh-theme-powerlevel10k](https://www.archlinux.org/packages/community/x86_64/zsh-theme-powerlevel10k/) community package. +Historically, [it has been breaking often and for extended periods of time](https://github.com/romkatv/powerlevel10k/pull/786). **Do not use it.** ## Configuration @@ -516,27 +505,21 @@ Configuration wizard creates `~/.p10k.zsh` based on your preferences. Additional customization can be done by editing this file. It has plenty of comments to help you navigate through configuration options. -*FAQ*: +_FAQ_: -- [What is the best prompt style in the configuration wizard?]( - #what-is-the-best-prompt-style-in-the-configuration-wizard) -- [What do different symbols in Git status mean?]( - #what-do-different-symbols-in-git-status-mean) +- [What is the best prompt style in the configuration wizard?](#what-is-the-best-prompt-style-in-the-configuration-wizard) +- [What do different symbols in Git status mean?](#what-do-different-symbols-in-git-status-mean) - [How do I change the format of Git status?](#how-do-i-change-the-format-of-git-status) -- [How do I add username and/or hostname to prompt?]( - #how-do-i-add-username-andor-hostname-to-prompt) +- [How do I add username and/or hostname to prompt?](#how-do-i-add-username-andor-hostname-to-prompt) - [How do I change prompt colors?](#how-do-i-change-prompt-colors) -- [Why some prompt segments appear and disappear as I'm typing?]( - #why-some-prompt-segments-appear-and-disappear-as-im-typing) +- [Why some prompt segments appear and disappear as I'm typing?](#why-some-prompt-segments-appear-and-disappear-as-im-typing) -*Troubleshooting*: +_Troubleshooting_: - [Question mark in prompt](#question-mark-in-prompt). - [Icons, glyphs or powerline symbols don't render](#icons-glyphs-or-powerline-symbols-dont-render). -- [Sub-pixel imperfections around powerline symbols]( - #sub-pixel-imperfections-around-powerline-symbols). -- [Directory is difficult to see in prompt when using Rainbow style]( - #directory-is-difficult-to-see-in-prompt-when-using-rainbow-style). +- [Sub-pixel imperfections around powerline symbols](#sub-pixel-imperfections-around-powerline-symbols). +- [Directory is difficult to see in prompt when using Rainbow style](#directory-is-difficult-to-see-in-prompt-when-using-rainbow-style). ### For Powerlevel9k users @@ -544,17 +527,13 @@ If you've been using Powerlevel9k before, **do not remove the configuration opti will pick them up and provide you with the same prompt UI you are used to. See [Powerlevel9k compatibility](#powerlevel9k-compatibility). -*FAQ*: +_FAQ_: -- [I'm using Powerlevel9k with Oh My Zsh. How do I migrate?]( - #im-using-powerlevel9k-with-oh-my-zsh-how-do-i-migrate) -- [What is the relationship between Powerlevel9k and Powerlevel10k?]( - #what-is-the-relationship-between-powerlevel9k-and-powerlevel10k) -- [Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config?]( - #does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config) +- [I'm using Powerlevel9k with Oh My Zsh. How do I migrate?](#im-using-powerlevel9k-with-oh-my-zsh-how-do-i-migrate) +- [What is the relationship between Powerlevel9k and Powerlevel10k?](#what-is-the-relationship-between-powerlevel9k-and-powerlevel10k) +- [Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config?](#does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config) -*Troubleshooting*: [Extra or missing spaces in prompt compared to Powerlevel9k]( - #extra-or-missing-spaces-in-prompt-compared-to-powerlevel9k). +_Troubleshooting_: [Extra or missing spaces in prompt compared to Powerlevel9k](#extra-or-missing-spaces-in-prompt-compared-to-powerlevel9k). ## Fonts @@ -575,82 +554,75 @@ originally developed by Ryan L McIntyre of Nerd Fonts. Contains all glyphs and s Powerlevel10k may need. Battle-tested in dozens of different terminals on all major operating systems. -*FAQ*: [How was the recommended font created?](#how-was-the-recommended-font-created) +_FAQ_: [How was the recommended font created?](#how-was-the-recommended-font-created) #### Automatic font installation If you are using iTerm2 or Termux, `p10k configure` can install the recommended font for you. -Simply answer `Yes` when asked whether to install *Meslo Nerd Font*. +Simply answer `Yes` when asked whether to install _Meslo Nerd Font_. If you are using a different terminal, proceed with manual font installation. 👇 #### Manual font installation 1. Download these four ttf files: - - [MesloLGS NF Regular.ttf]( - https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf) - - [MesloLGS NF Bold.ttf]( - https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf) - - [MesloLGS NF Italic.ttf]( - https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf) - - [MesloLGS NF Bold Italic.ttf]( - https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf) + - [MesloLGS NF Regular.ttf](https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf) + - [MesloLGS NF Bold.ttf](https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf) + - [MesloLGS NF Italic.ttf](https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf) + - [MesloLGS NF Bold Italic.ttf](https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf) 1. Double-click on each file and click "Install". This will make `MesloLGS NF` font available to all applications on your system. 1. Configure your terminal to use this font: - **iTerm2**: Type `p10k configure` and answer `Yes` when asked whether to install - *Meslo Nerd Font*. Alternatively, open *iTerm2 → Preferences → Profiles → Text* and set *Font* to + _Meslo Nerd Font_. Alternatively, open _iTerm2 → Preferences → Profiles → Text_ and set _Font_ to `MesloLGS NF`. - - **Apple Terminal**: Open *Terminal → Preferences → Profiles → Text*, click *Change* under *Font* + - **Apple Terminal**: Open _Terminal → Preferences → Profiles → Text_, click _Change_ under _Font_ and select `MesloLGS NF` family. - - **Hyper**: Open *Hyper → Edit → Preferences* and change the value of `fontFamily` under + - **Hyper**: Open _Hyper → Edit → Preferences_ and change the value of `fontFamily` under `module.exports.config` to `MesloLGS NF`. - - **Visual Studio Code**: Open *File → Preferences → Settings* (PC) or - *Code → Preferences → Settings* (Mac), enter `terminal.integrated.fontFamily` in the search box at - the top of *Settings* tab and set the value below to `MesloLGS NF`. - Consult [this screenshot]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/389133fb8c9a2347929a23702ce3039aacc46c3d/visual-studio-code-font-settings.jpg) - to see how it should look like or see [this issue]( - https://github.com/romkatv/powerlevel10k/issues/671) for extra information. - - **GNOME Terminal** (the default Ubuntu terminal): Open *Terminal → Preferences* and click on the - selected profile under *Profiles*. Check *Custom font* under *Text Appearance* and select + - **Visual Studio Code**: Open _File → Preferences → Settings_ (PC) or + _Code → Preferences → Settings_ (Mac), enter `terminal.integrated.fontFamily` in the search box at + the top of _Settings_ tab and set the value below to `MesloLGS NF`. + Consult [this screenshot](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/389133fb8c9a2347929a23702ce3039aacc46c3d/visual-studio-code-font-settings.jpg) + to see how it should look like or see [this issue](https://github.com/romkatv/powerlevel10k/issues/671) for extra information. + - **GNOME Terminal** (the default Ubuntu terminal): Open _Terminal → Preferences_ and click on the + selected profile under _Profiles_. Check _Custom font_ under _Text Appearance_ and select `MesloLGS NF Regular`. - - **Konsole**: Open *Settings → Edit Current Profile → Appearance*, click *Select Font* and select + - **Konsole**: Open _Settings → Edit Current Profile → Appearance_, click _Select Font_ and select `MesloLGS NF Regular`. - - **Tilix**: Open *Tilix → Preferences* and click on the selected profile under *Profiles*. Check - *Custom font* under *Text Appearance* and select `MesloLGS NF Regular`. + - **Tilix**: Open _Tilix → Preferences_ and click on the selected profile under _Profiles_. Check + _Custom font_ under _Text Appearance_ and select `MesloLGS NF Regular`. - **Windows Console Host** (the old thing): Click the icon in the top left corner, then - *Properties → Font* and set *Font* to `MesloLGS NF`. + _Properties → Font_ and set _Font_ to `MesloLGS NF`. - **Windows Terminal** by Microsoft (the new thing): Open `settings.json` (Ctrl+Shift+,), search for `fontFace` and set the value to `MesloLGS NF` for every profile. If you don't find - `fontFace`, add it under *profiles → defaults*. See [this settings file]( - https://raw.githubusercontent.com/romkatv/dotfiles-public/aba0e6c4657d705ed6c344d700d659977385f25c/dotfiles/microsoft-terminal-settings.json) + `fontFace`, add it under _profiles → defaults_. See [this settings file](https://raw.githubusercontent.com/romkatv/dotfiles-public/aba0e6c4657d705ed6c344d700d659977385f25c/dotfiles/microsoft-terminal-settings.json) for example. - - **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor → - Color Scheme → Console Font*. Select *Use console font instead of the default* and set the font + - **IntelliJ** (and other IDEs by Jet Brains): Open _IDE → Edit → Preferences → Editor → + Color Scheme → Console Font_. Select _Use console font instead of the default_ and set the font name to `MesloLGS NF`. - **Termux**: Type `p10k configure` and answer `Yes` when asked whether to install - *Meslo Nerd Font*. - - **Blink**: Type `config`, go to *Appearance*, tap *Add a new font*, tap *Open Gallery*, select - *MesloLGS NF.css*, tap *import* and type `exit` in the home view to reload the font. - - **Terminus**: Open *Settings → Appearance* and set *Font* to `MesloLGS NF`. - - **Terminator**: Open *Preferences* using the context menu. Under *Profiles* select the *General* - tab (should be selected already), uncheck *Use the system fixed width font* (if not already) - and select `MesloLGS NF Regular`. Exit the Preferences dialog by clicking *Close*. - - **Guake**: Right Click on an open terminal and open *Preferences*. Under *Appearance* - tab, uncheck *Use the system fixed width font* (if not already) and select `MesloLGS NF Regular`. - Exit the Preferences dialog by clicking *Close*. - - **MobaXterm**: Open *Settings* → *Configuration* → *Terminal* → (under *Terminal look and feel*) - and change *Font* to `MesloLGS NF`. - - **Asbrú Connection Manager**: Open *Preferences → Local Shell Options → Look and Feel*, enable - *Use these personal options* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`. - To change the font for the remote host connections, go to *Preferences → Terminal Options → - Look and Feel* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`. - - **WSLtty**: Right click on an open terminal and then on *Options*. In the *Text* section, under - *Font*, click *"Select..."* and set Font to `MesloLGS NF Regular`. - - **Yakuake**: Click *≡* → *Manage Profiles* → *New* → *Appearance*. Click *Choose* next to the - *Font* dropdown, select `MesloLGS NF` and click *OK*. Click *OK* to save the profile. Select the - new profile and click *Set as Default*. + _Meslo Nerd Font_. + - **Blink**: Type `config`, go to _Appearance_, tap _Add a new font_, tap _Open Gallery_, select + _MesloLGS NF.css_, tap _import_ and type `exit` in the home view to reload the font. + - **Terminus**: Open _Settings → Appearance_ and set _Font_ to `MesloLGS NF`. + - **Terminator**: Open _Preferences_ using the context menu. Under _Profiles_ select the _General_ + tab (should be selected already), uncheck _Use the system fixed width font_ (if not already) + and select `MesloLGS NF Regular`. Exit the Preferences dialog by clicking _Close_. + - **Guake**: Right Click on an open terminal and open _Preferences_. Under _Appearance_ + tab, uncheck _Use the system fixed width font_ (if not already) and select `MesloLGS NF Regular`. + Exit the Preferences dialog by clicking _Close_. + - **MobaXterm**: Open _Settings_ → _Configuration_ → _Terminal_ → (under _Terminal look and feel_) + and change _Font_ to `MesloLGS NF`. + - **Asbrú Connection Manager**: Open _Preferences → Local Shell Options → Look and Feel_, enable + _Use these personal options_ and change _Font:_ under _Terminal UI_ to `MesloLGS NF Regular`. + To change the font for the remote host connections, go to _Preferences → Terminal Options → + Look and Feel_ and change _Font:_ under _Terminal UI_ to `MesloLGS NF Regular`. + - **WSLtty**: Right click on an open terminal and then on _Options_. In the _Text_ section, under + _Font_, click _"Select..."_ and set Font to `MesloLGS NF Regular`. + - **Yakuake**: Click _≡_ → _Manage Profiles_ → _New_ → _Appearance_. Click _Choose_ next to the + _Font_ dropdown, select `MesloLGS NF` and click _OK_. Click _OK_ to save the profile. Select the + new profile and click _Set as Default_. - **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and add the following section to it: ```yaml @@ -658,12 +630,12 @@ If you are using a different terminal, proceed with manual font installation. normal: family: "MesloLGS NF" ``` - - **kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following line to it: - ```text - font_family MesloLGS NF - ``` - Restart kitty by closing all sessions and opening a new session. - - **puTTY**: Set *Window* → *Appearance* → *Font* to `MesloLGS NF`. Requires puTTY + - **kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following line to it: + ```text + font_family MesloLGS NF + ``` + Restart kitty by closing all sessions and opening a new session. + - **puTTY**: Set _Window_ → _Appearance_ → _Font_ to `MesloLGS NF`. Requires puTTY version >= 0.75. - **WezTerm**: Create or open `$HOME/.config/wezterm/wezterm.lua` and add the following: ```lua @@ -706,10 +678,10 @@ docker run -e TERM -e COLORTERM -e LC_ALL=C.UTF-8 -it --rm alpine sh -uec ' exec zsh' ``` -*Tip*: Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) before +_Tip_: Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) before running the Docker command to get access to all prompt styles. -*Tip*: Run `p10k configure` while in Docker to try a different prompt style. +_Tip_: Run `p10k configure` while in Docker to try a different prompt style. ## License @@ -742,7 +714,7 @@ Powerlevel10k is released under the - [Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config?](#does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config) - [What is the best prompt style in the configuration wizard?](#what-is-the-best-prompt-style-in-the-configuration-wizard) - [How to make Powerlevel10k look like robbyrussell Oh My Zsh theme?](#how-to-make-powerlevel10k-look-like-robbyrussell-oh-my-zsh-theme) -- [Can prompts for completed commands display error status for *those* commands instead of the commands preceding them?](#can-prompts-for-completed-commands-display-error-status-for-those-commands-instead-of-the-commands-preceding-them) +- [Can prompts for completed commands display error status for _those_ commands instead of the commands preceding them?](#can-prompts-for-completed-commands-display-error-status-for-those-commands-instead-of-the-commands-preceding-them) - [What is the minimum supported Zsh version?](#what-is-the-minimum-supported-zsh-version) - [How were these screenshots and animated gifs created?](#how-were-these-screenshots-and-animated-gifs-created) - [How was the recommended font created?](#how-was-the-recommended-font-created) @@ -752,22 +724,21 @@ Powerlevel10k is released under the The command to update Powerlevel10k depends on how it was installed. -| Installation | Update command | -|---------------------------|-------------------------------------------------------------| -| [Manual](#manual) | `git -C ~/powerlevel10k pull` | +| Installation | Update command | +| ------------------------- | ------------------------------------------------------------------------- | +| [Manual](#manual) | `git -C ~/powerlevel10k pull` | | [Oh My Zsh](#oh-my-zsh) | `git -C ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k pull` | -| [Prezto](#prezto) | `zprezto-update` | -| [Zim](#zim) | `zimfw update` | -| [Antigen](#antigen) | `antigen update` | -| [Zplug](#zplug) | `zplug update` | -| [Zgen](#zgen) | `zgen update` | -| [Zplugin](#zplugin) | `zplugin update` | -| [Zinit](#zinit) | `zinit update` | -| [Homebrew](#homebrew) | `brew update && brew upgrade` | -| [Arch Linux](#arch-linux) | `yay -S --noconfirm zsh-theme-powerlevel10k-git` | +| [Prezto](#prezto) | `zprezto-update` | +| [Zim](#zim) | `zimfw update` | +| [Antigen](#antigen) | `antigen update` | +| [Zplug](#zplug) | `zplug update` | +| [Zgen](#zgen) | `zgen update` | +| [Zplugin](#zplugin) | `zplugin update` | +| [Zinit](#zinit) | `zinit update` | +| [Homebrew](#homebrew) | `brew update && brew upgrade` | +| [Arch Linux](#arch-linux) | `yay -S --noconfirm zsh-theme-powerlevel10k-git` | -**IMPORTANT**: Restart Zsh after updating Powerlevel10k. [Do not use `source ~/.zshrc`]( - #weird-things-happen-after-typing-source-zshrc). +**IMPORTANT**: Restart Zsh after updating Powerlevel10k. [Do not use `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc). ### How do I uninstall Powerlevel10k? @@ -802,19 +773,20 @@ The command to update Powerlevel10k depends on how it was installed. Powerlevel10k. The command to delete them depends on which installation method you'd chosen. Refer to the [installation instructions](#installation) if you need a reminder. - | Installation | Uninstall command | - |---------------------------|------------------------------------------------------------------| - | [Manual](#manual) | `rm -rf ~/powerlevel10k` | + | Installation | Uninstall command | + | ------------------------- | ----------------------------------------------------------------------- | + | [Manual](#manual) | `rm -rf ~/powerlevel10k` | | [Oh My Zsh](#oh-my-zsh) | `rm -rf -- ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k` | - | [Prezto](#prezto) | n/a | - | [Zim](#zim) | `zimfw uninstall` | - | [Antigen](#antigen) | `antigen purge romkatv/powerlevel10k` | - | [Zplug](#zplug) | `zplug clean` | - | [Zgen](#zgen) | `zgen reset` | - | [Zplugin](#zplugin) | `zplugin delete romkatv/powerlevel10k` | - | [Zinit](#zinit) | `zinit delete romkatv/powerlevel10k` | - | [Homebrew](#homebrew) | `brew uninstall powerlevel10k; brew untap romkatv/powerlevel10k` | - | [Arch Linux](#arch-linux) | `yay -R --noconfirm zsh-theme-powerlevel10k-git` | + | [Prezto](#prezto) | n/a | + | [Zim](#zim) | `zimfw uninstall` | + | [Antigen](#antigen) | `antigen purge romkatv/powerlevel10k` | + | [Zplug](#zplug) | `zplug clean` | + | [Zgen](#zgen) | `zgen reset` | + | [Zplugin](#zplugin) | `zplugin delete romkatv/powerlevel10k` | + | [Zinit](#zinit) | `zinit delete romkatv/powerlevel10k` | + | [Homebrew](#homebrew) | `brew uninstall powerlevel10k; brew untap romkatv/powerlevel10k` | + | [Arch Linux](#arch-linux) | `yay -R --noconfirm zsh-theme-powerlevel10k-git` | + 6. Restart Zsh. [Do not use `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc). 7. Delete Powerlevel10k cache files. ```zsh @@ -850,25 +822,20 @@ To update, remove `~/powerlevel10k` on both machines and repeat steps 1-3. ### Where can I ask for help and report bugs? -The best way to ask for help and to report bugs is to [open an issue]( - https://github.com/romkatv/powerlevel10k/issues). +The best way to ask for help and to report bugs is to [open an issue](https://github.com/romkatv/powerlevel10k/issues). -[Gitter]( - https://gitter.im/powerlevel10k/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) +[Gitter](https://gitter.im/powerlevel10k/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) is another option. If all else fails, email roman.perepelitsa@gmail.com. -If necessary, encrypt your communication with [this PGP key]( - https://api.github.com/users/romkatv/gpg_keys). +If necessary, encrypt your communication with [this PGP key](https://api.github.com/users/romkatv/gpg_keys). ### Which aspects of shell and terminal does Powerlevel10k affect? -Powerlevel10k defines prompt and nothing else. It sets [prompt-related options]( - http://zsh.sourceforge.net/Doc/Release/Options.html#Prompting), and parameters `PS1` and `RPS1`. +Powerlevel10k defines prompt and nothing else. It sets [prompt-related options](http://zsh.sourceforge.net/Doc/Release/Options.html#Prompting), and parameters `PS1` and `RPS1`. -![Prompt Highlight]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/prompt-highlight.png) +![Prompt Highlight](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/prompt-highlight.png) Everything within the highlighted areas on the screenshot is produced by Powerlevel10k. Powerlevel10k has no control over the terminal content or colors outside these areas. @@ -883,12 +850,12 @@ Powerlevel10k does not affect: - Key bindings. - Aliases. - Prompt parameters other than `PS1` and `RPS1`. -- Zsh options other than those [related to prompt]( - http://zsh.sourceforge.net/Doc/Release/Options.html#Prompting). +- Zsh options other than those [related to prompt](http://zsh.sourceforge.net/Doc/Release/Options.html#Prompting). ### I'm using Powerlevel9k with Oh My Zsh. How do I migrate? 1. Run this command: + ```zsh # Add powerlevel10k to the list of Oh My Zsh themes. git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k @@ -897,17 +864,17 @@ sed -i.bak 's/powerlevel9k/powerlevel10k/g' ~/.zshrc # Restart Zsh. exec zsh ``` -2. *Optional but highly recommended:* + +2. _Optional but highly recommended:_ 1. Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). 1. Type `p10k configure` and choose your favorite prompt style. -*Related:* - - [Powerlevel9k compatibility.](#powerlevel9k-compatibility) - - [Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config?]( - #does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config) - - [Extra or missing spaces in prompt compared to Powerlevel9k.]( - #extra-or-missing-spaces-in-prompt-compared-to-powerlevel9k) - - [Configuration wizard.](#configuration-wizard) +_Related:_ + +- [Powerlevel9k compatibility.](#powerlevel9k-compatibility) +- [Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config?](#does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config) +- [Extra or missing spaces in prompt compared to Powerlevel9k.](#extra-or-missing-spaces-in-prompt-compared-to-powerlevel9k) +- [Configuration wizard.](#configuration-wizard) ### Is it really fast? @@ -943,7 +910,7 @@ is printed out. When using instant prompt, you should carefully check any output that appears on Zsh startup as it may indicate that initialization has been altered, or perhaps even broken, by instant prompt. Initialization code that may require console input, such as asking for a keyring password or for a -*[y/n]* confirmation, must be moved above the instant prompt preamble in `~/.zshrc`. Initialization +_[y/n]_ confirmation, must be moved above the instant prompt preamble in `~/.zshrc`. Initialization code that merely prints to console but never reads from it will work correctly with instant prompt, although output that normally has colors may appear uncolored. You can either leave it be, suppress the output, or move it above the instant prompt preamble. @@ -985,18 +952,16 @@ instant prompt with `POWERLEVEL9K_INSTANT_PROMPT=off`. Do this if instant prompt initialization and you don't know how to fix it. The value of `POWERLEVEL9K_INSTANT_PROMPT` can be changed by running `p10k configure` and selecting -the appropriate option on the *Instant Prompt* screen. Alternatively, you can search for +the appropriate option on the _Instant Prompt_ screen. Alternatively, you can search for `POWERLEVEL9K_INSTANT_PROMPT` in the existing `~/.p10k.zsh` and change its value there. -*Note*: Instant prompt requires Zsh >= 5.4. It's OK to enable it even when using an older version of +_Note_: Instant prompt requires Zsh >= 5.4. It's OK to enable it even when using an older version of Zsh but it won't do anything. -*FAQ*: +_FAQ_: -- [How do I initialize direnv when using instant prompt?]( - #how-do-i-initialize-direnv-when-using-instant-prompt) -- [How do I export GPG_TTY when using instant prompt?]( - #how-do-i-export-gpg_tty-when-using-instant-prompt) +- [How do I initialize direnv when using instant prompt?](#how-do-i-initialize-direnv-when-using-instant-prompt) +- [How do I export GPG_TTY when using instant prompt?](#how-do-i-export-gpg_tty-when-using-instant-prompt) ### How do I initialize direnv when using instant prompt? @@ -1021,8 +986,7 @@ fi (( ${+commands[direnv]} )) && emulate zsh -c "$(direnv hook zsh)" ``` -*Related*: [How do I export GPG_TTY when using instant prompt?]( - #how-do-i-export-gpg_tty-when-using-instant-prompt) +_Related_: [How do I export GPG_TTY when using instant prompt?](#how-do-i-export-gpg_tty-when-using-instant-prompt) ### How do I export GPG_TTY when using instant prompt? @@ -1036,8 +1000,7 @@ This works whether you are using [instant prompt](#instant-prompt) or not. It wo aren't using powerlevel10k. As an extra bonus, it's much faster than the commonly used `export GPG_TTY=$(tty)`. -*Related*: [How do I initialize direnv when using instant prompt?]( - #how-do-i-initialize-direnv-when-using-instant-prompt) +_Related_: [How do I initialize direnv when using instant prompt?](#how-do-i-initialize-direnv-when-using-instant-prompt) ### What do different symbols in Git status mean? @@ -1047,32 +1010,31 @@ When using Lean, Classic or Rainbow style, Git status may look like this: feature:master wip ⇣42⇡42 ⇠42⇢42 *42 merge ~42 +42 !42 ?42 ``` -| Symbol | Meaning | Source | -| --------- | -------------------------------------------------------------------- | ------------------------------------------------------ | -| `feature` | current branch; replaced with `#tag` or `@commit` if not on a branch | `git status --ignore-submodules=dirty` | -| `master` | remote tracking branch; only shown if different from local branch | `git rev-parse --abbrev-ref --symbolic-full-name @{upstream}` | -| `wip` | the latest commit's summary contains "wip" or "WIP" | `git show --pretty=%s --no-patch HEAD` | -| `⇣42` | this many commits behind the remote | `git rev-list --right-only --count HEAD...@{upstream}` | -| `⇡42` | this many commits ahead of the remote | `git rev-list --left-only --count HEAD...@{upstream}` | -| `⇠42` | this many commits behind the push remote | `git rev-list --right-only --count HEAD...@{push}` | -| `⇢42` | this many commits ahead of the push remote | `git rev-list --left-only --count HEAD...@{push}` | -| `*42` | this many stashes | `git stash list` | -| `merge` | repository state | `git status --ignore-submodules=dirty` | -| `~42` | this many merge conflicts | `git status --ignore-submodules=dirty` | -| `+42` | this many staged changes | `git status --ignore-submodules=dirty` | -| `!42` | this many unstaged changes | `git status --ignore-submodules=dirty` | -| `?42` | this many untracked files | `git status --ignore-submodules=dirty` | +| Symbol | Meaning | Source | +| --------- | -------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `feature` | current branch; replaced with `#tag` or `@commit` if not on a branch | `git status --ignore-submodules=dirty` | +| `master` | remote tracking branch; only shown if different from local branch | `git rev-parse --abbrev-ref --symbolic-full-name @{upstream}` | +| `wip` | the latest commit's summary contains "wip" or "WIP" | `git show --pretty=%s --no-patch HEAD` | +| `⇣42` | this many commits behind the remote | `git rev-list --right-only --count HEAD...@{upstream}` | +| `⇡42` | this many commits ahead of the remote | `git rev-list --left-only --count HEAD...@{upstream}` | +| `⇠42` | this many commits behind the push remote | `git rev-list --right-only --count HEAD...@{push}` | +| `⇢42` | this many commits ahead of the push remote | `git rev-list --left-only --count HEAD...@{push}` | +| `*42` | this many stashes | `git stash list` | +| `merge` | repository state | `git status --ignore-submodules=dirty` | +| `~42` | this many merge conflicts | `git status --ignore-submodules=dirty` | +| `+42` | this many staged changes | `git status --ignore-submodules=dirty` | +| `!42` | this many unstaged changes | `git status --ignore-submodules=dirty` | +| `?42` | this many untracked files | `git status --ignore-submodules=dirty` | | `─` | the number of staged, unstaged or untracked files is unknown | `echo $POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY` or `git config --get bash.showDirtyState` | -*Related*: [How do I change the format of Git status?](#how-do-i-change-the-format-of-git-status) +_Related_: [How do I change the format of Git status?](#how-do-i-change-the-format-of-git-status) ### How do I change the format of Git status? To change the format of Git status, open `~/.p10k.zsh`, search for `my_git_formatter` and edit its source code. -*Related*: [What do different symbols in Git status mean?]( - #what-do-different-symbols-in-git-status-mean) +_Related_: [What do different symbols in Git status mean?](#what-do-different-symbols-in-git-status-mean) ### Why is Git status from `$HOME/.git` not displayed in prompt? @@ -1101,7 +1063,7 @@ can take quite a bit of time. If it takes longer than 10 milliseconds (configura grey and continues to compute up-to-date Git status in the background. When the computation completes, Powerlevel10k refreshes prompt with new information, this time with colored Git status. -When using *Rainbow* style, Git status is displayed as black on grey while it's still being +When using _Rainbow_ style, Git status is displayed as black on grey while it's still being computed. Depending on the terminal color palette, this may be difficult to read. In this case you might want to change the background color to something ligher for more contrast. To do that, open `~/.p10k.zsh`, search for `POWERLEVEL9K_VCS_LOADING_BACKGROUND`, uncomment it if it's commented out, @@ -1113,7 +1075,7 @@ typeset -g POWERLEVEL9K_VCS_LOADING_BACKGROUND=244 Type `source ~/.p10k.zsh` to apply your changes to the current Zsh session. -*Related*: [How do I change prompt colors?](#how-do-i-change-prompt-colors) +_Related_: [How do I change prompt colors?](#how-do-i-change-prompt-colors) ### How do I add username and/or hostname to prompt? @@ -1166,7 +1128,7 @@ prompt segments are shown, open `~/.p10k.zsh`, search for `SHOW_ON_COMMAND` and parameters or change their values. You can also define a function in `~/.zshrc` to toggle the display of a prompt segment between -*always* and *on command*. This is similar to `kubeon`/`kubeoff` from +_always_ and _on command_. This is similar to `kubeon`/`kubeoff` from [kube-ps1](https://github.com/jonmosco/kube-ps1). ```zsh @@ -1194,10 +1156,8 @@ bindkey '^]' kube-toggle # ctrl-] to toggle kubecontext in powerlevel10k prompt ### How do I change prompt colors? -You can either [change the color palette used by your terminal]( - #change-the-color-palette-used-by-your-terminal) or -[set colors through Powerlevel10k configuration parameters]( - #set-colors-through-Powerlevel10k-configuration-parameters). +You can either [change the color palette used by your terminal](#change-the-color-palette-used-by-your-terminal) or +[set colors through Powerlevel10k configuration parameters](#set-colors-through-Powerlevel10k-configuration-parameters). #### Change the color palette used by your terminal @@ -1207,8 +1167,8 @@ documentation. When you change the terminal color palette, it usually affects only the first 16 colors, numbered from 0 to 15. In order to see any effect on Powerlevel10k prompt, you need to use prompt style that -utilizes these low-numbered colors. Type `p10k configure` and select *Rainbow*, *Lean* → *8 colors* -or *Pure* → *Original*. Other styles use higher-numbered colors, so they look the same in any +utilizes these low-numbered colors. Type `p10k configure` and select _Rainbow_, _Lean_ → _8 colors_ +or _Pure_ → _Original_. Other styles use higher-numbered colors, so they look the same in any terminal color palette. #### Set colors through Powerlevel10k configuration parameters @@ -1233,9 +1193,9 @@ To see how different colors look in your terminal, run the following command: for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done ``` -*Related:* - - [Directory is difficult to see in prompt when using Rainbow style.]( - #directory-is-difficult-to-see-in-prompt-when-using-rainbow-style) +_Related:_ + +- [Directory is difficult to see in prompt when using Rainbow style.](#directory-is-difficult-to-see-in-prompt-when-using-rainbow-style) ### Why does Powerlevel10k spawn extra processes? @@ -1283,7 +1243,7 @@ Almost. There are a few differences. - By default only `git` vcs backend is enabled in Powerlevel10k. If you need `svn` and `hg`, add them to `POWERLEVEL9K_VCS_BACKENDS`. These backends aren't yet optimized in Powerlevel10k, so - enabling them will make prompt *very slow*. + enabling them will make prompt _very slow_. - Powerlevel10k doesn't support `POWERLEVEL9K_VCS_SHOW_SUBMODULE_DIRTY=true`. - Powerlevel10k strives to be bug-compatible with Powerlevel9k but not when it comes to egregious bugs. If you accidentally rely on these bugs, your prompt will differ between Powerlevel9k and @@ -1298,7 +1258,7 @@ Almost. There are a few differences. don't want that space. More details in [troubleshooting](#extra-space-without-background-on-the-right-side-of-right-prompt). - Powerlevel9k has inconsistent spacing around icons. This was fixed in Powerlevel10k. Set - `POWERLEVEL9K_LEGACY_ICON_SPACING=true` to get the same spacing as in Powerlevel9k. More + `POWERLEVEL9K_LEGACY_ICON_SPACING=true` to get the same spacing as in Powerlevel9k. More details in [troubleshooting](#extra-or-missing-spaces-around-icons). - There are dozens more bugs in Powerlevel9k that don't exist in Powerlevel10k. @@ -1314,11 +1274,11 @@ Pure style is an exact replication of [Pure Zsh theme](https://github.com/sindre exists to ease the migration for users of this theme. Unless you are one of them, choose Lean style over Pure. -If you want to confine prompt colors to the selected terminal color palette (say, *Solarized Dark*), -use *Rainbow*, *Lean* → *8 colors* or *Pure* → *Original*. Other styles use fixed colors and thus +If you want to confine prompt colors to the selected terminal color palette (say, _Solarized Dark_), +use _Rainbow_, _Lean_ → _8 colors_ or _Pure_ → _Original_. Other styles use fixed colors and thus look the same in any terminal color palette. -All styles except Pure have an option to use *ASCII* charset. Prompt will look less pretty but will +All styles except Pure have an option to use _ASCII_ charset. Prompt will look less pretty but will render correctly with all fonts and in all locales. If you enable transient prompt, take advantage of two-line prompt. You'll get the benefit of @@ -1330,8 +1290,8 @@ great choice. If you are using vi keymap, choose prompt with `prompt_char` in it (shown as green `❯` in the wizard). This symbol changes depending on vi mode: `❯`, `❮`, `V`, `▶` for insert, command, visual -and replace mode respectively. When a command fails, the symbol turns red. *Lean* style always has -`prompt_char` in it. *Rainbow* and *Classic* styles have it only in the two-line configuration +and replace mode respectively. When a command fails, the symbol turns red. _Lean_ style always has +`prompt_char` in it. _Rainbow_ and _Classic_ styles have it only in the two-line configuration without left frame. If you value horizontal space or prefer minimalist aesthetics: @@ -1339,30 +1299,28 @@ If you value horizontal space or prefer minimalist aesthetics: - Use a monospace font, such as [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). Non-monospace fonts require extra space after icons that are larger than a single column. - Use Lean style. Compared to Classic and Rainbow, it saves two characters per prompt segment. -- Disable *current time* and *frame*. -- Use *few icons*. The extra icons enabled by the *many icons* option primarily serve decorative +- Disable _current time_ and _frame_. +- Use _few icons_. The extra icons enabled by the _many icons_ option primarily serve decorative function. Informative icons, such as background job indicator, will be shown either way. -*Note*: You can run configuration wizard as many times as you like. Type `p10k configure` to try new +_Note_: You can run configuration wizard as many times as you like. Type `p10k configure` to try new prompt style. ### How to make Powerlevel10k look like robbyrussell Oh My Zsh theme? -Use [this config]( - https://github.com/romkatv/powerlevel10k/blob/master/config/p10k-robbyrussell.zsh). +Use [this config](https://github.com/romkatv/powerlevel10k/blob/master/config/p10k-robbyrussell.zsh). You can either download it, save as `~/.p10k.zsh` and `source ~/.p10k.zsh` from `~/.zshrc`, or source `p10k-robbyrussell.zsh` directly from your cloned `powerlevel10k` repository. -### Can prompts for completed commands display error status for *those* commands instead of the commands preceding them? +### Can prompts for completed commands display error status for _those_ commands instead of the commands preceding them? -No. When you hit *ENTER* and the command you've typed starts running, its error status isn't yet +No. When you hit _ENTER_ and the command you've typed starts running, its error status isn't yet known, so it cannot be shown in prompt. When the command completes, the error status gets known but -it's no longer possible to update prompt for *that* command. This is why the error status for every -command is reflected in the *next* prompt. +it's no longer possible to update prompt for _that_ command. This is why the error status for every +command is reflected in the _next_ prompt. -For details, see [this post on /r/zsh]( -https://www.reddit.com/r/zsh/comments/eg49ff/powerlevel10k_prompt_history_exit_code_colors/fc5huku). +For details, see [this post on /r/zsh](https://www.reddit.com/r/zsh/comments/eg49ff/powerlevel10k_prompt_history_exit_code_colors/fc5huku). ### What is the minimum supported Zsh version? @@ -1374,20 +1332,17 @@ All screenshots and animated gifs were recorded in GNOME Terminal with [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) and Tango Dark color palette with custom background color (`#171A1B` instead of `#2E3436` -- twice as dark). -![GNOME Terminal Color Settings]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/gnome-terminal-colors.png) +![GNOME Terminal Color Settings](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/gnome-terminal-colors.png) -Syntax highlighting, where present, was provided by [zsh-syntax-highlighting]( - https://github.com/zsh-users/zsh-syntax-highlighting). +Syntax highlighting, where present, was provided by [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting). ### How was the recommended font created? [The recommended font](#meslo-nerd-font-patched-for-powerlevel10k) is the product of many -individuals. Its origin is *Bitstream Vera Sans Mono*, which has given birth to *Menlo*, which in -turn has spawned *Meslo*. Finally, extra glyphs have been added to *Meslo* with scripts forked +individuals. Its origin is _Bitstream Vera Sans Mono_, which has given birth to _Menlo_, which in +turn has spawned _Meslo_. Finally, extra glyphs have been added to _Meslo_ with scripts forked from Nerd Fonts. The final font is released under the terms of -[Apache License]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/MesloLGS%20NF%20License.txt). +[Apache License](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/MesloLGS%20NF%20License.txt). MesloLGS NF font can be recreated with the following command (requires `git` and `docker`): @@ -1434,12 +1389,10 @@ If it looks like a regular `?`, that's normal. It means you have untracked files repository. Type `git status` to see these files. You can change this symbol or disable the display of untracked files altogether. Search for `untracked files` in `~/.p10k.zsh`. -*FAQ*: [What do different symbols in Git status mean?]( - #what-do-different-symbols-in-git-status-mean) +_FAQ_: [What do different symbols in Git status mean?](#what-do-different-symbols-in-git-status-mean) You can also get a weird-looking question mark in your prompt if your terminal's font is missing -some glyphs. See [icons, glyphs or powerline symbols don't render]( - #icons-glyphs-or-powerline-symbols-dont-render). +some glyphs. See [icons, glyphs or powerline symbols don't render](#icons-glyphs-or-powerline-symbols-dont-render). ### Icons, glyphs or powerline symbols don't render @@ -1448,23 +1401,21 @@ and run `p10k configure`. ### Sub-pixel imperfections around powerline symbols -![Powerline Prompt Imperfections]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/powerline-imperfections.png) +![Powerline Prompt Imperfections](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/powerline-imperfections.png) There are three imperfections on the screenshot. From left to right: 1. A thin blue line (a sub-pixel gap) between the content of a prompt segment and the following -powerline connection. + powerline connection. 1. Incorrect alignment of a powerline connection and the following prompt segment. The connection -appears shifted to the right. + appears shifted to the right. 1. A thin red line below a powerline connection. The connection appears shifted up. Zsh themes don't have down-to-pixel control over the terminal content. Everything you see on the screen is made of monospace characters. A white powerline prompt segment is made of text on white background followed by U+E0B0 (a right-pointing triangle). -![Powerline Prompt Imperfections]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/powerline-anatomy.png) +![Powerline Prompt Imperfections](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/powerline-anatomy.png) If Powerlevel10k prompt has imperfections around powerline symbols, you'll see exactly the same imperfections with all powerline themes (Agnoster, Powerlevel9k, Powerline, etc.) @@ -1481,7 +1432,7 @@ There are several things you can try to deal with these imperfections: - Try a different terminal. A more radical solution is to switch to prompt style without background. Type `p10k configure` and -select *Lean*. This style has a modern lightweight look. As a bonus, it doesn't suffer from +select _Lean_. This style has a modern lightweight look. As a bonus, it doesn't suffer from rendering imperfections that afflict powerline-style prompt. ### Error: character not in range @@ -1489,7 +1440,7 @@ rendering imperfections that afflict powerline-style prompt. Type `echo '\u276F'`. If you get an error saying "zsh: character not in range", your locale doesn't support UTF-8. You need to fix it. If you are running Zsh over SSH, see [this](https://github.com/romkatv/powerlevel10k/issues/153#issuecomment-518347833). If you are -running Zsh locally, Google "set UTF-8 locale in *your OS*". +running Zsh locally, Google "set UTF-8 locale in _your OS_". ### Cursor is in the wrong place @@ -1600,27 +1551,27 @@ configuration wizard. Once you can see the errors, fix `~/.zshrc` to get rid of ### Some prompt styles are missing from the configuration wizard If Zsh version is below 5.7.1 or `COLORTERM` environment variable is neither `24bit` nor -`truecolor`, configuration wizard won't offer Pure style with Snazzy color scheme. *Fix*: Install +`truecolor`, configuration wizard won't offer Pure style with Snazzy color scheme. _Fix_: Install Zsh >= 5.7.1 and use a terminal with truecolor support. Verify with `print -P '%F{#ff0000}red%f'`. If the terminal can display fewer than 256 colors, configuration wizard preselects Lean style with -8 colors. All other styles require at least 256 colors. *Fix*: Use a terminal with 256 color support +8 colors. All other styles require at least 256 colors. _Fix_: Use a terminal with 256 color support and make sure that `TERM` environment variable is set correctly. Verify with `print $terminfo[colors]`. If there is no UTF-8 locale on the system, configuration wizard won't offer prompt styles that use -Unicode characters. *Fix*: Install a UTF-8 locale. Verify with `locale -a`. +Unicode characters. _Fix_: Install a UTF-8 locale. Verify with `locale -a`. When a UTF-8 locale is available, the first few questions asked by the configuration wizard assess capabilities of the terminal font. If your answers indicate that some glyphs don't render correctly, -configuration wizard won't offer prompt styles that use them. *Fix*: Restart your terminal and +configuration wizard won't offer prompt styles that use them. _Fix_: Restart your terminal and install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). Verify by running `p10k configure` and checking that all glyphs render correctly. ### Cannot install the recommended font Once you download [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k), -you can install it just like any other font. Google "how to install fonts on *your OS*". +you can install it just like any other font. Google "how to install fonts on _your OS_". ### Extra or missing spaces in prompt compared to Powerlevel9k @@ -1634,8 +1585,7 @@ and there. These come in two flavors. tl;dr: Add `ZLE_RPROMPT_INDENT=0` to `~/.zshrc` to get rid of that space. -From [Zsh documentation]( - http://zsh.sourceforge.net/Doc/Release/Parameters.html#index-ZLE_005fRPROMPT_005fINDENT): +From [Zsh documentation](http://zsh.sourceforge.net/Doc/Release/Parameters.html#index-ZLE_005fRPROMPT_005fINDENT): > `ZLE_RPROMPT_INDENT ` > @@ -1651,8 +1601,7 @@ is the same thing as setting it to `1`), you'll get an empty space to the right you set `ZLE_RPROMPT_INDENT=0`, your prompt will go to the edge of the terminal. This is how it works in every theme except Powerlevel9k. -![ZLE_RPROMPT_INDENT: Powerlevel10k vs Powerlevel9k]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/p9k-vs-p10k-zle-rprompt-indent.png) +![ZLE_RPROMPT_INDENT: Powerlevel10k vs Powerlevel9k](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/p9k-vs-p10k-zle-rprompt-indent.png) Powerlevel9k issue: [powerlevel9k#1292](https://github.com/Powerlevel9k/powerlevel9k/issues/1292). It's been fixed in the development branch of Powerlevel9k but the fix hasn't yet made it to @@ -1661,7 +1610,7 @@ It's been fixed in the development branch of Powerlevel9k but the fix hasn't yet Add `ZLE_RPROMPT_INDENT=0` to `~/.zshrc` to get the same spacing on the right edge of prompt as in Powerlevel9k. -*Note:* Several versions of Zsh have bugs that get triggered when you set `ZLE_RPROMPT_INDENT=0`. +_Note:_ Several versions of Zsh have bugs that get triggered when you set `ZLE_RPROMPT_INDENT=0`. Powerlevel10k can work around these bugs when using powerline prompt style. If you notice visual artifacts in prompt, or wrong cursor position, try removing `ZLE_RPROMPT_INDENT` from `~/.zshrc`. @@ -1672,14 +1621,13 @@ icons as in Powerlevel9k. Spacing around icons in Powerlevel9k is inconsistent. -![ZLE_RPROMPT_INDENT: Powerlevel10k vs Powerlevel9k]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/p9k-vs-p10k-icon-spacing.png) +![ZLE_RPROMPT_INDENT: Powerlevel10k vs Powerlevel9k](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/p9k-vs-p10k-icon-spacing.png) This inconsistency is a constant source of annoyance, so it was fixed in Powerlevel10k. You can add `POWERLEVEL9K_LEGACY_ICON_SPACING=true` to `~/.zshrc` to get the same spacing around icons as in Powerlevel9k. -*Note:* It's not a good idea to define `POWERLEVEL9K_LEGACY_ICON_SPACING` when using +_Note:_ It's not a good idea to define `POWERLEVEL9K_LEGACY_ICON_SPACING` when using `p10k configure`. ### Weird things happen after typing `source ~/.zshrc` @@ -1694,8 +1642,7 @@ than `source ~/.zshrc`. ### Transient prompt stops working after some time -See [weird things happen after typing `source ~/.zshrc`]( - #weird-things-happen-after-typing-source-zshrc). +See [weird things happen after typing `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc). ### Cannot make Powerlevel10k work with my plugin manager @@ -1745,17 +1692,15 @@ There are several ways to fix this. When you resize a terminal window horizontally back and forth a few times, you might see this ugly picture. -![Powerlevel10k Resizing Mess]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resizing-mess.png) +![Powerlevel10k Resizing Mess](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resizing-mess.png) tl;dr: This issue arises when a terminal reflows Zsh prompt upon resizing. It isn't specific to Powerlevel10k. See [mitigation](#mitigation). -*Note: This section [used to say]( - https://github.com/romkatv/powerlevel10k/blob/dce00cdb5daaa8a519df234a7012ba3257b644d4/README.md#horrific-mess-when-resizing-terminal-window) +_Note: This section [used to say](https://github.com/romkatv/powerlevel10k/blob/dce00cdb5daaa8a519df234a7012ba3257b644d4/README.md#horrific-mess-when-resizing-terminal-window) that the problem is caused by a bug in Zsh. While it's true that it's possible to avoid the problem in many circumstances by modifying Zsh, it cannot be completely resolved this way. Thus it's unfair -to pin the blame on Zsh.* +to pin the blame on Zsh._ #### The anatomy of the problem @@ -1763,22 +1708,19 @@ The issue is manifested when the vertical distance between the start of the curr cursor (henceforth `VD`) changes when the terminal window is resized. When a terminal window gets shrunk horizontally, there are two ways for a terminal to handle long -lines that no longer fit: *reflow* or *truncate*. +lines that no longer fit: _reflow_ or _truncate_. Terminal content before shrinking: -![Terminal Content Before Shrinking]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-original.png) +![Terminal Content Before Shrinking](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-original.png) Terminal reflows text when shrinking: -![Terminal Reflows Text When Shrinking]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-reflow.png) +![Terminal Reflows Text When Shrinking](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-reflow.png) Terminal truncates text when shrinking: -![Terminal Truncates Text When Shrinking]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-truncate.png) +![Terminal Truncates Text When Shrinking](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-truncate.png) Reflowing strategy can change the height of terminal content. If such content happens to be between the start of the current prompt and the cursor, Zsh will print prompt on the wrong line. Truncation @@ -1800,41 +1742,36 @@ PROMPT=$'${$((pause()))+}left>${(pl.$((COLUMNS-12))..-.)} ' When `PROMPT` gets expanded, it calls `pause` to let us observe the state of the terminal. Here's the initial state: -![Terminal Resizing Bug 1]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-bug-1.png) +![Terminal Resizing Bug 1](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-bug-1.png) Zsh keeps track of the cursor position relative to the start of the current prompt. In this case it knows that the cursor is one line below. When we shrink the terminal window, it looks like this: -![Terminal Resizing Bug 2]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-bug-2.png) +![Terminal Resizing Bug 2](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-bug-2.png) At this point the terminal sends `SIGWINCH` to Zsh to notify it about changes in the terminal -dimensions. Note that this signal is sent *after* the content of the terminal has been reflown. +dimensions. Note that this signal is sent _after_ the content of the terminal has been reflown. When Zsh receives `SIGWINCH`, it attempts to erase the current prompt and print it anew. It goes to -the position where it *thinks* the current prompt is -- one line above the cursor (!) -- erases all +the position where it _thinks_ the current prompt is -- one line above the cursor (!) -- erases all terminal content that follows and prints reexpanded prompt there. However, after resizing prompt is no longer one line above the cursor. It's two lines above! Zsh ends up printing new prompt one line too low. -![Terminal Resizing Bug 3]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-bug-3.png) +![Terminal Resizing Bug 3](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-bug-3.png) -In this case we ended up with unwanted junk content because `VD` has *increased*. When you make -terminal window wider, `VD` can also *decrease*, which would result in the new prompt being printed +In this case we ended up with unwanted junk content because `VD` has _increased_. When you make +terminal window wider, `VD` can also _decrease_, which would result in the new prompt being printed higher than intended, potentially erasing useful content in the process. Here are a few more examples where shrinking terminal window increased `VD`. - Simple one-line left prompt with right prompt. No `prompt_subst`. Note that the cursor is below - the prompt line (hit *ESC-ENTER* to get it there). - ![Zsh Prompt That Breaks on Terminal Shrinking 1]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-breakable-1.png) + the prompt line (hit _ESC-ENTER_ to get it there). + ![Zsh Prompt That Breaks on Terminal Shrinking 1](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-breakable-1.png) - Simple one-line left prompt. No `prompt_subst`, no right prompt. Here `VD` is bound to increase upon terminal shrinking due to the command line wrapping around. - ![Zsh Prompt That Breaks on Terminal Shrinking 2]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-breakable-2.png) + ![Zsh Prompt That Breaks on Terminal Shrinking 2](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-breakable-2.png) #### Zsh patch @@ -1862,8 +1799,7 @@ fact don't: continuously reflow text and rapid-fire `SIGWINCH` when the window is being resized. In such environment real terminal dimensions go out of sync with what Zsh thinks the dimensions are. -There is no ETA for the patch making its way into upstream Zsh. See [discussion]( - https://www.zsh.org/mla/workers//2019/msg00561.html). +There is no ETA for the patch making its way into upstream Zsh. See [discussion](https://www.zsh.org/mla/workers//2019/msg00561.html). #### Mitigation @@ -1872,8 +1808,7 @@ There are a few mitigation options for this issue. - Use [kitty](https://sw.kovidgoyal.net/kitty/) terminal version >= 0.24.0 and enable terminal-shell integration in Powerlevel10k by defining `POWERLEVEL9K_TERM_SHELL_INTEGRATION=true` in `~/.p10k.zsh`. -- Apply [the patch](#zsh-patch) and [rebuild Zsh from source]( - https://github.com/zsh-users/zsh/blob/master/INSTALL). It won't help if you are using Alacritty, +- Apply [the patch](#zsh-patch) and [rebuild Zsh from source](https://github.com/zsh-users/zsh/blob/master/INSTALL). It won't help if you are using Alacritty, kitty or some other terminal that reflows text on resize but doesn't reflow saved cursor position. On such terminals the patch will have no visible effect. - Disable text reflowing on window resize in terminal settings. If your terminal doesn't have this @@ -1895,8 +1830,7 @@ When using Konsole with a non-monospace font, icons may be cut off on the right "non-monospace" refers to any font with glyphs wider than a single column, or wider than two columns for glyphs designated as "wide" in the Unicode standard. -![Icons cut off in Konsole]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/konsole-non-monospace-font.png) +![Icons cut off in Konsole](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/konsole-non-monospace-font.png) The last line on the screenshot shows a cut off Arch Linux logo. @@ -1907,32 +1841,35 @@ There are several mitigation options for this issue. 3. Manually add an extra space after the icon that gets cut off. For example, if the content of `os_icon` prompt segment gets cut off, open `~/.p10k.zsh`, search for `POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION` and change it as follows: + ```zsh typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='${P9K_CONTENT} ' # extra space at the end ``` + 4. Use a different icon that is monospace. For example, if Arch Linux logo gets cut off, add the following parameter to `~/.p10k.zsh`: + ```zsh typeset -g POWERLEVEL9K_LINUX_ARCH_ICON='Arch' # plain "Arch" in place of a logo ``` + 5. Disable the display of the icon that gets cut off. For example, if the content of `os_icon` prompt segment gets cut off, open `~/.p10k.zsh` and remove `os_icon` from `POWERLEVEL9K_LEFT_PROMPT_ELEMENTS` and `POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS`. -*Note*: [Non-monospace fonts are not officially supported by Konsole]( - https://bugs.kde.org/show_bug.cgi?id=418553#c5). +_Note_: [Non-monospace fonts are not officially supported by Konsole](https://bugs.kde.org/show_bug.cgi?id=418553#c5). ### Arch Linux logo has a dot in the bottom right corner -![Arch Linux Logo with a dot]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/arch-linux-logo-dot.png) +![Arch Linux Logo with a dot](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/arch-linux-logo-dot.png) Some fonts have this incorrect dotted icon in bold typeface. There are two ways to fix this issue. 1. Use a font with a correct Arch Linux logo in bold typeface. For example, - [the recommended Powerlevel10k font](#meslo-nerd-font-patched-for-powerlevel10k). + [the recommended Powerlevel10k font](#meslo-nerd-font-patched-for-powerlevel10k). 2. Display the icon in regular (non-bold) typeface. To do this, open `~/.p10k.zsh`, search for `POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION` and remove `%B` from its value. + ```zsh typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='${P9K_CONTENT}' # not bold ``` From d03058819df3aa74fe9f6c639935ce18d27a2703 Mon Sep 17 00:00:00 2001 From: AdalZanabria Date: Tue, 3 May 2022 11:41:29 -0500 Subject: [PATCH 167/380] Revert "Added missing segments to README." because of auto-formatting. This reverts commit e65e508743d96d44df4703bd5e5a7e7b34795ef4. --- README.md | 775 +++++++++++++++++++++++++++++------------------------- 1 file changed, 419 insertions(+), 356 deletions(-) diff --git a/README.md b/README.md index e3069b7b..3f36888f 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ # Powerlevel10k - -[![Gitter](https://badges.gitter.im/powerlevel10k/community.svg)](https://gitter.im/powerlevel10k/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) +[![Gitter](https://badges.gitter.im/powerlevel10k/community.svg)]( + https://gitter.im/powerlevel10k/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) Powerlevel10k is a theme for Zsh. It emphasizes [speed](#uncompromising-performance), [flexibility](#extremely-customizable) and [out-of-the-box experience](#configuration-wizard). -![Powerlevel10k](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/prompt-styles-high-contrast.png) +![Powerlevel10k]( +https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/prompt-styles-high-contrast.png) - [Getting started](#getting-started) - [Features](#features) @@ -19,8 +20,8 @@ Powerlevel10k is a theme for Zsh. It emphasizes [speed](#uncompromising-performa ## Getting started -1. [Install the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). _Optional but highly - recommended._ +1. [Install the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). *Optional but highly + recommended.* 1. [Install Powerlevel10k](#installation) itself. 1. Restart Zsh with `exec zsh`. 1. Type `p10k configure` if the configuration wizard doesn't start automatically. @@ -46,8 +47,8 @@ Type `p10k configure` to access the builtin configuration wizard right from your
Screen recording -![Powerlevel10k Configuration Wizard](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/configuration-wizard.gif) - + ![Powerlevel10k Configuration Wizard]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/configuration-wizard.gif)
All styles except [Pure](#pure-compatibility) are functionally equivalent. They display the same @@ -57,26 +58,31 @@ Configuration wizard creates `~/.p10k.zsh` based on your preferences. Additional customization can be done by editing this file. It has plenty of comments to help you navigate through configuration options. -_Tip_: Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) before +*Tip*: Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) before running `p10k configure` to unlock all prompt styles. -_FAQ:_ +*FAQ:* -- [What is the best prompt style in the configuration wizard?](#what-is-the-best-prompt-style-in-the-configuration-wizard) -- [What do different symbols in Git status mean?](#what-do-different-symbols-in-git-status-mean) +- [What is the best prompt style in the configuration wizard?]( + #what-is-the-best-prompt-style-in-the-configuration-wizard) +- [What do different symbols in Git status mean?]( + #what-do-different-symbols-in-git-status-mean) - [How do I change prompt colors?](#how-do-i-change-prompt-colors) -_Troubleshooting_: +*Troubleshooting*: -- [Some prompt styles are missing from the configuration wizard](#some-prompt-styles-are-missing-from-the-configuration-wizard). +- [Some prompt styles are missing from the configuration wizard]( + #some-prompt-styles-are-missing-from-the-configuration-wizard). - [Question mark in prompt](#question-mark-in-prompt). - [Icons, glyphs or powerline symbols don't render](#icons-glyphs-or-powerline-symbols-dont-render). -- [Sub-pixel imperfections around powerline symbols](#sub-pixel-imperfections-around-powerline-symbols). -- [Directory is difficult to see in prompt when using Rainbow style](#directory-is-difficult-to-see-in-prompt-when-using-rainbow-style). +- [Sub-pixel imperfections around powerline symbols]( + #sub-pixel-imperfections-around-powerline-symbols). +- [Directory is difficult to see in prompt when using Rainbow style]( + #directory-is-difficult-to-see-in-prompt-when-using-rainbow-style). ### Uncompromising performance -When you hit _ENTER_, the next prompt appears instantly. With Powerlevel10k there is no prompt lag. +When you hit *ENTER*, the next prompt appears instantly. With Powerlevel10k there is no prompt lag. If you install Cygwin on Raspberry Pi, `cd` into a Linux Git repository and activate enough prompt segments to fill four prompt lines on both sides of the screen... wait, that's just crazy and no one ever does that. Probably impossible, too. The point is, Powerlevel10k prompt is always fast, no @@ -85,24 +91,24 @@ matter what you do!
Screen recording -![Powerlevel10k Performance](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/performance.gif) - + ![Powerlevel10k Performance]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/performance.gif)
Note how the effect of every command is instantly reflected by the very next prompt. -| Command | Prompt Indicator | Meaning | -| ----------------------------- | :--------------: | --------------------------------------------------------------------: | -| `timew start hack linux` | `⌚ hack linux` | time tracking enabled in [timewarrior](https://timewarrior.net/) | -| `touch x y` | `?2` | 2 untracked files in the Git repo | -| `rm COPYING` | `!1` | 1 unstaged change in the Git repo | -| `echo 3.7.3 >.python-version` | `🐍 3.7.3` | the current python version in [pyenv](https://github.com/pyenv/pyenv) | +| Command | Prompt Indicator | Meaning | +|-------------------------------|:----------------:|----------------------------------------------------------------------:| +| `timew start hack linux` | `⌚ hack linux` | time tracking enabled in [timewarrior](https://timewarrior.net/) | +| `touch x y` | `?2` | 2 untracked files in the Git repo | +| `rm COPYING` | `!1` | 1 unstaged change in the Git repo | +| `echo 3.7.3 >.python-version` | `🐍 3.7.3` | the current python version in [pyenv](https://github.com/pyenv/pyenv) | Other Zsh themes capable of displaying the same information either produce prompt lag or print prompt that doesn't reflect the current state of the system and then refresh it later. With -Powerlevel10k you get fast prompt _and_ up-to-date information. +Powerlevel10k you get fast prompt *and* up-to-date information. -_FAQ_: [Is it really fast?](#is-it-really-fast) +*FAQ*: [Is it really fast?](#is-it-really-fast) ### Powerlevel9k compatibility @@ -112,31 +118,35 @@ configuration parameters.
Screen recording -![Powerlevel10k Compatibility with 9k](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/9k-compatibility.gif) - + ![Powerlevel10k Compatibility with 9k]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/9k-compatibility.gif)
[Migration](#installation) from Powerlevel9k to Powerlevel10k is a straightforward process. All your `POWERLEVEL9K` configuration parameters will still work. Prompt will look the same as before -([almost](#does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config)) +([almost]( + #does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config)) but it will be [much faster](#uncompromising-performance) ([certainly](#is-it-really-fast)). -_FAQ_: +*FAQ*: -- [I'm using Powerlevel9k with Oh My Zsh. How do I migrate?](#im-using-powerlevel9k-with-oh-my-zsh-how-do-i-migrate) -- [Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config?](#does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config) -- [What is the relationship between Powerlevel9k and Powerlevel10k?](#What-is-the-relationship-between-powerlevel9k-and-powerlevel10k) +- [I'm using Powerlevel9k with Oh My Zsh. How do I migrate?]( + #im-using-powerlevel9k-with-oh-my-zsh-how-do-i-migrate) +- [Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config?]( + #does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config) +- [What is the relationship between Powerlevel9k and Powerlevel10k?]( + #What-is-the-relationship-between-powerlevel9k-and-powerlevel10k) ### Pure compatibility Powerlevel10k can produce the same prompt as [Pure](https://github.com/sindresorhus/pure). Type -`p10k configure` and select _Pure_ style. +`p10k configure` and select *Pure* style.
Screen recording -![Powerlevel10k Pure Style](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/pure-style.gif) - + ![Powerlevel10k Pure Style]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/pure-style.gif)
You can still use Powerlevel10k features such as [transient prompt](#transient-prompt) or @@ -147,7 +157,8 @@ parameters, so you'll need to use `POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD `PURE_CMD_MAX_EXEC_TIME=3`, etc. All relevant parameters are in `~/.p10k.zsh`. This file has plenty of comments to help you navigate through it. -_FAQ:_ [What is the best prompt style in the configuration wizard?](#what-is-the-best-prompt-style-in-the-configuration-wizard) +*FAQ:* [What is the best prompt style in the configuration wizard?]( + #what-is-the-best-prompt-style-in-the-configuration-wizard) ### Instant prompt @@ -158,8 +169,8 @@ may have noticed that it takes some time for Zsh to start.
Screen recording -![Powerlevel10k No Instant Prompt](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/no-instant-prompt.gif) - + ![Powerlevel10k No Instant Prompt]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/no-instant-prompt.gif)
Powerlevel10k can remove Zsh startup lag **even if it's not caused by a theme**. @@ -167,21 +178,21 @@ Powerlevel10k can remove Zsh startup lag **even if it's not caused by a theme**.
Screen recording -![Powerlevel10k Instant Prompt](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/instant-prompt.gif) - + ![Powerlevel10k Instant Prompt]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/instant-prompt.gif)
-This feature is called _Instant Prompt_. You need to explicitly enable it through `p10k configure` +This feature is called *Instant Prompt*. You need to explicitly enable it through `p10k configure` or [manually](#how-do-i-configure-instant-prompt). It does what it says on the tin -- prints prompt instantly upon Zsh startup allowing you to start typing while plugins are still loading. -Other themes _increase_ Zsh startup lag -- some by a lot, others by a just a little. Powerlevel10k -_removes_ it outright. +Other themes *increase* Zsh startup lag -- some by a lot, others by a just a little. Powerlevel10k +*removes* it outright. -If you are curious about how _Instant Prompt_ works, see +If you are curious about how *Instant Prompt* works, see [this section in zsh-bench](https://github.com/romkatv/zsh-bench#instant-prompt). -_FAQ:_ [How do I configure instant prompt?](#how-do-i-configure-instant-prompt) +*FAQ:* [How do I configure instant prompt?](#how-do-i-configure-instant-prompt) ### Show on command @@ -190,14 +201,14 @@ image on the cluster defined by the current kubernetes context. If you frequentl between "prod" and "testing", you might want to display the current context in Zsh prompt. If you do likewise for AWS, Azure and Google Cloud credentials, prompt will get pretty crowded. -Enter _Show On Command_. This feature makes prompt segments appear only when they are relevant to +Enter *Show On Command*. This feature makes prompt segments appear only when they are relevant to the command you are currently typing.
Screen recording -![Powerlevel10k Show On Command](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/show-on-command.gif) - + ![Powerlevel10k Show On Command]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/show-on-command.gif)
Configs created by `p10k configure` enable show on command for several prompt segments by default. @@ -215,19 +226,19 @@ or change their values. ### Transient prompt -When _Transient Prompt_ is enabled through `p10k configure`, Powerlevel10k will trim down every +When *Transient Prompt* is enabled through `p10k configure`, Powerlevel10k will trim down every prompt when accepting a command line.
Screen recording -![Powerlevel10k Transient Prompt](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/transient-prompt.gif) - + ![Powerlevel10k Transient Prompt]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/transient-prompt.gif)
Transient prompt makes it much easier to copy-paste series of commands from the terminal scrollback. -_Tip_: If you enable transient prompt, take advantage of two-line prompt. You'll get the benefit of +*Tip*: If you enable transient prompt, take advantage of two-line prompt. You'll get the benefit of extra space for typing commands without the usual drawback of reduced scrollback density. Sparse prompt (with an empty line before prompt) also works great in combination with transient prompt. @@ -240,8 +251,8 @@ when horizontal space gets scarce.
Screen recording -![Powerlevel10k Directory Truncation](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/directory-truncation.gif) - + ![Powerlevel10k Directory Truncation]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/directory-truncation.gif)
When the full directory doesn't fit, the leftmost segment gets truncated to its shortest unique @@ -256,9 +267,10 @@ Directory segments are shown in one of three colors: roots of Git repositories, etc. - Regular segments (not truncated but can be) use in-between color. -_Tip_: If you copy-paste a truncated directory and hit _TAB_, it'll complete to the original. +*Tip*: If you copy-paste a truncated directory and hit *TAB*, it'll complete to the original. -_Troubleshooting_: [Directory is difficult to see in prompt when using Rainbow style.](#directory-is-difficult-to-see-in-prompt-when-using-rainbow-style) +*Troubleshooting*: [Directory is difficult to see in prompt when using Rainbow style.]( + #directory-is-difficult-to-see-in-prompt-when-using-rainbow-style) ### Extremely customizable @@ -267,22 +279,25 @@ Powerlevel10k can be configured to look like any other Zsh theme out there.
Screen recording -![Powerlevel10k Other Theme Emulation](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/other-theme-emulation.gif) - + ![Powerlevel10k Other Theme Emulation]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/other-theme-emulation.gif)
-[Pure](#pure-compatibility), [Powerlevel9k](#powerlevel9k-compatibility) and [robbyrussell](#how-to-make-powerlevel10k-look-like-robbyrussell-oh-my-zsh-theme) emulations are built-in. +[Pure](#pure-compatibility), [Powerlevel9k](#powerlevel9k-compatibility) and [robbyrussell]( + #how-to-make-powerlevel10k-look-like-robbyrussell-oh-my-zsh-theme) emulations are built-in. To emulate the appearance of other themes, you'll need to write a suitable configuration file. The best way to go about it is to run `p10k configure`, select the style that is the closest to your goal and then edit `~/.p10k.zsh`. The full range of Powerlevel10k appearance spans from spartan: -![Powerlevel10k Spartan Style](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/spartan-style.png) +![Powerlevel10k Spartan Style]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/spartan-style.png) To ~~ridiculous~~ extravagant: -![Powerlevel10k Extravagant Style](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/extravagant-style.png) +![Powerlevel10k Extravagant Style]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/extravagant-style.png) ### Batteries included @@ -291,74 +306,71 @@ and choose any style except [Pure](#pure-compatibility), many of these segments default while others be manually enabled by opening `~/.p10k.zsh` and uncommenting them. You can enable as many segments as you like. It won't slow down your prompt or Zsh startup. -| Segment | Meaning | -| -----------------------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `anaconda` | virtual environment from [conda](https://conda.io/) | -| `asdf` | tool versions from [asdf](https://github.com/asdf-vm/asdf) | -| `aws` | [aws profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) | -| `aws_eb_env` | [aws elastic beanstalk](https://aws.amazon.com/elasticbeanstalk/) environment | -| `azure` | [azure](https://docs.microsoft.com/en-us/cli/azure) account name | -| `background_jobs` | presence of background jobs | -| `battery` | internal battery state and charge level (yep, batteries _literally_ included) | -| `command_execution_time` | duration (wall time) of the last command | -| `context` | user@hostname | -| `dir` | current working directory | -| `direnv` | [direnv](https://direnv.net/) status | -| `disk_usage` | disk usage | -| `dotnet_version` | [dotnet](https://dotnet.microsoft.com) version | -| `fvm` | flutter environment from [fvm](https://github.com/leoafarias/fvm) | -| `gcloud` | [google cloud](https://cloud.google.com/) cli account and project | -| `goenv` | go environment from [goenv](https://github.com/syndbg/goenv) | -| `google_app_cred` | [google application credentials](https://cloud.google.com/docs/authentication/production) | -| `go_version` | [go](https://golang.org) version | -| `haskell_stack` | haskell version from [stack](https://haskellstack.org/) | -| `ip` | IP address and bandwidth usage for a specified network interface | -| `java_version` | [java](https://www.java.com/) version | -| `jenv` | java environment from [jenv](https://github.com/jenv/jenv) | -| `kubecontext` | current [kubernetes](https://kubernetes.io/) context | -| `laravel_version` | [laravel php framework](https://laravel.com/) version | -| `load` | CPU load | -| `luaenv` | lua environment from [luaenv](https://github.com/cehoffman/luaenv) | -| `midnight_commander` | [midnight commander](https://midnight-commander.org/) shell | -| `nix_shell` | [nix shell](https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) indicator | -| `nnn` | [nnn](https://github.com/jarun/nnn) shell | -| `nodeenv` | node.js environment from [nodeenv](https://github.com/ekalinin/nodeenv) | -| `nodenv` | node.js environment from [nodenv](https://github.com/nodenv/nodenv) | -| `node_version` | [node.js](https://nodejs.org/) version | -| `nordvpn` | [nordvpn](https://nordvpn.com/) connection status | -| `nvm` | node.js environment from [nvm](https://github.com/nvm-sh/nvm) | -| `os_icon` | your OS logo (apple for macOS, swirl for debian, etc.) | -| `package` | `name@version` from [package.json](https://docs.npmjs.com/files/package.json) | -| `perlbrew` | perl version from [perlbrew](https://github.com/gugod/App-perlbrew) | -| `phpenv` | php environment from [phpenv](https://github.com/phpenv/phpenv) | -| `php_version` | [php](https://www.php.net/) version | -| `plenv` | perl environment from [plenv](https://github.com/tokuhirom/plenv) | -| `prompt_char` | multi-functional prompt symbol; changes depending on vi mode: `❯`, `❮`, `V`, `▶` for insert, command, visual and replace mode respectively; turns red on error | -| `proxy` | system-wide http/https/ftp proxy | -| `public_ip` | public IP address | -| `pyenv` | python environment from [pyenv](https://github.com/pyenv/pyenv) | -| `ram` | free RAM | -| `ranger` | [ranger](https://github.com/ranger/ranger) shell | -| `rbenv` | ruby environment from [rbenv](https://github.com/rbenv/rbenv) | -| `rust_version` | [rustc](https://www.rust-lang.org) version | -| `rvm` | ruby environment from [rvm](https://rvm.io) | -| `scalaenv` | scala version from [scalaenv](https://github.com/scalaenv/scalaenv) | -| `status` | exit code of the last command | -| `swap` | used swap | -| `taskwarrior` | [taskwarrior](https://taskwarrior.org/) task count | -| `terraform` | [terraform](https://www.terraform.io) workspace | -| `terraform_version` | [terraform](https://www.terraform.io) version | -| `time` | current time | -| `timewarrior` | [timewarrior](https://timewarrior.net/) tracking status | -| `todo` | [todo](https://github.com/todotxt/todo.txt-cli) items | -| `toolbox` | [toolbox](https://github.com/containers/toolbox) name | -| `vcs` | Git repository status | -| `vim_shell` | [vim](https://www.vim.org/) shell (`:sh`) | -| `virtualenv` | python environment from [venv](https://docs.python.org/3/library/venv.html) | -| `vi_mode` | vi mode (you don't need this if you've enabled prompt_char) | -| `vpn_ip` | virtual private network indicator | -| `wifi` | WiFi speed | -| `xplr` | [xplr](https://github.com/sayanarijit/xplr) shell | +| Segment | Meaning | +|--------:|---------| +| `anaconda` | virtual environment from [conda](https://conda.io/) | +| `asdf` | tool versions from [asdf](https://github.com/asdf-vm/asdf) | +| `aws` | [aws profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) | +| `aws_eb_env` | [aws elastic beanstalk](https://aws.amazon.com/elasticbeanstalk/) environment | +| `azure` | [azure](https://docs.microsoft.com/en-us/cli/azure) account name | +| `background_jobs` | presence of background jobs | +| `battery` | internal battery state and charge level (yep, batteries *literally* included) | +| `command_execution_time` | duration (wall time) of the last command | +| `context` | user@hostname | +| `dir` | current working directory | +| `direnv` | [direnv](https://direnv.net/) status | +| `disk_usage` | disk usage | +| `dotnet_version` | [dotnet](https://dotnet.microsoft.com) version | +| `fvm` | flutter environment from [fvm](https://github.com/leoafarias/fvm) | +| `gcloud` | [google cloud](https://cloud.google.com/) cli account and project | +| `goenv` | go environment from [goenv](https://github.com/syndbg/goenv) | +| `google_app_cred` | [google application credentials](https://cloud.google.com/docs/authentication/production) | +| `go_version` | [go](https://golang.org) version | +| `haskell_stack` | haskell version from [stack](https://haskellstack.org/) | +| `ip` | IP address and bandwidth usage for a specified network interface | +| `java_version` | [java](https://www.java.com/) version | +| `jenv` | java environment from [jenv](https://github.com/jenv/jenv) | +| `kubecontext` | current [kubernetes](https://kubernetes.io/) context | +| `laravel_version` | [laravel php framework](https://laravel.com/) version | +| `load` | CPU load | +| `luaenv` | lua environment from [luaenv](https://github.com/cehoffman/luaenv) | +| `midnight_commander` | [midnight commander](https://midnight-commander.org/) shell | +| `nix_shell` | [nix shell](https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) indicator | +| `nnn` | [nnn](https://github.com/jarun/nnn) shell | +| `nodeenv` | node.js environment from [nodeenv](https://github.com/ekalinin/nodeenv) | +| `nodenv` | node.js environment from [nodenv](https://github.com/nodenv/nodenv) | +| `node_version` | [node.js](https://nodejs.org/) version | +| `nordvpn` | [nordvpn](https://nordvpn.com/) connection status | +| `nvm` | node.js environment from [nvm](https://github.com/nvm-sh/nvm) | +| `os_icon` | your OS logo (apple for macOS, swirl for debian, etc.) | +| `package` | `name@version` from [package.json](https://docs.npmjs.com/files/package.json) | +| `phpenv` | php environment from [phpenv](https://github.com/phpenv/phpenv) | +| `php_version` | [php](https://www.php.net/) version | +| `plenv` | perl environment from [plenv](https://github.com/tokuhirom/plenv) | +| `prompt_char` | multi-functional prompt symbol; changes depending on vi mode: `❯`, `❮`, `V`, `▶` for insert, command, visual and replace mode respectively; turns red on error | +| `proxy` | system-wide http/https/ftp proxy | +| `public_ip` | public IP address | +| `pyenv` | python environment from [pyenv](https://github.com/pyenv/pyenv) | +| `ram` | free RAM | +| `ranger` | [ranger](https://github.com/ranger/ranger) shell | +| `rbenv` | ruby environment from [rbenv](https://github.com/rbenv/rbenv) | +| `rust_version` | [rustc](https://www.rust-lang.org) version | +| `rvm` | ruby environment from [rvm](https://rvm.io) | +| `status` | exit code of the last command | +| `swap` | used swap | +| `taskwarrior` | [taskwarrior](https://taskwarrior.org/) task count | +| `terraform` | [terraform](https://www.terraform.io) workspace | +| `terraform_version` | [terraform](https://www.terraform.io) version | +| `time` | current time | +| `timewarrior` | [timewarrior](https://timewarrior.net/) tracking status | +| `todo` | [todo](https://github.com/todotxt/todo.txt-cli) items | +| `toolbox` | [toolbox](https://github.com/containers/toolbox) name | +| `vcs` | Git repository status | +| `vim_shell` | [vim](https://www.vim.org/) shell (`:sh`) | +| `virtualenv` | python environment from [venv](https://docs.python.org/3/library/venv.html) | +| `vpn_ip` | virtual private network indicator | +| `wifi` | WiFi speed | +| `xplr` | [xplr](https://github.com/sayanarijit/xplr) shell | ### Extensible @@ -368,8 +380,8 @@ public API for defining segments that are as fast and as flexible as built-in on
Screen recording -![Powerlevel10k Custom Segment](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/custom-segment.gif) - + ![Powerlevel10k Custom Segment]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/custom-segment.gif)
On Linux you can fetch current CPU temperature by reading `/sys/class/thermal/thermal_zone0/temp`. @@ -379,7 +391,7 @@ it out of the box. Type `p10k help segment` for reference. -_Tip_: Prefix names of your own segments with `my_` to avoid clashes with future versions of +*Tip*: Prefix names of your own segments with `my_` to avoid clashes with future versions of Powerlevel10k. ## Installation @@ -419,18 +431,15 @@ make sure to disable the current theme in your plugin manager. See ### Oh My Zsh 1. Clone the repository: + ```zsh + git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k + ``` + Users in mainland China can use the official mirror on gitee.com for faster download.
+ 中国大陆用户可以使用 gitee.com 上的官方镜像加速下载. - ```zsh - git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k - ``` - - Users in mainland China can use the official mirror on gitee.com for faster download.
- 中国大陆用户可以使用 gitee.com 上的官方镜像加速下载. - - ```zsh - git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k - ``` - + ```zsh + git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k + ``` 2. Set `ZSH_THEME="powerlevel10k/powerlevel10k"` in `~/.zshrc`. ### Prezto @@ -489,8 +498,10 @@ echo 'source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme' >>~/.zs [zsh-theme-powerlevel10k-git](https://aur.archlinux.org/packages/zsh-theme-powerlevel10k-git/) referenced above is the official Powerlevel10k package. -There is also [zsh-theme-powerlevel10k](https://www.archlinux.org/packages/community/x86_64/zsh-theme-powerlevel10k/) community package. -Historically, [it has been breaking often and for extended periods of time](https://github.com/romkatv/powerlevel10k/pull/786). **Do not use it.** +There is also [zsh-theme-powerlevel10k]( + https://www.archlinux.org/packages/community/x86_64/zsh-theme-powerlevel10k/) community package. +Historically, [it has been breaking often and for extended periods of time]( + https://github.com/romkatv/powerlevel10k/pull/786). **Do not use it.** ## Configuration @@ -505,21 +516,27 @@ Configuration wizard creates `~/.p10k.zsh` based on your preferences. Additional customization can be done by editing this file. It has plenty of comments to help you navigate through configuration options. -_FAQ_: +*FAQ*: -- [What is the best prompt style in the configuration wizard?](#what-is-the-best-prompt-style-in-the-configuration-wizard) -- [What do different symbols in Git status mean?](#what-do-different-symbols-in-git-status-mean) +- [What is the best prompt style in the configuration wizard?]( + #what-is-the-best-prompt-style-in-the-configuration-wizard) +- [What do different symbols in Git status mean?]( + #what-do-different-symbols-in-git-status-mean) - [How do I change the format of Git status?](#how-do-i-change-the-format-of-git-status) -- [How do I add username and/or hostname to prompt?](#how-do-i-add-username-andor-hostname-to-prompt) +- [How do I add username and/or hostname to prompt?]( + #how-do-i-add-username-andor-hostname-to-prompt) - [How do I change prompt colors?](#how-do-i-change-prompt-colors) -- [Why some prompt segments appear and disappear as I'm typing?](#why-some-prompt-segments-appear-and-disappear-as-im-typing) +- [Why some prompt segments appear and disappear as I'm typing?]( + #why-some-prompt-segments-appear-and-disappear-as-im-typing) -_Troubleshooting_: +*Troubleshooting*: - [Question mark in prompt](#question-mark-in-prompt). - [Icons, glyphs or powerline symbols don't render](#icons-glyphs-or-powerline-symbols-dont-render). -- [Sub-pixel imperfections around powerline symbols](#sub-pixel-imperfections-around-powerline-symbols). -- [Directory is difficult to see in prompt when using Rainbow style](#directory-is-difficult-to-see-in-prompt-when-using-rainbow-style). +- [Sub-pixel imperfections around powerline symbols]( + #sub-pixel-imperfections-around-powerline-symbols). +- [Directory is difficult to see in prompt when using Rainbow style]( + #directory-is-difficult-to-see-in-prompt-when-using-rainbow-style). ### For Powerlevel9k users @@ -527,13 +544,17 @@ If you've been using Powerlevel9k before, **do not remove the configuration opti will pick them up and provide you with the same prompt UI you are used to. See [Powerlevel9k compatibility](#powerlevel9k-compatibility). -_FAQ_: +*FAQ*: -- [I'm using Powerlevel9k with Oh My Zsh. How do I migrate?](#im-using-powerlevel9k-with-oh-my-zsh-how-do-i-migrate) -- [What is the relationship between Powerlevel9k and Powerlevel10k?](#what-is-the-relationship-between-powerlevel9k-and-powerlevel10k) -- [Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config?](#does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config) +- [I'm using Powerlevel9k with Oh My Zsh. How do I migrate?]( + #im-using-powerlevel9k-with-oh-my-zsh-how-do-i-migrate) +- [What is the relationship between Powerlevel9k and Powerlevel10k?]( + #what-is-the-relationship-between-powerlevel9k-and-powerlevel10k) +- [Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config?]( + #does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config) -_Troubleshooting_: [Extra or missing spaces in prompt compared to Powerlevel9k](#extra-or-missing-spaces-in-prompt-compared-to-powerlevel9k). +*Troubleshooting*: [Extra or missing spaces in prompt compared to Powerlevel9k]( + #extra-or-missing-spaces-in-prompt-compared-to-powerlevel9k). ## Fonts @@ -554,75 +575,82 @@ originally developed by Ryan L McIntyre of Nerd Fonts. Contains all glyphs and s Powerlevel10k may need. Battle-tested in dozens of different terminals on all major operating systems. -_FAQ_: [How was the recommended font created?](#how-was-the-recommended-font-created) +*FAQ*: [How was the recommended font created?](#how-was-the-recommended-font-created) #### Automatic font installation If you are using iTerm2 or Termux, `p10k configure` can install the recommended font for you. -Simply answer `Yes` when asked whether to install _Meslo Nerd Font_. +Simply answer `Yes` when asked whether to install *Meslo Nerd Font*. If you are using a different terminal, proceed with manual font installation. 👇 #### Manual font installation 1. Download these four ttf files: - - [MesloLGS NF Regular.ttf](https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf) - - [MesloLGS NF Bold.ttf](https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf) - - [MesloLGS NF Italic.ttf](https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf) - - [MesloLGS NF Bold Italic.ttf](https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf) + - [MesloLGS NF Regular.ttf]( + https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf) + - [MesloLGS NF Bold.ttf]( + https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf) + - [MesloLGS NF Italic.ttf]( + https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf) + - [MesloLGS NF Bold Italic.ttf]( + https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf) 1. Double-click on each file and click "Install". This will make `MesloLGS NF` font available to all applications on your system. 1. Configure your terminal to use this font: - **iTerm2**: Type `p10k configure` and answer `Yes` when asked whether to install - _Meslo Nerd Font_. Alternatively, open _iTerm2 → Preferences → Profiles → Text_ and set _Font_ to + *Meslo Nerd Font*. Alternatively, open *iTerm2 → Preferences → Profiles → Text* and set *Font* to `MesloLGS NF`. - - **Apple Terminal**: Open _Terminal → Preferences → Profiles → Text_, click _Change_ under _Font_ + - **Apple Terminal**: Open *Terminal → Preferences → Profiles → Text*, click *Change* under *Font* and select `MesloLGS NF` family. - - **Hyper**: Open _Hyper → Edit → Preferences_ and change the value of `fontFamily` under + - **Hyper**: Open *Hyper → Edit → Preferences* and change the value of `fontFamily` under `module.exports.config` to `MesloLGS NF`. - - **Visual Studio Code**: Open _File → Preferences → Settings_ (PC) or - _Code → Preferences → Settings_ (Mac), enter `terminal.integrated.fontFamily` in the search box at - the top of _Settings_ tab and set the value below to `MesloLGS NF`. - Consult [this screenshot](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/389133fb8c9a2347929a23702ce3039aacc46c3d/visual-studio-code-font-settings.jpg) - to see how it should look like or see [this issue](https://github.com/romkatv/powerlevel10k/issues/671) for extra information. - - **GNOME Terminal** (the default Ubuntu terminal): Open _Terminal → Preferences_ and click on the - selected profile under _Profiles_. Check _Custom font_ under _Text Appearance_ and select + - **Visual Studio Code**: Open *File → Preferences → Settings* (PC) or + *Code → Preferences → Settings* (Mac), enter `terminal.integrated.fontFamily` in the search box at + the top of *Settings* tab and set the value below to `MesloLGS NF`. + Consult [this screenshot]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/389133fb8c9a2347929a23702ce3039aacc46c3d/visual-studio-code-font-settings.jpg) + to see how it should look like or see [this issue]( + https://github.com/romkatv/powerlevel10k/issues/671) for extra information. + - **GNOME Terminal** (the default Ubuntu terminal): Open *Terminal → Preferences* and click on the + selected profile under *Profiles*. Check *Custom font* under *Text Appearance* and select `MesloLGS NF Regular`. - - **Konsole**: Open _Settings → Edit Current Profile → Appearance_, click _Select Font_ and select + - **Konsole**: Open *Settings → Edit Current Profile → Appearance*, click *Select Font* and select `MesloLGS NF Regular`. - - **Tilix**: Open _Tilix → Preferences_ and click on the selected profile under _Profiles_. Check - _Custom font_ under _Text Appearance_ and select `MesloLGS NF Regular`. + - **Tilix**: Open *Tilix → Preferences* and click on the selected profile under *Profiles*. Check + *Custom font* under *Text Appearance* and select `MesloLGS NF Regular`. - **Windows Console Host** (the old thing): Click the icon in the top left corner, then - _Properties → Font_ and set _Font_ to `MesloLGS NF`. + *Properties → Font* and set *Font* to `MesloLGS NF`. - **Windows Terminal** by Microsoft (the new thing): Open `settings.json` (Ctrl+Shift+,), search for `fontFace` and set the value to `MesloLGS NF` for every profile. If you don't find - `fontFace`, add it under _profiles → defaults_. See [this settings file](https://raw.githubusercontent.com/romkatv/dotfiles-public/aba0e6c4657d705ed6c344d700d659977385f25c/dotfiles/microsoft-terminal-settings.json) + `fontFace`, add it under *profiles → defaults*. See [this settings file]( + https://raw.githubusercontent.com/romkatv/dotfiles-public/aba0e6c4657d705ed6c344d700d659977385f25c/dotfiles/microsoft-terminal-settings.json) for example. - - **IntelliJ** (and other IDEs by Jet Brains): Open _IDE → Edit → Preferences → Editor → - Color Scheme → Console Font_. Select _Use console font instead of the default_ and set the font + - **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor → + Color Scheme → Console Font*. Select *Use console font instead of the default* and set the font name to `MesloLGS NF`. - **Termux**: Type `p10k configure` and answer `Yes` when asked whether to install - _Meslo Nerd Font_. - - **Blink**: Type `config`, go to _Appearance_, tap _Add a new font_, tap _Open Gallery_, select - _MesloLGS NF.css_, tap _import_ and type `exit` in the home view to reload the font. - - **Terminus**: Open _Settings → Appearance_ and set _Font_ to `MesloLGS NF`. - - **Terminator**: Open _Preferences_ using the context menu. Under _Profiles_ select the _General_ - tab (should be selected already), uncheck _Use the system fixed width font_ (if not already) - and select `MesloLGS NF Regular`. Exit the Preferences dialog by clicking _Close_. - - **Guake**: Right Click on an open terminal and open _Preferences_. Under _Appearance_ - tab, uncheck _Use the system fixed width font_ (if not already) and select `MesloLGS NF Regular`. - Exit the Preferences dialog by clicking _Close_. - - **MobaXterm**: Open _Settings_ → _Configuration_ → _Terminal_ → (under _Terminal look and feel_) - and change _Font_ to `MesloLGS NF`. - - **Asbrú Connection Manager**: Open _Preferences → Local Shell Options → Look and Feel_, enable - _Use these personal options_ and change _Font:_ under _Terminal UI_ to `MesloLGS NF Regular`. - To change the font for the remote host connections, go to _Preferences → Terminal Options → - Look and Feel_ and change _Font:_ under _Terminal UI_ to `MesloLGS NF Regular`. - - **WSLtty**: Right click on an open terminal and then on _Options_. In the _Text_ section, under - _Font_, click _"Select..."_ and set Font to `MesloLGS NF Regular`. - - **Yakuake**: Click _≡_ → _Manage Profiles_ → _New_ → _Appearance_. Click _Choose_ next to the - _Font_ dropdown, select `MesloLGS NF` and click _OK_. Click _OK_ to save the profile. Select the - new profile and click _Set as Default_. + *Meslo Nerd Font*. + - **Blink**: Type `config`, go to *Appearance*, tap *Add a new font*, tap *Open Gallery*, select + *MesloLGS NF.css*, tap *import* and type `exit` in the home view to reload the font. + - **Terminus**: Open *Settings → Appearance* and set *Font* to `MesloLGS NF`. + - **Terminator**: Open *Preferences* using the context menu. Under *Profiles* select the *General* + tab (should be selected already), uncheck *Use the system fixed width font* (if not already) + and select `MesloLGS NF Regular`. Exit the Preferences dialog by clicking *Close*. + - **Guake**: Right Click on an open terminal and open *Preferences*. Under *Appearance* + tab, uncheck *Use the system fixed width font* (if not already) and select `MesloLGS NF Regular`. + Exit the Preferences dialog by clicking *Close*. + - **MobaXterm**: Open *Settings* → *Configuration* → *Terminal* → (under *Terminal look and feel*) + and change *Font* to `MesloLGS NF`. + - **Asbrú Connection Manager**: Open *Preferences → Local Shell Options → Look and Feel*, enable + *Use these personal options* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`. + To change the font for the remote host connections, go to *Preferences → Terminal Options → + Look and Feel* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`. + - **WSLtty**: Right click on an open terminal and then on *Options*. In the *Text* section, under + *Font*, click *"Select..."* and set Font to `MesloLGS NF Regular`. + - **Yakuake**: Click *≡* → *Manage Profiles* → *New* → *Appearance*. Click *Choose* next to the + *Font* dropdown, select `MesloLGS NF` and click *OK*. Click *OK* to save the profile. Select the + new profile and click *Set as Default*. - **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and add the following section to it: ```yaml @@ -630,12 +658,12 @@ If you are using a different terminal, proceed with manual font installation. normal: family: "MesloLGS NF" ``` - - **kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following line to it: - ```text - font_family MesloLGS NF - ``` - Restart kitty by closing all sessions and opening a new session. - - **puTTY**: Set _Window_ → _Appearance_ → _Font_ to `MesloLGS NF`. Requires puTTY + - **kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following line to it: + ```text + font_family MesloLGS NF + ``` + Restart kitty by closing all sessions and opening a new session. + - **puTTY**: Set *Window* → *Appearance* → *Font* to `MesloLGS NF`. Requires puTTY version >= 0.75. - **WezTerm**: Create or open `$HOME/.config/wezterm/wezterm.lua` and add the following: ```lua @@ -678,10 +706,10 @@ docker run -e TERM -e COLORTERM -e LC_ALL=C.UTF-8 -it --rm alpine sh -uec ' exec zsh' ``` -_Tip_: Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) before +*Tip*: Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) before running the Docker command to get access to all prompt styles. -_Tip_: Run `p10k configure` while in Docker to try a different prompt style. +*Tip*: Run `p10k configure` while in Docker to try a different prompt style. ## License @@ -714,7 +742,7 @@ Powerlevel10k is released under the - [Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config?](#does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config) - [What is the best prompt style in the configuration wizard?](#what-is-the-best-prompt-style-in-the-configuration-wizard) - [How to make Powerlevel10k look like robbyrussell Oh My Zsh theme?](#how-to-make-powerlevel10k-look-like-robbyrussell-oh-my-zsh-theme) -- [Can prompts for completed commands display error status for _those_ commands instead of the commands preceding them?](#can-prompts-for-completed-commands-display-error-status-for-those-commands-instead-of-the-commands-preceding-them) +- [Can prompts for completed commands display error status for *those* commands instead of the commands preceding them?](#can-prompts-for-completed-commands-display-error-status-for-those-commands-instead-of-the-commands-preceding-them) - [What is the minimum supported Zsh version?](#what-is-the-minimum-supported-zsh-version) - [How were these screenshots and animated gifs created?](#how-were-these-screenshots-and-animated-gifs-created) - [How was the recommended font created?](#how-was-the-recommended-font-created) @@ -724,21 +752,22 @@ Powerlevel10k is released under the The command to update Powerlevel10k depends on how it was installed. -| Installation | Update command | -| ------------------------- | ------------------------------------------------------------------------- | -| [Manual](#manual) | `git -C ~/powerlevel10k pull` | +| Installation | Update command | +|---------------------------|-------------------------------------------------------------| +| [Manual](#manual) | `git -C ~/powerlevel10k pull` | | [Oh My Zsh](#oh-my-zsh) | `git -C ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k pull` | -| [Prezto](#prezto) | `zprezto-update` | -| [Zim](#zim) | `zimfw update` | -| [Antigen](#antigen) | `antigen update` | -| [Zplug](#zplug) | `zplug update` | -| [Zgen](#zgen) | `zgen update` | -| [Zplugin](#zplugin) | `zplugin update` | -| [Zinit](#zinit) | `zinit update` | -| [Homebrew](#homebrew) | `brew update && brew upgrade` | -| [Arch Linux](#arch-linux) | `yay -S --noconfirm zsh-theme-powerlevel10k-git` | +| [Prezto](#prezto) | `zprezto-update` | +| [Zim](#zim) | `zimfw update` | +| [Antigen](#antigen) | `antigen update` | +| [Zplug](#zplug) | `zplug update` | +| [Zgen](#zgen) | `zgen update` | +| [Zplugin](#zplugin) | `zplugin update` | +| [Zinit](#zinit) | `zinit update` | +| [Homebrew](#homebrew) | `brew update && brew upgrade` | +| [Arch Linux](#arch-linux) | `yay -S --noconfirm zsh-theme-powerlevel10k-git` | -**IMPORTANT**: Restart Zsh after updating Powerlevel10k. [Do not use `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc). +**IMPORTANT**: Restart Zsh after updating Powerlevel10k. [Do not use `source ~/.zshrc`]( + #weird-things-happen-after-typing-source-zshrc). ### How do I uninstall Powerlevel10k? @@ -773,20 +802,19 @@ The command to update Powerlevel10k depends on how it was installed. Powerlevel10k. The command to delete them depends on which installation method you'd chosen. Refer to the [installation instructions](#installation) if you need a reminder. - | Installation | Uninstall command | - | ------------------------- | ----------------------------------------------------------------------- | - | [Manual](#manual) | `rm -rf ~/powerlevel10k` | + | Installation | Uninstall command | + |---------------------------|------------------------------------------------------------------| + | [Manual](#manual) | `rm -rf ~/powerlevel10k` | | [Oh My Zsh](#oh-my-zsh) | `rm -rf -- ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k` | - | [Prezto](#prezto) | n/a | - | [Zim](#zim) | `zimfw uninstall` | - | [Antigen](#antigen) | `antigen purge romkatv/powerlevel10k` | - | [Zplug](#zplug) | `zplug clean` | - | [Zgen](#zgen) | `zgen reset` | - | [Zplugin](#zplugin) | `zplugin delete romkatv/powerlevel10k` | - | [Zinit](#zinit) | `zinit delete romkatv/powerlevel10k` | - | [Homebrew](#homebrew) | `brew uninstall powerlevel10k; brew untap romkatv/powerlevel10k` | - | [Arch Linux](#arch-linux) | `yay -R --noconfirm zsh-theme-powerlevel10k-git` | - + | [Prezto](#prezto) | n/a | + | [Zim](#zim) | `zimfw uninstall` | + | [Antigen](#antigen) | `antigen purge romkatv/powerlevel10k` | + | [Zplug](#zplug) | `zplug clean` | + | [Zgen](#zgen) | `zgen reset` | + | [Zplugin](#zplugin) | `zplugin delete romkatv/powerlevel10k` | + | [Zinit](#zinit) | `zinit delete romkatv/powerlevel10k` | + | [Homebrew](#homebrew) | `brew uninstall powerlevel10k; brew untap romkatv/powerlevel10k` | + | [Arch Linux](#arch-linux) | `yay -R --noconfirm zsh-theme-powerlevel10k-git` | 6. Restart Zsh. [Do not use `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc). 7. Delete Powerlevel10k cache files. ```zsh @@ -822,20 +850,25 @@ To update, remove `~/powerlevel10k` on both machines and repeat steps 1-3. ### Where can I ask for help and report bugs? -The best way to ask for help and to report bugs is to [open an issue](https://github.com/romkatv/powerlevel10k/issues). +The best way to ask for help and to report bugs is to [open an issue]( + https://github.com/romkatv/powerlevel10k/issues). -[Gitter](https://gitter.im/powerlevel10k/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) +[Gitter]( + https://gitter.im/powerlevel10k/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) is another option. If all else fails, email roman.perepelitsa@gmail.com. -If necessary, encrypt your communication with [this PGP key](https://api.github.com/users/romkatv/gpg_keys). +If necessary, encrypt your communication with [this PGP key]( + https://api.github.com/users/romkatv/gpg_keys). ### Which aspects of shell and terminal does Powerlevel10k affect? -Powerlevel10k defines prompt and nothing else. It sets [prompt-related options](http://zsh.sourceforge.net/Doc/Release/Options.html#Prompting), and parameters `PS1` and `RPS1`. +Powerlevel10k defines prompt and nothing else. It sets [prompt-related options]( + http://zsh.sourceforge.net/Doc/Release/Options.html#Prompting), and parameters `PS1` and `RPS1`. -![Prompt Highlight](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/prompt-highlight.png) +![Prompt Highlight]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/prompt-highlight.png) Everything within the highlighted areas on the screenshot is produced by Powerlevel10k. Powerlevel10k has no control over the terminal content or colors outside these areas. @@ -850,12 +883,12 @@ Powerlevel10k does not affect: - Key bindings. - Aliases. - Prompt parameters other than `PS1` and `RPS1`. -- Zsh options other than those [related to prompt](http://zsh.sourceforge.net/Doc/Release/Options.html#Prompting). +- Zsh options other than those [related to prompt]( + http://zsh.sourceforge.net/Doc/Release/Options.html#Prompting). ### I'm using Powerlevel9k with Oh My Zsh. How do I migrate? 1. Run this command: - ```zsh # Add powerlevel10k to the list of Oh My Zsh themes. git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k @@ -864,17 +897,17 @@ sed -i.bak 's/powerlevel9k/powerlevel10k/g' ~/.zshrc # Restart Zsh. exec zsh ``` - -2. _Optional but highly recommended:_ +2. *Optional but highly recommended:* 1. Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). 1. Type `p10k configure` and choose your favorite prompt style. -_Related:_ - -- [Powerlevel9k compatibility.](#powerlevel9k-compatibility) -- [Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config?](#does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config) -- [Extra or missing spaces in prompt compared to Powerlevel9k.](#extra-or-missing-spaces-in-prompt-compared-to-powerlevel9k) -- [Configuration wizard.](#configuration-wizard) +*Related:* + - [Powerlevel9k compatibility.](#powerlevel9k-compatibility) + - [Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config?]( + #does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config) + - [Extra or missing spaces in prompt compared to Powerlevel9k.]( + #extra-or-missing-spaces-in-prompt-compared-to-powerlevel9k) + - [Configuration wizard.](#configuration-wizard) ### Is it really fast? @@ -910,7 +943,7 @@ is printed out. When using instant prompt, you should carefully check any output that appears on Zsh startup as it may indicate that initialization has been altered, or perhaps even broken, by instant prompt. Initialization code that may require console input, such as asking for a keyring password or for a -_[y/n]_ confirmation, must be moved above the instant prompt preamble in `~/.zshrc`. Initialization +*[y/n]* confirmation, must be moved above the instant prompt preamble in `~/.zshrc`. Initialization code that merely prints to console but never reads from it will work correctly with instant prompt, although output that normally has colors may appear uncolored. You can either leave it be, suppress the output, or move it above the instant prompt preamble. @@ -952,16 +985,18 @@ instant prompt with `POWERLEVEL9K_INSTANT_PROMPT=off`. Do this if instant prompt initialization and you don't know how to fix it. The value of `POWERLEVEL9K_INSTANT_PROMPT` can be changed by running `p10k configure` and selecting -the appropriate option on the _Instant Prompt_ screen. Alternatively, you can search for +the appropriate option on the *Instant Prompt* screen. Alternatively, you can search for `POWERLEVEL9K_INSTANT_PROMPT` in the existing `~/.p10k.zsh` and change its value there. -_Note_: Instant prompt requires Zsh >= 5.4. It's OK to enable it even when using an older version of +*Note*: Instant prompt requires Zsh >= 5.4. It's OK to enable it even when using an older version of Zsh but it won't do anything. -_FAQ_: +*FAQ*: -- [How do I initialize direnv when using instant prompt?](#how-do-i-initialize-direnv-when-using-instant-prompt) -- [How do I export GPG_TTY when using instant prompt?](#how-do-i-export-gpg_tty-when-using-instant-prompt) +- [How do I initialize direnv when using instant prompt?]( + #how-do-i-initialize-direnv-when-using-instant-prompt) +- [How do I export GPG_TTY when using instant prompt?]( + #how-do-i-export-gpg_tty-when-using-instant-prompt) ### How do I initialize direnv when using instant prompt? @@ -986,7 +1021,8 @@ fi (( ${+commands[direnv]} )) && emulate zsh -c "$(direnv hook zsh)" ``` -_Related_: [How do I export GPG_TTY when using instant prompt?](#how-do-i-export-gpg_tty-when-using-instant-prompt) +*Related*: [How do I export GPG_TTY when using instant prompt?]( + #how-do-i-export-gpg_tty-when-using-instant-prompt) ### How do I export GPG_TTY when using instant prompt? @@ -1000,7 +1036,8 @@ This works whether you are using [instant prompt](#instant-prompt) or not. It wo aren't using powerlevel10k. As an extra bonus, it's much faster than the commonly used `export GPG_TTY=$(tty)`. -_Related_: [How do I initialize direnv when using instant prompt?](#how-do-i-initialize-direnv-when-using-instant-prompt) +*Related*: [How do I initialize direnv when using instant prompt?]( + #how-do-i-initialize-direnv-when-using-instant-prompt) ### What do different symbols in Git status mean? @@ -1010,31 +1047,32 @@ When using Lean, Classic or Rainbow style, Git status may look like this: feature:master wip ⇣42⇡42 ⇠42⇢42 *42 merge ~42 +42 !42 ?42 ``` -| Symbol | Meaning | Source | -| --------- | -------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -| `feature` | current branch; replaced with `#tag` or `@commit` if not on a branch | `git status --ignore-submodules=dirty` | -| `master` | remote tracking branch; only shown if different from local branch | `git rev-parse --abbrev-ref --symbolic-full-name @{upstream}` | -| `wip` | the latest commit's summary contains "wip" or "WIP" | `git show --pretty=%s --no-patch HEAD` | -| `⇣42` | this many commits behind the remote | `git rev-list --right-only --count HEAD...@{upstream}` | -| `⇡42` | this many commits ahead of the remote | `git rev-list --left-only --count HEAD...@{upstream}` | -| `⇠42` | this many commits behind the push remote | `git rev-list --right-only --count HEAD...@{push}` | -| `⇢42` | this many commits ahead of the push remote | `git rev-list --left-only --count HEAD...@{push}` | -| `*42` | this many stashes | `git stash list` | -| `merge` | repository state | `git status --ignore-submodules=dirty` | -| `~42` | this many merge conflicts | `git status --ignore-submodules=dirty` | -| `+42` | this many staged changes | `git status --ignore-submodules=dirty` | -| `!42` | this many unstaged changes | `git status --ignore-submodules=dirty` | -| `?42` | this many untracked files | `git status --ignore-submodules=dirty` | +| Symbol | Meaning | Source | +| --------- | -------------------------------------------------------------------- | ------------------------------------------------------ | +| `feature` | current branch; replaced with `#tag` or `@commit` if not on a branch | `git status --ignore-submodules=dirty` | +| `master` | remote tracking branch; only shown if different from local branch | `git rev-parse --abbrev-ref --symbolic-full-name @{upstream}` | +| `wip` | the latest commit's summary contains "wip" or "WIP" | `git show --pretty=%s --no-patch HEAD` | +| `⇣42` | this many commits behind the remote | `git rev-list --right-only --count HEAD...@{upstream}` | +| `⇡42` | this many commits ahead of the remote | `git rev-list --left-only --count HEAD...@{upstream}` | +| `⇠42` | this many commits behind the push remote | `git rev-list --right-only --count HEAD...@{push}` | +| `⇢42` | this many commits ahead of the push remote | `git rev-list --left-only --count HEAD...@{push}` | +| `*42` | this many stashes | `git stash list` | +| `merge` | repository state | `git status --ignore-submodules=dirty` | +| `~42` | this many merge conflicts | `git status --ignore-submodules=dirty` | +| `+42` | this many staged changes | `git status --ignore-submodules=dirty` | +| `!42` | this many unstaged changes | `git status --ignore-submodules=dirty` | +| `?42` | this many untracked files | `git status --ignore-submodules=dirty` | | `─` | the number of staged, unstaged or untracked files is unknown | `echo $POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY` or `git config --get bash.showDirtyState` | -_Related_: [How do I change the format of Git status?](#how-do-i-change-the-format-of-git-status) +*Related*: [How do I change the format of Git status?](#how-do-i-change-the-format-of-git-status) ### How do I change the format of Git status? To change the format of Git status, open `~/.p10k.zsh`, search for `my_git_formatter` and edit its source code. -_Related_: [What do different symbols in Git status mean?](#what-do-different-symbols-in-git-status-mean) +*Related*: [What do different symbols in Git status mean?]( + #what-do-different-symbols-in-git-status-mean) ### Why is Git status from `$HOME/.git` not displayed in prompt? @@ -1063,7 +1101,7 @@ can take quite a bit of time. If it takes longer than 10 milliseconds (configura grey and continues to compute up-to-date Git status in the background. When the computation completes, Powerlevel10k refreshes prompt with new information, this time with colored Git status. -When using _Rainbow_ style, Git status is displayed as black on grey while it's still being +When using *Rainbow* style, Git status is displayed as black on grey while it's still being computed. Depending on the terminal color palette, this may be difficult to read. In this case you might want to change the background color to something ligher for more contrast. To do that, open `~/.p10k.zsh`, search for `POWERLEVEL9K_VCS_LOADING_BACKGROUND`, uncomment it if it's commented out, @@ -1075,7 +1113,7 @@ typeset -g POWERLEVEL9K_VCS_LOADING_BACKGROUND=244 Type `source ~/.p10k.zsh` to apply your changes to the current Zsh session. -_Related_: [How do I change prompt colors?](#how-do-i-change-prompt-colors) +*Related*: [How do I change prompt colors?](#how-do-i-change-prompt-colors) ### How do I add username and/or hostname to prompt? @@ -1128,7 +1166,7 @@ prompt segments are shown, open `~/.p10k.zsh`, search for `SHOW_ON_COMMAND` and parameters or change their values. You can also define a function in `~/.zshrc` to toggle the display of a prompt segment between -_always_ and _on command_. This is similar to `kubeon`/`kubeoff` from +*always* and *on command*. This is similar to `kubeon`/`kubeoff` from [kube-ps1](https://github.com/jonmosco/kube-ps1). ```zsh @@ -1156,8 +1194,10 @@ bindkey '^]' kube-toggle # ctrl-] to toggle kubecontext in powerlevel10k prompt ### How do I change prompt colors? -You can either [change the color palette used by your terminal](#change-the-color-palette-used-by-your-terminal) or -[set colors through Powerlevel10k configuration parameters](#set-colors-through-Powerlevel10k-configuration-parameters). +You can either [change the color palette used by your terminal]( + #change-the-color-palette-used-by-your-terminal) or +[set colors through Powerlevel10k configuration parameters]( + #set-colors-through-Powerlevel10k-configuration-parameters). #### Change the color palette used by your terminal @@ -1167,8 +1207,8 @@ documentation. When you change the terminal color palette, it usually affects only the first 16 colors, numbered from 0 to 15. In order to see any effect on Powerlevel10k prompt, you need to use prompt style that -utilizes these low-numbered colors. Type `p10k configure` and select _Rainbow_, _Lean_ → _8 colors_ -or _Pure_ → _Original_. Other styles use higher-numbered colors, so they look the same in any +utilizes these low-numbered colors. Type `p10k configure` and select *Rainbow*, *Lean* → *8 colors* +or *Pure* → *Original*. Other styles use higher-numbered colors, so they look the same in any terminal color palette. #### Set colors through Powerlevel10k configuration parameters @@ -1193,9 +1233,9 @@ To see how different colors look in your terminal, run the following command: for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done ``` -_Related:_ - -- [Directory is difficult to see in prompt when using Rainbow style.](#directory-is-difficult-to-see-in-prompt-when-using-rainbow-style) +*Related:* + - [Directory is difficult to see in prompt when using Rainbow style.]( + #directory-is-difficult-to-see-in-prompt-when-using-rainbow-style) ### Why does Powerlevel10k spawn extra processes? @@ -1243,7 +1283,7 @@ Almost. There are a few differences. - By default only `git` vcs backend is enabled in Powerlevel10k. If you need `svn` and `hg`, add them to `POWERLEVEL9K_VCS_BACKENDS`. These backends aren't yet optimized in Powerlevel10k, so - enabling them will make prompt _very slow_. + enabling them will make prompt *very slow*. - Powerlevel10k doesn't support `POWERLEVEL9K_VCS_SHOW_SUBMODULE_DIRTY=true`. - Powerlevel10k strives to be bug-compatible with Powerlevel9k but not when it comes to egregious bugs. If you accidentally rely on these bugs, your prompt will differ between Powerlevel9k and @@ -1258,7 +1298,7 @@ Almost. There are a few differences. don't want that space. More details in [troubleshooting](#extra-space-without-background-on-the-right-side-of-right-prompt). - Powerlevel9k has inconsistent spacing around icons. This was fixed in Powerlevel10k. Set - `POWERLEVEL9K_LEGACY_ICON_SPACING=true` to get the same spacing as in Powerlevel9k. More + `POWERLEVEL9K_LEGACY_ICON_SPACING=true` to get the same spacing as in Powerlevel9k. More details in [troubleshooting](#extra-or-missing-spaces-around-icons). - There are dozens more bugs in Powerlevel9k that don't exist in Powerlevel10k. @@ -1274,11 +1314,11 @@ Pure style is an exact replication of [Pure Zsh theme](https://github.com/sindre exists to ease the migration for users of this theme. Unless you are one of them, choose Lean style over Pure. -If you want to confine prompt colors to the selected terminal color palette (say, _Solarized Dark_), -use _Rainbow_, _Lean_ → _8 colors_ or _Pure_ → _Original_. Other styles use fixed colors and thus +If you want to confine prompt colors to the selected terminal color palette (say, *Solarized Dark*), +use *Rainbow*, *Lean* → *8 colors* or *Pure* → *Original*. Other styles use fixed colors and thus look the same in any terminal color palette. -All styles except Pure have an option to use _ASCII_ charset. Prompt will look less pretty but will +All styles except Pure have an option to use *ASCII* charset. Prompt will look less pretty but will render correctly with all fonts and in all locales. If you enable transient prompt, take advantage of two-line prompt. You'll get the benefit of @@ -1290,8 +1330,8 @@ great choice. If you are using vi keymap, choose prompt with `prompt_char` in it (shown as green `❯` in the wizard). This symbol changes depending on vi mode: `❯`, `❮`, `V`, `▶` for insert, command, visual -and replace mode respectively. When a command fails, the symbol turns red. _Lean_ style always has -`prompt_char` in it. _Rainbow_ and _Classic_ styles have it only in the two-line configuration +and replace mode respectively. When a command fails, the symbol turns red. *Lean* style always has +`prompt_char` in it. *Rainbow* and *Classic* styles have it only in the two-line configuration without left frame. If you value horizontal space or prefer minimalist aesthetics: @@ -1299,28 +1339,30 @@ If you value horizontal space or prefer minimalist aesthetics: - Use a monospace font, such as [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). Non-monospace fonts require extra space after icons that are larger than a single column. - Use Lean style. Compared to Classic and Rainbow, it saves two characters per prompt segment. -- Disable _current time_ and _frame_. -- Use _few icons_. The extra icons enabled by the _many icons_ option primarily serve decorative +- Disable *current time* and *frame*. +- Use *few icons*. The extra icons enabled by the *many icons* option primarily serve decorative function. Informative icons, such as background job indicator, will be shown either way. -_Note_: You can run configuration wizard as many times as you like. Type `p10k configure` to try new +*Note*: You can run configuration wizard as many times as you like. Type `p10k configure` to try new prompt style. ### How to make Powerlevel10k look like robbyrussell Oh My Zsh theme? -Use [this config](https://github.com/romkatv/powerlevel10k/blob/master/config/p10k-robbyrussell.zsh). +Use [this config]( + https://github.com/romkatv/powerlevel10k/blob/master/config/p10k-robbyrussell.zsh). You can either download it, save as `~/.p10k.zsh` and `source ~/.p10k.zsh` from `~/.zshrc`, or source `p10k-robbyrussell.zsh` directly from your cloned `powerlevel10k` repository. -### Can prompts for completed commands display error status for _those_ commands instead of the commands preceding them? +### Can prompts for completed commands display error status for *those* commands instead of the commands preceding them? -No. When you hit _ENTER_ and the command you've typed starts running, its error status isn't yet +No. When you hit *ENTER* and the command you've typed starts running, its error status isn't yet known, so it cannot be shown in prompt. When the command completes, the error status gets known but -it's no longer possible to update prompt for _that_ command. This is why the error status for every -command is reflected in the _next_ prompt. +it's no longer possible to update prompt for *that* command. This is why the error status for every +command is reflected in the *next* prompt. -For details, see [this post on /r/zsh](https://www.reddit.com/r/zsh/comments/eg49ff/powerlevel10k_prompt_history_exit_code_colors/fc5huku). +For details, see [this post on /r/zsh]( +https://www.reddit.com/r/zsh/comments/eg49ff/powerlevel10k_prompt_history_exit_code_colors/fc5huku). ### What is the minimum supported Zsh version? @@ -1332,17 +1374,20 @@ All screenshots and animated gifs were recorded in GNOME Terminal with [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) and Tango Dark color palette with custom background color (`#171A1B` instead of `#2E3436` -- twice as dark). -![GNOME Terminal Color Settings](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/gnome-terminal-colors.png) +![GNOME Terminal Color Settings]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/gnome-terminal-colors.png) -Syntax highlighting, where present, was provided by [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting). +Syntax highlighting, where present, was provided by [zsh-syntax-highlighting]( + https://github.com/zsh-users/zsh-syntax-highlighting). ### How was the recommended font created? [The recommended font](#meslo-nerd-font-patched-for-powerlevel10k) is the product of many -individuals. Its origin is _Bitstream Vera Sans Mono_, which has given birth to _Menlo_, which in -turn has spawned _Meslo_. Finally, extra glyphs have been added to _Meslo_ with scripts forked +individuals. Its origin is *Bitstream Vera Sans Mono*, which has given birth to *Menlo*, which in +turn has spawned *Meslo*. Finally, extra glyphs have been added to *Meslo* with scripts forked from Nerd Fonts. The final font is released under the terms of -[Apache License](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/MesloLGS%20NF%20License.txt). +[Apache License]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/MesloLGS%20NF%20License.txt). MesloLGS NF font can be recreated with the following command (requires `git` and `docker`): @@ -1389,10 +1434,12 @@ If it looks like a regular `?`, that's normal. It means you have untracked files repository. Type `git status` to see these files. You can change this symbol or disable the display of untracked files altogether. Search for `untracked files` in `~/.p10k.zsh`. -_FAQ_: [What do different symbols in Git status mean?](#what-do-different-symbols-in-git-status-mean) +*FAQ*: [What do different symbols in Git status mean?]( + #what-do-different-symbols-in-git-status-mean) You can also get a weird-looking question mark in your prompt if your terminal's font is missing -some glyphs. See [icons, glyphs or powerline symbols don't render](#icons-glyphs-or-powerline-symbols-dont-render). +some glyphs. See [icons, glyphs or powerline symbols don't render]( + #icons-glyphs-or-powerline-symbols-dont-render). ### Icons, glyphs or powerline symbols don't render @@ -1401,21 +1448,23 @@ and run `p10k configure`. ### Sub-pixel imperfections around powerline symbols -![Powerline Prompt Imperfections](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/powerline-imperfections.png) +![Powerline Prompt Imperfections]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/powerline-imperfections.png) There are three imperfections on the screenshot. From left to right: 1. A thin blue line (a sub-pixel gap) between the content of a prompt segment and the following - powerline connection. +powerline connection. 1. Incorrect alignment of a powerline connection and the following prompt segment. The connection - appears shifted to the right. +appears shifted to the right. 1. A thin red line below a powerline connection. The connection appears shifted up. Zsh themes don't have down-to-pixel control over the terminal content. Everything you see on the screen is made of monospace characters. A white powerline prompt segment is made of text on white background followed by U+E0B0 (a right-pointing triangle). -![Powerline Prompt Imperfections](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/powerline-anatomy.png) +![Powerline Prompt Imperfections]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/powerline-anatomy.png) If Powerlevel10k prompt has imperfections around powerline symbols, you'll see exactly the same imperfections with all powerline themes (Agnoster, Powerlevel9k, Powerline, etc.) @@ -1432,7 +1481,7 @@ There are several things you can try to deal with these imperfections: - Try a different terminal. A more radical solution is to switch to prompt style without background. Type `p10k configure` and -select _Lean_. This style has a modern lightweight look. As a bonus, it doesn't suffer from +select *Lean*. This style has a modern lightweight look. As a bonus, it doesn't suffer from rendering imperfections that afflict powerline-style prompt. ### Error: character not in range @@ -1440,7 +1489,7 @@ rendering imperfections that afflict powerline-style prompt. Type `echo '\u276F'`. If you get an error saying "zsh: character not in range", your locale doesn't support UTF-8. You need to fix it. If you are running Zsh over SSH, see [this](https://github.com/romkatv/powerlevel10k/issues/153#issuecomment-518347833). If you are -running Zsh locally, Google "set UTF-8 locale in _your OS_". +running Zsh locally, Google "set UTF-8 locale in *your OS*". ### Cursor is in the wrong place @@ -1551,27 +1600,27 @@ configuration wizard. Once you can see the errors, fix `~/.zshrc` to get rid of ### Some prompt styles are missing from the configuration wizard If Zsh version is below 5.7.1 or `COLORTERM` environment variable is neither `24bit` nor -`truecolor`, configuration wizard won't offer Pure style with Snazzy color scheme. _Fix_: Install +`truecolor`, configuration wizard won't offer Pure style with Snazzy color scheme. *Fix*: Install Zsh >= 5.7.1 and use a terminal with truecolor support. Verify with `print -P '%F{#ff0000}red%f'`. If the terminal can display fewer than 256 colors, configuration wizard preselects Lean style with -8 colors. All other styles require at least 256 colors. _Fix_: Use a terminal with 256 color support +8 colors. All other styles require at least 256 colors. *Fix*: Use a terminal with 256 color support and make sure that `TERM` environment variable is set correctly. Verify with `print $terminfo[colors]`. If there is no UTF-8 locale on the system, configuration wizard won't offer prompt styles that use -Unicode characters. _Fix_: Install a UTF-8 locale. Verify with `locale -a`. +Unicode characters. *Fix*: Install a UTF-8 locale. Verify with `locale -a`. When a UTF-8 locale is available, the first few questions asked by the configuration wizard assess capabilities of the terminal font. If your answers indicate that some glyphs don't render correctly, -configuration wizard won't offer prompt styles that use them. _Fix_: Restart your terminal and +configuration wizard won't offer prompt styles that use them. *Fix*: Restart your terminal and install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). Verify by running `p10k configure` and checking that all glyphs render correctly. ### Cannot install the recommended font Once you download [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k), -you can install it just like any other font. Google "how to install fonts on _your OS_". +you can install it just like any other font. Google "how to install fonts on *your OS*". ### Extra or missing spaces in prompt compared to Powerlevel9k @@ -1585,7 +1634,8 @@ and there. These come in two flavors. tl;dr: Add `ZLE_RPROMPT_INDENT=0` to `~/.zshrc` to get rid of that space. -From [Zsh documentation](http://zsh.sourceforge.net/Doc/Release/Parameters.html#index-ZLE_005fRPROMPT_005fINDENT): +From [Zsh documentation]( + http://zsh.sourceforge.net/Doc/Release/Parameters.html#index-ZLE_005fRPROMPT_005fINDENT): > `ZLE_RPROMPT_INDENT ` > @@ -1601,7 +1651,8 @@ is the same thing as setting it to `1`), you'll get an empty space to the right you set `ZLE_RPROMPT_INDENT=0`, your prompt will go to the edge of the terminal. This is how it works in every theme except Powerlevel9k. -![ZLE_RPROMPT_INDENT: Powerlevel10k vs Powerlevel9k](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/p9k-vs-p10k-zle-rprompt-indent.png) +![ZLE_RPROMPT_INDENT: Powerlevel10k vs Powerlevel9k]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/p9k-vs-p10k-zle-rprompt-indent.png) Powerlevel9k issue: [powerlevel9k#1292](https://github.com/Powerlevel9k/powerlevel9k/issues/1292). It's been fixed in the development branch of Powerlevel9k but the fix hasn't yet made it to @@ -1610,7 +1661,7 @@ It's been fixed in the development branch of Powerlevel9k but the fix hasn't yet Add `ZLE_RPROMPT_INDENT=0` to `~/.zshrc` to get the same spacing on the right edge of prompt as in Powerlevel9k. -_Note:_ Several versions of Zsh have bugs that get triggered when you set `ZLE_RPROMPT_INDENT=0`. +*Note:* Several versions of Zsh have bugs that get triggered when you set `ZLE_RPROMPT_INDENT=0`. Powerlevel10k can work around these bugs when using powerline prompt style. If you notice visual artifacts in prompt, or wrong cursor position, try removing `ZLE_RPROMPT_INDENT` from `~/.zshrc`. @@ -1621,13 +1672,14 @@ icons as in Powerlevel9k. Spacing around icons in Powerlevel9k is inconsistent. -![ZLE_RPROMPT_INDENT: Powerlevel10k vs Powerlevel9k](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/p9k-vs-p10k-icon-spacing.png) +![ZLE_RPROMPT_INDENT: Powerlevel10k vs Powerlevel9k]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/p9k-vs-p10k-icon-spacing.png) This inconsistency is a constant source of annoyance, so it was fixed in Powerlevel10k. You can add `POWERLEVEL9K_LEGACY_ICON_SPACING=true` to `~/.zshrc` to get the same spacing around icons as in Powerlevel9k. -_Note:_ It's not a good idea to define `POWERLEVEL9K_LEGACY_ICON_SPACING` when using +*Note:* It's not a good idea to define `POWERLEVEL9K_LEGACY_ICON_SPACING` when using `p10k configure`. ### Weird things happen after typing `source ~/.zshrc` @@ -1642,7 +1694,8 @@ than `source ~/.zshrc`. ### Transient prompt stops working after some time -See [weird things happen after typing `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc). +See [weird things happen after typing `source ~/.zshrc`]( + #weird-things-happen-after-typing-source-zshrc). ### Cannot make Powerlevel10k work with my plugin manager @@ -1692,15 +1745,17 @@ There are several ways to fix this. When you resize a terminal window horizontally back and forth a few times, you might see this ugly picture. -![Powerlevel10k Resizing Mess](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resizing-mess.png) +![Powerlevel10k Resizing Mess]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resizing-mess.png) tl;dr: This issue arises when a terminal reflows Zsh prompt upon resizing. It isn't specific to Powerlevel10k. See [mitigation](#mitigation). -_Note: This section [used to say](https://github.com/romkatv/powerlevel10k/blob/dce00cdb5daaa8a519df234a7012ba3257b644d4/README.md#horrific-mess-when-resizing-terminal-window) +*Note: This section [used to say]( + https://github.com/romkatv/powerlevel10k/blob/dce00cdb5daaa8a519df234a7012ba3257b644d4/README.md#horrific-mess-when-resizing-terminal-window) that the problem is caused by a bug in Zsh. While it's true that it's possible to avoid the problem in many circumstances by modifying Zsh, it cannot be completely resolved this way. Thus it's unfair -to pin the blame on Zsh._ +to pin the blame on Zsh.* #### The anatomy of the problem @@ -1708,19 +1763,22 @@ The issue is manifested when the vertical distance between the start of the curr cursor (henceforth `VD`) changes when the terminal window is resized. When a terminal window gets shrunk horizontally, there are two ways for a terminal to handle long -lines that no longer fit: _reflow_ or _truncate_. +lines that no longer fit: *reflow* or *truncate*. Terminal content before shrinking: -![Terminal Content Before Shrinking](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-original.png) +![Terminal Content Before Shrinking]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-original.png) Terminal reflows text when shrinking: -![Terminal Reflows Text When Shrinking](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-reflow.png) +![Terminal Reflows Text When Shrinking]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-reflow.png) Terminal truncates text when shrinking: -![Terminal Truncates Text When Shrinking](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-truncate.png) +![Terminal Truncates Text When Shrinking]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-truncate.png) Reflowing strategy can change the height of terminal content. If such content happens to be between the start of the current prompt and the cursor, Zsh will print prompt on the wrong line. Truncation @@ -1742,36 +1800,41 @@ PROMPT=$'${$((pause()))+}left>${(pl.$((COLUMNS-12))..-.)} ' When `PROMPT` gets expanded, it calls `pause` to let us observe the state of the terminal. Here's the initial state: -![Terminal Resizing Bug 1](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-bug-1.png) +![Terminal Resizing Bug 1]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-bug-1.png) Zsh keeps track of the cursor position relative to the start of the current prompt. In this case it knows that the cursor is one line below. When we shrink the terminal window, it looks like this: -![Terminal Resizing Bug 2](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-bug-2.png) +![Terminal Resizing Bug 2]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-bug-2.png) At this point the terminal sends `SIGWINCH` to Zsh to notify it about changes in the terminal -dimensions. Note that this signal is sent _after_ the content of the terminal has been reflown. +dimensions. Note that this signal is sent *after* the content of the terminal has been reflown. When Zsh receives `SIGWINCH`, it attempts to erase the current prompt and print it anew. It goes to -the position where it _thinks_ the current prompt is -- one line above the cursor (!) -- erases all +the position where it *thinks* the current prompt is -- one line above the cursor (!) -- erases all terminal content that follows and prints reexpanded prompt there. However, after resizing prompt is no longer one line above the cursor. It's two lines above! Zsh ends up printing new prompt one line too low. -![Terminal Resizing Bug 3](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-bug-3.png) +![Terminal Resizing Bug 3]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-bug-3.png) -In this case we ended up with unwanted junk content because `VD` has _increased_. When you make -terminal window wider, `VD` can also _decrease_, which would result in the new prompt being printed +In this case we ended up with unwanted junk content because `VD` has *increased*. When you make +terminal window wider, `VD` can also *decrease*, which would result in the new prompt being printed higher than intended, potentially erasing useful content in the process. Here are a few more examples where shrinking terminal window increased `VD`. - Simple one-line left prompt with right prompt. No `prompt_subst`. Note that the cursor is below - the prompt line (hit _ESC-ENTER_ to get it there). - ![Zsh Prompt That Breaks on Terminal Shrinking 1](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-breakable-1.png) + the prompt line (hit *ESC-ENTER* to get it there). + ![Zsh Prompt That Breaks on Terminal Shrinking 1]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-breakable-1.png) - Simple one-line left prompt. No `prompt_subst`, no right prompt. Here `VD` is bound to increase upon terminal shrinking due to the command line wrapping around. - ![Zsh Prompt That Breaks on Terminal Shrinking 2](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-breakable-2.png) + ![Zsh Prompt That Breaks on Terminal Shrinking 2]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-breakable-2.png) #### Zsh patch @@ -1799,7 +1862,8 @@ fact don't: continuously reflow text and rapid-fire `SIGWINCH` when the window is being resized. In such environment real terminal dimensions go out of sync with what Zsh thinks the dimensions are. -There is no ETA for the patch making its way into upstream Zsh. See [discussion](https://www.zsh.org/mla/workers//2019/msg00561.html). +There is no ETA for the patch making its way into upstream Zsh. See [discussion]( + https://www.zsh.org/mla/workers//2019/msg00561.html). #### Mitigation @@ -1808,7 +1872,8 @@ There are a few mitigation options for this issue. - Use [kitty](https://sw.kovidgoyal.net/kitty/) terminal version >= 0.24.0 and enable terminal-shell integration in Powerlevel10k by defining `POWERLEVEL9K_TERM_SHELL_INTEGRATION=true` in `~/.p10k.zsh`. -- Apply [the patch](#zsh-patch) and [rebuild Zsh from source](https://github.com/zsh-users/zsh/blob/master/INSTALL). It won't help if you are using Alacritty, +- Apply [the patch](#zsh-patch) and [rebuild Zsh from source]( + https://github.com/zsh-users/zsh/blob/master/INSTALL). It won't help if you are using Alacritty, kitty or some other terminal that reflows text on resize but doesn't reflow saved cursor position. On such terminals the patch will have no visible effect. - Disable text reflowing on window resize in terminal settings. If your terminal doesn't have this @@ -1830,7 +1895,8 @@ When using Konsole with a non-monospace font, icons may be cut off on the right "non-monospace" refers to any font with glyphs wider than a single column, or wider than two columns for glyphs designated as "wide" in the Unicode standard. -![Icons cut off in Konsole](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/konsole-non-monospace-font.png) +![Icons cut off in Konsole]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/konsole-non-monospace-font.png) The last line on the screenshot shows a cut off Arch Linux logo. @@ -1841,35 +1907,32 @@ There are several mitigation options for this issue. 3. Manually add an extra space after the icon that gets cut off. For example, if the content of `os_icon` prompt segment gets cut off, open `~/.p10k.zsh`, search for `POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION` and change it as follows: - ```zsh typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='${P9K_CONTENT} ' # extra space at the end ``` - 4. Use a different icon that is monospace. For example, if Arch Linux logo gets cut off, add the following parameter to `~/.p10k.zsh`: - ```zsh typeset -g POWERLEVEL9K_LINUX_ARCH_ICON='Arch' # plain "Arch" in place of a logo ``` - 5. Disable the display of the icon that gets cut off. For example, if the content of `os_icon` prompt segment gets cut off, open `~/.p10k.zsh` and remove `os_icon` from `POWERLEVEL9K_LEFT_PROMPT_ELEMENTS` and `POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS`. -_Note_: [Non-monospace fonts are not officially supported by Konsole](https://bugs.kde.org/show_bug.cgi?id=418553#c5). +*Note*: [Non-monospace fonts are not officially supported by Konsole]( + https://bugs.kde.org/show_bug.cgi?id=418553#c5). ### Arch Linux logo has a dot in the bottom right corner -![Arch Linux Logo with a dot](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/arch-linux-logo-dot.png) +![Arch Linux Logo with a dot]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/arch-linux-logo-dot.png) Some fonts have this incorrect dotted icon in bold typeface. There are two ways to fix this issue. 1. Use a font with a correct Arch Linux logo in bold typeface. For example, - [the recommended Powerlevel10k font](#meslo-nerd-font-patched-for-powerlevel10k). + [the recommended Powerlevel10k font](#meslo-nerd-font-patched-for-powerlevel10k). 2. Display the icon in regular (non-bold) typeface. To do this, open `~/.p10k.zsh`, search for `POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION` and remove `%B` from its value. - ```zsh typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='${P9K_CONTENT}' # not bold ``` From 406e6aa9e46429872c211d0c37517238ce9da3db Mon Sep 17 00:00:00 2001 From: AdalZanabria Date: Tue, 3 May 2022 11:48:01 -0500 Subject: [PATCH 168/380] Added missing segments to README without auto-formatting. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 3f36888f..86cb3a35 100644 --- a/README.md +++ b/README.md @@ -344,6 +344,7 @@ enable as many segments as you like. It won't slow down your prompt or Zsh start | `nvm` | node.js environment from [nvm](https://github.com/nvm-sh/nvm) | | `os_icon` | your OS logo (apple for macOS, swirl for debian, etc.) | | `package` | `name@version` from [package.json](https://docs.npmjs.com/files/package.json) | +| `perlbrew` | perl version from [perlbrew](https://github.com/gugod/App-perlbrew) | | `phpenv` | php environment from [phpenv](https://github.com/phpenv/phpenv) | | `php_version` | [php](https://www.php.net/) version | | `plenv` | perl environment from [plenv](https://github.com/tokuhirom/plenv) | @@ -356,6 +357,7 @@ enable as many segments as you like. It won't slow down your prompt or Zsh start | `rbenv` | ruby environment from [rbenv](https://github.com/rbenv/rbenv) | | `rust_version` | [rustc](https://www.rust-lang.org) version | | `rvm` | ruby environment from [rvm](https://rvm.io) | +| `scalaenv` | scala version from [scalaenv](https://github.com/scalaenv/scalaenv) | | `status` | exit code of the last command | | `swap` | used swap | | `taskwarrior` | [taskwarrior](https://taskwarrior.org/) task count | @@ -368,6 +370,7 @@ enable as many segments as you like. It won't slow down your prompt or Zsh start | `vcs` | Git repository status | | `vim_shell` | [vim](https://www.vim.org/) shell (`:sh`) | | `virtualenv` | python environment from [venv](https://docs.python.org/3/library/venv.html) | +| `vi_mode` | vi mode (you don't need this if you've enabled prompt_char) | | `vpn_ip` | virtual private network indicator | | `wifi` | WiFi speed | | `xplr` | [xplr](https://github.com/sayanarijit/xplr) shell | From 74ff02a819c5b83b8022c973ce100e41104a41cf Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 20 May 2022 16:58:20 +0200 Subject: [PATCH 169/380] work around a bug in zsh 5.4.1 (#1872) Here's the bug: zsh -fc 'print "${#${x}}"' This code should print "0" but it prints "1" in zsh 5.4.1. --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 22b4f49a..6d3299f1 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5999,7 +5999,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=45 +typeset -gri __p9k_instant_prompt_version=46 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -6033,7 +6033,7 @@ _p9k_dump_instant_prompt() { typeset -gi __p9k_instant_prompt_disabled=1 [[ \$ZSH_VERSION == ${(q)ZSH_VERSION} && \$ZSH_PATCHLEVEL == ${(q)ZSH_PATCHLEVEL} && $screen \${(M)TERM:#(screen*|tmux*)} && - \${#\${(M)VTE_VERSION:#(<1-4602>|4801)}} == ${#${(M)VTE_VERSION:#(<1-4602>|4801)}} && + \${#\${(M)VTE_VERSION:#(<1-4602>|4801)}} == "${#${(M)VTE_VERSION:#(<1-4602>|4801)}}" && \$POWERLEVEL9K_DISABLE_INSTANT_PROMPT != 'true' && \$POWERLEVEL9K_INSTANT_PROMPT != 'off' ]] || return typeset -g __p9k_instant_prompt_param_sig=${(q+)_p9k__param_sig} From cf9a1fd02de7c23de102abbf6406ceaabf252a83 Mon Sep 17 00:00:00 2001 From: Lucas Larson Date: Wed, 25 May 2022 18:48:57 -0400 Subject: [PATCH 170/380] =?UTF-8?q?suppress=20`nounset`=20error=20if=20`DI?= =?UTF-8?q?RENV=5FDIR`=20isn=E2=80=99t=20defined=20(fix=20#1876)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lucas Larson --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 6d3299f1..2ed2aaf9 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5007,7 +5007,7 @@ _p9k_prompt_proxy_init() { function prompt_direnv() { local -i len=$#_p9k__prompt _p9k__has_upglob - _p9k_prompt_segment $0 $_p9k_color1 yellow DIRENV_ICON 0 '$DIRENV_DIR' '' + _p9k_prompt_segment $0 $_p9k_color1 yellow DIRENV_ICON 0 '${DIRENV_DIR:-}' '' (( _p9k__has_upglob )) || typeset -g "_p9k__segment_val_${_p9k__prompt_side}[_p9k__segment_index]"=$_p9k__prompt[len+1,-1] } @@ -5018,7 +5018,7 @@ _p9k_prompt_direnv_init() { } function instant_prompt_direnv() { - if [[ -n $DIRENV_DIR && $precmd_functions[-1] == _p9k_precmd ]]; then + if [[ -n ${DIRENV_DIR:-} && $precmd_functions[-1] == _p9k_precmd ]]; then _p9k_prompt_segment prompt_direnv $_p9k_color1 yellow DIRENV_ICON 0 '' '' fi } From a3f6859a8d263973f840f2ae12c0c1f9821cdea8 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 26 May 2022 09:42:26 +0200 Subject: [PATCH 171/380] cleanup --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 2ed2aaf9..01898e1e 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5007,14 +5007,14 @@ _p9k_prompt_proxy_init() { function prompt_direnv() { local -i len=$#_p9k__prompt _p9k__has_upglob - _p9k_prompt_segment $0 $_p9k_color1 yellow DIRENV_ICON 0 '${DIRENV_DIR:-}' '' + _p9k_prompt_segment $0 $_p9k_color1 yellow DIRENV_ICON 0 '${DIRENV_DIR-}' '' (( _p9k__has_upglob )) || typeset -g "_p9k__segment_val_${_p9k__prompt_side}[_p9k__segment_index]"=$_p9k__prompt[len+1,-1] } _p9k_prompt_direnv_init() { # DIRENV_DIR is set in a precmd hook. If our hook isn't the last, DIRENV_DIR might # still get set before prompt is expanded. - typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${DIRENV_DIR:-${precmd_functions[-1]:#_p9k_precmd}}' + typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${DIRENV_DIR-${precmd_functions[-1]:#_p9k_precmd}}' } function instant_prompt_direnv() { From 5c7ad753a2addf016532283978c4b72653670275 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 28 May 2022 18:59:10 +0200 Subject: [PATCH 172/380] add installation instructions for alpine; related: #1828 --- README.md | 62 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 86cb3a35..5cb768c4 100644 --- a/README.md +++ b/README.md @@ -411,6 +411,7 @@ Powerlevel10k. - [Zinit](#zinit) - [Homebrew](#homebrew) - [Arch Linux](#arch-linux) +- [Alpine Linux](#arch-linux) ### Manual @@ -506,6 +507,13 @@ There is also [zsh-theme-powerlevel10k]( Historically, [it has been breaking often and for extended periods of time]( https://github.com/romkatv/powerlevel10k/pull/786). **Do not use it.** +### Alpine Linux + +```zsh +apk add zsh-theme-powerlevel10k +echo 'source /usr/share/zsh/plugins/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc +``` + ## Configuration - [For new users](#for-new-users) @@ -755,19 +763,20 @@ Powerlevel10k is released under the The command to update Powerlevel10k depends on how it was installed. -| Installation | Update command | -|---------------------------|-------------------------------------------------------------| -| [Manual](#manual) | `git -C ~/powerlevel10k pull` | -| [Oh My Zsh](#oh-my-zsh) | `git -C ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k pull` | -| [Prezto](#prezto) | `zprezto-update` | -| [Zim](#zim) | `zimfw update` | -| [Antigen](#antigen) | `antigen update` | -| [Zplug](#zplug) | `zplug update` | -| [Zgen](#zgen) | `zgen update` | -| [Zplugin](#zplugin) | `zplugin update` | -| [Zinit](#zinit) | `zinit update` | -| [Homebrew](#homebrew) | `brew update && brew upgrade` | -| [Arch Linux](#arch-linux) | `yay -S --noconfirm zsh-theme-powerlevel10k-git` | +| Installation | Update command | +|-------------------------------|-------------------------------------------------------------| +| [Manual](#manual) | `git -C ~/powerlevel10k pull` | +| [Oh My Zsh](#oh-my-zsh) | `git -C ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k pull` | +| [Prezto](#prezto) | `zprezto-update` | +| [Zim](#zim) | `zimfw update` | +| [Antigen](#antigen) | `antigen update` | +| [Zplug](#zplug) | `zplug update` | +| [Zgen](#zgen) | `zgen update` | +| [Zplugin](#zplugin) | `zplugin update` | +| [Zinit](#zinit) | `zinit update` | +| [Homebrew](#homebrew) | `brew update && brew upgrade` | +| [Arch Linux](#arch-linux) | `yay -S --noconfirm zsh-theme-powerlevel10k-git` | +| [Alpine Linux](#alpine-linux) | `apk update && apk upgrade` | **IMPORTANT**: Restart Zsh after updating Powerlevel10k. [Do not use `source ~/.zshrc`]( #weird-things-happen-after-typing-source-zshrc). @@ -805,19 +814,20 @@ The command to update Powerlevel10k depends on how it was installed. Powerlevel10k. The command to delete them depends on which installation method you'd chosen. Refer to the [installation instructions](#installation) if you need a reminder. - | Installation | Uninstall command | - |---------------------------|------------------------------------------------------------------| - | [Manual](#manual) | `rm -rf ~/powerlevel10k` | - | [Oh My Zsh](#oh-my-zsh) | `rm -rf -- ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k` | - | [Prezto](#prezto) | n/a | - | [Zim](#zim) | `zimfw uninstall` | - | [Antigen](#antigen) | `antigen purge romkatv/powerlevel10k` | - | [Zplug](#zplug) | `zplug clean` | - | [Zgen](#zgen) | `zgen reset` | - | [Zplugin](#zplugin) | `zplugin delete romkatv/powerlevel10k` | - | [Zinit](#zinit) | `zinit delete romkatv/powerlevel10k` | - | [Homebrew](#homebrew) | `brew uninstall powerlevel10k; brew untap romkatv/powerlevel10k` | - | [Arch Linux](#arch-linux) | `yay -R --noconfirm zsh-theme-powerlevel10k-git` | + | Installation | Uninstall command | + |-------------------------------|------------------------------------------------------------------| + | [Manual](#manual) | `rm -rf ~/powerlevel10k` | + | [Oh My Zsh](#oh-my-zsh) | `rm -rf -- ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k` | + | [Prezto](#prezto) | n/a | + | [Zim](#zim) | `zimfw uninstall` | + | [Antigen](#antigen) | `antigen purge romkatv/powerlevel10k` | + | [Zplug](#zplug) | `zplug clean` | + | [Zgen](#zgen) | `zgen reset` | + | [Zplugin](#zplugin) | `zplugin delete romkatv/powerlevel10k` | + | [Zinit](#zinit) | `zinit delete romkatv/powerlevel10k` | + | [Homebrew](#homebrew) | `brew uninstall powerlevel10k; brew untap romkatv/powerlevel10k` | + | [Arch Linux](#arch-linux) | `yay -R --noconfirm zsh-theme-powerlevel10k-git` | + | [Alpine Linux](#alpine-linux) | `apk del zsh-theme-powerlevel10k` | 6. Restart Zsh. [Do not use `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc). 7. Delete Powerlevel10k cache files. ```zsh From 89ecd6539aad247fb85ca4ea4304b1704a9ef035 Mon Sep 17 00:00:00 2001 From: Anupam Srivastava Date: Fri, 3 Jun 2022 18:49:20 +0530 Subject: [PATCH 173/380] Fixed minor spelling mistakes --- config/p10k-lean-8colors.zsh | 2 +- config/p10k-lean.zsh | 2 +- config/p10k-rainbow.zsh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 0dc5dbb2..26e34d48 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -486,7 +486,7 @@ # Show status of repositories of these types. You can add svn and/or hg if you are # using them. If you do, your prompt may become slow even when your current directory - # isn't in an svn or hg reposotiry. + # isn't in an svn or hg repository. typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) # These settings are used for repositories other than Git or when gitstatusd fails and diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index dbd9acc9..32588071 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -482,7 +482,7 @@ # Show status of repositories of these types. You can add svn and/or hg if you are # using them. If you do, your prompt may become slow even when your current directory - # isn't in an svn or hg reposotiry. + # isn't in an svn or hg repository. typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) # These settings are used for repositories other than Git or when gitstatusd fails and diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 4b00f3e8..1e47fd7f 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -141,7 +141,7 @@ # Filler between left and right prompt on the first prompt line. You can set it to ' ', '·' or # '─'. The last two make it easier to see the alignment between left and right prompt and to # separate prompt from command output. You might want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false - # for more compact prompt if using using this option. + # for more compact prompt if using this option. typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND= typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_GAP_BACKGROUND= @@ -485,7 +485,7 @@ # Show status of repositories of these types. You can add svn and/or hg if you are # using them. If you do, your prompt may become slow even when your current directory - # isn't in an svn or hg reposotiry. + # isn't in an svn or hg repository. typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) ##########################[ status: exit code of the last command ]########################### From 6b128d48d675509666ff222eb08922cc6a7b6753 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 6 Jun 2022 17:33:29 +0200 Subject: [PATCH 174/380] update alpine linux installation instructions --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5cb768c4..381bfde4 100644 --- a/README.md +++ b/README.md @@ -510,8 +510,9 @@ Historically, [it has been breaking often and for extended periods of time]( ### Alpine Linux ```zsh -apk add zsh-theme-powerlevel10k -echo 'source /usr/share/zsh/plugins/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc +apk add zsh zsh-theme-powerlevel10k +mkdir -p ~/.local/share/zsh/plugins +ln -s /usr/share/zsh/plugins/powerlevel10k ~/.local/share/zsh/plugins/ ``` ## Configuration @@ -827,7 +828,7 @@ The command to update Powerlevel10k depends on how it was installed. | [Zinit](#zinit) | `zinit delete romkatv/powerlevel10k` | | [Homebrew](#homebrew) | `brew uninstall powerlevel10k; brew untap romkatv/powerlevel10k` | | [Arch Linux](#arch-linux) | `yay -R --noconfirm zsh-theme-powerlevel10k-git` | - | [Alpine Linux](#alpine-linux) | `apk del zsh-theme-powerlevel10k` | + | [Alpine Linux](#alpine-linux) | `apk del zsh-theme-powerlevel10k` | 6. Restart Zsh. [Do not use `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc). 7. Delete Powerlevel10k cache files. ```zsh From 19bcd37935a7d8684304cccd9d6b4ca06c343339 Mon Sep 17 00:00:00 2001 From: Ilkin Bayramli <43158991+ibayramli2001@users.noreply.github.com> Date: Wed, 15 Jun 2022 11:25:22 -0700 Subject: [PATCH 175/380] Add Fig as an installation method to the README --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 381bfde4..54752d2c 100644 --- a/README.md +++ b/README.md @@ -401,6 +401,7 @@ Powerlevel10k. - [Manual](#manual) 👈 **choose this if confused or uncertain** - [Oh My Zsh](#oh-my-zsh) +- [Fig](#fig) - [Prezto](#prezto) - [Zim](#zim) - [Antibody](#antibody) @@ -446,6 +447,14 @@ make sure to disable the current theme in your plugin manager. See ``` 2. Set `ZSH_THEME="powerlevel10k/powerlevel10k"` in `~/.zshrc`. +### Fig + +[Fig](https://fig.io) adds apps, shortcuts, and autocomplete to your existing terminal. + +Install `Powerlevel10k` in just one click. + + + ### Prezto Add `zstyle :prezto:module:prompt theme powerlevel10k` to `~/.zpreztorc`. From 0bef490cdaedd992a27a50e14d536c4a795ebc2d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 15 Jun 2022 20:37:51 +0200 Subject: [PATCH 176/380] replace fig ads with installation instructions --- README.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 54752d2c..8ffd1229 100644 --- a/README.md +++ b/README.md @@ -401,7 +401,6 @@ Powerlevel10k. - [Manual](#manual) 👈 **choose this if confused or uncertain** - [Oh My Zsh](#oh-my-zsh) -- [Fig](#fig) - [Prezto](#prezto) - [Zim](#zim) - [Antibody](#antibody) @@ -413,6 +412,7 @@ Powerlevel10k. - [Homebrew](#homebrew) - [Arch Linux](#arch-linux) - [Alpine Linux](#arch-linux) +- [Fig](#fig) ### Manual @@ -447,14 +447,6 @@ make sure to disable the current theme in your plugin manager. See ``` 2. Set `ZSH_THEME="powerlevel10k/powerlevel10k"` in `~/.zshrc`. -### Fig - -[Fig](https://fig.io) adds apps, shortcuts, and autocomplete to your existing terminal. - -Install `Powerlevel10k` in just one click. - - - ### Prezto Add `zstyle :prezto:module:prompt theme powerlevel10k` to `~/.zpreztorc`. @@ -524,6 +516,11 @@ mkdir -p ~/.local/share/zsh/plugins ln -s /usr/share/zsh/plugins/powerlevel10k ~/.local/share/zsh/plugins/ ``` +### Fig + +Follow the instructions on +[this page](https://fig.io/plugins/other/powerlevel10k). + ## Configuration - [For new users](#for-new-users) From 0c197ed4a51e10ed613e48a080f23b1ee7968006 Mon Sep 17 00:00:00 2001 From: Gerald Turner Date: Sat, 18 Jun 2022 22:17:25 +0200 Subject: [PATCH 177/380] battery plugin: Support Linux on Librem5 phone --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 01898e1e..1e01ba5f 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1349,7 +1349,7 @@ _p9k_prompt_battery_init() { return fi if [[ $_p9k_os != (Linux|Android) || - -z /sys/class/power_supply/(CMB*|BAT*|battery)/(energy_full|charge_full|charge_counter)(#qN) ]]; then + -z /sys/class/power_supply/(CMB*|BAT*|*battery)/(energy_full|charge_full|charge_counter)(#qN) ]]; then typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${:-}' fi } @@ -1407,7 +1407,7 @@ _p9k_prompt_battery_set_args() { Linux|Android) # See https://sourceforge.net/projects/acpiclient. - local -a bats=( /sys/class/power_supply/(CMB*|BAT*|battery)/(FN) ) + local -a bats=( /sys/class/power_supply/(CMB*|BAT*|*battery)/(FN) ) (( $#bats )) || return local -i energy_now energy_full power_now From cf67cad46557d57d5d2399e6d893c317126e037c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 22 Jun 2022 12:06:24 +0200 Subject: [PATCH 178/380] fix the UNICODE code point for powerline "branch" icon in comments (#1911) --- config/p10k-classic.zsh | 2 +- config/p10k-lean-8colors.zsh | 2 +- config/p10k-lean.zsh | 2 +- config/p10k-rainbow.zsh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 46814ec0..12ba3c0b 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -341,7 +341,7 @@ # typeset -g POWERLEVEL9K_DIR_PREFIX='%248Fin ' #####################################[ vcs: git status ]###################################### - # Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon. + # Branch icon. Set this parameter to '\UE0A0 ' for the popular Powerline branch icon. typeset -g POWERLEVEL9K_VCS_BRANCH_ICON= # Untracked files icon. It's really a question mark, your font isn't broken. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 26e34d48..6eaa6564 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -339,7 +339,7 @@ # typeset -g POWERLEVEL9K_DIR_PREFIX='%fin ' #####################################[ vcs: git status ]###################################### - # Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon. + # Branch icon. Set this parameter to '\UE0A0 ' for the popular Powerline branch icon. typeset -g POWERLEVEL9K_VCS_BRANCH_ICON= # Untracked files icon. It's really a question mark, your font isn't broken. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 32588071..6b14d3d4 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -335,7 +335,7 @@ # typeset -g POWERLEVEL9K_DIR_PREFIX='%fin ' #####################################[ vcs: git status ]###################################### - # Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon. + # Branch icon. Set this parameter to '\UE0A0 ' for the popular Powerline branch icon. typeset -g POWERLEVEL9K_VCS_BRANCH_ICON= # Untracked files icon. It's really a question mark, your font isn't broken. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 1e47fd7f..cb69e856 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -351,7 +351,7 @@ typeset -g POWERLEVEL9K_VCS_CONFLICTED_BACKGROUND=3 typeset -g POWERLEVEL9K_VCS_LOADING_BACKGROUND=8 - # Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon. + # Branch icon. Set this parameter to '\UE0A0 ' for the popular Powerline branch icon. typeset -g POWERLEVEL9K_VCS_BRANCH_ICON= # Untracked files icon. It's really a question mark, your font isn't broken. From cb82b1f5d97322d07c1c210d1c9666b02a62e469 Mon Sep 17 00:00:00 2001 From: Christian Schulze Date: Fri, 24 Jun 2022 15:09:06 +1000 Subject: [PATCH 179/380] use HOST for distrobox detection --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 1e01ba5f..9668c421 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8280,7 +8280,7 @@ _p9k_init_toolbox() { local name=(${(Q)${${(@M)${(f)"$( Date: Sun, 10 Jul 2022 15:29:54 +0300 Subject: [PATCH 180/380] add Crostini installation instructions --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index 8ffd1229..2611a47f 100644 --- a/README.md +++ b/README.md @@ -704,6 +704,43 @@ If you are using a different terminal, proceed with manual font installation. ``` After changing the config run `xrdb ~/.Xresources` to reload it. The new config is applied to all new terminals. + - **[Crostini](https://chromeos.dev/en/linux)**: Open internal terminal preferences: + ``` + chrome-untrusted://terminal/html/nassh_preferences_editor.html + ``` + Set *Text font family* to: + ```text + 'Source Code Pro', 'MesloLGS NF', 'Powerline For Source Code Pro', 'Noto Sans Mono' + ``` + and *Custom CSS (inline text)* to: + ```css + @font-face { + font-family: "MesloLGS NF"; + src: url("https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/MesloLGS%20NF%20Regular.ttf"); + font-weight: normal; + font-style: normal; + } + @font-face { + font-family: "MesloLGS NF"; + src: url("https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/MesloLGS%20NF%20Bold.ttf"); + font-weight: bold; + font-style: normal; + } + @font-face { + font-family: "MesloLGS NF"; + src: url("https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/MesloLGS%20NF%20Italic.ttf"); + font-weight: normal; + font-style: italic; + } + @font-face { + font-family: "MesloLGS NF"; + src: url("https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/MesloLGS%20NF%20Bold%20Italic.ttf"); + font-weight: bold; + font-style: italic; + } + ``` + **_CAVEAT_**: If you open the normal terminal preferences these settings will be overwritten. + 1. Run `p10k configure` to generate a new `~/.p10k.zsh`. The old config may work incorrectly with the new font. From 487a388dbd50b18dd794cffbed0f78b01d4cc01b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 11 Jul 2022 10:00:20 +0200 Subject: [PATCH 181/380] make crostini font instructions stylistically similar to the rest and copy them over to font.md (#1934) --- README.md | 13 +++---------- font.md | 30 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 2611a47f..816327cb 100644 --- a/README.md +++ b/README.md @@ -704,15 +704,9 @@ If you are using a different terminal, proceed with manual font installation. ``` After changing the config run `xrdb ~/.Xresources` to reload it. The new config is applied to all new terminals. - - **[Crostini](https://chromeos.dev/en/linux)**: Open internal terminal preferences: - ``` - chrome-untrusted://terminal/html/nassh_preferences_editor.html - ``` - Set *Text font family* to: - ```text - 'Source Code Pro', 'MesloLGS NF', 'Powerline For Source Code Pro', 'Noto Sans Mono' - ``` - and *Custom CSS (inline text)* to: + - Crostini (Linux on Chrome OS): Open [internal terminal preferences]( + chrome-untrusted://terminal/html/nassh_preferences_editor.html), set *Text font family* to + `'MesloLGS NF'` and *Custom CSS (inline text)* to the following: ```css @font-face { font-family: "MesloLGS NF"; @@ -740,7 +734,6 @@ If you are using a different terminal, proceed with manual font installation. } ``` **_CAVEAT_**: If you open the normal terminal preferences these settings will be overwritten. - 1. Run `p10k configure` to generate a new `~/.p10k.zsh`. The old config may work incorrectly with the new font. diff --git a/font.md b/font.md index 964585a9..1af3b169 100644 --- a/font.md +++ b/font.md @@ -117,6 +117,36 @@ If you are using a different terminal, proceed with manual font installation. ``` After changing the config run `xrdb ~/.Xresources` to reload it. The new config is applied to all new terminals. + - Crostini (Linux on Chrome OS): Open [internal terminal preferences]( + chrome-untrusted://terminal/html/nassh_preferences_editor.html), set *Text font family* to + `'MesloLGS NF'` and *Custom CSS (inline text)* to the following: + ```css + @font-face { + font-family: "MesloLGS NF"; + src: url("https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/MesloLGS%20NF%20Regular.ttf"); + font-weight: normal; + font-style: normal; + } + @font-face { + font-family: "MesloLGS NF"; + src: url("https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/MesloLGS%20NF%20Bold.ttf"); + font-weight: bold; + font-style: normal; + } + @font-face { + font-family: "MesloLGS NF"; + src: url("https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/MesloLGS%20NF%20Italic.ttf"); + font-weight: normal; + font-style: italic; + } + @font-face { + font-family: "MesloLGS NF"; + src: url("https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/MesloLGS%20NF%20Bold%20Italic.ttf"); + font-weight: bold; + font-style: italic; + } + ``` + **_CAVEAT_**: If you open the normal terminal preferences these settings will be overwritten. 1. Run `p10k configure` to generate a new `~/.p10k.zsh`. The old config may work incorrectly with the new font. From be3724bc806a2dd7fbcb281a153b11ab19d8923d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 11 Jul 2022 10:08:06 +0200 Subject: [PATCH 182/380] typo in comments --- config/p10k-rainbow.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index cb69e856..a72fa65f 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -344,7 +344,7 @@ # typeset -g POWERLEVEL9K_DIR_PREFIX='in ' #####################################[ vcs: git status ]###################################### - # Version control system colors. + # Version control background colors. typeset -g POWERLEVEL9K_VCS_CLEAN_BACKGROUND=2 typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=3 typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=2 From 71e4e3288d08da5e9817ca64c350a7bc73bf598b Mon Sep 17 00:00:00 2001 From: Omeir Fawaz <54888682+omeiirr@users.noreply.github.com> Date: Thu, 14 Jul 2022 17:27:05 +0530 Subject: [PATCH 183/380] fix typo in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 816327cb..a912caf9 100644 --- a/README.md +++ b/README.md @@ -303,7 +303,7 @@ To ~~ridiculous~~ extravagant: Powerlevel10k comes with dozens of built-in high quality segments. When you run `p10k configure` and choose any style except [Pure](#pure-compatibility), many of these segments get enabled by -default while others be manually enabled by opening `~/.p10k.zsh` and uncommenting them. You can +default while others can be manually enabled by opening `~/.p10k.zsh` and uncommenting them. You can enable as many segments as you like. It won't slow down your prompt or Zsh startup. | Segment | Meaning | From 2dd6a29e4d7a33bfef10973d6550e087be37ddee Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 14 Jul 2022 11:52:31 +0200 Subject: [PATCH 184/380] replace a hyperlink in crostini instructions with regular text (#1934) --- README.md | 4 ++-- font.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a912caf9..425100db 100644 --- a/README.md +++ b/README.md @@ -704,8 +704,8 @@ If you are using a different terminal, proceed with manual font installation. ``` After changing the config run `xrdb ~/.Xresources` to reload it. The new config is applied to all new terminals. - - Crostini (Linux on Chrome OS): Open [internal terminal preferences]( - chrome-untrusted://terminal/html/nassh_preferences_editor.html), set *Text font family* to + - Crostini (Linux on Chrome OS): Open + chrome-untrusted://terminal/html/nassh_preferences_editor.html, set *Text font family* to `'MesloLGS NF'` and *Custom CSS (inline text)* to the following: ```css @font-face { diff --git a/font.md b/font.md index 1af3b169..72343840 100644 --- a/font.md +++ b/font.md @@ -117,8 +117,8 @@ If you are using a different terminal, proceed with manual font installation. ``` After changing the config run `xrdb ~/.Xresources` to reload it. The new config is applied to all new terminals. - - Crostini (Linux on Chrome OS): Open [internal terminal preferences]( - chrome-untrusted://terminal/html/nassh_preferences_editor.html), set *Text font family* to + - Crostini (Linux on Chrome OS): Open + chrome-untrusted://terminal/html/nassh_preferences_editor.html, set *Text font family* to `'MesloLGS NF'` and *Custom CSS (inline text)* to the following: ```css @font-face { From fd5fa095046233c7b4cddc3f1b7de04aae36f9fe Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 20 Jul 2022 11:12:37 +0200 Subject: [PATCH 185/380] fix toolbox segment (#1916) --- internal/p10k.zsh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 9668c421..7c2037f5 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5999,7 +5999,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=46 +typeset -gri __p9k_instant_prompt_version=47 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -8280,9 +8280,10 @@ _p9k_init_toolbox() { local name=(${(Q)${${(@M)${(f)"$( Date: Thu, 21 Jul 2022 13:54:51 +0200 Subject: [PATCH 186/380] don't trust cnorm as it's incorrect in some combinations of terminals and terminfo (#1699) --- internal/p10k.zsh | 12 ++++++++++-- internal/wizard.zsh | 7 ++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 7c2037f5..cf0c7f21 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6999,7 +6999,7 @@ function _p9k_reset_prompt() { zle .reset-prompt (( ${+functions[z4h]} )) || zle -R } always { - (( _p9k__can_hide_cursor )) && echoti cnorm + (( _p9k__can_hide_cursor )) && print -rn -- $_p9k__cnorm _p9k__cursor_hidden=0 } fi @@ -7121,6 +7121,14 @@ _p9k_init_vars() { typeset -gi _p9k__restore_prompt_fd typeset -gi _p9k__redraw_fd typeset -gi _p9k__can_hide_cursor=$(( $+terminfo[civis] && $+terminfo[cnorm] )) + if (( _p9k__can_hide_cursor )); then + # See https://github.com/romkatv/powerlevel10k/issues/1699 + if [[ $terminfo[cnorm] == *$'\e[?25h'(|'\e'*) ]]; then + typeset -g _p9k__cnorm=$'\e[?25h' + else + typeset -g _p9k__cnorm=$terminfo[cnorm] + fi + fi typeset -gi _p9k__cursor_hidden typeset -gi _p9k__non_hermetic_expansion typeset -g _p9k__time @@ -7656,7 +7664,7 @@ function _p9k_on_widget_deactivate-region() { _p9k_check_visual_mode; } function _p9k_on_widget_zle-line-init() { (( _p9k__cursor_hidden )) || return 0 _p9k__cursor_hidden=0 - echoti cnorm + print -rn -- $_p9k__cnorm } function _p9k_on_widget_zle-line-finish() { diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 5d6215a7..2ffb606c 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -222,7 +222,12 @@ function hide_cursor() { } function show_cursor() { - echoti cnorm 2>/dev/null + local cnorm=${terminfo[cnorm]-} + if [[ $cnorm == *$'\e[?25h'(|'\e'*) ]]; then + print -n '\e[?25h' + else + print -n $cnorm + fi } function consume_input() { From abc318b6087c01419aef30c6268332c82007ce5a Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Sun, 31 Jul 2022 11:37:26 +0200 Subject: [PATCH 187/380] Add Zi plugin manager to the install list A more detailled procedure of the installation of powerlevel10k with zi is available at [wiki.zshell.dev](https://wiki.zshell.dev/community/gallery/collection/themes#thp-romkatvpowerlevel10k) --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 425100db..5d2fa3c5 100644 --- a/README.md +++ b/README.md @@ -409,6 +409,7 @@ Powerlevel10k. - [Zgen](#zgen) - [Zplugin](#zplugin) - [Zinit](#zinit) +- [Zi](#zi) - [Homebrew](#homebrew) - [Arch Linux](#arch-linux) - [Alpine Linux](#arch-linux) @@ -486,6 +487,12 @@ Add `zinit ice depth=1; zinit light romkatv/powerlevel10k` to `~/.zshrc`. The use of `depth=1` ice is optional. Other types of ice are neither recommended nor officially supported by Powerlevel10k. +### ZI + +Add `zi ice depth=1; zi light romkatv/powerlevel10k` to `~/.zshrc`. + +See [wiki.zshell.dev](https://wiki.zshell.dev/community/gallery/collection/themes#thp-romkatvpowerlevel10k) for more + ### Homebrew ```zsh @@ -811,8 +818,9 @@ The command to update Powerlevel10k depends on how it was installed. | [Zgen](#zgen) | `zgen update` | | [Zplugin](#zplugin) | `zplugin update` | | [Zinit](#zinit) | `zinit update` | +| [Zi](#zi) | `zi update` | | [Homebrew](#homebrew) | `brew update && brew upgrade` | -| [Arch Linux](#arch-linux) | `yay -S --noconfirm zsh-theme-powerlevel10k-git` | +| [Arch Linux](#arch-linux) | `yay -S --noconfirm zsh-theme-powerlevel10k-git` | | [Alpine Linux](#alpine-linux) | `apk update && apk upgrade` | **IMPORTANT**: Restart Zsh after updating Powerlevel10k. [Do not use `source ~/.zshrc`]( @@ -862,8 +870,9 @@ The command to update Powerlevel10k depends on how it was installed. | [Zgen](#zgen) | `zgen reset` | | [Zplugin](#zplugin) | `zplugin delete romkatv/powerlevel10k` | | [Zinit](#zinit) | `zinit delete romkatv/powerlevel10k` | + | [Zi](#zi) | `zi delete romkatv/powerlevel10k` | | [Homebrew](#homebrew) | `brew uninstall powerlevel10k; brew untap romkatv/powerlevel10k` | - | [Arch Linux](#arch-linux) | `yay -R --noconfirm zsh-theme-powerlevel10k-git` | + | [Arch Linux](#arch-linux) | `yay -R --noconfirm zsh-theme-powerlevel10k-git` | | [Alpine Linux](#alpine-linux) | `apk del zsh-theme-powerlevel10k` | 6. Restart Zsh. [Do not use `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc). 7. Delete Powerlevel10k cache files. From f9fd384d8d64022e24c83bb03ba69e415c7fa90e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 31 Jul 2022 11:46:16 +0200 Subject: [PATCH 188/380] make zi installation instructions consistent with the rest; fix table formatting --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5d2fa3c5..ee231a2c 100644 --- a/README.md +++ b/README.md @@ -487,11 +487,12 @@ Add `zinit ice depth=1; zinit light romkatv/powerlevel10k` to `~/.zshrc`. The use of `depth=1` ice is optional. Other types of ice are neither recommended nor officially supported by Powerlevel10k. -### ZI +### Zi Add `zi ice depth=1; zi light romkatv/powerlevel10k` to `~/.zshrc`. -See [wiki.zshell.dev](https://wiki.zshell.dev/community/gallery/collection/themes#thp-romkatvpowerlevel10k) for more +The use of `depth=1` ice is optional. Other types of ice are neither recommended nor officially +supported by Powerlevel10k. ### Homebrew @@ -820,7 +821,7 @@ The command to update Powerlevel10k depends on how it was installed. | [Zinit](#zinit) | `zinit update` | | [Zi](#zi) | `zi update` | | [Homebrew](#homebrew) | `brew update && brew upgrade` | -| [Arch Linux](#arch-linux) | `yay -S --noconfirm zsh-theme-powerlevel10k-git` | +| [Arch Linux](#arch-linux) | `yay -S --noconfirm zsh-theme-powerlevel10k-git` | | [Alpine Linux](#alpine-linux) | `apk update && apk upgrade` | **IMPORTANT**: Restart Zsh after updating Powerlevel10k. [Do not use `source ~/.zshrc`]( @@ -872,7 +873,7 @@ The command to update Powerlevel10k depends on how it was installed. | [Zinit](#zinit) | `zinit delete romkatv/powerlevel10k` | | [Zi](#zi) | `zi delete romkatv/powerlevel10k` | | [Homebrew](#homebrew) | `brew uninstall powerlevel10k; brew untap romkatv/powerlevel10k` | - | [Arch Linux](#arch-linux) | `yay -R --noconfirm zsh-theme-powerlevel10k-git` | + | [Arch Linux](#arch-linux) | `yay -R --noconfirm zsh-theme-powerlevel10k-git` | | [Alpine Linux](#alpine-linux) | `apk del zsh-theme-powerlevel10k` | 6. Restart Zsh. [Do not use `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc). 7. Delete Powerlevel10k cache files. From 0493886837595bdfb0d8ee36a8b25556ac0a64ea Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 20 Aug 2022 10:16:28 +0200 Subject: [PATCH 189/380] clarify that quotes are necessary when specifying font name in crostini (#1934) --- README.md | 2 +- font.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ee231a2c..fcb8096c 100644 --- a/README.md +++ b/README.md @@ -714,7 +714,7 @@ If you are using a different terminal, proceed with manual font installation. all new terminals. - Crostini (Linux on Chrome OS): Open chrome-untrusted://terminal/html/nassh_preferences_editor.html, set *Text font family* to - `'MesloLGS NF'` and *Custom CSS (inline text)* to the following: + `'MesloLGS NF'` (including the quotes) and *Custom CSS (inline text)* to the following: ```css @font-face { font-family: "MesloLGS NF"; diff --git a/font.md b/font.md index 72343840..3390f5fa 100644 --- a/font.md +++ b/font.md @@ -119,7 +119,7 @@ If you are using a different terminal, proceed with manual font installation. all new terminals. - Crostini (Linux on Chrome OS): Open chrome-untrusted://terminal/html/nassh_preferences_editor.html, set *Text font family* to - `'MesloLGS NF'` and *Custom CSS (inline text)* to the following: + `'MesloLGS NF'` (including the quotes) and *Custom CSS (inline text)* to the following: ```css @font-face { font-family: "MesloLGS NF"; From 5d223b8351708685b8dd88b3e3556cbff4b95c1e Mon Sep 17 00:00:00 2001 From: phwt <28344318+phwt@users.noreply.github.com> Date: Tue, 30 Aug 2022 12:44:44 +0700 Subject: [PATCH 190/380] docs: update Windows Terminal font configuration --- README.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fcb8096c..5c628a75 100644 --- a/README.md +++ b/README.md @@ -647,11 +647,21 @@ If you are using a different terminal, proceed with manual font installation. *Custom font* under *Text Appearance* and select `MesloLGS NF Regular`. - **Windows Console Host** (the old thing): Click the icon in the top left corner, then *Properties → Font* and set *Font* to `MesloLGS NF`. - - **Windows Terminal** by Microsoft (the new thing): Open `settings.json` (Ctrl+Shift+,), - search for `fontFace` and set the value to `MesloLGS NF` for every profile. If you don't find - `fontFace`, add it under *profiles → defaults*. See [this settings file]( - https://raw.githubusercontent.com/romkatv/dotfiles-public/aba0e6c4657d705ed6c344d700d659977385f25c/dotfiles/microsoft-terminal-settings.json) + - **Windows Terminal** by Microsoft (the new thing): Open `settings.json` (Ctrl+,), + search for `font.face` and set the value to `MesloLGS NF` for every profile. If you don't find + `font.face`, add it under *profiles → defaults*. See [this settings file]( + https://raw.githubusercontent.com/romkatv/dotfiles-public/1843af92dbd8f6297de195a469362760e1748f58/dotfiles/microsoft-terminal-settings.json) for example. + ```json + { + "profiles": { + "defaults": { + "font": { + "face": "MesloLGS NF" + } + } + } + ``` - **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor → Color Scheme → Console Font*. Select *Use console font instead of the default* and set the font name to `MesloLGS NF`. From cbca1bd8c1259df640d77e06fb9385d8441ef746 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 31 Aug 2022 09:46:32 +0200 Subject: [PATCH 191/380] docs: set font in Windows Terminal through the Settings UI --- README.md | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 5c628a75..4f30eb07 100644 --- a/README.md +++ b/README.md @@ -647,21 +647,9 @@ If you are using a different terminal, proceed with manual font installation. *Custom font* under *Text Appearance* and select `MesloLGS NF Regular`. - **Windows Console Host** (the old thing): Click the icon in the top left corner, then *Properties → Font* and set *Font* to `MesloLGS NF`. - - **Windows Terminal** by Microsoft (the new thing): Open `settings.json` (Ctrl+,), - search for `font.face` and set the value to `MesloLGS NF` for every profile. If you don't find - `font.face`, add it under *profiles → defaults*. See [this settings file]( - https://raw.githubusercontent.com/romkatv/dotfiles-public/1843af92dbd8f6297de195a469362760e1748f58/dotfiles/microsoft-terminal-settings.json) - for example. - ```json - { - "profiles": { - "defaults": { - "font": { - "face": "MesloLGS NF" - } - } - } - ``` + - **Windows Terminal** by Microsoft (the new thing): Open *Settings* (Ctrl+,), click + either on the selected profile under *Profiles* or on *Defaults*, click *Appearance* and set + *Font face* to `MesloLGS NF`. - **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor → Color Scheme → Console Font*. Select *Use console font instead of the default* and set the font name to `MesloLGS NF`. From 3bfbb8294fd61d3fb9f75f944b178eb9c8c2c0f7 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 31 Aug 2022 09:47:53 +0200 Subject: [PATCH 192/380] sync fonts.md with README.md --- font.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/font.md b/font.md index 3390f5fa..429af320 100644 --- a/font.md +++ b/font.md @@ -52,11 +52,9 @@ If you are using a different terminal, proceed with manual font installation. *Custom font* under *Text Appearance* and select `MesloLGS NF Regular`. - **Windows Console Host** (the old thing): Click the icon in the top left corner, then *Properties → Font* and set *Font* to `MesloLGS NF`. - - **Windows Terminal** by Microsoft (the new thing): Open `settings.json` (Ctrl+Shift+,), - search for `fontFace` and set the value to `MesloLGS NF` for every profile. If you don't find - `fontFace`, add it under *profiles → defaults*. See [this settings file]( - https://raw.githubusercontent.com/romkatv/dotfiles-public/aba0e6c4657d705ed6c344d700d659977385f25c/dotfiles/microsoft-terminal-settings.json) - for example. + - **Windows Terminal** by Microsoft (the new thing): Open *Settings* (Ctrl+,), click + either on the selected profile under *Profiles* or on *Defaults*, click *Appearance* and set + *Font face* to `MesloLGS NF`. - **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor → Color Scheme → Console Font*. Select *Use console font instead of the default* and set the font name to `MesloLGS NF`. From 18f939d34445e314f58ed815794ea6337f54bfd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Srinivasan?= Date: Tue, 30 Aug 2022 17:03:37 -0700 Subject: [PATCH 193/380] Add references to Antidote MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Srinivasan --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fcb8096c..dd5a45ae 100644 --- a/README.md +++ b/README.md @@ -404,6 +404,7 @@ Powerlevel10k. - [Prezto](#prezto) - [Zim](#zim) - [Antibody](#antibody) +- [Antidote](#antidote) - [Antigen](#antigen) - [Zplug](#zplug) - [Zgen](#zgen) @@ -460,6 +461,10 @@ Add `zmodule romkatv/powerlevel10k --use degit` to `~/.zimrc` and run `zimfw ins Add `antibody bundle romkatv/powerlevel10k` to `~/.zshrc`. +### Antidote + +Add `romkatv/powerlevel10k` to `~/.zsh_plugins.txt`. + ### Antigen Add `antigen theme romkatv/powerlevel10k` to `~/.zshrc`. Make sure you have `antigen apply` @@ -815,6 +820,7 @@ The command to update Powerlevel10k depends on how it was installed. | [Prezto](#prezto) | `zprezto-update` | | [Zim](#zim) | `zimfw update` | | [Antigen](#antigen) | `antigen update` | +| [Antidote](#antidote) | `antidote update` | [Zplug](#zplug) | `zplug update` | | [Zgen](#zgen) | `zgen update` | | [Zplugin](#zplugin) | `zplugin update` | @@ -866,7 +872,8 @@ The command to update Powerlevel10k depends on how it was installed. | [Oh My Zsh](#oh-my-zsh) | `rm -rf -- ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k` | | [Prezto](#prezto) | n/a | | [Zim](#zim) | `zimfw uninstall` | - | [Antigen](#antigen) | `antigen purge romkatv/powerlevel10k` | + | [Antigen](#antigen) | `antigen purge romkatv/powerlevel10k` + | [Antidote](#antidote) | `antidote purge romkatv/powerlevel10k` | | [Zplug](#zplug) | `zplug clean` | | [Zgen](#zgen) | `zgen reset` | | [Zplugin](#zplugin) | `zplugin delete romkatv/powerlevel10k` | From 4bbb198a606b69dfb2d86ac33686e3d41f6d0141 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 4 Sep 2022 19:22:31 +0200 Subject: [PATCH 194/380] fix tables broken by the last commit --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9dc035cd..a0ce7d03 100644 --- a/README.md +++ b/README.md @@ -818,7 +818,7 @@ The command to update Powerlevel10k depends on how it was installed. | [Prezto](#prezto) | `zprezto-update` | | [Zim](#zim) | `zimfw update` | | [Antigen](#antigen) | `antigen update` | -| [Antidote](#antidote) | `antidote update` +| [Antidote](#antidote) | `antidote update` | | [Zplug](#zplug) | `zplug update` | | [Zgen](#zgen) | `zgen update` | | [Zplugin](#zplugin) | `zplugin update` | @@ -870,7 +870,7 @@ The command to update Powerlevel10k depends on how it was installed. | [Oh My Zsh](#oh-my-zsh) | `rm -rf -- ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k` | | [Prezto](#prezto) | n/a | | [Zim](#zim) | `zimfw uninstall` | - | [Antigen](#antigen) | `antigen purge romkatv/powerlevel10k` + | [Antigen](#antigen) | `antigen purge romkatv/powerlevel10k` | | [Antidote](#antidote) | `antidote purge romkatv/powerlevel10k` | | [Zplug](#zplug) | `zplug clean` | | [Zgen](#zgen) | `zgen reset` | From 957249a95c27c430aa55b55c0f4df9f5ced2bb39 Mon Sep 17 00:00:00 2001 From: hayas1 Date: Fri, 23 Sep 2022 20:54:49 +0900 Subject: [PATCH 195/380] Fix gcloud config directory --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index cf0c7f21..17e9bc89 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4647,9 +4647,9 @@ _p9k_gcloud_prefetch() { # P9K_GCLOUD_PROJECT is deprecated; it's always equal to P9K_GCLOUD_PROJECT_ID unset P9K_GCLOUD_CONFIGURATION P9K_GCLOUD_ACCOUNT P9K_GCLOUD_PROJECT P9K_GCLOUD_PROJECT_ID P9K_GCLOUD_PROJECT_NAME (( $+commands[gcloud] )) || return - _p9k_read_word ~/.config/gcloud/active_config || return + _p9k_read_word ${CLOUDSDK_CONFIG:-~/.config/gcloud}/active_config || return P9K_GCLOUD_CONFIGURATION=$_p9k__ret - if ! _p9k_cache_stat_get $0 ~/.config/gcloud/configurations/config_$P9K_GCLOUD_CONFIGURATION; then + if ! _p9k_cache_stat_get $0 ${CLOUDSDK_CONFIG:-~/.config/gcloud}/configurations/config_$P9K_GCLOUD_CONFIGURATION; then local pair account project_id pair="$(gcloud config configurations describe $P9K_GCLOUD_CONFIGURATION \ --format=$'value[separator="\1"](properties.core.account,properties.core.project)')" From 843dcf016710a4fe39f8ad65da2929f9128436fd Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 2 Oct 2022 18:34:25 +0200 Subject: [PATCH 196/380] survive broken FPATH (#10 --- config/p10k-classic.zsh | 2 +- config/p10k-lean-8colors.zsh | 2 +- config/p10k-lean.zsh | 2 +- config/p10k-pure.zsh | 2 +- config/p10k-rainbow.zsh | 2 +- config/p10k-robbyrussell.zsh | 2 +- gitstatus/mbuild | 4 +--- internal/p10k.zsh | 18 +++++++++--------- internal/wizard.zsh | 5 ++--- 9 files changed, 18 insertions(+), 21 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 12ba3c0b..459c243b 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -20,7 +20,7 @@ unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' # Zsh >= 5.1 is required. - autoload -Uz is-at-least && is-at-least 5.1 || return + [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return # The list of segments shown on the left. Fill it with the most important segments. typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 6eaa6564..8157875a 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -20,7 +20,7 @@ unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' # Zsh >= 5.1 is required. - autoload -Uz is-at-least && is-at-least 5.1 || return + [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return # The list of segments shown on the left. Fill it with the most important segments. typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 6b14d3d4..90953751 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -20,7 +20,7 @@ unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' # Zsh >= 5.1 is required. - autoload -Uz is-at-least && is-at-least 5.1 || return + [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return # The list of segments shown on the left. Fill it with the most important segments. typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( diff --git a/config/p10k-pure.zsh b/config/p10k-pure.zsh index 566c030d..97c1a207 100644 --- a/config/p10k-pure.zsh +++ b/config/p10k-pure.zsh @@ -29,7 +29,7 @@ unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' # Zsh >= 5.1 is required. - autoload -Uz is-at-least && is-at-least 5.1 || return + [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return # Prompt colors. local grey=242 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index a72fa65f..2f13370b 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -20,7 +20,7 @@ unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' # Zsh >= 5.1 is required. - autoload -Uz is-at-least && is-at-least 5.1 || return + [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return # The list of segments shown on the left. Fill it with the most important segments. typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( diff --git a/config/p10k-robbyrussell.zsh b/config/p10k-robbyrussell.zsh index a4cb8b2d..a59e222b 100644 --- a/config/p10k-robbyrussell.zsh +++ b/config/p10k-robbyrussell.zsh @@ -24,7 +24,7 @@ unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' # Zsh >= 5.1 is required. - autoload -Uz is-at-least && is-at-least 5.1 || return + [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return # Left prompt segments. typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(prompt_char dir vcs) diff --git a/gitstatus/mbuild b/gitstatus/mbuild index d3de3317..40316fdf 100755 --- a/gitstatus/mbuild +++ b/gitstatus/mbuild @@ -94,9 +94,7 @@ setopt no_unset extended_glob pipe_fail prompt_percent typeset_silent \ no_prompt_subst no_prompt_bang pushd_silent warn_create_global -autoload -Uz is-at-least - -if ! is-at-least 5.1 || [[ $ZSH_VERSION == 5.4.* ]]; then +if [[ $ZSH_VERSION != (5.<1->*|<6->.*) || $ZSH_VERSION == 5.4(|.*) ]]; then print -ru2 -- "[error] unsupported zsh version: $ZSH_VERSION" return 1 fi diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 17e9bc89..4e870737 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -20,7 +20,7 @@ if [[ $__p9k_sourced != 13 ]]; then return 1 fi -if ! autoload -Uz is-at-least || ! is-at-least 5.1; then +if [[ $ZSH_VERSION != (5.<1->*|<6->.*) ]]; then () { >&2 echo -E "You are using ZSH version $ZSH_VERSION. The minimum required version for Powerlevel10k is 5.1." >&2 echo -E "Type 'echo \$ZSH_VERSION' to see your current zsh version." @@ -31,7 +31,7 @@ if ! autoload -Uz is-at-least || ! is-at-least 5.1; then >&2 echo -E "The shell you are currently running is likely $cur." fi local other=${${:-zsh}:c} - if [[ -n $other ]] && $other -c 'autoload -Uz is-at-least && is-at-least 5.1' &>/dev/null; then + if [[ -n $other ]] && $other -c '[[ $ZSH_VERSION == (5.<1->*|<6->.*) ]]' &>/dev/null; then local other_v="$($other -c 'echo -E $ZSH_VERSION' 2>/dev/null)" if [[ -n $other_v && $other_v != $ZSH_VERSION ]]; then >&2 echo -E "You have $other with version $other_v but this is not what you are using." @@ -341,7 +341,7 @@ function _p9k_human_readable_bytes() { _p9k__ret=${${_p9k__ret%%0#}%.}$suf } -if is-at-least 5.4; then +if [[ $ZSH_VERSION == (5.<4->*|<6->.*) ]]; then function _p9k_print_params() { typeset -p -- "$@" } else # Cannot use `typeset -p` unconditionally because of bugs in zsh. @@ -7011,14 +7011,14 @@ function _p9k_reset_prompt() { # ZSH_PATCHLEVEL=zsh-5.4.2-159-gd8d9fee13. Released in 5.5. # # Fix: https://github.com/zsh-users/zsh/commit/64d13738357c9b9c212adbe17f271716abbcf6ea. -# ZSH_PATCHLEVEL=zsh-5.7.1-50-g64d137383. +# ZSH_PATCHLEVEL=zsh-5.7.1-50-g64d137383. Released in 5.7.2. # # Test: PROMPT="${(pl:$((COLUMNS))::-:)}<%1(l.%2(l.FAIL.PASS).FAIL)> " zsh -dfis <<= 50 )) - is-at-least 5.5 && ! is-at-least 5.7.2 + [[ $ZSH_VERSION == (5.<5->*|5.<6->*) || $ZSH_VERSION == 5.<7->* && $ZSH_VERSION != 5.7.<2->* ]] } typeset -g _p9k__param_pat @@ -7645,7 +7645,7 @@ function _p9k_on_widget_zle-keymap-select() { _p9k_check_visual_mode; __p9k_rese function _p9k_on_widget_overwrite-mode() { _p9k_check_visual_mode; __p9k_reset_state=2; } function _p9k_on_widget_vi-replace() { _p9k_check_visual_mode; __p9k_reset_state=2; } -if is-at-least 5.3; then +if [[ $ZSH_VERSION == (5.<3->*|<6->.*) ]]; then function _p9k_check_visual_mode() { [[ ${KEYMAP:-} == vicmd ]] || return 0 local region=${${REGION_ACTIVE:-0}/2/1} @@ -7822,7 +7822,7 @@ function _p9k_wrap_widgets() { typeset -gir __p9k_widgets_wrapped=1 local -a widget_list - if is-at-least 5.3; then + if [[ $ZSH_VERSION == (5.<3->*|<6->.*) ]]; then local -aU widget_list=( zle-line-pre-redraw zle-line-init @@ -8168,7 +8168,7 @@ _p9k_init_prompt() { _p9k_all_params_eq '_POWERLEVEL9K_*WHITESPACE_BETWEEN_RIGHT_SEGMENTS' ' ' && _p9k_all_params_eq '_POWERLEVEL9K_*RIGHT_RIGHT_WHITESPACE' ' ' && _p9k_all_params_eq '_POWERLEVEL9K_*RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL' '' && - ! is-at-least 5.7.2; then + [[ $ZSH_VERSION != (5.7.<2->*|<6->.*) ]]; then _p9k_emulate_zero_rprompt_indent=1 _p9k_prompt_prefix_left+='${${:-${_p9k__real_zle_rprompt_indent:=$ZLE_RPROMPT_INDENT}${ZLE_RPROMPT_INDENT::=1}${_p9k__ind::=0}}+}' _p9k_line_suffix_right[-1]='${_p9k__sss:+${_p9k__sss% }%E}}' @@ -8839,7 +8839,7 @@ typeset -gi __p9k_configured=0 typeset -gri __p9k_instant_prompt_disabled=1 # `typeset -g` doesn't roundtrip in zsh prior to 5.4. -if is-at-least 5.4; then +if [[ $ZSH_VERSION == (5.<4->*|<6->.*) ]]; then typeset -gri __p9k_dumps_enabled=1 else typeset -gri __p9k_dumps_enabled=0 diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 2ffb606c..99cf63ad 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1449,7 +1449,7 @@ function print_instant_prompt_link() { } function ask_instant_prompt() { - if ! is-at-least 5.4; then + if [[ $ZSH_VERSION != (5.<4->*|<6->.*) ]]; then instant_prompt=off options+=instant_prompt=auto-off return 0 @@ -2008,9 +2008,8 @@ else fi zmodload zsh/terminfo || return -autoload -Uz is-at-least || return -if is-at-least 5.7.1 && [[ $COLORTERM == (24bit|truecolor) ]]; then +if [[ $ZSH_VERSION == (5.7.<1->*|<6->.*) && $COLORTERM == (24bit|truecolor) ]]; then local -ir has_truecolor=1 else local -ir has_truecolor=0 From cf1b58651505a3d5799a7f6bb5b8ce964c729c51 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 5 Oct 2022 10:23:04 +0200 Subject: [PATCH 197/380] fix bugs introduced in 843dcf016710a4fe39f8ad65da2929f9128436fd --- internal/p10k.zsh | 10 +++++----- internal/wizard.zsh | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 4e870737..08aacf79 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -31,8 +31,8 @@ if [[ $ZSH_VERSION != (5.<1->*|<6->.*) ]]; then >&2 echo -E "The shell you are currently running is likely $cur." fi local other=${${:-zsh}:c} - if [[ -n $other ]] && $other -c '[[ $ZSH_VERSION == (5.<1->*|<6->.*) ]]' &>/dev/null; then - local other_v="$($other -c 'echo -E $ZSH_VERSION' 2>/dev/null)" + if [[ -n $other ]] && $other -fc '[[ $ZSH_VERSION == (5.<1->*|<6->.*) ]]' &>/dev/null; then + local other_v="$($other -fc 'echo -E $ZSH_VERSION' 2>/dev/null)" if [[ -n $other_v && $other_v != $ZSH_VERSION ]]; then >&2 echo -E "You have $other with version $other_v but this is not what you are using." if [[ -n $def && $def != ${other:A} ]]; then @@ -7018,7 +7018,7 @@ function _p9k_reset_prompt() { function _p9k_prompt_overflow_bug() { [[ $ZSH_PATCHLEVEL =~ '^zsh-5\.4\.2-([0-9]+)-' ]] && return $(( match[1] < 159 )) [[ $ZSH_PATCHLEVEL =~ '^zsh-5\.7\.1-([0-9]+)-' ]] && return $(( match[1] >= 50 )) - [[ $ZSH_VERSION == (5.<5->*|5.<6->*) || $ZSH_VERSION == 5.<7->* && $ZSH_VERSION != 5.7.<2->* ]] + [[ $ZSH_VERSION == 5.<5-7>* && $ZSH_VERSION != 5.7.<2->* ]] } typeset -g _p9k__param_pat @@ -8168,7 +8168,7 @@ _p9k_init_prompt() { _p9k_all_params_eq '_POWERLEVEL9K_*WHITESPACE_BETWEEN_RIGHT_SEGMENTS' ' ' && _p9k_all_params_eq '_POWERLEVEL9K_*RIGHT_RIGHT_WHITESPACE' ' ' && _p9k_all_params_eq '_POWERLEVEL9K_*RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL' '' && - [[ $ZSH_VERSION != (5.7.<2->*|<6->.*) ]]; then + [[ $ZSH_VERSION != (5.7.<2->*|5.<8->*|<6->.*) ]]; then _p9k_emulate_zero_rprompt_indent=1 _p9k_prompt_prefix_left+='${${:-${_p9k__real_zle_rprompt_indent:=$ZLE_RPROMPT_INDENT}${ZLE_RPROMPT_INDENT::=1}${_p9k__ind::=0}}+}' _p9k_line_suffix_right[-1]='${_p9k__sss:+${_p9k__sss% }%E}}' @@ -8306,7 +8306,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v135\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v136\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$__p9k_force_term_shell_integration$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 99cf63ad..2bed68bf 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -2009,7 +2009,7 @@ fi zmodload zsh/terminfo || return -if [[ $ZSH_VERSION == (5.7.<1->*|<6->.*) && $COLORTERM == (24bit|truecolor) ]]; then +if [[ $ZSH_VERSION == (5.7.<1->*|5.<8>*|<6->.*) && $COLORTERM == (24bit|truecolor) ]]; then local -ir has_truecolor=1 else local -ir has_truecolor=0 From 5ee784787fe3c1855ee6f365cbf045712843989e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 5 Oct 2022 11:26:40 +0200 Subject: [PATCH 198/380] fix a bug introduced in cf1b58651505a3d5799a7f6bb5b8ce964c729c51 --- internal/wizard.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 2bed68bf..64695f1a 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -2009,7 +2009,7 @@ fi zmodload zsh/terminfo || return -if [[ $ZSH_VERSION == (5.7.<1->*|5.<8>*|<6->.*) && $COLORTERM == (24bit|truecolor) ]]; then +if [[ $ZSH_VERSION == (5.7.<1->*|5.<8->*|<6->.*) && $COLORTERM == (24bit|truecolor) ]]; then local -ir has_truecolor=1 else local -ir has_truecolor=0 From efffc87cf54eb4609fa960ba28b04221b08d56dc Mon Sep 17 00:00:00 2001 From: Max Mathys Date: Sat, 8 Oct 2022 13:05:32 +0200 Subject: [PATCH 199/380] Rename "mainland China" to "China" --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a0ce7d03..5897827e 100644 --- a/README.md +++ b/README.md @@ -423,7 +423,7 @@ git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc ``` -Users in mainland China can use the official mirror on gitee.com for faster download.
+Users in China can use the official mirror on gitee.com for faster download.
中国大陆用户可以使用 gitee.com 上的官方镜像加速下载. ```zsh @@ -441,7 +441,7 @@ make sure to disable the current theme in your plugin manager. See ```zsh git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k ``` - Users in mainland China can use the official mirror on gitee.com for faster download.
+ Users in China can use the official mirror on gitee.com for faster download.
中国大陆用户可以使用 gitee.com 上的官方镜像加速下载. ```zsh From 3e952468aac3823324430f5212fecb2a9f916ca5 Mon Sep 17 00:00:00 2001 From: Max Mathys Date: Sat, 8 Oct 2022 13:07:13 +0200 Subject: [PATCH 200/380] "mainland China" to "China" --- gitstatus/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitstatus/README.md b/gitstatus/README.md index 0fcf098b..b8d86163 100644 --- a/gitstatus/README.md +++ b/gitstatus/README.md @@ -35,7 +35,7 @@ git clone --depth=1 https://github.com/romkatv/gitstatus.git ~/gitstatus echo 'source ~/gitstatus/gitstatus.prompt.zsh' >>! ~/.zshrc ``` -Users in mainland China can use the official mirror on gitee.com for faster download.
+Users in China can use the official mirror on gitee.com for faster download.
中国大陆用户可以使用 gitee.com 上的官方镜像加速下载. ```zsh @@ -136,7 +136,7 @@ git clone --depth=1 https://github.com/romkatv/gitstatus.git ~/gitstatus echo 'source ~/gitstatus/gitstatus.prompt.sh' >> ~/.bashrc ``` -Users in mainland China can use the official mirror on gitee.com for faster download.
+Users in China can use the official mirror on gitee.com for faster download.
中国大陆用户可以使用 gitee.com 上的官方镜像加速下载. ```bash From bd0c9f4ec7511f51851f9bde0e2e24b05fd1c10e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 9 Oct 2022 11:54:02 +0200 Subject: [PATCH 201/380] rename arch to cpu_arch and rewrite it (#1752) --- config/p10k-classic.zsh | 17 ++++++++++++----- config/p10k-lean-8colors.zsh | 17 ++++++++++++----- config/p10k-lean.zsh | 17 ++++++++++++----- config/p10k-rainbow.zsh | 18 +++++++++++++----- internal/icons.zsh | 11 ++++++----- internal/p10k.zsh | 24 ++++++++++++++++-------- 6 files changed, 71 insertions(+), 33 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 15242372..24c4022b 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -95,7 +95,7 @@ todo # todo items (https://github.com/todotxt/todo.txt-cli) timewarrior # timewarrior tracking status (https://timewarrior.net/) taskwarrior # taskwarrior task count (https://taskwarrior.org/) - # arch # current CPU Architecture + # cpu_arch # CPU architecture # time # current time # =========================[ Line #2 ]========================= newline # \n @@ -861,6 +861,17 @@ # Custom icon. # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + ################################[ cpu_arch: CPU architecture ]################################ + # CPU architecture color. + typeset -g POWERLEVEL9K_CPU_ARCH_FOREGROUND=172 + + # Hide the segment when on a specific CPU architecture. + # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_CONTENT_EXPANSION= + # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_VISUAL_IDENTIFIER_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_CPU_ARCH_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################################[ context: user@hostname ]################################## # Context color when running with privileges. typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=178 @@ -1561,10 +1572,6 @@ # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) - ##############################[ arch: current cup architecture ]############################## - # Default CPU Aricheture (section is hidden when current architecture matches default) - # typeset -g POWERLEVEL9K_ARCH_DEFAULT='i386' - ####################################[ time: current time ]#################################### # Current time color. typeset -g POWERLEVEL9K_TIME_FOREGROUND=66 diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 4137f0e2..1d2962a0 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -94,7 +94,7 @@ todo # todo items (https://github.com/todotxt/todo.txt-cli) timewarrior # timewarrior tracking status (https://timewarrior.net/) taskwarrior # taskwarrior task count (https://taskwarrior.org/) - # arch # current CPU Architecture + # cpu_arch # CPU architecture # time # current time # =========================[ Line #2 ]========================= newline # \n @@ -842,6 +842,17 @@ # Custom icon. # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + ################################[ cpu_arch: CPU architecture ]################################ + # CPU architecture color. + typeset -g POWERLEVEL9K_CPU_ARCH_FOREGROUND=3 + + # Hide the segment when on a specific CPU architecture. + # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_CONTENT_EXPANSION= + # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_VISUAL_IDENTIFIER_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_CPU_ARCH_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################################[ context: user@hostname ]################################## # Context color when running with privileges. typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=1 @@ -1542,10 +1553,6 @@ # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) - ##############################[ arch: current cup architecture ]############################## - # Default CPU Aricheture (section is hidden when current architecture matches default) - # typeset -g POWERLEVEL9K_ARCH_DEFAULT='i386' - ####################################[ time: current time ]#################################### # Current time color. typeset -g POWERLEVEL9K_TIME_FOREGROUND=6 diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 55f9bdd0..98bb8145 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -94,7 +94,7 @@ todo # todo items (https://github.com/todotxt/todo.txt-cli) timewarrior # timewarrior tracking status (https://timewarrior.net/) taskwarrior # taskwarrior task count (https://taskwarrior.org/) - # arch # current CPU Architecture + # cpu_arch # CPU architecture # time # current time # =========================[ Line #2 ]========================= newline @@ -838,6 +838,17 @@ # Custom icon. # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + ################################[ cpu_arch: CPU architecture ]################################ + # CPU architecture color. + typeset -g POWERLEVEL9K_CPU_ARCH_FOREGROUND=172 + + # Hide the segment when on a specific CPU architecture. + # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_CONTENT_EXPANSION= + # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_VISUAL_IDENTIFIER_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_CPU_ARCH_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################################[ context: user@hostname ]################################## # Context color when running with privileges. typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=178 @@ -1538,10 +1549,6 @@ # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) - ##############################[ arch: current cup architecture ]############################## - # Default CPU Aricheture (section is hidden when current architecture matches default) - # typeset -g POWERLEVEL9K_ARCH_DEFAULT='i386' - ####################################[ time: current time ]#################################### # Current time color. typeset -g POWERLEVEL9K_TIME_FOREGROUND=66 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index a8d2946b..c12c286c 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -95,7 +95,7 @@ todo # todo items (https://github.com/todotxt/todo.txt-cli) timewarrior # timewarrior tracking status (https://timewarrior.net/) taskwarrior # taskwarrior task count (https://taskwarrior.org/) - # arch # current CPU Architecture + # cpu_arch # CPU architecture # time # current time # =========================[ Line #2 ]========================= newline @@ -896,6 +896,18 @@ # Custom icon. # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + ################################[ cpu_arch: CPU architecture ]################################ + # CPU architecture color. + typeset -g POWERLEVEL9K_CPU_ARCH_FOREGROUND=0 + typeset -g POWERLEVEL9K_CPU_ARCH_BACKGROUND=3 + + # Hide the segment when on a specific CPU architecture. + # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_CONTENT_EXPANSION= + # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_VISUAL_IDENTIFIER_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_CPU_ARCH_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################################[ context: user@hostname ]################################## # Context color when running with privileges. typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=1 @@ -1646,10 +1658,6 @@ # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) - ##############################[ arch: current cup architecture ]############################## - # Default CPU Aricheture (section is hidden when current architecture matches default) - # typeset -g POWERLEVEL9K_ARCH_DEFAULT='i386' - ####################################[ time: current time ]#################################### # Current time color. typeset -g POWERLEVEL9K_TIME_FOREGROUND=0 diff --git a/internal/icons.zsh b/internal/icons.zsh index c67bc45d..d38cf7bd 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -148,7 +148,7 @@ function _p9k_init_icons() { JULIA_ICON 'jl' SCALA_ICON 'scala' TOOLBOX_ICON '\u2B22' # ⬢ - ARCH_ICON '\uE205' #  + ARCH_ICON 'arch' ) ;; 'awesome-fontconfig') @@ -281,7 +281,7 @@ function _p9k_init_icons() { JULIA_ICON 'jl' SCALA_ICON 'scala' TOOLBOX_ICON '\u2B22' # ⬢ - ARCH_ICON '\uE205' #  + ARCH_ICON 'arch' ) ;; 'awesome-mapped-fontconfig') @@ -417,7 +417,7 @@ function _p9k_init_icons() { JULIA_ICON 'jl' SCALA_ICON 'scala' TOOLBOX_ICON '\u2B22' # ⬢ - ARCH_ICON '\uE205' #  + ARCH_ICON 'arch' ) ;; 'nerdfont-complete'|'nerdfont-fontconfig') @@ -551,7 +551,7 @@ function _p9k_init_icons() { JULIA_ICON '\uE624' #  SCALA_ICON '\uE737' #  TOOLBOX_ICON '\uE20F'$s #  - ARCH_ICON '\uE266' + ARCH_ICON '\uE266' #  ) ;; ascii) @@ -682,6 +682,7 @@ function _p9k_init_icons() { JULIA_ICON 'jl' SCALA_ICON 'scala' TOOLBOX_ICON 'toolbox' + ARCH_ICON 'arch' ) ;; *) @@ -814,7 +815,7 @@ function _p9k_init_icons() { JULIA_ICON 'jl' SCALA_ICON 'scala' TOOLBOX_ICON '\u2B22' # ⬢ - ARCH_ICON '\uE205' #  + ARCH_ICON 'arch' ) ;; esac diff --git a/internal/p10k.zsh b/internal/p10k.zsh index f9e38f84..b21b57bf 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5646,18 +5646,26 @@ _p9k_prompt_haskell_stack_init() { ################################################################ # CPU Architecture -prompt_arch() { - if ! _p9k_cache_ephemeral_get $0 ; then - _p9k_cache_ephemeral_set $(arch) +prompt_cpu_arch() { + local -i len=$#_p9k__prompt _p9k__has_upglob + + local state text + if _p9k_cache_ephemeral_get $0; then + state=$_p9k__cache_val[1] + text=$_p9k__cache_val[2] + else + text=$(command arch) 2>/dev/null && [[ $text == [a-zA-Z][a-zA-Z0-9_]# ]] || text= + state=_${(U)text} + _p9k_cache_ephemeral_set "$state" "$text" fi - [[ $_p9k__cache_val[1] == $POWERLEVEL9K_ARCH_DEFAULT ]] && return - _p9k_prompt_segment "$0" "$_p9k_color1" "orange1" 'ARCH_ICON' 0 '' "$_p9k__cache_val[1]" + if [[ -n $text ]]; then + _p9k_prompt_segment "$0$state" "yellow" "$_p9k_color1" 'ARCH_ICON' 0 '' "$text" + fi + + (( _p9k__has_upglob )) || typeset -g "_p9k__segment_val_${_p9k__prompt_side}[_p9k__segment_index]"=$_p9k__prompt[len+1,-1] } -instant_prompt_arch() { prompt_arch; } - _p9k_prompt_arch_init() { - echo 'arch init' >> ~/p9k_debug.txt typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$commands[arch]' } From ed1b02efd5f7691d72cf9b657d939e3adc31034c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 9 Oct 2022 11:58:40 +0200 Subject: [PATCH 202/380] Squashed 'gitstatus/' changes from 6dc0738c0..4b47ca047 4b47ca047 docs: s/mainland China/China/ b74da1403 docs: fix grammar fc27662b4 Merge branch 'andresrinivasan-patch-1' ad739b2b0 Clarify that gitstatus is included with Powerlevel10k git-subtree-dir: gitstatus git-subtree-split: 4b47ca047be1d482dbebec7279386a9365b946c6 --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0fcf098b..82a19981 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,8 @@ Bash bindings for integration with shell. The easiest way to take advantage of gitstatus from Zsh is to use a theme that's already integrated with it. For example, [Powerlevel10k](https://github.com/romkatv/powerlevel10k) is a flexible and -fast theme with first-class gitstatus integration. +fast theme with first-class gitstatus integration. If you install Powerlevel10k, you don't need to +install gitstatus. ![Powerlevel10k Zsh Theme]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/prompt-styles-high-contrast.png) @@ -35,7 +36,7 @@ git clone --depth=1 https://github.com/romkatv/gitstatus.git ~/gitstatus echo 'source ~/gitstatus/gitstatus.prompt.zsh' >>! ~/.zshrc ``` -Users in mainland China can use the official mirror on gitee.com for faster download.
+Users in China can use the official mirror on gitee.com for faster download.
中国大陆用户可以使用 gitee.com 上的官方镜像加速下载. ```zsh @@ -136,7 +137,7 @@ git clone --depth=1 https://github.com/romkatv/gitstatus.git ~/gitstatus echo 'source ~/gitstatus/gitstatus.prompt.sh' >> ~/.bashrc ``` -Users in mainland China can use the official mirror on gitee.com for faster download.
+Users in China can use the official mirror on gitee.com for faster download.
中国大陆用户可以使用 gitee.com 上的官方镜像加速下载. ```bash @@ -491,7 +492,7 @@ cd gitstatus ./build -w -s -d docker ``` -Users in mainland China can use the official mirror on gitee.com for faster download.
+Users in China can use the official mirror on gitee.com for faster download.
中国大陆用户可以使用 gitee.com 上的官方镜像加速下载. ```zsh From b8c6c6f42f8b40fb7668bcb23c4abbd416234fc1 Mon Sep 17 00:00:00 2001 From: Hartley McGuire Date: Tue, 25 Oct 2022 17:49:05 -0400 Subject: [PATCH 203/380] Add chruby config to hide RUBY_ENGINE when "ruby" Previously, the chruby segment looks like this for standard and non-standard ruby implementations respectively: ``` Ruby ruby 3.1.2 Ruby truffleruby 3.0.3 ``` While displaying the RUBY_ENGINE is helpful for non-standard implementations, showing it for "ruby" results in "Ruby ruby" which feels redundant. This commit adds a new configuration option to disable showing the RUBY_ENGINE when it is "ruby". Other values for RUBY_ENGINE will always display as before: ``` Ruby 3.1.2 Ruby truffleruby 3.0.3 ``` This also makes the formatting more similar to the asdf segment: ``` Ruby 3.1.2 Ruby truffleruby-22.3.0 ``` --- internal/p10k.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index b21b57bf..6cf6e6b5 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3139,7 +3139,9 @@ _p9k_prompt_perlbrew_init() { # see https://github.com/postmodern/chruby/issues/245 for chruby_auto issue with ZSH prompt_chruby() { local v - (( _POWERLEVEL9K_CHRUBY_SHOW_ENGINE )) && v=$RUBY_ENGINE + if (( _POWERLEVEL9K_CHRUBY_SHOW_ENGINE )) && [[ "$RUBY_ENGINE" != "ruby" || $_POWERLEVEL9K_CHRUBY_SHOW_ENGINE_IF_RUBY == 1 ]]; then + v=$RUBY_ENGINE + fi if [[ $_POWERLEVEL9K_CHRUBY_SHOW_VERSION == 1 && -n $RUBY_VERSION ]] && v+=${v:+ }$RUBY_VERSION _p9k_prompt_segment "$0" "red" "$_p9k_color1" 'RUBY_ICON' 0 '' "${v//\%/%%}" } @@ -7534,6 +7536,7 @@ _p9k_init_params() { _p9k_declare -b POWERLEVEL9K_RVM_SHOW_PREFIX 0 _p9k_declare -b POWERLEVEL9K_CHRUBY_SHOW_VERSION 1 _p9k_declare -b POWERLEVEL9K_CHRUBY_SHOW_ENGINE 1 + _p9k_declare -b POWERLEVEL9K_CHRUBY_SHOW_ENGINE_IF_RUBY 1 _p9k_declare -b POWERLEVEL9K_STATUS_CROSS 0 _p9k_declare -b POWERLEVEL9K_STATUS_OK 1 _p9k_declare -b POWERLEVEL9K_STATUS_OK_PIPE 1 From 5a3109e40d2843d5e93d238568abaf5d5bc5d85a Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 2 Nov 2022 15:55:35 +0100 Subject: [PATCH 204/380] replace POWERLEVEL9K_CHRUBY_SHOW_ENGINE_IF_RUBY with POWERLEVEL9K_CHRUBY_SHOW_ENGINE_PATTERN (#2072) POWERLEVEL9K_CHRUBY_SHOW_ENGINE_PATTERN defines a pattern that RUBY_ENGINE should match for it to be shown. Matching is done with extended_glob. For example, to show all values of RUBY_ENGINE except "ruby": POWERLEVEL9K_CHRUBY_SHOW_ENGINE_PATTERN='^ruby' If POWERLEVEL9K_CHRUBY_SHOW_ENGINE_PATTERN is unset and POWERLEVEL9K_CHRUBY_SHOW_ENGINE is set to true, the behavior is the same as if POWERLEVEL9K_CHRUBY_SHOW_ENGINE_PATTERN was set to *. --- internal/p10k.zsh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 6cf6e6b5..70c83c7b 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3138,11 +3138,8 @@ _p9k_prompt_perlbrew_init() { # Segment to display chruby information # see https://github.com/postmodern/chruby/issues/245 for chruby_auto issue with ZSH prompt_chruby() { - local v - if (( _POWERLEVEL9K_CHRUBY_SHOW_ENGINE )) && [[ "$RUBY_ENGINE" != "ruby" || $_POWERLEVEL9K_CHRUBY_SHOW_ENGINE_IF_RUBY == 1 ]]; then - v=$RUBY_ENGINE - fi - if [[ $_POWERLEVEL9K_CHRUBY_SHOW_VERSION == 1 && -n $RUBY_VERSION ]] && v+=${v:+ }$RUBY_VERSION + local v=${(M)RUBY_ENGINE:#$~_POWERLEVEL9K_CHRUBY_SHOW_ENGINE_PATTERN} + [[ $_POWERLEVEL9K_CHRUBY_SHOW_VERSION == 1 && -n $RUBY_VERSION ]] && v+=${v:+ }$RUBY_VERSION _p9k_prompt_segment "$0" "red" "$_p9k_color1" 'RUBY_ICON' 0 '' "${v//\%/%%}" } @@ -7536,7 +7533,10 @@ _p9k_init_params() { _p9k_declare -b POWERLEVEL9K_RVM_SHOW_PREFIX 0 _p9k_declare -b POWERLEVEL9K_CHRUBY_SHOW_VERSION 1 _p9k_declare -b POWERLEVEL9K_CHRUBY_SHOW_ENGINE 1 - _p9k_declare -b POWERLEVEL9K_CHRUBY_SHOW_ENGINE_IF_RUBY 1 + _p9k_declare -s POWERLEVEL9K_CHRUBY_SHOW_ENGINE_PATTERN + if (( _POWERLEVEL9K_CHRUBY_SHOW_ENGINE )); then + : ${_POWERLEVEL9K_CHRUBY_SHOW_ENGINE_PATTERN=*} + fi _p9k_declare -b POWERLEVEL9K_STATUS_CROSS 0 _p9k_declare -b POWERLEVEL9K_STATUS_OK 1 _p9k_declare -b POWERLEVEL9K_STATUS_OK_PIPE 1 @@ -8334,7 +8334,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v136\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v137\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$__p9k_force_term_shell_integration$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' From 8c55eb4fa3a33f9a0a5c52775a253ad3b18b988c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 14 Nov 2022 14:26:12 +0100 Subject: [PATCH 205/380] wizad: add a hint pointing to the frame when asking for frame color --- internal/wizard.zsh | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 64695f1a..7b6de601 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -988,6 +988,15 @@ function ask_color() { return 0 } +function print_frame_marker() { + local label="(1) $color_name[1]." + local -i n='wizard_columns - 7' + local -i m=$((n - $#label)) + print -P "${(l:$n:: :)}frame" + print -P "%B$label%b${(l:$m:: :)} |" + print -P "${(l:$n:: :)} v" +} + function ask_ornaments_color() { [[ $style != (rainbow|lean*) || $num_lines == 1 ]] && return [[ $gap_char == ' ' && $left_frame == 0 && $right_frame == 0 ]] && return @@ -995,10 +1004,17 @@ function ask_ornaments_color() { [[ $gap_char != ' ' ]] && ornaments+=Connection (( left_frame || right_frame )) && ornaments+=Frame add_widget 0 flowing -c "%B${(j: & :)ornaments} Color%b" - add_widget 0 print - add_widget 1 - add_widget 0 print -P "%B(1) $color_name[1].%b" - add_prompt color=1 + if (( left_frame || right_frame )); then + add_widget 0 print_frame_marker + add_widget 3 print -P "%B(1) $color_name[1].%b" + add_prompt_n color=1 + add_widget 0 print + add_widget 2 + else + add_widget 1 + add_widget 0 print -P "%B(1) $color_name[1].%b" + add_prompt color=1 + fi add_widget 0 print -P "%B(2) $color_name[2].%b" add_prompt color=2 add_widget 0 print -P "%B(3) $color_name[3].%b" From 5691a418e09ccc982cf8f58d40849d46be01be2c Mon Sep 17 00:00:00 2001 From: Jonathan Sambrook Date: Mon, 14 Nov 2022 13:27:46 +0000 Subject: [PATCH 206/380] Prefer `ip` over `ifconfig` for i/f detection. `ifconfig`'s formatting doesn't cope well with long interface names. In these cases it will eat up the whitespace separating the name from the text "Link" in the output, which makes parsing the output problematic. e.g. `ifconfig`: wlp0s20f0u2Link encap:Ethernet HWaddr 00:AA:BB:CC:DD:EE v.s `ip`: 21: wlp0s20f0u2: mtu 1500 qdisc \ mq state UP group default qlen 1000 This commit swaps the order of detection inside `_p9k_prompt_net_iface_async()`, so that `ip` will be preferred. `ifconfig` is deprecated by distros in favour of `ip`, so this will often be an incredibly marginal performance boost :) NOTE: this commit does not address the problem with using `ifconfig`. I don't understand the zsh regex, so have not touched it. --- internal/p10k.zsh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 70c83c7b..9a8f52d6 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5721,19 +5721,19 @@ function _p9k_prompt_net_iface_async() { # netstat -inbI en0 local iface ip line var typeset -a iface2ip ips ifaces - if (( $+commands[ifconfig] )); then - for line in ${(f)"$(command ifconfig 2>/dev/null)"}; do - if [[ $line == (#b)([^[:space:]]##):[[:space:]]##flags=([[:xdigit:]]##)'<'* ]]; then - [[ $match[2] == *[13579bdfBDF] ]] && iface=$match[1] || iface= + if (( $+commands[ip] )); then + for line in ${(f)"$(command ip -4 a show 2>/dev/null)"}; do + if [[ $line == (#b)<->:[[:space:]]##([^:]##):[[:space:]]##\<([^\>]#)\>* ]]; then + [[ ,$match[2], == *,UP,* ]] && iface=$match[1] || iface= elif [[ -n $iface && $line == (#b)[[:space:]]##inet[[:space:]]##([0-9.]##)* ]]; then iface2ip+=($iface $match[1]) iface= fi done - elif (( $+commands[ip] )); then - for line in ${(f)"$(command ip -4 a show 2>/dev/null)"}; do - if [[ $line == (#b)<->:[[:space:]]##([^:]##):[[:space:]]##\<([^\>]#)\>* ]]; then - [[ ,$match[2], == *,UP,* ]] && iface=$match[1] || iface= + elif (( $+commands[ifconfig] )); then + for line in ${(f)"$(command ifconfig 2>/dev/null)"}; do + if [[ $line == (#b)([^[:space:]]##):[[:space:]]##flags=([[:xdigit:]]##)'<'* ]]; then + [[ $match[2] == *[13579bdfBDF] ]] && iface=$match[1] || iface= elif [[ -n $iface && $line == (#b)[[:space:]]##inet[[:space:]]##([0-9.]##)* ]]; then iface2ip+=($iface $match[1]) iface= From d5123401be1933c955efdad0f9eb7197a0ee7415 Mon Sep 17 00:00:00 2001 From: shwcsmack Date: Wed, 16 Nov 2022 17:08:59 -0600 Subject: [PATCH 207/380] Add reference to Zap plugin manager I added a reference in the Readme for my favorite ZSH package manager: Zap --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 5897827e..2a96db38 100644 --- a/README.md +++ b/README.md @@ -411,6 +411,7 @@ Powerlevel10k. - [Zplugin](#zplugin) - [Zinit](#zinit) - [Zi](#zi) +- [Zap](#zap) - [Homebrew](#homebrew) - [Arch Linux](#arch-linux) - [Alpine Linux](#arch-linux) @@ -499,6 +500,13 @@ Add `zi ice depth=1; zi light romkatv/powerlevel10k` to `~/.zshrc`. The use of `depth=1` ice is optional. Other types of ice are neither recommended nor officially supported by Powerlevel10k. +### Zap + +Add `plug "romkatv/powerlevel10k"` to `~/.zshrc`. Then, +```zsh +source ~/.zshrc +``` + ### Homebrew ```zsh @@ -824,6 +832,7 @@ The command to update Powerlevel10k depends on how it was installed. | [Zplugin](#zplugin) | `zplugin update` | | [Zinit](#zinit) | `zinit update` | | [Zi](#zi) | `zi update` | +| [Zap](#zap) | `zap --update` | | [Homebrew](#homebrew) | `brew update && brew upgrade` | | [Arch Linux](#arch-linux) | `yay -S --noconfirm zsh-theme-powerlevel10k-git` | | [Alpine Linux](#alpine-linux) | `apk update && apk upgrade` | From cf83ab21e440ffa276a13ab5fd63b6372b674b5e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 17 Nov 2022 10:22:27 +0100 Subject: [PATCH 208/380] fix a bug in zap install instructions and add uninstall instructions (#2093) --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2a96db38..bd27a04c 100644 --- a/README.md +++ b/README.md @@ -502,10 +502,7 @@ supported by Powerlevel10k. ### Zap -Add `plug "romkatv/powerlevel10k"` to `~/.zshrc`. Then, -```zsh -source ~/.zshrc -``` +Add `plug "romkatv/powerlevel10k"` to `~/.zshrc`. ### Homebrew @@ -886,6 +883,7 @@ The command to update Powerlevel10k depends on how it was installed. | [Zplugin](#zplugin) | `zplugin delete romkatv/powerlevel10k` | | [Zinit](#zinit) | `zinit delete romkatv/powerlevel10k` | | [Zi](#zi) | `zi delete romkatv/powerlevel10k` | + | [Zap](#zap) | `zsh -ic 'zap --clean'` | | [Homebrew](#homebrew) | `brew uninstall powerlevel10k; brew untap romkatv/powerlevel10k` | | [Arch Linux](#arch-linux) | `yay -R --noconfirm zsh-theme-powerlevel10k-git` | | [Alpine Linux](#alpine-linux) | `apk del zsh-theme-powerlevel10k` | From 176f781121c02af7c504746619eab910a457e935 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 27 Nov 2022 11:45:23 +0100 Subject: [PATCH 209/380] assume that dotnet version may depend on the content of global.json (#2103) --- internal/p10k.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 9a8f52d6..2e816714 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -2650,7 +2650,10 @@ prompt_dotnet_version() { if (( _POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY )); then _p9k_upglob 'project.json|global.json|packet.dependencies|*.csproj|*.fsproj|*.xproj|*.sln' && return fi - _p9k_cached_cmd 0 '' dotnet --version || return + + local cfg + _p9k_upglob global.json || cfg=$_p9k__parent_dirs[$?]/global.json + _p9k_cached_cmd 0 "$cfg" dotnet --version || return _p9k_prompt_segment "$0" "magenta" "white" 'DOTNET_ICON' 0 '' "$_p9k__ret" } @@ -8334,7 +8337,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v137\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v138\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$__p9k_force_term_shell_integration$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' From 8d47270e8c17672e9323373e4df3699cb43545ff Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 27 Nov 2022 15:37:04 +0100 Subject: [PATCH 210/380] don't invoke mktemp if it doesn't exist --- internal/wizard.zsh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 7b6de601..e8a7c1b1 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1565,8 +1565,11 @@ function ask_config_overwrite() { local tmpdir=/tmp local tmpdir_u=/tmp fi - config_backup="$(mktemp $tmpdir/$__p9k_cfg_basename.XXXXXXXXXX)" || quit -c - cp $__p9k_cfg_path $config_backup || quit -c + if (( ! $+commands[mktemp] )) || + ! config_backup=$(mktemp $tmpdir/$__p9k_cfg_basename.XXXXXXXXXX 2>/dev/null); then + config_backup=$tmpdir/$__p9k_cfg_basename.$EPOCHREALTIME + fi + cp $__p9k_cfg_path $config_backup || quit -c config_backup_u=$tmpdir_u/${(q-)config_backup:t} ;; esac @@ -2023,7 +2026,7 @@ else _p9k_can_configure -q || return fi -zmodload zsh/terminfo || return +zmodload zsh/terminfo zsh/datetime || return if [[ $ZSH_VERSION == (5.7.<1->*|5.<8->*|<6->.*) && $COLORTERM == (24bit|truecolor) ]]; then local -ir has_truecolor=1 From 6609767abd81aed3101cb67908df727998b0b619 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 28 Nov 2022 12:14:48 +0100 Subject: [PATCH 211/380] don't invoke mktemp if it doesn't exist --- internal/wizard.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index e8a7c1b1..f93fd0a3 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1638,7 +1638,10 @@ function ask_zshrc_edit() { local tmpdir=/tmp local tmpdir_u=/tmp fi - zshrc_backup="$(mktemp $tmpdir/.zshrc.XXXXXXXXXX)" || quit -c + if (( ! $+commands[mktemp] )) || + ! zshrc_backup="$(mktemp $tmpdir/.zshrc.XXXXXXXXXX 2>/dev/null)"; then + zshrc_backup=$tmpdir/.zshrc.$EPOCHREALTIME + fi cp -p $__p9k_zshrc $zshrc_backup || quit -c local -i writable=1 if [[ ! -w $zshrc_backup ]]; then From 45758d95fb43730f75b3f75c6c7034de7e81b7cf Mon Sep 17 00:00:00 2001 From: "Clark S. Cox" Date: Thu, 1 Dec 2022 16:08:09 -0800 Subject: [PATCH 212/380] Use "machine" where available for CPU arch This allows shells on macOS to display more specific CPU arch (e.g. a 64-bit intel machine will display "x86_64" instead of "i386") --- internal/p10k.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 2e816714..a5e004b3 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5656,7 +5656,9 @@ prompt_cpu_arch() { state=$_p9k__cache_val[1] text=$_p9k__cache_val[2] else - text=$(command arch) 2>/dev/null && [[ $text == [a-zA-Z][a-zA-Z0-9_]# ]] || text= + text=$(command machine) 2>/dev/null && [[ $text == [a-zA-Z][a-zA-Z0-9_]# ]] || + text=$(command arch) 2>/dev/null && [[ $text == [a-zA-Z][a-zA-Z0-9_]# ]] || + text= state=_${(U)text} _p9k_cache_ephemeral_set "$state" "$text" fi From edafcb5a7dbe809d40264643a55b72a25c3bbe05 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 2 Dec 2022 10:34:51 +0100 Subject: [PATCH 213/380] fix bugs in cpu_arch --- internal/p10k.zsh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index a5e004b3..b90b747e 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5656,10 +5656,16 @@ prompt_cpu_arch() { state=$_p9k__cache_val[1] text=$_p9k__cache_val[2] else - text=$(command machine) 2>/dev/null && [[ $text == [a-zA-Z][a-zA-Z0-9_]# ]] || - text=$(command arch) 2>/dev/null && [[ $text == [a-zA-Z][a-zA-Z0-9_]# ]] || - text= - state=_${(U)text} + local cmd + for cmd in machine arch; do + (( $+commands[$cmd] )) || continue + if text=$(command -- $cmd) 2>/dev/null && [[ $text == [a-zA-Z][a-zA-Z0-9_]# ]]; then + break + else + text= + fi + done + state=_${${(U)text}//İ/I} _p9k_cache_ephemeral_set "$state" "$text" fi if [[ -n $text ]]; then @@ -5669,8 +5675,8 @@ prompt_cpu_arch() { (( _p9k__has_upglob )) || typeset -g "_p9k__segment_val_${_p9k__prompt_side}[_p9k__segment_index]"=$_p9k__prompt[len+1,-1] } -_p9k_prompt_arch_init() { - typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$commands[arch]' +_p9k_prompt_cpu_arch_init() { + typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$commands[machine]$commands[arch]' } # Use two preexec hooks to survive https://github.com/MichaelAquilina/zsh-you-should-use with @@ -8339,7 +8345,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v138\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v139\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$__p9k_force_term_shell_integration$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' From a7bf4c83dee601f91aaabf3956c93f5ebe26699d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 2 Dec 2022 10:36:06 +0100 Subject: [PATCH 214/380] docs: add cpu_arch --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index bd27a04c..48768808 100644 --- a/README.md +++ b/README.md @@ -317,6 +317,7 @@ enable as many segments as you like. It won't slow down your prompt or Zsh start | `battery` | internal battery state and charge level (yep, batteries *literally* included) | | `command_execution_time` | duration (wall time) of the last command | | `context` | user@hostname | +| `cpu_arch` | CPU architecture | | `dir` | current working directory | | `direnv` | [direnv](https://direnv.net/) status | | `disk_usage` | disk usage | From 7f2950f9cc6d7ae805b4e9f365cc3340afc955a6 Mon Sep 17 00:00:00 2001 From: Leon Satoshi <118800175+0n3W4y7ick3t@users.noreply.github.com> Date: Sun, 11 Dec 2022 20:34:18 +0800 Subject: [PATCH 215/380] Update README.md change from China mainland to China in Mandarin --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 48768808..4b92bf7f 100644 --- a/README.md +++ b/README.md @@ -426,7 +426,7 @@ echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc ``` Users in China can use the official mirror on gitee.com for faster download.
-中国大陆用户可以使用 gitee.com 上的官方镜像加速下载. +中国用户可以使用 gitee.com 上的官方镜像加速下载. ```zsh git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ~/powerlevel10k @@ -444,7 +444,7 @@ make sure to disable the current theme in your plugin manager. See git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k ``` Users in China can use the official mirror on gitee.com for faster download.
- 中国大陆用户可以使用 gitee.com 上的官方镜像加速下载. + 中国用户可以使用 gitee.com 上的官方镜像加速下载. ```zsh git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k From 07b5a607d46672e88167608414cace36e134f971 Mon Sep 17 00:00:00 2001 From: Utkarsh Verma Date: Fri, 16 Dec 2022 19:55:25 +0530 Subject: [PATCH 216/380] Add lf segment --- README.md | 1 + config/p10k-classic.zsh | 7 +++++++ config/p10k-lean-8colors.zsh | 7 +++++++ config/p10k-lean.zsh | 6 ++++++ config/p10k-rainbow.zsh | 8 ++++++++ internal/icons.zsh | 6 ++++++ internal/p10k.zsh | 12 ++++++++++++ 7 files changed, 47 insertions(+) diff --git a/README.md b/README.md index 4b92bf7f..c98df091 100644 --- a/README.md +++ b/README.md @@ -338,6 +338,7 @@ enable as many segments as you like. It won't slow down your prompt or Zsh start | `midnight_commander` | [midnight commander](https://midnight-commander.org/) shell | | `nix_shell` | [nix shell](https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) indicator | | `nnn` | [nnn](https://github.com/jarun/nnn) shell | +| `lf` | [lf](https://github.com/gokcehan/lf) shell | | `nodeenv` | node.js environment from [nodeenv](https://github.com/ekalinin/nodeenv) | | `nodenv` | node.js environment from [nodenv](https://github.com/nodenv/nodenv) | | `node_version` | [node.js](https://nodejs.org/) version | diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 24c4022b..5a040cd0 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -82,6 +82,7 @@ nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) nnn # nnn shell (https://github.com/jarun/nnn) + lf # lf shell (https://github.com/gokcehan/lf) xplr # xplr shell (https://github.com/sayanarijit/xplr) vim_shell # vim shell indicator (:sh) midnight_commander # midnight commander shell (https://midnight-commander.org/) @@ -723,6 +724,12 @@ # Custom icon. # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' + ######################[ lf: lf shell (https://github.com/gokcehan/lf) ]####################### + # lf shell color. + typeset -g POWERLEVEL9K_LF_FOREGROUND=72 + # Custom icon. + # typeset -g POWERLEVEL9K_LF_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## # xplr shell color. typeset -g POWERLEVEL9K_XPLR_FOREGROUND=72 diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 1d2962a0..8852c094 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -82,6 +82,7 @@ nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) nnn # nnn shell (https://github.com/jarun/nnn) + lf # lf shell (https://github.com/gokcehan/lf) xplr # xplr shell (https://github.com/sayanarijit/xplr) vim_shell # vim shell indicator (:sh) midnight_commander # midnight commander shell (https://midnight-commander.org/) @@ -721,6 +722,12 @@ # Custom icon. # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' + ######################[ lf: lf shell (https://github.com/gokcehan/lf) ]####################### + # lf shell color. + typeset -g POWERLEVEL9K_LF_FOREGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_LF_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## # xplr shell color. typeset -g POWERLEVEL9K_XPLR_FOREGROUND=3 diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 98bb8145..8519e03c 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -82,6 +82,7 @@ nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) nnn # nnn shell (https://github.com/jarun/nnn) + lf # lf shell (https://github.com/gokcehan/lf) xplr # xplr shell (https://github.com/sayanarijit/xplr) vim_shell # vim shell indicator (:sh) midnight_commander # midnight commander shell (https://midnight-commander.org/) @@ -717,6 +718,11 @@ # Custom icon. # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' + # lf shell color. + typeset -g POWERLEVEL9K_LF_FOREGROUND=72 + # Custom icon. + # typeset -g POWERLEVEL9K_LF_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## # xplr shell color. typeset -g POWERLEVEL9K_XPLR_FOREGROUND=72 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index c12c286c..f314498a 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -82,6 +82,7 @@ nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) nnn # nnn shell (https://github.com/jarun/nnn) + lf # lf shell (https://github.com/gokcehan/lf) xplr # xplr shell (https://github.com/sayanarijit/xplr) vim_shell # vim shell indicator (:sh) midnight_commander # midnight commander shell (https://midnight-commander.org/) @@ -743,6 +744,13 @@ # Custom icon. # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' + ######################[ lf: lf shell (https://github.com/gokcehan/lf) ]####################### + # lf shell color. + typeset -g POWERLEVEL9K_LF_FOREGROUND=0 + typeset -g POWERLEVEL9K_LF_BACKGROUND=6 + # Custom icon. + # typeset -g POWERLEVEL9K_LF_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## # xplr shell color. typeset -g POWERLEVEL9K_XPLR_FOREGROUND=0 diff --git a/internal/icons.zsh b/internal/icons.zsh index d38cf7bd..95620b7d 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -134,6 +134,7 @@ function _p9k_init_icons() { LUA_ICON 'lua' PERL_ICON 'perl' NNN_ICON 'nnn' + LF_ICON 'lf' XPLR_ICON 'xplr' TIMEWARRIOR_ICON 'tw' TASKWARRIOR_ICON 'task' @@ -267,6 +268,7 @@ function _p9k_init_icons() { LUA_ICON 'lua' PERL_ICON 'perl' NNN_ICON 'nnn' + LF_ICON 'lf' XPLR_ICON 'xplr' TIMEWARRIOR_ICON 'tw' TASKWARRIOR_ICON 'task' @@ -403,6 +405,7 @@ function _p9k_init_icons() { LUA_ICON 'lua' PERL_ICON 'perl' NNN_ICON 'nnn' + LF_ICON 'lf' XPLR_ICON 'xplr' TIMEWARRIOR_ICON 'tw' TASKWARRIOR_ICON 'task' @@ -537,6 +540,7 @@ function _p9k_init_icons() { LUA_ICON '\uE620' #  PERL_ICON '\uE769' #  NNN_ICON 'nnn' + LF_ICON 'lf' XPLR_ICON 'xplr' TIMEWARRIOR_ICON '\uF49B' #  TASKWARRIOR_ICON '\uF4A0 ' #  @@ -668,6 +672,7 @@ function _p9k_init_icons() { LUA_ICON 'lua' PERL_ICON 'perl' NNN_ICON 'nnn' + LF_ICON 'lf' XPLR_ICON 'xplr' TIMEWARRIOR_ICON 'tw' TASKWARRIOR_ICON 'task' @@ -801,6 +806,7 @@ function _p9k_init_icons() { LUA_ICON 'lua' PERL_ICON 'perl' NNN_ICON 'nnn' + LF_ICON 'lf' XPLR_ICON 'xplr' TIMEWARRIOR_ICON 'tw' TASKWARRIOR_ICON 'task' diff --git a/internal/p10k.zsh b/internal/p10k.zsh index b90b747e..3f6da4fd 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4921,6 +4921,18 @@ function instant_prompt_nnn() { _p9k_prompt_segment prompt_nnn 6 $_p9k_color1 NNN_ICON 1 '${NNNLVL:#0}' '$NNNLVL' } +function prompt_lf() { + _p9k_prompt_segment $0 6 $_p9k_color1 LF_ICON 0 '' $LF_LEVEL +} + +_p9k_prompt_lf_init() { + typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${LF_LEVEL:#0}' +} + +function instant_prompt_lf() { + _p9k_prompt_segment prompt_lf 6 $_p9k_color1 LF_ICON 1 '${LF_LEVEL:#0}' '$LF_LEVEL' +} + function prompt_xplr() { local -i len=$#_p9k__prompt _p9k__has_upglob _p9k_prompt_segment $0 6 $_p9k_color1 XPLR_ICON 0 '' '' From 33916e91a743a73472a15f3fc27dd0aa9f7abbdf Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 16 Dec 2022 15:52:19 +0100 Subject: [PATCH 217/380] add a missing lf header to p10k-lean.zsh (#2126) --- config/p10k-lean.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 8519e03c..f90bddb6 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -718,6 +718,7 @@ # Custom icon. # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' + ######################[ lf: lf shell (https://github.com/gokcehan/lf) ]####################### # lf shell color. typeset -g POWERLEVEL9K_LF_FOREGROUND=72 # Custom icon. From 35165798a83e2e4f2f0aa6c820e2f7fba23e0179 Mon Sep 17 00:00:00 2001 From: kvanzuijlen <8818390+kvanzuijlen@users.noreply.github.com> Date: Fri, 6 Jan 2023 01:38:58 +0100 Subject: [PATCH 218/380] Added kubent to KUBECONTEXT_SHOW_ON_COMMAND --- README.md | 10 +++++----- config/p10k-classic.zsh | 2 +- config/p10k-lean-8colors.zsh | 2 +- config/p10k-lean.zsh | 2 +- config/p10k-rainbow.zsh | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index c98df091..af117958 100644 --- a/README.md +++ b/README.md @@ -216,8 +216,8 @@ Here's the relevant parameter for kubernetes context: ```zsh # Show prompt segment "kubecontext" only when the command you are typing -# invokes kubectl, helm, kubens, kubectx, oc, istioctl, kogito, k9s, helmfile, flux, fluxctl, stern, kubeseal, or skaffold. -typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold' +# invokes kubectl, helm, kubens, kubectx, oc, istioctl, kogito, k9s, helmfile, flux, fluxctl, stern, kubeseal, skaffold, or kubent. +typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent' ``` To customize when different prompt segments are shown, open `~/.p10k.zsh`, search for @@ -1231,8 +1231,8 @@ a relevant tool. ```zsh # Show prompt segment "kubecontext" only when the command you are typing -# invokes kubectl, helm, kubens, kubectx, oc, istioctl, kogito, k9s, helmfile, flux, fluxctl, stern, kubeseal, or skaffold. -typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold' +# invokes kubectl, helm, kubens, kubectx, oc, istioctl, kogito, k9s, helmfile, flux, fluxctl, stern, kubeseal, skaffold, or kubent. +typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent' ``` Configs created by `p10k configure` may contain parameters of this kind. To customize when different @@ -1248,7 +1248,7 @@ function kube-toggle() { if (( ${+POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND} )); then unset POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND else - POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold' + POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent' fi p10k reload if zle; then diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 5a040cd0..df7787a3 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1245,7 +1245,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 8852c094..3c4eeef7 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1187,7 +1187,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index f90bddb6..a0036ce0 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1183,7 +1183,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index f314498a..ff4ea22e 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1318,7 +1318,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. From 1a4b01c2321860aadd952d661debdb29980c2e40 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 11 Jan 2023 21:52:12 +0100 Subject: [PATCH 219/380] work around a bug in ohmyzsh (#2152) The bug was introduced here: https://github.com/ohmyzsh/ohmyzsh/commit/3dd83a22a160249a71631a51490fd3b89d1b3975 This causes Oh My Zsh to print \r to the terminal. --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 3f6da4fd..6bdaaf1d 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6584,7 +6584,7 @@ function _p9k_clear_instant_prompt() { print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed] local unexpected=${(S)${${content//$'\e[?'<->'c'}//$'\e['<->' q'}//$'\e'[^$'\a\e']#($'\a'|$'\e\\')} # Visual Studio Code prints this garbage. - unexpected=${unexpected//$'\033[1;32mShell integration activated\033[0m\n'} + unexpected=${${unexpected//$'\033[1;32mShell integration activated\033[0m\n'}//$'\r'} if [[ -n $unexpected ]]; then local omz1='[Oh My Zsh] Would you like to update? [Y/n]: ' local omz2='Updating Oh My Zsh' From a066b55f855c8e488d3ea9e26e861bdd5ecd4fe8 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 13 Jan 2023 12:06:20 +0100 Subject: [PATCH 220/380] don't trust P9K_SSH if it was set with a different TTY (#2154) --- internal/p10k.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 6bdaaf1d..85873ffb 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8310,8 +8310,9 @@ _p9k_init_ssh() { # # License: https://github.com/sindresorhus/pure/blob/e8abf9d37185ec9b7b4398ca9c5eba555a1028eb/license. - [[ -n $P9K_SSH ]] && return + [[ -n $P9K_SSH && $_P9K_SSH_TTY == $TTY ]] && return typeset -gix P9K_SSH=0 + typeset -gx _P9K_SSH_TTY=$TTY if [[ -n $SSH_CLIENT || -n $SSH_TTY || -n $SSH_CONNECTION ]]; then P9K_SSH=1 return 0 @@ -8881,7 +8882,7 @@ _p9k_deinit() { fi (( $+_p9k__iterm2_precmd )) && functions[iterm2_precmd]=$_p9k__iterm2_precmd (( $+_p9k__iterm2_decorate_prompt )) && functions[iterm2_decorate_prompt]=$_p9k__iterm2_decorate_prompt - unset -m '(_POWERLEVEL9K_|P9K_|_p9k_)*~(P9K_SSH|P9K_TOOLBOX_NAME|P9K_TTY|_P9K_TTY)' + unset -m '(_POWERLEVEL9K_|P9K_|_p9k_)*~(P9K_SSH|_P9K_SSH_TTY|P9K_TOOLBOX_NAME|P9K_TTY|_P9K_TTY)' [[ -n $__p9k_locale ]] || unset __p9k_locale } From d1b89dd3813fca823afef323101faf71a9840d36 Mon Sep 17 00:00:00 2001 From: James Winegar Date: Thu, 19 Jan 2023 09:26:40 -0600 Subject: [PATCH 221/380] Update README.md You run containers that are based on images. The container will be deleted, but not the image. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index af117958..2a88005c 100644 --- a/README.md +++ b/README.md @@ -761,7 +761,7 @@ PR to expand the list!_ ## Try it in Docker Try Powerlevel10k in Docker. You can safely make any changes to the file system while trying out -the theme. Once you exit Zsh, the image is deleted. +the theme. Once you exit Zsh, the container is deleted. ```zsh docker run -e TERM -e COLORTERM -e LC_ALL=C.UTF-8 -it --rm alpine sh -uec ' From b165fec0ed971fc54c47a746eb15454c8c808eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Reegn?= Date: Thu, 19 Jan 2023 18:38:12 +0100 Subject: [PATCH 222/380] Add AWS partitions support to EKS kubernetes cluster names The AWS ARN in govcloud and china looks different to the currently supported one: https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/using-govcloud-arns.html https://docs.amazonaws.cn/en_us/aws/latest/userguide/ARNs.html This change introduces support for all possible AWS partitions. --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 85873ffb..ea59a50f 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4520,7 +4520,7 @@ prompt_kubecontext() { text=$cloud_cluster fi # arn:aws:eks:us-east-1:123456789012:cluster/cluster-01 - elif [[ $cluster == (#b)arn:aws:eks:([[:alnum:]-]##):([[:digit:]]##):cluster/(?*) ]]; then + elif [[ $cluster == (#b)arn:aws[[:alnum:]-]#:eks:([[:alnum:]-]##):([[:digit:]]##):cluster/(?*) ]]; then cloud_name=eks cloud_zone=$match[1] cloud_account=$match[2] From 21e89cb61d9ed240c1ddf6dd09ce306e7c9cf437 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 19 Jan 2023 18:46:16 +0100 Subject: [PATCH 223/380] bust caches --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index ea59a50f..22786fee 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8358,7 +8358,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v139\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v140\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$__p9k_force_term_shell_integration$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' From f03d917fb0842e412748f284afba093aaeb01fc9 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 23 Jan 2023 10:59:07 +0100 Subject: [PATCH 224/380] fix network interface detection on macos (#2170) This was broken in #2088. --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 22786fee..337f08e8 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5744,7 +5744,7 @@ function _p9k_prompt_net_iface_async() { # netstat -inbI en0 local iface ip line var typeset -a iface2ip ips ifaces - if (( $+commands[ip] )); then + if (( $+commands[ip] )) && [[ $+commands[ifconfig] == 0 || $OSTYPE != linux* ]]; then for line in ${(f)"$(command ip -4 a show 2>/dev/null)"}; do if [[ $line == (#b)<->:[[:space:]]##([^:]##):[[:space:]]##\<([^\>]#)\>* ]]; then [[ ,$match[2], == *,UP,* ]] && iface=$match[1] || iface= From 0adbc1415bf1bad46a7fd111b39640d995294dad Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 23 Jan 2023 11:11:20 +0100 Subject: [PATCH 225/380] fix a silly bug introduced in the last commit (#2170) --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 337f08e8..75f317ac 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5744,7 +5744,7 @@ function _p9k_prompt_net_iface_async() { # netstat -inbI en0 local iface ip line var typeset -a iface2ip ips ifaces - if (( $+commands[ip] )) && [[ $+commands[ifconfig] == 0 || $OSTYPE != linux* ]]; then + if (( $+commands[ip] )) && [[ $+commands[ifconfig] == 0 || $OSTYPE == linux* ]]; then for line in ${(f)"$(command ip -4 a show 2>/dev/null)"}; do if [[ $line == (#b)<->:[[:space:]]##([^:]##):[[:space:]]##\<([^\>]#)\>* ]]; then [[ ,$match[2], == *,UP,* ]] && iface=$match[1] || iface= From e9e94a503a550b13b63a7528551a30dc5938c541 Mon Sep 17 00:00:00 2001 From: Mehyar Date: Sat, 28 Jan 2023 12:05:46 +0100 Subject: [PATCH 226/380] fix the default value of POWERLEVEL9K_VPN_IP_INTERFACE It was broken by #1730. --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 75f317ac..ed6085ba 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7490,7 +7490,7 @@ _p9k_init_params() { _p9k_declare -s POWERLEVEL9K_IP_INTERFACE "" : ${_POWERLEVEL9K_IP_INTERFACE:='.*'} _p9k_segment_in_use ip || _POWERLEVEL9K_IP_INTERFACE= - _p9k_declare -s POWERLEVEL9K_VPN_IP_INTERFACE "(gpd|wg|(.*tun)|tailscale)[0-9]*)|(zt.*)" + _p9k_declare -s POWERLEVEL9K_VPN_IP_INTERFACE "(gpd|wg|(.*tun)|tailscale)[0-9]*|(zt.*)" : ${_POWERLEVEL9K_VPN_IP_INTERFACE:='.*'} _p9k_segment_in_use vpn_ip || _POWERLEVEL9K_VPN_IP_INTERFACE= _p9k_declare -b POWERLEVEL9K_VPN_IP_SHOW_ALL 0 From e7b2bb2372c5c7060d35c0b7a710f3f01bd4593b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 28 Jan 2023 12:50:42 +0100 Subject: [PATCH 227/380] set POWERLEVEL9K_VPN_IP_INTERFACE to the same value as the default: this adds ZeroTier support --- config/p10k-classic.zsh | 2 +- config/p10k-lean-8colors.zsh | 2 +- config/p10k-lean.zsh | 2 +- config/p10k-rainbow.zsh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index df7787a3..a1bb7fbc 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1504,7 +1504,7 @@ typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN # to see the name of the interface. - typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*' + typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*|(zt.*)' # If set to true, show one segment per matching network interface. If set to false, show only # one segment corresponding to the first matching network interface. # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 3c4eeef7..4df8482f 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1485,7 +1485,7 @@ typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN # to see the name of the interface. - typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*' + typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*|(zt.*)' # If set to true, show one segment per matching network interface. If set to false, show only # one segment corresponding to the first matching network interface. # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index a0036ce0..88957415 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1481,7 +1481,7 @@ typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN # to see the name of the interface. - typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*' + typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*|(zt.*)' # If set to true, show one segment per matching network interface. If set to false, show only # one segment corresponding to the first matching network interface. # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index ff4ea22e..3ecfe60b 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1587,7 +1587,7 @@ typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN # to see the name of the interface. - typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*' + typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*|(zt.*)' # If set to true, show one segment per matching network interface. If set to false, show only # one segment corresponding to the first matching network interface. # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. From a30145b0f82d06770e924e9eac064ed223a94e6b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 30 Jan 2023 20:25:55 +0100 Subject: [PATCH 228/380] add an optional parameter to _p9k_upglob to pass glob qualifiers and use it in most cases to restrict globbing to files/directories/links/etc (#2175) --- internal/p10k.zsh | 75 +++++++++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 39 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index ed6085ba..a8662762 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -233,7 +233,7 @@ function _p9k_fetch_cwd() { _p9k__parent_mtimes_s="$_p9k__parent_mtimes_i" } -# Usage: _p9k_glob parent_dir_index pattern +# Usage: _p9k_glob parent_dir_index pattern [glob_qual] # # parent_dir_index indexes _p9k__parent_dirs. # @@ -250,12 +250,12 @@ function _p9k_glob() { fi local -a stat zstat -A stat +mtime -- $dir 2>/dev/null || stat=(-1) - local files=($dir/$~2(N:t)) + eval 'local files=($dir/$~2('$3'N:t))' _p9k__glob_cache[$dir/$2]="$stat[1]:$#files" return $#files } -# Usage: _p9k_upglob pattern +# Usage: _p9k_upglob pattern [glob_qual] # # Returns index within _p9k__parent_dirs or 0 if there is no match. # @@ -273,7 +273,7 @@ function _p9k_upglob() { cached[-1]=() local -i i for i in ${(@)${cached:|_p9k__parent_mtimes_i}%:*}; do - _p9k_glob $i $1 && continue + _p9k_glob $i "$@" && continue _p9k__upsearch_cache[$_p9k__cwd/$1]="${_p9k__parent_mtimes_i[1,i]} $i" return i done @@ -286,7 +286,7 @@ function _p9k_upglob() { local -i i=1 fi for ((; i <= $#_p9k__parent_mtimes; ++i)); do - _p9k_glob $i $1 && continue + _p9k_glob $i "$@" && continue _p9k__upsearch_cache[$_p9k__cwd/$1]="${_p9k__parent_mtimes_i[1,i]} $i" return i done @@ -1212,7 +1212,7 @@ _p9k_prompt_aws_init() { ################################################################ # Current Elastic Beanstalk environment prompt_aws_eb_env() { - _p9k_upglob .elasticbeanstalk && return + _p9k_upglob .elasticbeanstalk -/ && return local dir=$_p9k__parent_dirs[$?] if ! _p9k_cache_stat_get $0 $dir/.elasticbeanstalk/config.yml; then @@ -1304,25 +1304,21 @@ function _p9k_read_file() { } function _p9k_fvm_old() { - _p9k_upglob fvm && return 1 + _p9k_upglob fvm @ && return 1 local fvm=$_p9k__parent_dirs[$?]/fvm - if [[ -L $fvm ]]; then - if [[ ${fvm:A} == (#b)*/versions/([^/]##)/bin/flutter ]]; then - _p9k_prompt_segment prompt_fvm blue $_p9k_color1 FLUTTER_ICON 0 '' ${match[1]//\%/%%} - return 0 - fi + if [[ ${fvm:A} == (#b)*/versions/([^/]##)/bin/flutter ]]; then + _p9k_prompt_segment prompt_fvm blue $_p9k_color1 FLUTTER_ICON 0 '' ${match[1]//\%/%%} + return 0 fi return 1 } function _p9k_fvm_new() { - _p9k_upglob .fvm && return 1 + _p9k_upglob .fvm @ && return 1 local sdk=$_p9k__parent_dirs[$?]/.fvm/flutter_sdk - if [[ -L $sdk ]]; then - if [[ ${sdk:A} == (#b)*/versions/([^/]##) ]]; then - _p9k_prompt_segment prompt_fvm blue $_p9k_color1 FLUTTER_ICON 0 '' ${match[1]//\%/%%} - return 0 - fi + if [[ ${sdk:A} == (#b)*/versions/([^/]##) ]]; then + _p9k_prompt_segment prompt_fvm blue $_p9k_color1 FLUTTER_ICON 0 '' ${match[1]//\%/%%} + return 0 fi return 1 } @@ -2196,7 +2192,7 @@ prompt_go_version() { fi fi if [[ $_p9k__cwd/ != $p/* && $_p9k__cwd_a/ != $p/* ]]; then - _p9k_upglob go.mod && return + _p9k_upglob go.mod -. && return fi fi _p9k_prompt_segment "$0" "green" "grey93" "GO_ICON" 0 '' "${v//\%/%%}" @@ -2216,7 +2212,7 @@ prompt_history() { prompt_package() { unset P9K_PACKAGE_NAME P9K_PACKAGE_VERSION - _p9k_upglob package.json && return + _p9k_upglob package.json -. && return local file=$_p9k__parent_dirs[$?]/package.json if ! _p9k_cache_stat_get $0 $file; then @@ -2321,6 +2317,7 @@ _p9k_vpn_ip_render() { ################################################################ # Segment to display laravel version prompt_laravel_version() { + # TODO: add a '-/' or '-.' here depending on whether artisan is a directory or a file. _p9k_upglob artisan && return local dir=$_p9k__parent_dirs[$?] local app=$dir/vendor/laravel/framework/src/Illuminate/Foundation/Application.php @@ -2432,7 +2429,7 @@ function _p9k_cached_cmd() { ################################################################ # Segment to diplay Node version prompt_node_version() { - _p9k_upglob package.json + _p9k_upglob package.json -. local -i idx=$? if (( idx )); then _p9k_cached_cmd 0 $_p9k__parent_dirs[idx]/package.json node --version || return @@ -2612,7 +2609,7 @@ prompt_nodenv() { fi fi if [[ -z $_p9k__ret ]]; then - _p9k_upglob .node-version + _p9k_upglob .node-version -. local -i idx=$? if (( idx )) && _p9k_read_word $_p9k__parent_dirs[idx]/.node-version; then (( ${_POWERLEVEL9K_NODENV_SOURCES[(I)local]} )) || return @@ -2648,11 +2645,11 @@ _p9k_prompt_nodenv_init() { prompt_dotnet_version() { if (( _POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY )); then - _p9k_upglob 'project.json|global.json|packet.dependencies|*.csproj|*.fsproj|*.xproj|*.sln' && return + _p9k_upglob 'project.json|global.json|packet.dependencies|*.csproj|*.fsproj|*.xproj|*.sln' -. && return fi local cfg - _p9k_upglob global.json || cfg=$_p9k__parent_dirs[$?]/global.json + _p9k_upglob global.json -. || cfg=$_p9k__parent_dirs[$?]/global.json _p9k_cached_cmd 0 "$cfg" dotnet --version || return _p9k_prompt_segment "$0" "magenta" "white" 'DOTNET_ICON' 0 '' "$_p9k__ret" } @@ -2675,7 +2672,7 @@ instant_prompt_os_icon() { prompt_os_icon; } # Segment to display PHP version number prompt_php_version() { if (( _POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY )); then - _p9k_upglob 'composer.json|*.php' && return + _p9k_upglob 'composer.json|*.php' -. && return fi _p9k_cached_cmd 0 '' php --version || return [[ $_p9k__ret == (#b)(*$'\n')#'PHP '([[:digit:].]##)* ]] || return @@ -2782,7 +2779,7 @@ prompt_rbenv() { fi fi if [[ -z $_p9k__ret ]]; then - _p9k_upglob .ruby-version + _p9k_upglob .ruby-version -. local -i idx=$? if (( idx )) && _p9k_read_word $_p9k__parent_dirs[idx]/.ruby-version; then (( ${_POWERLEVEL9K_RBENV_SOURCES[(I)local]} )) || return @@ -2845,7 +2842,7 @@ prompt_scalaenv() { fi fi if [[ -z $_p9k__ret ]]; then - _p9k_upglob .scala-version + _p9k_upglob .scala-version -. local -i idx=$? if (( idx )) && _p9k_read_word $_p9k__parent_dirs[idx]/.scala-version; then (( ${_POWERLEVEL9K_SCALAENV_SOURCES[(I)local]} )) || return @@ -2903,7 +2900,7 @@ prompt_phpenv() { fi fi if [[ -z $_p9k__ret ]]; then - _p9k_upglob .php-version + _p9k_upglob .php-version -. local -i idx=$? if (( idx )) && _p9k_read_word $_p9k__parent_dirs[idx]/.php-version; then (( ${_POWERLEVEL9K_PHPENV_SOURCES[(I)local]} )) || return @@ -2964,7 +2961,7 @@ prompt_luaenv() { fi fi if [[ -z $_p9k__ret ]]; then - _p9k_upglob .lua-version + _p9k_upglob .lua-version -. local -i idx=$? if (( idx )) && _p9k_read_word $_p9k__parent_dirs[idx]/.lua-version; then (( ${_POWERLEVEL9K_LUAENV_SOURCES[(I)local]} )) || return @@ -3025,7 +3022,7 @@ prompt_jenv() { fi fi if [[ -z $_p9k__ret ]]; then - _p9k_upglob .java-version + _p9k_upglob .java-version -. local -i idx=$? if (( idx )) && _p9k_read_word $_p9k__parent_dirs[idx]/.java-version; then (( ${_POWERLEVEL9K_JENV_SOURCES[(I)local]} )) || return @@ -3086,7 +3083,7 @@ prompt_plenv() { fi fi if [[ -z $_p9k__ret ]]; then - _p9k_upglob .perl-version + _p9k_upglob .perl-version -. local -i idx=$? if (( idx )) && _p9k_read_word $_p9k__parent_dirs[idx]/.perl-version; then (( ${_POWERLEVEL9K_PLENV_SOURCES[(I)local]} )) || return @@ -3124,7 +3121,7 @@ _p9k_prompt_plenv_init() { prompt_perlbrew() { if (( _POWERLEVEL9K_PERLBREW_PROJECT_ONLY )); then - _p9k_upglob 'cpanfile|.perltidyrc|(|MY)META.(yml|json)|(Makefile|Build).PL|*.(pl|pm|t|pod)' && return + _p9k_upglob 'cpanfile|.perltidyrc|(|MY)META.(yml|json)|(Makefile|Build).PL|*.(pl|pm|t|pod)' -. && return fi local v=$PERLBREW_PERL @@ -3165,7 +3162,7 @@ instant_prompt_root_indicator() { prompt_root_indicator; } prompt_rust_version() { unset P9K_RUST_VERSION if (( _POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY )); then - _p9k_upglob Cargo.toml && return + _p9k_upglob Cargo.toml -. && return fi local rustc=$commands[rustc] toolchain deps=() if (( $+commands[ldd] )); then @@ -3198,7 +3195,7 @@ prompt_rust_version() { fi fi local -A overrides=($_p9k__cache_val) - _p9k_upglob rust-toolchain + _p9k_upglob rust-toolchain -. local dir=$_p9k__parent_dirs[$?] local -i n m=${dir[(I)/]} local pair @@ -4321,7 +4318,7 @@ function _p9k_pyenv_compute() { fi fi if [[ -z $_p9k__ret ]]; then - _p9k_upglob .python-version + _p9k_upglob .python-version -. local -i idx=$? if (( idx )) && _p9k_read_pyenv_like_version_file $_p9k__parent_dirs[idx]/.python-version python-; then (( ${_POWERLEVEL9K_PYENV_SOURCES[(I)local]} )) || return @@ -4401,7 +4398,7 @@ prompt_goenv() { fi fi if [[ -z $_p9k__ret ]]; then - _p9k_upglob .go-version + _p9k_upglob .go-version -. local -i idx=$? if (( idx )) && _p9k_read_pyenv_like_version_file $_p9k__parent_dirs[idx]/.go-version go-; then (( ${_POWERLEVEL9K_GOENV_SOURCES[(I)local]} )) || return @@ -4586,7 +4583,7 @@ _p9k_prompt_dropbox_init() { # print Java version number prompt_java_version() { if (( _POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY )); then - _p9k_upglob 'pom.xml|build.gradle.kts|build.sbt|deps.edn|project.clj|build.boot|*.(java|class|jar|gradle|clj|cljc)' && return + _p9k_upglob 'pom.xml|build.gradle.kts|build.sbt|deps.edn|project.clj|build.boot|*.(java|class|jar|gradle|clj|cljc)' -. && return fi local java=$commands[java] @@ -5631,7 +5628,7 @@ prompt_haskell_stack() { _p9k_haskell_stack_version $STACK_YAML else (( ${_POWERLEVEL9K_HASKELL_STACK_SOURCES[(I)local|global]} )) || return - if _p9k_upglob stack.yaml; then + if _p9k_upglob stack.yaml -.; then (( _POWERLEVEL9K_HASKELL_STACK_PROMPT_ALWAYS_SHOW )) || return (( ${_POWERLEVEL9K_HASKELL_STACK_SOURCES[(I)global]} )) || return _p9k_haskell_stack_version ${STACK_ROOT:-~/.stack}/global-project/stack.yaml @@ -8358,7 +8355,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v140\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v141\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$__p9k_force_term_shell_integration$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' From 373337123c2843bc752b52b7fd6dc38982b6c4c5 Mon Sep 17 00:00:00 2001 From: NatureLR <1127711564@qq.com> Date: Fri, 3 Mar 2023 11:15:44 +0800 Subject: [PATCH 229/380] Added kubecolor to KUBECONTEXT_SHOW_ON_COMMAND --- README.md | 8 ++++---- config/p10k-classic.zsh | 2 +- config/p10k-lean-8colors.zsh | 2 +- config/p10k-lean.zsh | 2 +- config/p10k-rainbow.zsh | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 2a88005c..62294f16 100644 --- a/README.md +++ b/README.md @@ -216,8 +216,8 @@ Here's the relevant parameter for kubernetes context: ```zsh # Show prompt segment "kubecontext" only when the command you are typing -# invokes kubectl, helm, kubens, kubectx, oc, istioctl, kogito, k9s, helmfile, flux, fluxctl, stern, kubeseal, skaffold, or kubent. -typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent' +# invokes kubectl, helm, kubens, kubectx, oc, istioctl, kogito, k9s, helmfile, flux, fluxctl, stern, kubeseal, skaffold, kubent, or kubecolor. +typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor' ``` To customize when different prompt segments are shown, open `~/.p10k.zsh`, search for @@ -1232,7 +1232,7 @@ a relevant tool. ```zsh # Show prompt segment "kubecontext" only when the command you are typing # invokes kubectl, helm, kubens, kubectx, oc, istioctl, kogito, k9s, helmfile, flux, fluxctl, stern, kubeseal, skaffold, or kubent. -typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent' +typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor' ``` Configs created by `p10k configure` may contain parameters of this kind. To customize when different @@ -1248,7 +1248,7 @@ function kube-toggle() { if (( ${+POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND} )); then unset POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND else - POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent' + POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor' fi p10k reload if zle; then diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index a1bb7fbc..aead8089 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1245,7 +1245,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 4df8482f..c40b3efa 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1187,7 +1187,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 88957415..3009d464 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1183,7 +1183,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 3ecfe60b..775b919e 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1318,7 +1318,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. From 2aa16c54314f175e4f34fdd7fa1bdb03f1797c6a Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 3 Mar 2023 17:01:19 +0100 Subject: [PATCH 230/380] docs: prune the list of kubecontext commands --- README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 62294f16..c67529ef 100644 --- a/README.md +++ b/README.md @@ -215,9 +215,8 @@ Configs created by `p10k configure` enable show on command for several prompt se Here's the relevant parameter for kubernetes context: ```zsh -# Show prompt segment "kubecontext" only when the command you are typing -# invokes kubectl, helm, kubens, kubectx, oc, istioctl, kogito, k9s, helmfile, flux, fluxctl, stern, kubeseal, skaffold, kubent, or kubecolor. -typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor' +# Show prompt segment "kubecontext" only when the command you are typing invokes one of these tools. +typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens' ``` To customize when different prompt segments are shown, open `~/.p10k.zsh`, search for @@ -1230,9 +1229,9 @@ Prompt segments can be configured to be shown only when the current command you a relevant tool. ```zsh -# Show prompt segment "kubecontext" only when the command you are typing -# invokes kubectl, helm, kubens, kubectx, oc, istioctl, kogito, k9s, helmfile, flux, fluxctl, stern, kubeseal, skaffold, or kubent. -typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor' +# Show prompt segment "kubecontext" only when the command you are typing invokes +# invokes kubectl, helm, or kubens. +typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens' ``` Configs created by `p10k configure` may contain parameters of this kind. To customize when different @@ -1248,7 +1247,7 @@ function kube-toggle() { if (( ${+POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND} )); then unset POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND else - POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor' + POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens' fi p10k reload if zle; then From e2c4e6673f3e6b230af8d05f8d3bac13d72fa7d4 Mon Sep 17 00:00:00 2001 From: Lazar Jovanovic Date: Wed, 15 Mar 2023 12:24:13 -0700 Subject: [PATCH 231/380] Add manual MesloLGS NF font installation for Zed --- README.md | 13 +++++++++++++ font.md | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/README.md b/README.md index c67529ef..8148e163 100644 --- a/README.md +++ b/README.md @@ -721,6 +721,19 @@ If you are using a different terminal, proceed with manual font installation. ``` After changing the config run `xrdb ~/.Xresources` to reload it. The new config is applied to all new terminals. + - **Zed**: Open `settings.json` file (type `CMD + ,` or open `~/.config/zed/settings.json`). + Add the following lines to your existing settings: + ```jsonc + { + // your existing settings + + { + "terminal": { + "font_family": "MesloLGS NF" + } + } + } + ``` - Crostini (Linux on Chrome OS): Open chrome-untrusted://terminal/html/nassh_preferences_editor.html, set *Text font family* to `'MesloLGS NF'` (including the quotes) and *Custom CSS (inline text)* to the following: diff --git a/font.md b/font.md index 429af320..85a2e7f9 100644 --- a/font.md +++ b/font.md @@ -115,6 +115,19 @@ If you are using a different terminal, proceed with manual font installation. ``` After changing the config run `xrdb ~/.Xresources` to reload it. The new config is applied to all new terminals. + - **Zed**: Open `settings.json` file (type `CMD + ,` or open `~/.config/zed/settings.json`). + Add the following lines to your existing settings: + ```jsonc + { + // your existing settings + + { + "terminal": { + "font_family": "MesloLGS NF" + } + } + } + ``` - Crostini (Linux on Chrome OS): Open chrome-untrusted://terminal/html/nassh_preferences_editor.html, set *Text font family* to `'MesloLGS NF'` (including the quotes) and *Custom CSS (inline text)* to the following: From cb9788b12a1fade6be631ad905928f9a5f7eb03f Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 16 Mar 2023 09:51:24 +0100 Subject: [PATCH 232/380] docs: fix zed font instructions --- README.md | 14 +++++--------- font.md | 14 +++++--------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 8148e163..6629e910 100644 --- a/README.md +++ b/README.md @@ -721,17 +721,13 @@ If you are using a different terminal, proceed with manual font installation. ``` After changing the config run `xrdb ~/.Xresources` to reload it. The new config is applied to all new terminals. - - **Zed**: Open `settings.json` file (type `CMD + ,` or open `~/.config/zed/settings.json`). - Add the following lines to your existing settings: + - **Zed**: Open `~/.config/zed/settings.json` and set `terminal.font_family` to `"MesloLGS NF"`. ```jsonc { - // your existing settings - - { - "terminal": { - "font_family": "MesloLGS NF" - } - } + "terminal": { + "font_family": "MesloLGS NF" + }, + // Other settings. } ``` - Crostini (Linux on Chrome OS): Open diff --git a/font.md b/font.md index 85a2e7f9..e7505ef4 100644 --- a/font.md +++ b/font.md @@ -115,17 +115,13 @@ If you are using a different terminal, proceed with manual font installation. ``` After changing the config run `xrdb ~/.Xresources` to reload it. The new config is applied to all new terminals. - - **Zed**: Open `settings.json` file (type `CMD + ,` or open `~/.config/zed/settings.json`). - Add the following lines to your existing settings: + - **Zed**: Open `~/.config/zed/settings.json` and set `terminal.font_family` to `"MesloLGS NF"`. ```jsonc { - // your existing settings - - { - "terminal": { - "font_family": "MesloLGS NF" - } - } + "terminal": { + "font_family": "MesloLGS NF" + }, + // Other settings. } ``` - Crostini (Linux on Chrome OS): Open From 614a6ed1ca8bcad6a5960457c6cd3acd15bc0456 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 1 Apr 2023 10:51:37 +0200 Subject: [PATCH 233/380] display nix_shell if path contains /nix/store/* (#2246) --- internal/p10k.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index a8662762..b0096548 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4963,11 +4963,13 @@ function prompt_nix_shell() { } _p9k_prompt_nix_shell_init() { - typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${IN_NIX_SHELL:#0}' + typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${IN_NIX_SHELL:#0}${${path[(I)/nix/store/*]}:#0}' } function instant_prompt_nix_shell() { - _p9k_prompt_segment prompt_nix_shell 4 $_p9k_color1 NIX_SHELL_ICON 1 '${IN_NIX_SHELL:#0}' '${(M)IN_NIX_SHELL:#(pure|impure)}' + _p9k_prompt_segment prompt_nix_shell 4 $_p9k_color1 NIX_SHELL_ICON 1 \ + '${IN_NIX_SHELL:#0}${${path[(I)/nix/store/*]}:#0}' \ + '${(M)IN_NIX_SHELL:#(pure|impure)}' } function prompt_terraform() { From f02b8d365baae5336a5399256739930fa323f3f1 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 2 Apr 2023 13:14:47 +0200 Subject: [PATCH 234/380] add POWERLEVEL9K_MODE=nerdfont-v3 (#2217) This is Step 1 of https://github.com/romkatv/powerlevel10k/issues/2217#issuecomment-1493271666. --- internal/icons.zsh | 135 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) diff --git a/internal/icons.zsh b/internal/icons.zsh index 95620b7d..c6a14ffc 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -423,6 +423,141 @@ function _p9k_init_icons() { ARCH_ICON 'arch' ) ;; + 'nerdfont-v3') + # In this version of Nerd Fonts the Material icons are mapped to U+F0001-U+F19C3. + # The font may also have Material icons in the old range of U+F500-U+FD46 but + # powerlevel10k won't rely on them. + icons=( + RULER_CHAR '\u2500' # ─ + LEFT_SEGMENT_SEPARATOR '\uE0B0' #  + RIGHT_SEGMENT_SEPARATOR '\uE0B2' #  + LEFT_SEGMENT_END_SEPARATOR ' ' # + LEFT_SUBSEGMENT_SEPARATOR '\uE0B1' #  + RIGHT_SUBSEGMENT_SEPARATOR '\uE0B3' #  + CARRIAGE_RETURN_ICON '\u21B5' # ↵ + ROOT_ICON '\uE614'$q #  + SUDO_ICON '\uF09C'$s #  + RUBY_ICON '\uF219 ' #  + AWS_ICON '\uF270'$s #  + AWS_EB_ICON '\UF1BD'$q$q #  + BACKGROUND_JOBS_ICON '\uF013 ' #  + TEST_ICON '\uF188'$s #  + TODO_ICON '\u2611' # ☑ + BATTERY_ICON '\UF240 ' #  + DISK_ICON '\uF0A0'$s #  + OK_ICON '\uF00C'$s #  + FAIL_ICON '\uF00D' #  + SYMFONY_ICON '\uE757' #  + NODE_ICON '\uE617 ' #  + NODEJS_ICON '\uE617 ' #  + MULTILINE_FIRST_PROMPT_PREFIX '\u256D\U2500' # ╭─ + MULTILINE_NEWLINE_PROMPT_PREFIX '\u251C\U2500' # ├─ + MULTILINE_LAST_PROMPT_PREFIX '\u2570\U2500 ' # ╰─ + APPLE_ICON '\uF179' #  + WINDOWS_ICON '\uF17A'$s #  + FREEBSD_ICON '\UF30C ' #  + ANDROID_ICON '\uF17B' #  + LINUX_ARCH_ICON '\uF303' #  + LINUX_CENTOS_ICON '\uF304'$s #  + LINUX_COREOS_ICON '\uF305'$s #  + LINUX_DEBIAN_ICON '\uF306' #  + LINUX_RASPBIAN_ICON '\uF315' #  + LINUX_ELEMENTARY_ICON '\uF309'$s #  + LINUX_FEDORA_ICON '\uF30a'$s #  + LINUX_GENTOO_ICON '\uF30d'$s #  + LINUX_MAGEIA_ICON '\uF310' #  + LINUX_MINT_ICON '\uF30e'$s #  + LINUX_NIXOS_ICON '\uF313'$s #  + LINUX_MANJARO_ICON '\uF312'$s #  + LINUX_DEVUAN_ICON '\uF307'$s #  + LINUX_ALPINE_ICON '\uF300'$s #  + LINUX_AOSC_ICON '\uF301'$s #  + LINUX_OPENSUSE_ICON '\uF314'$s #  + LINUX_SABAYON_ICON '\uF317'$s #  + LINUX_SLACKWARE_ICON '\uF319'$s #  + LINUX_VOID_ICON '\uF17C' #  + LINUX_ARTIX_ICON '\uF17C' #  + LINUX_UBUNTU_ICON '\uF31b'$s #  + LINUX_RHEL_ICON '\uF316'$s #  + LINUX_AMZN_ICON '\uF270'$s #  + LINUX_ICON '\uF17C' #  + SUNOS_ICON '\uF185 ' #  + HOME_ICON '\uF015'$s #  + HOME_SUB_ICON '\uF07C'$s #  + FOLDER_ICON '\uF115'$s #  + ETC_ICON '\uF013'$s #  + NETWORK_ICON '\UF0378'$s # 󰍸 + LOAD_ICON '\uF080 ' #  + SWAP_ICON '\uF464'$s #  + RAM_ICON '\uF0E4'$s #  + SERVER_ICON '\uF0AE'$s #  + VCS_UNTRACKED_ICON '\uF059'$s #  + VCS_UNSTAGED_ICON '\uF06A'$s #  + VCS_STAGED_ICON '\uF055'$s #  + VCS_STASH_ICON '\uF01C ' #  + VCS_INCOMING_CHANGES_ICON '\uF01A ' #  + VCS_OUTGOING_CHANGES_ICON '\uF01B ' #  + VCS_TAG_ICON '\uF02B ' #  + VCS_BOOKMARK_ICON '\uF461 ' #  + VCS_COMMIT_ICON '\uE729 ' #  + VCS_BRANCH_ICON '\uF126 ' #  + VCS_REMOTE_BRANCH_ICON '\uE728 ' #  + VCS_LOADING_ICON '' # + VCS_GIT_ICON '\uF1D3 ' #  + VCS_GIT_GITHUB_ICON '\uF113 ' #  + VCS_GIT_BITBUCKET_ICON '\uE703 ' #  + VCS_GIT_GITLAB_ICON '\uF296 ' #  + VCS_HG_ICON '\uF0C3 ' #  + VCS_SVN_ICON '\uE72D'$q #  + RUST_ICON '\uE7A8'$q #  + PYTHON_ICON '\UE73C ' #  + SWIFT_ICON '\uE755' #  + GO_ICON '\uE626' #  + GOLANG_ICON '\uE626' #  + PUBLIC_IP_ICON '\UF0AC'$s #  + LOCK_ICON '\UF023' #  + NORDVPN_ICON '\UF023' #  + EXECUTION_TIME_ICON '\uF252'$s #  + SSH_ICON '\uF489'$s #  + VPN_ICON '\UF023' #  + KUBERNETES_ICON '\U2388' # ⎈ + DROPBOX_ICON '\UF16B'$s #  + DATE_ICON '\uF073 ' #  + TIME_ICON '\uF017 ' #  + JAVA_ICON '\uE738' #  + LARAVEL_ICON '\ue73f'$q #  + RANGER_ICON '\uF00b ' #  + MIDNIGHT_COMMANDER_ICON 'mc' # mc + VIM_ICON '\uE62B' #  + TERRAFORM_ICON '\uF1BB ' #  + PROXY_ICON '\u2194' # ↔ + DOTNET_ICON '\uE77F' #  + DOTNET_CORE_ICON '\uE77F' #  + AZURE_ICON '\UF0805' # 󰠅 + DIRENV_ICON '\u25BC' # ▼ + FLUTTER_ICON 'F' # F + GCLOUD_ICON '\UF02AD' # 󰊭 + LUA_ICON '\uE620' #  + PERL_ICON '\uE769' #  + NNN_ICON 'nnn' # nnn + LF_ICON 'lf' # lf + XPLR_ICON 'xplr' # xplr + TIMEWARRIOR_ICON '\uF49B' #  + TASKWARRIOR_ICON '\uF4A0 ' #  + NIX_SHELL_ICON '\uF313 ' #  + WIFI_ICON '\uF1EB ' #  + ERLANG_ICON '\uE7B1 ' #  + ELIXIR_ICON '\uE62D' #  + POSTGRES_ICON '\uE76E' #  + PHP_ICON '\uE608' #  + HASKELL_ICON '\uE61F' #  + PACKAGE_ICON '\UF03D7' # 󰏗 + JULIA_ICON '\uE624' #  + SCALA_ICON '\uE737' #  + TOOLBOX_ICON '\uE20F'$s #  + ARCH_ICON '\uE266' #  + ) + ;; 'nerdfont-complete'|'nerdfont-fontconfig') # nerd-font patched (complete) font required! See # https://github.com/ryanoasis/nerd-fonts From ec1702caf1c61d8b2a04658857c1c526aa989901 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 2 Apr 2023 13:20:27 +0200 Subject: [PATCH 235/380] nerdfonts-v3: add icons for artix and void linux (#2033) --- internal/icons.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/icons.zsh b/internal/icons.zsh index c6a14ffc..b49f9951 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -475,8 +475,8 @@ function _p9k_init_icons() { LINUX_OPENSUSE_ICON '\uF314'$s #  LINUX_SABAYON_ICON '\uF317'$s #  LINUX_SLACKWARE_ICON '\uF319'$s #  - LINUX_VOID_ICON '\uF17C' #  - LINUX_ARTIX_ICON '\uF17C' #  + LINUX_VOID_ICON '\UF32E'$s #  + LINUX_ARTIX_ICON '\UF31F'$s #  LINUX_UBUNTU_ICON '\uF31b'$s #  LINUX_RHEL_ICON '\uF316'$s #  LINUX_AMZN_ICON '\uF270'$s #  From 6b50e0918b66d390891b585a9d38463e04d22fab Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 2 Apr 2023 13:23:06 +0200 Subject: [PATCH 236/380] nerdfonts-v3: use the kubernetes logo as a kubernetes icon (#2184) --- internal/icons.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/icons.zsh b/internal/icons.zsh index b49f9951..b551c733 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -520,7 +520,7 @@ function _p9k_init_icons() { EXECUTION_TIME_ICON '\uF252'$s #  SSH_ICON '\uF489'$s #  VPN_ICON '\UF023' #  - KUBERNETES_ICON '\U2388' # ⎈ + KUBERNETES_ICON '\F10FE' # 󱃾 DROPBOX_ICON '\UF16B'$s #  DATE_ICON '\uF073 ' #  TIME_ICON '\uF017 ' #  From 6c82236d6ff803b928a8935ea48318940a17425c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 2 Apr 2023 13:34:20 +0200 Subject: [PATCH 237/380] nerdfonts-v3: add an icon for EndevourOS (#1933) --- internal/icons.zsh | 7 +++++++ internal/p10k.zsh | 1 + internal/wizard.zsh | 1 + 3 files changed, 9 insertions(+) diff --git a/internal/icons.zsh b/internal/icons.zsh index b551c733..4a60756b 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -71,6 +71,7 @@ function _p9k_init_icons() { LINUX_ARTIX_ICON '\uE271'$s #  LINUX_RHEL_ICON '\uE271'$s #  LINUX_AMZN_ICON '\uE271'$s #  + LINUX_ENDEAVOUROS_ICON '\uE271'$s #  SUNOS_ICON '\U1F31E'$q # 🌞 HOME_ICON '\uE12C'$s #  HOME_SUB_ICON '\uE18D'$s #  @@ -209,6 +210,7 @@ function _p9k_init_icons() { LINUX_ARTIX_ICON '\uF17C'$s #  LINUX_RHEL_ICON '\uF17C'$s #  LINUX_AMZN_ICON '\uF17C'$s #  + LINUX_ENDEAVOUROS_ICON '\uF17C'$s #  SUNOS_ICON '\uF185 ' #  HOME_ICON '\uF015'$s #  HOME_SUB_ICON '\uF07C'$s #  @@ -348,6 +350,7 @@ function _p9k_init_icons() { LINUX_ARTIX_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" LINUX_RHEL_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" LINUX_AMZN_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" + LINUX_ENDEAVOUROS_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" SUNOS_ICON "${CODEPOINT_OF_AWESOME_SUN_O:+\\u$CODEPOINT_OF_AWESOME_SUN_O }" HOME_ICON "${CODEPOINT_OF_AWESOME_HOME:+\\u$CODEPOINT_OF_AWESOME_HOME$s}" HOME_SUB_ICON "${CODEPOINT_OF_AWESOME_FOLDER_OPEN:+\\u$CODEPOINT_OF_AWESOME_FOLDER_OPEN$s}" @@ -480,6 +483,7 @@ function _p9k_init_icons() { LINUX_UBUNTU_ICON '\uF31b'$s #  LINUX_RHEL_ICON '\uF316'$s #  LINUX_AMZN_ICON '\uF270'$s #  + LINUX_ENDEAVOUROS_ICON '\UF322'$s #  LINUX_ICON '\uF17C' #  SUNOS_ICON '\uF185 ' #  HOME_ICON '\uF015'$s #  @@ -615,6 +619,7 @@ function _p9k_init_icons() { LINUX_UBUNTU_ICON '\uF31b'$s #  LINUX_RHEL_ICON '\uF316'$s #  LINUX_AMZN_ICON '\uF270'$s #  + LINUX_ENDEAVOUROS_ICON '\uF17C' #  LINUX_ICON '\uF17C' #  SUNOS_ICON '\uF185 ' #  HOME_ICON '\uF015'$s #  @@ -748,6 +753,7 @@ function _p9k_init_icons() { LINUX_ARTIX_ICON 'artix' LINUX_RHEL_ICON 'rhel' LINUX_AMZN_ICON 'amzn' + LINUX_ENDEAVOUROS_ICON 'edvos' SUNOS_ICON 'sunos' HOME_ICON '' HOME_SUB_ICON '' @@ -882,6 +888,7 @@ function _p9k_init_icons() { LINUX_ARTIX_ICON 'Art' LINUX_RHEL_ICON 'RH' LINUX_AMZN_ICON 'Amzn' + LINUX_ENDEAVOUROS_ICON 'Edv' SUNOS_ICON 'Sun' HOME_ICON '' HOME_SUB_ICON '' diff --git a/internal/p10k.zsh b/internal/p10k.zsh index b0096548..cd49b689 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8485,6 +8485,7 @@ function _p9k_init_cacheable() { *artix*) _p9k_set_os Linux LINUX_ARTIX_ICON;; *rhel*) _p9k_set_os Linux LINUX_RHEL_ICON;; amzn) _p9k_set_os Linux LINUX_AMZN_ICON;; + endeavouros) _p9k_set_os Linux LINUX_ENDEAVOUROS_ICON;; *) _p9k_set_os Linux LINUX_ICON;; esac ;; diff --git a/internal/wizard.zsh b/internal/wizard.zsh index f93fd0a3..ab5c7ea8 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1115,6 +1115,7 @@ function os_icon_name() { *artix*) echo LINUX_ARTIX_ICON;; *rhel*) echo LINUX_RHEL_ICON;; amzn) echo LINUX_AMZN_ICON;; + endeavouros) echo LINUX_ENDEAVOUROS_ICON;; *) echo LINUX_ICON;; esac ;; From 6314edf35c2529179449a12d24071803b1eaa029 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 2 Apr 2023 14:19:00 +0200 Subject: [PATCH 238/380] wizard: rename capability "arrow" to "quotes" --- internal/wizard.zsh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index ab5c7ea8..66fe73db 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -744,7 +744,7 @@ function ask_python() { return 0 } -function ask_arrow() { +function ask_quotes() { add_widget 0 flowing -c %BDoes this look like%b "%2F><%f" %Bbut taller and "fatter?%b" add_widget 0 print -P "" add_widget 0 flowing -c -- "---> \u276F\u276E <---" @@ -760,8 +760,8 @@ function ask_arrow() { ask ynr case $choice in r) return 1;; - y) cap_arrow=1;; - n) cap_arrow=0;; + y) cap_quotes=1;; + n) cap_quotes=0;; esac return 0 } @@ -912,7 +912,7 @@ function ask_charset() { cap_python=0 cap_debian=0 cap_lock=0 - cap_arrow=0 + cap_quotes=0 ;; esac return 0 @@ -2047,7 +2047,7 @@ while true; do local gap_char=' ' prompt_char='❯' down_triangle='\uE0BC' up_triangle='\uE0BA' slanted_bar='\u2571' local left_subsep= right_subsep= left_tail= right_tail= left_head= right_head= time= local -i num_lines=2 empty_line=0 color=2 left_frame=1 right_frame=1 transient_prompt=0 - local -i cap_diamond=0 cap_python=0 cap_debian=0 cap_lock=0 cap_arrow=0 + local -i cap_diamond=0 cap_python=0 cap_debian=0 cap_lock=0 cap_quotes=0 local -a extra_icons=('' '' '') local -a frame_color=(244 242 240 238) local -a color_name=(Lightest Light Dark Darkest) @@ -2081,8 +2081,8 @@ while true; do if (( cap_diamond )); then POWERLEVEL9K_MODE=powerline else - ask_arrow || continue - (( cap_arrow )) && POWERLEVEL9K_MODE=compatible || POWERLEVEL9K_MODE=ascii + ask_quotes || continue + (( cap_quotes )) && POWERLEVEL9K_MODE=compatible || POWERLEVEL9K_MODE=ascii fi fi elif (( ! cap_diamond )); then From d031df752b6c5a8c7f4e2bb33b23af01a559ff2e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 2 Apr 2023 14:22:01 +0200 Subject: [PATCH 239/380] wizard: detect POWERLEVEL9K_MODE=nerdfont-v3 This is Step 2 of https://github.com/romkatv/powerlevel10k/issues/2217#issuecomment-1493271666. --- internal/wizard.zsh | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 66fe73db..f15dfb35 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -766,11 +766,12 @@ function ask_quotes() { return 0 } -function ask_debian() { - add_widget 0 flowing -c %BDoes this look like a%b "%2FDebian logo%f" "%B(swirl/spiral)?%b" - add_widget 0 flowing -c reference: "$(href https://debian.org/logos/openlogo-nd.svg)" +function ask_arrow() { + [[ -n $2 ]] && add_widget 0 flowing -c "$2" + add_widget 0 flowing -c %BDoes this look like an%b "%2Fupwards arrow%f%B?%b" + add_widget 0 flowing -c reference: "$(href https://graphemica.com/%F0%9F%A0%89)" add_widget 0 print -P "" - add_widget 0 flowing -c -- "---> \uF306 <---" + add_widget 0 flowing -c -- "---> $1 <---" add_widget 0 print -P "" add_widget 3 add_widget 0 print -P "%B(y) Yes.%b" @@ -783,8 +784,8 @@ function ask_debian() { ask ynr case $choice in r) return 1;; - y) cap_debian=1;; - n) cap_debian=0;; + y) cap_arrow=1;; + n) cap_arrow=0;; esac return 0 } @@ -910,7 +911,7 @@ function ask_charset() { POWERLEVEL9K_ICON_PADDING=none cap_diamond=0 cap_python=0 - cap_debian=0 + cap_arrow=0 cap_lock=0 cap_quotes=0 ;; @@ -1721,9 +1722,14 @@ function generate_config() { sub PYTHON_ICON "'🐍'" fi - if [[ $POWERLEVEL9K_MODE == nerdfont-complete ]]; then - sub BATTERY_STAGES "'\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578'" - fi + case $POWERLEVEL9K_MODE in + nerdfont-complete) + sub BATTERY_STAGES "'\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578'" + ;; + nerdfont-v3) + sub BATTERY_STAGES "'\UF008E\UF007A\UF007B\UF007C\UF007D\UF007E\UF007F\UF0080\UF0081\UF0082\UF0079'" + ;; + esac if [[ $style == (classic|rainbow) ]]; then if [[ $style == classic ]]; then @@ -2047,7 +2053,7 @@ while true; do local gap_char=' ' prompt_char='❯' down_triangle='\uE0BC' up_triangle='\uE0BA' slanted_bar='\u2571' local left_subsep= right_subsep= left_tail= right_tail= left_head= right_head= time= local -i num_lines=2 empty_line=0 color=2 left_frame=1 right_frame=1 transient_prompt=0 - local -i cap_diamond=0 cap_python=0 cap_debian=0 cap_lock=0 cap_quotes=0 + local -i cap_diamond=0 cap_python=0 cap_arrow=0 cap_lock=0 cap_quotes=0 local -a extra_icons=('' '' '') local -a frame_color=(244 242 240 238) local -a color_name=(Lightest Light Dark Darkest) @@ -2088,12 +2094,17 @@ while true; do elif (( ! cap_diamond )); then POWERLEVEL9K_MODE=awesome-fontconfig else - ask_debian || continue - if (( cap_debian )); then - POWERLEVEL9K_MODE=nerdfont-complete + ask_arrow '\UF0737' || continue + if (( cap_arrow )); then + POWERLEVEL9K_MODE=nerdfont-v3 else - POWERLEVEL9K_MODE=awesome-fontconfig - ask_python || continue + ask_arrow '\uFC35' "Let's try another one." || continue + if (( cap_arrow )); then + POWERLEVEL9K_MODE=nerdfont-complete + else + POWERLEVEL9K_MODE=awesome-fontconfig + ask_python || continue + fi fi fi fi From 8167383665ff5def22670229a0eb4186aa05a361 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 3 Apr 2023 12:34:11 +0200 Subject: [PATCH 240/380] wizard bug fix: offer advanced powerline options when using nerdfont-v3 --- internal/wizard.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index f15dfb35..ecc9a476 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1190,7 +1190,7 @@ function ask_separators() { add_widget 2 add_widget 0 print -P "%B(2) Vertical.%b" add_prompt left_sep='' right_sep='' left_subsep=$vertical_bar right_subsep=$vertical_bar - if [[ $POWERLEVEL9K_MODE == nerdfont-complete ]]; then + if [[ $POWERLEVEL9K_MODE == nerdfont-* ]]; then extra+=3 add_widget 0 print -P "%B(3) Slanted.%b" add_prompt left_sep=$down_triangle right_sep=$up_triangle left_subsep=$slanted_bar right_subsep=$slanted_bar @@ -1254,7 +1254,7 @@ function ask_heads() { fi add_widget 0 print -P "%B(2) Blurred.%b" add_prompt left_head=$fade_out right_head=$fade_in - if [[ $POWERLEVEL9K_MODE == nerdfont-complete ]]; then + if [[ $POWERLEVEL9K_MODE == nerdfont-* ]]; then extra+=3 add_widget 0 print -P "%B(3) Slanted.%b" add_prompt left_head=$down_triangle right_head=$up_triangle @@ -1322,7 +1322,7 @@ function ask_tails() { extra+=3 add_widget 0 print -P "%B(3) Sharp.%b" add_prompt left_tail=$left_triangle right_tail=$right_triangle - if [[ $POWERLEVEL9K_MODE == nerdfont-complete ]]; then + if [[ $POWERLEVEL9K_MODE == nerdfont-* ]]; then extra+=4 add_widget 0 print -P "%B(4) Slanted.%b" add_prompt left_tail=$up_triangle right_tail=$down_triangle From b474978b2e9435c10ca66f8281352ebc825264f4 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 3 Apr 2023 14:23:14 +0200 Subject: [PATCH 241/380] wizard: prefer POWERLEVEL9K_MODE=nerdfont-complete over nerdfont-v3 Apparently Windows Terminal has a bug. To reproduce: print -P '\UF0737%K{red} %k' The expected output: x_ Here 'x' signifies any glyph of width 1, and '_' signifies a red block. The actual output: x _ Notice the space. The output of the following two commands is as expected: print -P '\UFC35%K{red} %k' print -P '\UFC35x' --- internal/wizard.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index ecc9a476..c2079e52 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -2094,13 +2094,13 @@ while true; do elif (( ! cap_diamond )); then POWERLEVEL9K_MODE=awesome-fontconfig else - ask_arrow '\UF0737' || continue + ask_arrow '\uFC35' || continue if (( cap_arrow )); then - POWERLEVEL9K_MODE=nerdfont-v3 + POWERLEVEL9K_MODE=nerdfont-complete else - ask_arrow '\uFC35' "Let's try another one." || continue + ask_arrow '\UF0737' "Let's try another one." || continue if (( cap_arrow )); then - POWERLEVEL9K_MODE=nerdfont-complete + POWERLEVEL9K_MODE=nerdfont-v3 else POWERLEVEL9K_MODE=awesome-fontconfig ask_python || continue From 1cff22491b730c6a7bed7a306376f975ee16f81f Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 5 Apr 2023 18:14:52 +0200 Subject: [PATCH 242/380] fix the kubernetes icon (#2217) --- internal/icons.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/icons.zsh b/internal/icons.zsh index 4a60756b..0a6c665d 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -524,7 +524,7 @@ function _p9k_init_icons() { EXECUTION_TIME_ICON '\uF252'$s #  SSH_ICON '\uF489'$s #  VPN_ICON '\UF023' #  - KUBERNETES_ICON '\F10FE' # 󱃾 + KUBERNETES_ICON '\UF10FE' # 󱃾 DROPBOX_ICON '\UF16B'$s #  DATE_ICON '\uF073 ' #  TIME_ICON '\uF017 ' #  From fb1287fedbb877201572d164ba0bad5c9d375b4f Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 7 Apr 2023 13:24:49 +0200 Subject: [PATCH 243/380] simplify _p9k_url_escape --- internal/p10k.zsh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index cd49b689..d638cfc1 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1747,16 +1747,9 @@ function _p9k_shorten_delim_len() { # Percents are duplicated because this function is currently used only # where the result is going to be percent-expanded. function _p9k_url_escape() { - if [[ $1 == [a-zA-Z0-9"/:_.-!'()~ "]# ]]; then - _p9k__ret=${1// /%%20} - else - local c - _p9k__ret= - for c in ${(s::)1}; do - [[ $c == [a-zA-Z0-9"/:_.-!'()~"] ]] || printf -v c '%%%%%02X' $(( #c )) - _p9k__ret+=$c - done - fi + emulate -L zsh -o no_multi_byte -o extended_glob + local MATCH MBEGIN MEND + _p9k__ret=${1//(#m)[^a-zA-Z0-9"\/:_.-!'()~"]/%%${(l:2::0:)$(([##16]#MATCH))}} } ################################################################ From bab655fb1f457de5ae5ad9f3c425a2e5186aa6b8 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 12 Apr 2023 11:07:32 +0200 Subject: [PATCH 244/380] do not infer nix_shell from PATH unless POWERLEVEL9K_NIX_SHELL_INFER_FROM_PATH is set to true (#2246) --- config/p10k-classic.zsh | 3 +++ config/p10k-lean-8colors.zsh | 3 +++ config/p10k-lean.zsh | 3 +++ config/p10k-rainbow.zsh | 3 +++ internal/p10k.zsh | 12 ++++++++---- 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index aead8089..441be2ce 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -752,6 +752,9 @@ # Nix shell color. typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=74 + # Display the icon of nix_shell if PATH contains a subdirectory of /nix/store. + # typeset -g POWERLEVEL9K_NIX_SHELL_INFER_FROM_PATH=false + # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index c40b3efa..50e42617 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -750,6 +750,9 @@ # Nix shell color. typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=4 + # Display the icon of nix_shell if PATH contains a subdirectory of /nix/store. + # typeset -g POWERLEVEL9K_NIX_SHELL_INFER_FROM_PATH=false + # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 3009d464..b938ce69 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -746,6 +746,9 @@ # Nix shell color. typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=74 + # Display the icon of nix_shell if PATH contains a subdirectory of /nix/store. + # typeset -g POWERLEVEL9K_NIX_SHELL_INFER_FROM_PATH=false + # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 775b919e..e989b0a7 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -777,6 +777,9 @@ typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=0 typeset -g POWERLEVEL9K_NIX_SHELL_BACKGROUND=4 + # Display the icon of nix_shell if PATH contains a subdirectory of /nix/store. + # typeset -g POWERLEVEL9K_NIX_SHELL_INFER_FROM_PATH=false + # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= diff --git a/internal/p10k.zsh b/internal/p10k.zsh index d638cfc1..64a58591 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4956,13 +4956,11 @@ function prompt_nix_shell() { } _p9k_prompt_nix_shell_init() { - typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${IN_NIX_SHELL:#0}${${path[(I)/nix/store/*]}:#0}' + typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"=$_p9k_nix_shell_cond } function instant_prompt_nix_shell() { - _p9k_prompt_segment prompt_nix_shell 4 $_p9k_color1 NIX_SHELL_ICON 1 \ - '${IN_NIX_SHELL:#0}${${path[(I)/nix/store/*]}:#0}' \ - '${(M)IN_NIX_SHELL:#(pure|impure)}' + _p9k_prompt_segment prompt_nix_shell 4 $_p9k_color1 NIX_SHELL_ICON 1 "$_p9k_nix_shell_cond" '${(M)IN_NIX_SHELL:#(pure|impure)}' } function prompt_terraform() { @@ -7651,6 +7649,12 @@ _p9k_init_params() { # If set to true, time will update every second. _p9k_declare -b POWERLEVEL9K_EXPERIMENTAL_TIME_REALTIME 0 + _p9k_declare -b POWERLEVEL9K_NIX_SHELL_INFER_FROM_PATH 0 + typeset -g _p9k_nix_shell_cond='${IN_NIX_SHELL:#0}' + if (( _POWERLEVEL9K_NIX_SHELL_INFER_FROM_PATH )); then + _p9k_nix_shell_cond+='${path[(r)/nix/store/*]}' + fi + local -i i=1 while (( i <= $#_POWERLEVEL9K_LEFT_PROMPT_ELEMENTS )); do local segment=${${(U)_POWERLEVEL9K_LEFT_PROMPT_ELEMENTS[i]}//İ/I} From f27d192eb20cbf9cf690a372f342110b7347c8d6 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 12 Apr 2023 11:08:01 +0200 Subject: [PATCH 245/380] bump version --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 64a58591..4354a2e0 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8354,7 +8354,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v141\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v144\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$__p9k_force_term_shell_integration$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' From 954f38d589212753e1c767f56b3a3fed9cfacfe2 Mon Sep 17 00:00:00 2001 From: Lucas Larson Date: Fri, 14 Apr 2023 10:37:01 -0400 Subject: [PATCH 246/380] use less surprising input for clock option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit for the three clock options (no clock, a 12-hour clock, or a 24-hour clock), use the first character of the option as the input to fix #2266. This pull request is a reissue of – and supersession of – #2267, which was pushed on a branch with non-ASCII characters in the name. Signed-off-by: Lucas Larson --- internal/wizard.zsh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index c2079e52..a89b40f6 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1037,19 +1037,19 @@ function ask_time() { add_widget 0 flowing -c "%BShow current time?%b" add_widget 0 print add_widget 1 - add_widget 0 print -P "%B(1) No.%b" + add_widget 0 print -P "%B(n) No.%b" add_prompt time= + add_widget 0 print -P "%B(1) 12-hour format.%b" + add_prompt time=$time_12h add_widget 0 print -P "%B(2) 24-hour format.%b" add_prompt time=$time_24h - add_widget 0 print -P "%B(3) 12-hour format.%b" - add_prompt time=$time_12h add_widget 0 print -P "(r) Restart from the beginning." - ask 123r + ask n12r case $choice in r) return 1;; - 1) time=;; + n) time=;; + 1) time=$time_12h; options+='12h time';; 2) time=$time_24h; options+='24h time';; - 3) time=$time_12h; options+='12h time';; esac return 0 } From 045f006c50d782a6d3acbd8a07d1595322ff7e43 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 18 Apr 2023 09:50:43 +0200 Subject: [PATCH 247/380] correctly resolve node_version when using nodenv (#2268) --- internal/p10k.zsh | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 4354a2e0..ac4783e4 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -2424,14 +2424,41 @@ function _p9k_cached_cmd() { prompt_node_version() { _p9k_upglob package.json -. local -i idx=$? - if (( idx )); then - _p9k_cached_cmd 0 $_p9k__parent_dirs[idx]/package.json node --version || return - else - (( _POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY )) && return - _p9k_cached_cmd 0 '' node --version || return + (( idx || ! _POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY )) || return + + local node=$commands[node] + local -a file_deps env_deps + if [[ $node == ${NODENV_ROOT:-$HOME/.nodenv}/shims/node ]]; then + env_deps+=("$NODENV_VERSION") + file_deps+=(${NODENV_ROOT:-$HOME/.nodenv}/version) + if [[ $NODENV_DIR != (|.) ]]; then + [[ $NODENV_DIR == /* ]] && local dir=$NODENV_DIR || local dir="$_p9k__cwd_a/$NODENV_DIR" + dir=${dir:A} + if [[ $dir != $_p9k__cwd_a ]]; then + while true; do + if [[ -e $dir/.node-version ]]; then + file_deps+=($dir/.node-version) + break + fi + [[ $dir == (/|.) ]] && break + dir=${dir:h} + done + fi + fi + _p9k_upglob .node-version -. || file_deps+=($_p9k__parent_dirs[idx]/.node-version) + elif (( idx )); then + file_deps+=($_p9k__parent_dirs[idx]/package.json) fi - [[ $_p9k__ret == v?* ]] || return - _p9k_prompt_segment "$0" "green" "white" 'NODE_ICON' 0 '' "${_p9k__ret#v}" + + if ! _p9k_cache_stat_get "$0 $#env_deps ${(j: :)${(@q)env_deps}} ${(j: :)${(@q)file_deps}}" $file_deps $node; then + local out + out=$($node --version 2>/dev/null) + _p9k_cache_stat_set $(( ! $? )) "$out" + fi + (( $_p9k__cache_val[1] )) || return + local v=$_p9k__cache_val[2] + [[ $v == v?* ]] || return + _p9k_prompt_segment "$0" "green" "white" 'NODE_ICON' 0 '' "${${v#v}//\%/%%}" } _p9k_prompt_node_version_init() { @@ -8354,7 +8381,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v144\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v145\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$__p9k_force_term_shell_integration$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' From 94c4428ddc9aab97aeaf1c7fffe2f13cdcd1b8bb Mon Sep 17 00:00:00 2001 From: Martin Mosler Date: Sun, 23 Apr 2023 21:08:36 +0200 Subject: [PATCH 248/380] added icon for kali linux --- internal/icons.zsh | 7 +++++++ internal/p10k.zsh | 1 + 2 files changed, 8 insertions(+) diff --git a/internal/icons.zsh b/internal/icons.zsh index 0a6c665d..cb0c3995 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -52,6 +52,7 @@ function _p9k_init_icons() { LINUX_DEBIAN_ICON '\uE271'$s #  LINUX_RASPBIAN_ICON '\uE271'$s #  LINUX_UBUNTU_ICON '\uE271'$s #  + LINUX_KALI_ICON '\uE271'$s #  LINUX_CENTOS_ICON '\uE271'$s #  LINUX_COREOS_ICON '\uE271'$s #  LINUX_ELEMENTARY_ICON '\uE271'$s #  @@ -191,6 +192,7 @@ function _p9k_init_icons() { LINUX_DEBIAN_ICON '\uF17C'$s #  LINUX_RASPBIAN_ICON '\uF17C'$s #  LINUX_UBUNTU_ICON '\uF17C'$s #  + LINUX_KALI_ICON '\uF17C'$s #  LINUX_CENTOS_ICON '\uF17C'$s #  LINUX_COREOS_ICON '\uF17C'$s #  LINUX_ELEMENTARY_ICON '\uF17C'$s #  @@ -331,6 +333,7 @@ function _p9k_init_icons() { LINUX_DEBIAN_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" LINUX_RASPBIAN_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" LINUX_UBUNTU_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" + LINUX_KALI_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" LINUX_CENTOS_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" LINUX_COREOS_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" LINUX_ELEMENTARY_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" @@ -464,6 +467,7 @@ function _p9k_init_icons() { LINUX_CENTOS_ICON '\uF304'$s #  LINUX_COREOS_ICON '\uF305'$s #  LINUX_DEBIAN_ICON '\uF306' #  + LINUX_KALI_ICON '\uF327' #  LINUX_RASPBIAN_ICON '\uF315' #  LINUX_ELEMENTARY_ICON '\uF309'$s #  LINUX_FEDORA_ICON '\uF30a'$s #  @@ -600,6 +604,7 @@ function _p9k_init_icons() { LINUX_CENTOS_ICON '\uF304'$s #  LINUX_COREOS_ICON '\uF305'$s #  LINUX_DEBIAN_ICON '\uF306' #  + LINUX_KALI_ICON '\uF327' #  LINUX_RASPBIAN_ICON '\uF315' #  LINUX_ELEMENTARY_ICON '\uF309'$s #  LINUX_FEDORA_ICON '\uF30a'$s #  @@ -732,6 +737,7 @@ function _p9k_init_icons() { LINUX_ICON 'linux' LINUX_ARCH_ICON 'arch' LINUX_DEBIAN_ICON 'debian' + LINUX_KALI_ICON 'kali' LINUX_RASPBIAN_ICON 'pi' LINUX_UBUNTU_ICON 'ubuntu' LINUX_CENTOS_ICON 'centos' @@ -867,6 +873,7 @@ function _p9k_init_icons() { LINUX_ICON 'Lx' LINUX_ARCH_ICON 'Arc' LINUX_DEBIAN_ICON 'Deb' + LINUX_KALI_ICON 'Kal' LINUX_RASPBIAN_ICON 'RPi' LINUX_UBUNTU_ICON 'Ubu' LINUX_CENTOS_ICON 'Cen' diff --git a/internal/p10k.zsh b/internal/p10k.zsh index ac4783e4..87c5017d 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8493,6 +8493,7 @@ function _p9k_init_cacheable() { *elementary*) _p9k_set_os Linux LINUX_ELEMENTARY_ICON;; *fedora*) _p9k_set_os Linux LINUX_FEDORA_ICON;; *coreos*) _p9k_set_os Linux LINUX_COREOS_ICON;; + *kali*) _p9k_set_os Linux LINUX_KALI_ICON;; *gentoo*) _p9k_set_os Linux LINUX_GENTOO_ICON;; *mageia*) _p9k_set_os Linux LINUX_MAGEIA_ICON;; *centos*) _p9k_set_os Linux LINUX_CENTOS_ICON;; From bbea8d2d06382f6f0001c9212da91a319076f06e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 24 Apr 2023 10:39:39 +0200 Subject: [PATCH 249/380] use U+F327 (Kali Linux logo) only with POWERLEVEL9K_MODE=nerdfont-v3 (#2281) --- internal/icons.zsh | 8 ++++---- internal/wizard.zsh | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/icons.zsh b/internal/icons.zsh index cb0c3995..6b3a9b09 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -467,7 +467,6 @@ function _p9k_init_icons() { LINUX_CENTOS_ICON '\uF304'$s #  LINUX_COREOS_ICON '\uF305'$s #  LINUX_DEBIAN_ICON '\uF306' #  - LINUX_KALI_ICON '\uF327' #  LINUX_RASPBIAN_ICON '\uF315' #  LINUX_ELEMENTARY_ICON '\uF309'$s #  LINUX_FEDORA_ICON '\uF30a'$s #  @@ -485,6 +484,7 @@ function _p9k_init_icons() { LINUX_VOID_ICON '\UF32E'$s #  LINUX_ARTIX_ICON '\UF31F'$s #  LINUX_UBUNTU_ICON '\uF31b'$s #  + LINUX_KALI_ICON '\uF327'$s #  LINUX_RHEL_ICON '\uF316'$s #  LINUX_AMZN_ICON '\uF270'$s #  LINUX_ENDEAVOUROS_ICON '\UF322'$s #  @@ -604,7 +604,6 @@ function _p9k_init_icons() { LINUX_CENTOS_ICON '\uF304'$s #  LINUX_COREOS_ICON '\uF305'$s #  LINUX_DEBIAN_ICON '\uF306' #  - LINUX_KALI_ICON '\uF327' #  LINUX_RASPBIAN_ICON '\uF315' #  LINUX_ELEMENTARY_ICON '\uF309'$s #  LINUX_FEDORA_ICON '\uF30a'$s #  @@ -622,6 +621,7 @@ function _p9k_init_icons() { LINUX_VOID_ICON '\uF17C' #  LINUX_ARTIX_ICON '\uF17C' #  LINUX_UBUNTU_ICON '\uF31b'$s #  + LINUX_KALI_ICON '\uF17C' #  LINUX_RHEL_ICON '\uF316'$s #  LINUX_AMZN_ICON '\uF270'$s #  LINUX_ENDEAVOUROS_ICON '\uF17C' #  @@ -737,9 +737,9 @@ function _p9k_init_icons() { LINUX_ICON 'linux' LINUX_ARCH_ICON 'arch' LINUX_DEBIAN_ICON 'debian' - LINUX_KALI_ICON 'kali' LINUX_RASPBIAN_ICON 'pi' LINUX_UBUNTU_ICON 'ubuntu' + LINUX_KALI_ICON 'kali' LINUX_CENTOS_ICON 'centos' LINUX_COREOS_ICON 'coreos' LINUX_ELEMENTARY_ICON 'elementary' @@ -873,9 +873,9 @@ function _p9k_init_icons() { LINUX_ICON 'Lx' LINUX_ARCH_ICON 'Arc' LINUX_DEBIAN_ICON 'Deb' - LINUX_KALI_ICON 'Kal' LINUX_RASPBIAN_ICON 'RPi' LINUX_UBUNTU_ICON 'Ubu' + LINUX_KALI_ICON 'Kal' LINUX_CENTOS_ICON 'Cen' LINUX_COREOS_ICON 'Cor' LINUX_ELEMENTARY_ICON 'Elm' diff --git a/internal/wizard.zsh b/internal/wizard.zsh index a89b40f6..c18474b2 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1100,6 +1100,7 @@ function os_icon_name() { *elementary*) echo LINUX_ELEMENTARY_ICON;; *fedora*) echo LINUX_FEDORA_ICON;; *coreos*) echo LINUX_COREOS_ICON;; + *kali*) echo LINUX_KALI_ICON;; *gentoo*) echo LINUX_GENTOO_ICON;; *mageia*) echo LINUX_MAGEIA_ICON;; *centos*) echo LINUX_CENTOS_ICON;; From 630c1868df23bb3b62abf90d50e8801ca084b9d3 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 29 Apr 2023 08:51:49 +0200 Subject: [PATCH 250/380] add POWERLEVEL9K_GITSTATUS_INIT_TIMEOUT_SEC --- internal/p10k.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 87c5017d..7e6affe6 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7611,6 +7611,7 @@ _p9k_init_params() { _p9k_declare -i POWERLEVEL9K_VCS_COMMITS_AHEAD_MAX_NUM -1 _p9k_declare -i POWERLEVEL9K_VCS_COMMITS_BEHIND_MAX_NUM -1 _p9k_declare -b POWERLEVEL9K_VCS_RECURSE_UNTRACKED_DIRS 0 + _p9k_declare -F POWERLEVEL9K_GITSTATUS_INIT_TIMEOUT_SEC 5 _p9k_declare -b POWERLEVEL9K_DISABLE_GITSTATUS 0 _p9k_declare -e POWERLEVEL9K_VI_INSERT_MODE_STRING "INSERT" _p9k_declare -e POWERLEVEL9K_VI_COMMAND_MODE_STRING "NORMAL" @@ -8381,7 +8382,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v145\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v146\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$__p9k_force_term_shell_integration$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' @@ -8661,7 +8662,7 @@ _p9k_init_vcs() { () { trap 'return 130' INT { - gitstatus_start_p9k_ POWERLEVEL9K + gitstatus_start_p9k_ -t $_POWERLEVEL9K_GITSTATUS_INIT_TIMEOUT_SEC POWERLEVEL9K } always { trap ':' INT } @@ -8705,6 +8706,7 @@ _p9k_init_vcs() { -d $_POWERLEVEL9K_VCS_UNTRACKED_MAX_NUM \ -c $_POWERLEVEL9K_VCS_CONFLICTED_MAX_NUM \ -m $_POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY \ + -t $_POWERLEVEL9K_GITSTATUS_INIT_TIMEOUT_SEC \ ${${_POWERLEVEL9K_VCS_RECURSE_UNTRACKED_DIRS:#0}:+-e} \ POWERLEVEL9K } always { From dff735c26173183dc44864ae5d9aa4c1d74fe150 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 29 Apr 2023 08:52:46 +0200 Subject: [PATCH 251/380] increase the default value of POWERLEVEL9K_GITSTATUS_INIT_TIMEOUT_SEC from 5 to 10 --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 7e6affe6..a8223299 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7611,7 +7611,7 @@ _p9k_init_params() { _p9k_declare -i POWERLEVEL9K_VCS_COMMITS_AHEAD_MAX_NUM -1 _p9k_declare -i POWERLEVEL9K_VCS_COMMITS_BEHIND_MAX_NUM -1 _p9k_declare -b POWERLEVEL9K_VCS_RECURSE_UNTRACKED_DIRS 0 - _p9k_declare -F POWERLEVEL9K_GITSTATUS_INIT_TIMEOUT_SEC 5 + _p9k_declare -F POWERLEVEL9K_GITSTATUS_INIT_TIMEOUT_SEC 10 _p9k_declare -b POWERLEVEL9K_DISABLE_GITSTATUS 0 _p9k_declare -e POWERLEVEL9K_VI_INSERT_MODE_STRING "INSERT" _p9k_declare -e POWERLEVEL9K_VI_COMMAND_MODE_STRING "NORMAL" @@ -8382,7 +8382,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v146\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v147\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$__p9k_force_term_shell_integration$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' From ce0bee979bec1b63d2d2005d96253bbe87fe2a72 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 4 May 2023 10:40:52 +0200 Subject: [PATCH 252/380] wizard: check for unicode 9 support before asking about U+F0737 --- internal/wizard.zsh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index c18474b2..c77f8151 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -767,6 +767,11 @@ function ask_quotes() { } function ask_arrow() { + # This condition holds as long as zsh is compiled with unicode 9 support. + if (( ${(m)#${(g::)1}} != 1 )); then + cap_arrow=0 + return + fi [[ -n $2 ]] && add_widget 0 flowing -c "$2" add_widget 0 flowing -c %BDoes this look like an%b "%2Fupwards arrow%f%B?%b" add_widget 0 flowing -c reference: "$(href https://graphemica.com/%F0%9F%A0%89)" From 0af598cbed78660066f8a8f4465844501ba5695b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 4 May 2023 11:50:14 +0200 Subject: [PATCH 253/380] wizard: add a screen for detecting faulty terminals that render glyphs such as U+F0001 as wide (e.g., Windows Terminal) --- internal/wizard.zsh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index c77f8151..2265b07c 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -795,6 +795,39 @@ function ask_arrow() { return 0 } +function print_indented() { + local -i max_width=$1 + local text=$2 + local -i indent='(wizard_columns - max_width) / 2' + print -P "${(l:$indent:: :)}$text" +} + +function ask_width() { + add_widget 0 flowing -c %BWhat digit is the%b "%2Fdownwards arrow%f" %Bpointing "at?%b" + add_widget 0 print -P "" + add_widget 0 print_indented 11 '%3F\UF0734%f %3F\UF0734%f %3F\UF0734%f %2F\UF072E%f' + add_widget 0 print_indented 11 ' 111222' + add_widget 0 print -P "" + add_widget 3 + add_widget 0 print -P "%B(1) It is pointing at '1'.%b" + add_widget 0 print -P "" + add_widget 1 + add_widget 0 print -P "%B(2) It is pointing at '2'.%b" + add_widget 0 print -P "" + add_widget 1 + add_widget 0 print -P "%B(3) Something else.%b" + add_widget 0 print -P "" + add_widget 2 + add_widget 0 print -P "(r) Restart from the beginning." + ask 123r + case $choice in + r) return 1;; + 1) cap_arrow=1;; + 2|3) cap_arrow=0;; + esac + return 0 +} + function ask_icon_padding() { if [[ $POWERLEVEL9K_MODE == (powerline|compatible|ascii) ]]; then POWERLEVEL9K_ICON_PADDING=none @@ -2105,6 +2138,9 @@ while true; do POWERLEVEL9K_MODE=nerdfont-complete else ask_arrow '\UF0737' "Let's try another one." || continue + if (( cap_arrow )); then + ask_width || continue + fi if (( cap_arrow )); then POWERLEVEL9K_MODE=nerdfont-v3 else From 5d16c106ed2807fb368dcac4df0e2b3dd619bb8d Mon Sep 17 00:00:00 2001 From: Zaidhaan Hussain Date: Sat, 6 May 2023 15:52:08 +0800 Subject: [PATCH 254/380] nvm: implement POWERLEVEL9K_NVM_SHOW_SYSTEM and default to true --- config/p10k-classic.zsh | 2 ++ config/p10k-lean-8colors.zsh | 2 ++ config/p10k-lean.zsh | 2 ++ config/p10k-rainbow.zsh | 2 ++ internal/p10k.zsh | 4 ++++ 5 files changed, 12 insertions(+) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 441be2ce..231c8009 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1007,6 +1007,8 @@ ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### # Nvm color. typeset -g POWERLEVEL9K_NVM_FOREGROUND=70 + # If set to false, hide node version if it's equal to "system". + typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true # Custom icon. # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 50e42617..36dc7287 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -988,6 +988,8 @@ ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### # Nvm color. typeset -g POWERLEVEL9K_NVM_FOREGROUND=2 + # If set to false, hide node version if it's equal to "system". + typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true # Custom icon. # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index b938ce69..09403985 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -984,6 +984,8 @@ ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### # Nvm color. typeset -g POWERLEVEL9K_NVM_FOREGROUND=70 + # If set to false, hide node version if it's equal to "system". + typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true # Custom icon. # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index e989b0a7..c6fd0553 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1053,6 +1053,8 @@ # Nvm color. typeset -g POWERLEVEL9K_NVM_FOREGROUND=0 typeset -g POWERLEVEL9K_NVM_BACKGROUND=5 + # If set to false, hide node version if it's equal to "system". + typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true # Custom icon. # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/internal/p10k.zsh b/internal/p10k.zsh index a8223299..cf32f9ba 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -2568,6 +2568,9 @@ prompt_nvm() { [[ -n $NVM_DIR ]] && _p9k_nvm_ls_current || return local current=$_p9k__ret ! _p9k_nvm_ls_default || [[ $_p9k__ret != $current ]] || return + if (( !_POWERLEVEL9K_NVM_SHOW_SYSTEM )); then + [[ $current == system ]] && return + fi _p9k_prompt_segment "$0" "magenta" "black" 'NODE_ICON' 0 '' "${${current#v}//\%/%%}" } @@ -7530,6 +7533,7 @@ _p9k_init_params() { _p9k_declare -b POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW 0 _p9k_declare -a POWERLEVEL9K_NODENV_SOURCES -- shell local global _p9k_declare -b POWERLEVEL9K_NODENV_SHOW_SYSTEM 1 + _p9k_declare -b POWERLEVEL9K_NVM_SHOW_SYSTEM 1 _p9k_declare -b POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW 0 _p9k_declare -a POWERLEVEL9K_RBENV_SOURCES -- shell local global _p9k_declare -b POWERLEVEL9K_RBENV_SHOW_SYSTEM 1 From 4ed8aae3246da5c8f16978266ba6af139a1d06ca Mon Sep 17 00:00:00 2001 From: Zaidhaan Hussain Date: Sun, 7 May 2023 17:10:08 +0800 Subject: [PATCH 255/380] nvm: implement POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW and default to false --- config/p10k-classic.zsh | 3 +++ config/p10k-lean-8colors.zsh | 3 +++ config/p10k-lean.zsh | 3 +++ config/p10k-rainbow.zsh | 3 +++ internal/p10k.zsh | 6 +++++- 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 231c8009..d29aa2f8 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1007,6 +1007,9 @@ ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### # Nvm color. typeset -g POWERLEVEL9K_NVM_FOREGROUND=70 + # If set to false, hide node version if it's the same as default: + # $(nvm version current) == $(nvm version default). + typeset -g POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW=false # If set to false, hide node version if it's equal to "system". typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true # Custom icon. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 36dc7287..9fbd5fa2 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -988,6 +988,9 @@ ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### # Nvm color. typeset -g POWERLEVEL9K_NVM_FOREGROUND=2 + # If set to false, hide node version if it's the same as default: + # $(nvm version current) == $(nvm version default). + typeset -g POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW=false # If set to false, hide node version if it's equal to "system". typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true # Custom icon. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 09403985..844c1bfe 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -984,6 +984,9 @@ ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### # Nvm color. typeset -g POWERLEVEL9K_NVM_FOREGROUND=70 + # If set to false, hide node version if it's the same as default: + # $(nvm version current) == $(nvm version default). + typeset -g POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW=false # If set to false, hide node version if it's equal to "system". typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true # Custom icon. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index c6fd0553..c21d879a 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1053,6 +1053,9 @@ # Nvm color. typeset -g POWERLEVEL9K_NVM_FOREGROUND=0 typeset -g POWERLEVEL9K_NVM_BACKGROUND=5 + # If set to false, hide node version if it's the same as default: + # $(nvm version current) == $(nvm version default). + typeset -g POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW=false # If set to false, hide node version if it's equal to "system". typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true # Custom icon. diff --git a/internal/p10k.zsh b/internal/p10k.zsh index cf32f9ba..87af17e8 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -2567,7 +2567,10 @@ _p9k_nvm_ls_current() { prompt_nvm() { [[ -n $NVM_DIR ]] && _p9k_nvm_ls_current || return local current=$_p9k__ret - ! _p9k_nvm_ls_default || [[ $_p9k__ret != $current ]] || return + _p9k_nvm_ls_default + if (( !_POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW )); then + [[ $current == $_p9k__ret ]] && return + fi if (( !_POWERLEVEL9K_NVM_SHOW_SYSTEM )); then [[ $current == system ]] && return fi @@ -7533,6 +7536,7 @@ _p9k_init_params() { _p9k_declare -b POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW 0 _p9k_declare -a POWERLEVEL9K_NODENV_SOURCES -- shell local global _p9k_declare -b POWERLEVEL9K_NODENV_SHOW_SYSTEM 1 + _p9k_declare -b POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW 0 _p9k_declare -b POWERLEVEL9K_NVM_SHOW_SYSTEM 1 _p9k_declare -b POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW 0 _p9k_declare -a POWERLEVEL9K_RBENV_SOURCES -- shell local global From 016512f493c52d2b32d4ade4fbd4638617a8cf83 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 8 May 2023 09:04:43 +0200 Subject: [PATCH 256/380] nvm: change the default value of POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW to true and fix the way it is used (#2296) --- internal/p10k.zsh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 87af17e8..67561c45 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -2567,13 +2567,13 @@ _p9k_nvm_ls_current() { prompt_nvm() { [[ -n $NVM_DIR ]] && _p9k_nvm_ls_current || return local current=$_p9k__ret - _p9k_nvm_ls_default - if (( !_POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW )); then - [[ $current == $_p9k__ret ]] && return - fi - if (( !_POWERLEVEL9K_NVM_SHOW_SYSTEM )); then - [[ $current == system ]] && return - fi + (( _POWERLEVEL9K_NVM_SHOW_SYSTEM )) || + [[ $current != system ]] || + return + (( _POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW )) || + ! _p9k_nvm_ls_default || + [[ $_p9k__ret != $current ]] || + return _p9k_prompt_segment "$0" "magenta" "black" 'NODE_ICON' 0 '' "${${current#v}//\%/%%}" } @@ -7536,7 +7536,7 @@ _p9k_init_params() { _p9k_declare -b POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW 0 _p9k_declare -a POWERLEVEL9K_NODENV_SOURCES -- shell local global _p9k_declare -b POWERLEVEL9K_NODENV_SHOW_SYSTEM 1 - _p9k_declare -b POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW 0 + _p9k_declare -b POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW 1 _p9k_declare -b POWERLEVEL9K_NVM_SHOW_SYSTEM 1 _p9k_declare -b POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW 0 _p9k_declare -a POWERLEVEL9K_RBENV_SOURCES -- shell local global @@ -8390,7 +8390,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v147\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v148\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$__p9k_force_term_shell_integration$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' From 0a9eb73e161fd4d73140bd90c00c52602cf9aa42 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 8 May 2023 09:10:24 +0200 Subject: [PATCH 257/380] nvm: change the default value of POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW back to false (#2296) --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 67561c45..171c26f8 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7536,7 +7536,7 @@ _p9k_init_params() { _p9k_declare -b POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW 0 _p9k_declare -a POWERLEVEL9K_NODENV_SOURCES -- shell local global _p9k_declare -b POWERLEVEL9K_NODENV_SHOW_SYSTEM 1 - _p9k_declare -b POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW 1 + _p9k_declare -b POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW 0 _p9k_declare -b POWERLEVEL9K_NVM_SHOW_SYSTEM 1 _p9k_declare -b POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW 0 _p9k_declare -a POWERLEVEL9K_RBENV_SOURCES -- shell local global @@ -8390,7 +8390,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v148\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v149\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$__p9k_force_term_shell_integration$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' From 064f4d22097a8086eb857f04d11c00eb4b452275 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 10 May 2023 09:25:01 +0200 Subject: [PATCH 258/380] whitelist DCS in startup console output (#2299) --- internal/p10k.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 171c26f8..31a6d621 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6605,7 +6605,9 @@ function _p9k_clear_instant_prompt() { unset _z4h_saved_screen fi print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed] - local unexpected=${(S)${${content//$'\e[?'<->'c'}//$'\e['<->' q'}//$'\e'[^$'\a\e']#($'\a'|$'\e\\')} + local unexpected=${${content//$'\e[?'<->'c'}//$'\e['<->' q'} + unexpected=${(S)unexpected//$'\eP'*[^$'\e']#($'\e\\')} + unexpected=${(S)unexpected//$'\e'[^$'\a\e']#($'\a'|$'\e\\')} # Visual Studio Code prints this garbage. unexpected=${${unexpected//$'\033[1;32mShell integration activated\033[0m\n'}//$'\r'} if [[ -n $unexpected ]]; then From 1dcd8825937e2a58519bef4fb7ef3f0322a91db8 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 10 May 2023 09:25:31 +0200 Subject: [PATCH 259/380] set P9K_STARTUP_CONSOLE_OUTPUT to assist in debugging startup console output problems --- internal/p10k.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 31a6d621..ae9ffacd 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6610,6 +6610,7 @@ function _p9k_clear_instant_prompt() { unexpected=${(S)unexpected//$'\e'[^$'\a\e']#($'\a'|$'\e\\')} # Visual Studio Code prints this garbage. unexpected=${${unexpected//$'\033[1;32mShell integration activated\033[0m\n'}//$'\r'} + typeset -g P9K_STARTUP_CONSOLE_OUTPUT=("$content" "$unexpected") if [[ -n $unexpected ]]; then local omz1='[Oh My Zsh] Would you like to update? [Y/n]: ' local omz2='Updating Oh My Zsh' From 9b47a22f13402ba95262b66ada569f122f5528a0 Mon Sep 17 00:00:00 2001 From: Arthur McLain Date: Thu, 11 May 2023 03:24:16 +0200 Subject: [PATCH 260/380] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6629e910..314f839d 100644 --- a/README.md +++ b/README.md @@ -839,7 +839,7 @@ The command to update Powerlevel10k depends on how it was installed. | [Zplugin](#zplugin) | `zplugin update` | | [Zinit](#zinit) | `zinit update` | | [Zi](#zi) | `zi update` | -| [Zap](#zap) | `zap --update` | +| [Zap](#zap) | `zap update` | | [Homebrew](#homebrew) | `brew update && brew upgrade` | | [Arch Linux](#arch-linux) | `yay -S --noconfirm zsh-theme-powerlevel10k-git` | | [Alpine Linux](#alpine-linux) | `apk update && apk upgrade` | @@ -893,7 +893,7 @@ The command to update Powerlevel10k depends on how it was installed. | [Zplugin](#zplugin) | `zplugin delete romkatv/powerlevel10k` | | [Zinit](#zinit) | `zinit delete romkatv/powerlevel10k` | | [Zi](#zi) | `zi delete romkatv/powerlevel10k` | - | [Zap](#zap) | `zsh -ic 'zap --clean'` | + | [Zap](#zap) | `zsh -ic 'zap clean'` | | [Homebrew](#homebrew) | `brew uninstall powerlevel10k; brew untap romkatv/powerlevel10k` | | [Arch Linux](#arch-linux) | `yay -R --noconfirm zsh-theme-powerlevel10k-git` | | [Alpine Linux](#alpine-linux) | `apk del zsh-theme-powerlevel10k` | From 7bb3f053186f597b1a93a0fb7daf02e8fa83376d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 16 May 2023 10:16:05 +0200 Subject: [PATCH 261/380] annotate right prompt for warp (#2307) --- internal/p10k.zsh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index ae9ffacd..9e955413 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8266,9 +8266,17 @@ _p9k_init_prompt() { if (( _POWERLEVEL9K_TERM_SHELL_INTEGRATION )); then _p9k_prompt_prefix_left+=$'%{\e]133;A\a%}' _p9k_prompt_suffix_left+=$'%{\e]133;B\a%}' + if [[ $TERM_PROGRAM == WarpTerminal ]]; then + _p9k_prompt_prefix_right=$'%{\e]133;P;k=r\a%}'$_p9k_prompt_prefix_right + _p9k_prompt_suffix_right+=$'%{\e]133;B\a%}' + fi if (( $+_z4h_iterm_cmd && _z4h_can_save_restore_screen == 1 )); then _p9k_prompt_prefix_left+=$'%{\ePtmux;\e\e]133;A\a\e\\%}' _p9k_prompt_suffix_left+=$'%{\ePtmux;\e\e]133;B\a\e\\%}' + if [[ $TERM_PROGRAM == WarpTerminal ]]; then + _p9k_prompt_prefix_right=$'%{\ePtmux;\e\e]133;P;k=r\a\e\\%}'$_p9k_prompt_prefix_right + _p9k_prompt_suffix_right+=$'%{\ePtmux;\e\e]133;B\a\e\\%}' + fi fi fi @@ -8393,8 +8401,8 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v149\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' - _p9k__param_pat+=$__p9k_force_term_shell_integration$'\1' + _p9k__param_pat=$'v150\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat+=$__p9k_force_term_shell_integration$'\1'${(q)TERM_PROGRAM}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$GITSTATUS_CACHE_DIR\1$GITSTATUS_AUTO_INSTALL\1${ZLE_RPROMPT_INDENT:-1}\1' From f4a7e6d0e033b1428279313c6849ceec0a3f1757 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 16 May 2023 10:16:42 +0200 Subject: [PATCH 262/380] force shell integration when running under warp (#2307) --- internal/p10k.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 9e955413..4867f481 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8950,6 +8950,8 @@ _p9k_precmd_first() { if [[ -n $KITTY_SHELL_INTEGRATION && KITTY_SHELL_INTEGRATION[(wIe)no-prompt-mark] -eq 0 ]]; then KITTY_SHELL_INTEGRATION+=' no-prompt-mark' (( $+__p9k_force_term_shell_integration )) || typeset -gri __p9k_force_term_shell_integration=1 + elif [[ $TERM_PROGRAM == WarpTerminal ]]; then + (( $+__p9k_force_term_shell_integration )) || typeset -gri __p9k_force_term_shell_integration=1 fi typeset -ga precmd_functions=(${precmd_functions:#_p9k_precmd_first}) } From a69aa22fa8a4fe0927bb73716c2f7c9d2580a51d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 16 May 2023 10:43:49 +0200 Subject: [PATCH 263/380] show the right cwd when some part of it gets renamed (#2304) --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index ae9ffacd..a3541bac 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1904,7 +1904,7 @@ prompt_dir() { else local key= fi - if ! _p9k_cache_ephemeral_get $0 $e $i $_p9k__cwd || [[ $key != $_p9k__cache_val[1] ]]; then + if ! _p9k_cache_ephemeral_get $0 $e $i $_p9k__cwd $p || [[ $key != $_p9k__cache_val[1] ]]; then local rtail=${(j./.)rparts[i,-1]} local parent=$_p9k__cwd[1,-2-$#rtail] _p9k_prompt_length $delim From 8cce84643f53354a227fccd109c61d99940d910a Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 17 May 2023 17:57:29 +0200 Subject: [PATCH 264/380] set P9K_VERSION (#2307) --- internal/p10k.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 4867f481..d166744e 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8401,7 +8401,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v150\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=${(q)P9K_VERSION}$'\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$__p9k_force_term_shell_integration$'\1'${(q)TERM_PROGRAM}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' @@ -9351,6 +9351,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi +typeset -g P9K_VERSION=1.18.1 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From 6740f08f61395665714fbba150c82e99ffe0e784 Mon Sep 17 00:00:00 2001 From: Alkindi42 Date: Thu, 18 May 2023 11:57:40 +0200 Subject: [PATCH 265/380] chezmoi: add chezmoi prompt --- internal/p10k.zsh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index a3541bac..dea5e26d 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4260,6 +4260,17 @@ instant_prompt_vi_mode() { fi } +################################################################ +# Segment to display chezmoi information. +# More information: https://www.chezmoi.io/ +prompt_chezmoi() { + _p9k_prompt_segment "$0" "blue" "$_p9k_color1" '' 0 '' "chezmoi" +} + +_p9k_prompt_chezmoi_init() { + typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$CHEZMOI' +} + ################################################################ # Virtualenv: current working virtualenv # More information on virtualenv (Python): From 951d6957895b1887567b3ea7e548f9533daa3c83 Mon Sep 17 00:00:00 2001 From: Skyler <81177923+Sarvasv-0@users.noreply.github.com> Date: Sat, 20 May 2023 13:08:26 +0530 Subject: [PATCH 266/380] Update README.md Fixed a small bug in alpine linux hyperlink under Installation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 314f839d..30f9927c 100644 --- a/README.md +++ b/README.md @@ -415,7 +415,7 @@ Powerlevel10k. - [Zap](#zap) - [Homebrew](#homebrew) - [Arch Linux](#arch-linux) -- [Alpine Linux](#arch-linux) +- [Alpine Linux](#alpine-linux) - [Fig](#fig) ### Manual From 29c0b258505c5214667c20ce4cb5d4f7e743776c Mon Sep 17 00:00:00 2001 From: Alkindi42 Date: Sun, 21 May 2023 21:42:09 +0200 Subject: [PATCH 267/380] feat: enable chezmoi prompt in configurations --- config/p10k-classic.zsh | 1 + config/p10k-lean-8colors.zsh | 1 + config/p10k-lean.zsh | 1 + config/p10k-pure.zsh | 1 + config/p10k-rainbow.zsh | 1 + 5 files changed, 5 insertions(+) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index d29aa2f8..25c2f79c 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -42,6 +42,7 @@ status # exit code of the last command command_execution_time # duration of the last command background_jobs # presence of background jobs + chezmoi # chezmoi prompt (https://github.com/twpayne/chezmoi) direnv # direnv status (https://direnv.net/) asdf # asdf version manager (https://github.com/asdf-vm/asdf) virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 9fbd5fa2..608e93f6 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -42,6 +42,7 @@ status # exit code of the last command command_execution_time # duration of the last command background_jobs # presence of background jobs + chezmoi # chezmoi prompt (https://github.com/twpayne/chezmoi) direnv # direnv status (https://direnv.net/) asdf # asdf version manager (https://github.com/asdf-vm/asdf) virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 844c1bfe..c427b529 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -42,6 +42,7 @@ status # exit code of the last command command_execution_time # duration of the last command background_jobs # presence of background jobs + chezmoi # chezmoi prompt (https://github.com/twpayne/chezmoi) direnv # direnv status (https://direnv.net/) asdf # asdf version manager (https://github.com/asdf-vm/asdf) virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) diff --git a/config/p10k-pure.zsh b/config/p10k-pure.zsh index 97c1a207..4682fc76 100644 --- a/config/p10k-pure.zsh +++ b/config/p10k-pure.zsh @@ -51,6 +51,7 @@ newline # \n virtualenv # python virtual environment prompt_char # prompt symbol + chezmoi # chezmoi prompt (https://github.com/twpayne/chezmoi) ) # Right prompt segments. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index c21d879a..5213589c 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -45,6 +45,7 @@ direnv # direnv status (https://direnv.net/) asdf # asdf version manager (https://github.com/asdf-vm/asdf) virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) + chezmoi # chezmoi prompt (https://github.com/twpayne/chezmoi) anaconda # conda environment (https://conda.io/) pyenv # python environment (https://github.com/pyenv/pyenv) goenv # go environment (https://github.com/syndbg/goenv) From 6db5920bb9ecdba25b8253a93120f973b686199f Mon Sep 17 00:00:00 2001 From: Alkindi42 Date: Sun, 21 May 2023 21:45:11 +0200 Subject: [PATCH 268/380] feat: add chezmoi icon --- internal/icons.zsh | 5 +++++ internal/p10k.zsh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/icons.zsh b/internal/icons.zsh index 6b3a9b09..b5f1d0ec 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -107,6 +107,7 @@ function _p9k_init_icons() { VCS_SVN_ICON 'svn'$q RUST_ICON 'R' PYTHON_ICON '\uE63C'$s #  (doesn't always work) + CHEZMOI_ICON '\uf015' #  SWIFT_ICON 'Swift' GO_ICON 'Go' GOLANG_ICON 'Go' @@ -243,6 +244,7 @@ function _p9k_init_icons() { VCS_SVN_ICON 'svn'$q RUST_ICON '\uE6A8' #  PYTHON_ICON '\uE63C'$s #  + CHEZMOI_ICON '\uf015' #  SWIFT_ICON 'Swift' GO_ICON 'Go' GOLANG_ICON 'Go' @@ -384,6 +386,7 @@ function _p9k_init_icons() { VCS_SVN_ICON 'svn'$q RUST_ICON '\uE6A8' #  PYTHON_ICON '\U1F40D' # 🐍 + CHEZMOI_ICON "${CODEPOINT_OF_AWESOME_HOME:+\\u$CODEPOINT_OF_AWESOME_HOME}" SWIFT_ICON '\uE655'$s #  PUBLIC_IP_ICON "${CODEPOINT_OF_AWESOME_GLOBE:+\\u$CODEPOINT_OF_AWESOME_GLOBE$s}" LOCK_ICON "${CODEPOINT_OF_AWESOME_LOCK:+\\u$CODEPOINT_OF_AWESOME_LOCK}" @@ -519,6 +522,7 @@ function _p9k_init_icons() { VCS_SVN_ICON '\uE72D'$q #  RUST_ICON '\uE7A8'$q #  PYTHON_ICON '\UE73C ' #  + CHEZMOI_ICON '\Uf015' #  SWIFT_ICON '\uE755' #  GO_ICON '\uE626' #  GOLANG_ICON '\uE626' #  @@ -656,6 +660,7 @@ function _p9k_init_icons() { VCS_SVN_ICON '\uE72D'$q #  RUST_ICON '\uE7A8'$q #  PYTHON_ICON '\UE73C ' #  + CHEZMOI_ICON '\Uf015' #  SWIFT_ICON '\uE755' #  GO_ICON '\uE626' #  GOLANG_ICON '\uE626' #  diff --git a/internal/p10k.zsh b/internal/p10k.zsh index dea5e26d..b2b07aa6 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4264,7 +4264,7 @@ instant_prompt_vi_mode() { # Segment to display chezmoi information. # More information: https://www.chezmoi.io/ prompt_chezmoi() { - _p9k_prompt_segment "$0" "blue" "$_p9k_color1" '' 0 '' "chezmoi" + _p9k_prompt_segment "$0" "black" "white" 'CHEZMOI_ICON' 0 '' "chezmoi" } _p9k_prompt_chezmoi_init() { From 9ed51ec315cd438063f6514e50dd630bad9c62f2 Mon Sep 17 00:00:00 2001 From: Alkindi42 Date: Sun, 21 May 2023 21:54:50 +0200 Subject: [PATCH 269/380] doc: add chezmoi prompt in the README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 314f839d..210c6b8e 100644 --- a/README.md +++ b/README.md @@ -314,6 +314,7 @@ enable as many segments as you like. It won't slow down your prompt or Zsh start | `azure` | [azure](https://docs.microsoft.com/en-us/cli/azure) account name | | `background_jobs` | presence of background jobs | | `battery` | internal battery state and charge level (yep, batteries *literally* included) | +| `chezmoi` | [chezmoi](https://github.com/twpayne/chezmoi) shell | | `command_execution_time` | duration (wall time) of the last command | | `context` | user@hostname | | `cpu_arch` | CPU architecture | From 79753faacb6dc511088cb0d136ec438873613932 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 4 Jun 2023 20:11:07 +0200 Subject: [PATCH 270/380] add a comment within .p10k.zsh explaining the use of "_joined" (#2332) --- config/p10k-classic.zsh | 3 +++ config/p10k-rainbow.zsh | 3 +++ 2 files changed, 6 insertions(+) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index d29aa2f8..de12ec1d 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -168,6 +168,9 @@ typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B0' # Separator between different-color segments on the right. typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B2' + # To remove a separator between two segments, add "_joined" to the second segment name. + # For example: POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(os_icon context_joined) + # The right end of left prompt. typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0' # The left end of right prompt. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index c21d879a..674d51ef 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -165,6 +165,9 @@ typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B0' # Separator between different-color segments on the right. typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B2' + # To remove a separator between two segments, add "_joined" to the second segment name. + # For example: POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(os_icon context_joined) + # The right end of left prompt. typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0' # The left end of right prompt. From e4b8925478d79795713c80dca4680782a33cdc1b Mon Sep 17 00:00:00 2001 From: kvanzuijlen <8818390+kvanzuijlen@users.noreply.github.com> Date: Wed, 7 Jun 2023 14:33:37 +0200 Subject: [PATCH 271/380] Added cert manager cmctl to POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND --- config/p10k-classic.zsh | 2 +- config/p10k-lean-8colors.zsh | 2 +- config/p10k-lean.zsh | 2 +- config/p10k-rainbow.zsh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index de12ec1d..c67d63a0 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1256,7 +1256,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 9fbd5fa2..c63bc6c7 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1195,7 +1195,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 844c1bfe..154dc0ec 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1191,7 +1191,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 674d51ef..7f35949c 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1329,7 +1329,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. From 7b197465803cd5f646e916b631f1b239d02efebf Mon Sep 17 00:00:00 2001 From: Alkindi42 Date: Sat, 10 Jun 2023 14:09:50 +0200 Subject: [PATCH 272/380] feat: add color and custom icon --- config/p10k-classic.zsh | 6 ++++++ config/p10k-lean-8colors.zsh | 6 ++++++ config/p10k-lean.zsh | 6 ++++++ config/p10k-rainbow.zsh | 7 +++++++ 4 files changed, 25 insertions(+) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 25c2f79c..74c05409 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -737,6 +737,12 @@ # Custom icon. # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################[ chezmoi: chezmoi shell (https://github.com/twpayne/chezmoi) ]################## + # chezmoi shell color. + typeset -g POWERLEVEL9K_CHEZMOI_FOREGROUND=72 + # Custom icon. + # typeset -g POWERLEVEL9K_CHEZMOI_VISUAL_IDENTIFIER_EXPANSION='⭐' + ###########################[ vim_shell: vim shell indicator (:sh) ]########################### # Vim shell indicator color. typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=34 diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 608e93f6..70c87668 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -735,6 +735,12 @@ # Custom icon. # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################[ chezmoi: chezmoi shell (https://github.com/twpayne/chezmoi) ]################## + # chezmoi shell color. + typeset -g POWERLEVEL9K_CHEZMOI_FOREGROUND=72 + # Custom icon. + # typeset -g POWERLEVEL9K_CHEZMOI_VISUAL_IDENTIFIER_EXPANSION='⭐' + ###########################[ vim_shell: vim shell indicator (:sh) ]########################### # Vim shell indicator color. typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=3 diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index c427b529..5e58b448 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -731,6 +731,12 @@ # Custom icon. # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################[ chezmoi: chezmoi shell (https://github.com/twpayne/chezmoi) ]################## + # chezmoi shell color. + typeset -g POWERLEVEL9K_CHEZMOI_FOREGROUND=72 + # Custom icon. + # typeset -g POWERLEVEL9K_CHEZMOI_VISUAL_IDENTIFIER_EXPANSION='⭐' + ###########################[ vim_shell: vim shell indicator (:sh) ]########################### # Vim shell indicator color. typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=34 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 5213589c..ce57757b 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -759,6 +759,13 @@ # Custom icon. # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################[ chezmoi: chezmoi shell (https://github.com/twpayne/chezmoi) ]################## + # chezmoi shell color. + typeset -g POWERLEVEL9K_CHEZMOI_FOREGROUND=0 + typeset -g POWERLEVEL9K_CHEZMOI_BACKGROUND=6 + # Custom icon. + # typeset -g POWERLEVEL9K_CHEZMOI_VISUAL_IDENTIFIER_EXPANSION='⭐' + ###########################[ vim_shell: vim shell indicator (:sh) ]########################### # Vim shell indicator color. typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=0 From 3ecef8c6a5d12d7aaf0335efc3483c4145371337 Mon Sep 17 00:00:00 2001 From: Alkindi42 Date: Sat, 10 Jun 2023 14:25:17 +0200 Subject: [PATCH 273/380] feat(chezmoi): add instant_prompt_chezmoi --- internal/p10k.zsh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index b2b07aa6..5a72b7e4 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4271,6 +4271,10 @@ _p9k_prompt_chezmoi_init() { typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$CHEZMOI' } +function instant_prompt_chezmoi() { + _p9k_prompt_segment prompt_chezmoi "black" "white" CHEZMOI_ICON 0 '' 'chezmoi' +} + ################################################################ # Virtualenv: current working virtualenv # More information on virtualenv (Python): From cc4878aef2bdefbac98fa135fca6070d27e4f041 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 11 Jun 2023 09:07:41 +0200 Subject: [PATCH 274/380] fix chezmoi segment and rename it to chezmoi_shell (#2311) - Link to the project's homepage rather than its source code. - Move `chezmoi_shell` next to all the other *shell indicator* segments. - Use a shade of blue that resembes the color on chezmoi.io. - Don't go beyond 8 colors in 8-color configs. - Remove the segment from the *pure* config. - Fix whitespace padding on `CHEZMOI_ICON`. - Use the appropriate icon with all fonts (the same as `HOME`). - Add missing `CHEZMOI_ICON` definitions for "powerline" and "ascii" font modes. - Remove the redundant literal "chezmoi" content from the segment. - Fix instant prompt so that the segment is shown only when `$CHEZMOI` is non-empty. --- README.md | 2 +- config/p10k-classic.zsh | 14 +++++++------- config/p10k-lean-8colors.zsh | 14 +++++++------- config/p10k-lean.zsh | 14 +++++++------- config/p10k-pure.zsh | 1 - config/p10k-rainbow.zsh | 16 ++++++++-------- internal/icons.zsh | 12 +++++++----- internal/p10k.zsh | 14 ++++++-------- 8 files changed, 43 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 1de5aac5..a4aff1fc 100644 --- a/README.md +++ b/README.md @@ -314,7 +314,7 @@ enable as many segments as you like. It won't slow down your prompt or Zsh start | `azure` | [azure](https://docs.microsoft.com/en-us/cli/azure) account name | | `background_jobs` | presence of background jobs | | `battery` | internal battery state and charge level (yep, batteries *literally* included) | -| `chezmoi` | [chezmoi](https://github.com/twpayne/chezmoi) shell | +| `chezmoi_shell` | [chezmoi](https://www.chezmoi.io/) shell | | `command_execution_time` | duration (wall time) of the last command | | `context` | user@hostname | | `cpu_arch` | CPU architecture | diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 8a52ae1e..5ea3dba3 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -42,7 +42,6 @@ status # exit code of the last command command_execution_time # duration of the last command background_jobs # presence of background jobs - chezmoi # chezmoi prompt (https://github.com/twpayne/chezmoi) direnv # direnv status (https://direnv.net/) asdf # asdf version manager (https://github.com/asdf-vm/asdf) virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) @@ -88,6 +87,7 @@ vim_shell # vim shell indicator (:sh) midnight_commander # midnight commander shell (https://midnight-commander.org/) nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) + chezmoi_shell # chezmoi shell (https://www.chezmoi.io/) # vi_mode # vi mode (you don't need this if you've enabled prompt_char) # vpn_ip # virtual private network indicator # load # CPU load @@ -740,12 +740,6 @@ # Custom icon. # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' - ##################[ chezmoi: chezmoi shell (https://github.com/twpayne/chezmoi) ]################## - # chezmoi shell color. - typeset -g POWERLEVEL9K_CHEZMOI_FOREGROUND=72 - # Custom icon. - # typeset -g POWERLEVEL9K_CHEZMOI_VISUAL_IDENTIFIER_EXPANSION='⭐' - ###########################[ vim_shell: vim shell indicator (:sh) ]########################### # Vim shell indicator color. typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=34 @@ -771,6 +765,12 @@ # Custom icon. # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################[ chezmoi_shell: chezmoi shell (https://www.chezmoi.io/) ]################## + # chezmoi shell color. + typeset -g POWERLEVEL9K_CHEZMOI_SHELL_FOREGROUND=33 + # Custom icon. + # typeset -g POWERLEVEL9K_CHEZMOI_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################################[ disk_usage: disk usage ]################################## # Colors for different levels of disk usage. typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=35 diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index b4ee4e8a..3ce3f2c9 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -42,7 +42,6 @@ status # exit code of the last command command_execution_time # duration of the last command background_jobs # presence of background jobs - chezmoi # chezmoi prompt (https://github.com/twpayne/chezmoi) direnv # direnv status (https://direnv.net/) asdf # asdf version manager (https://github.com/asdf-vm/asdf) virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) @@ -88,6 +87,7 @@ vim_shell # vim shell indicator (:sh) midnight_commander # midnight commander shell (https://midnight-commander.org/) nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) + chezmoi_shell # chezmoi shell (https://www.chezmoi.io/) # vpn_ip # virtual private network indicator # load # CPU load # disk_usage # disk usage @@ -735,12 +735,6 @@ # Custom icon. # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' - ##################[ chezmoi: chezmoi shell (https://github.com/twpayne/chezmoi) ]################## - # chezmoi shell color. - typeset -g POWERLEVEL9K_CHEZMOI_FOREGROUND=72 - # Custom icon. - # typeset -g POWERLEVEL9K_CHEZMOI_VISUAL_IDENTIFIER_EXPANSION='⭐' - ###########################[ vim_shell: vim shell indicator (:sh) ]########################### # Vim shell indicator color. typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=3 @@ -766,6 +760,12 @@ # Custom icon. # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################[ chezmoi_shell: chezmoi shell (https://www.chezmoi.io/) ]################## + # chezmoi shell color. + typeset -g POWERLEVEL9K_CHEZMOI_SHELL_FOREGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_CHEZMOI_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################################[ disk_usage: disk usage ]################################## # Colors for different levels of disk usage. typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=2 diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 1c8520bd..e08237bf 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -42,7 +42,6 @@ status # exit code of the last command command_execution_time # duration of the last command background_jobs # presence of background jobs - chezmoi # chezmoi prompt (https://github.com/twpayne/chezmoi) direnv # direnv status (https://direnv.net/) asdf # asdf version manager (https://github.com/asdf-vm/asdf) virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) @@ -88,6 +87,7 @@ vim_shell # vim shell indicator (:sh) midnight_commander # midnight commander shell (https://midnight-commander.org/) nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) + chezmoi_shell # chezmoi shell (https://www.chezmoi.io/) # vpn_ip # virtual private network indicator # load # CPU load # disk_usage # disk usage @@ -731,12 +731,6 @@ # Custom icon. # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' - ##################[ chezmoi: chezmoi shell (https://github.com/twpayne/chezmoi) ]################## - # chezmoi shell color. - typeset -g POWERLEVEL9K_CHEZMOI_FOREGROUND=72 - # Custom icon. - # typeset -g POWERLEVEL9K_CHEZMOI_VISUAL_IDENTIFIER_EXPANSION='⭐' - ###########################[ vim_shell: vim shell indicator (:sh) ]########################### # Vim shell indicator color. typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=34 @@ -762,6 +756,12 @@ # Custom icon. # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################[ chezmoi_shell: chezmoi shell (https://www.chezmoi.io/) ]################## + # chezmoi shell color. + typeset -g POWERLEVEL9K_CHEZMOI_SHELL_FOREGROUND=33 + # Custom icon. + # typeset -g POWERLEVEL9K_CHEZMOI_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################################[ disk_usage: disk usage ]################################## # Colors for different levels of disk usage. typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=35 diff --git a/config/p10k-pure.zsh b/config/p10k-pure.zsh index 4682fc76..97c1a207 100644 --- a/config/p10k-pure.zsh +++ b/config/p10k-pure.zsh @@ -51,7 +51,6 @@ newline # \n virtualenv # python virtual environment prompt_char # prompt symbol - chezmoi # chezmoi prompt (https://github.com/twpayne/chezmoi) ) # Right prompt segments. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index f8290dc2..48fdacfd 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -45,7 +45,6 @@ direnv # direnv status (https://direnv.net/) asdf # asdf version manager (https://github.com/asdf-vm/asdf) virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) - chezmoi # chezmoi prompt (https://github.com/twpayne/chezmoi) anaconda # conda environment (https://conda.io/) pyenv # python environment (https://github.com/pyenv/pyenv) goenv # go environment (https://github.com/syndbg/goenv) @@ -88,6 +87,7 @@ vim_shell # vim shell indicator (:sh) midnight_commander # midnight commander shell (https://midnight-commander.org/) nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) + chezmoi_shell # chezmoi shell (https://www.chezmoi.io/) # vi_mode # vi mode (you don't need this if you've enabled prompt_char) # vpn_ip # virtual private network indicator # load # CPU load @@ -762,13 +762,6 @@ # Custom icon. # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' - ##################[ chezmoi: chezmoi shell (https://github.com/twpayne/chezmoi) ]################## - # chezmoi shell color. - typeset -g POWERLEVEL9K_CHEZMOI_FOREGROUND=0 - typeset -g POWERLEVEL9K_CHEZMOI_BACKGROUND=6 - # Custom icon. - # typeset -g POWERLEVEL9K_CHEZMOI_VISUAL_IDENTIFIER_EXPANSION='⭐' - ###########################[ vim_shell: vim shell indicator (:sh) ]########################### # Vim shell indicator color. typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=0 @@ -797,6 +790,13 @@ # Custom icon. # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################[ chezmoi_shell: chezmoi shell (https://www.chezmoi.io/) ]################## + # chezmoi shell color. + typeset -g POWERLEVEL9K_CHEZMOI_SHELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_CHEZMOI_SHELL_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_CHEZMOI_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################################[ disk_usage: disk usage ]################################## # Colors for different levels of disk usage. typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=3 diff --git a/internal/icons.zsh b/internal/icons.zsh index b5f1d0ec..4fce1ee0 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -107,7 +107,7 @@ function _p9k_init_icons() { VCS_SVN_ICON 'svn'$q RUST_ICON 'R' PYTHON_ICON '\uE63C'$s #  (doesn't always work) - CHEZMOI_ICON '\uf015' #  + CHEZMOI_ICON '\uE12C'$s #  SWIFT_ICON 'Swift' GO_ICON 'Go' GOLANG_ICON 'Go' @@ -244,7 +244,7 @@ function _p9k_init_icons() { VCS_SVN_ICON 'svn'$q RUST_ICON '\uE6A8' #  PYTHON_ICON '\uE63C'$s #  - CHEZMOI_ICON '\uf015' #  + CHEZMOI_ICON '\uF015'$s #  SWIFT_ICON 'Swift' GO_ICON 'Go' GOLANG_ICON 'Go' @@ -386,7 +386,7 @@ function _p9k_init_icons() { VCS_SVN_ICON 'svn'$q RUST_ICON '\uE6A8' #  PYTHON_ICON '\U1F40D' # 🐍 - CHEZMOI_ICON "${CODEPOINT_OF_AWESOME_HOME:+\\u$CODEPOINT_OF_AWESOME_HOME}" + CHEZMOI_ICON "${CODEPOINT_OF_AWESOME_HOME:+\\u$CODEPOINT_OF_AWESOME_HOME$s}" SWIFT_ICON '\uE655'$s #  PUBLIC_IP_ICON "${CODEPOINT_OF_AWESOME_GLOBE:+\\u$CODEPOINT_OF_AWESOME_GLOBE$s}" LOCK_ICON "${CODEPOINT_OF_AWESOME_LOCK:+\\u$CODEPOINT_OF_AWESOME_LOCK}" @@ -522,7 +522,7 @@ function _p9k_init_icons() { VCS_SVN_ICON '\uE72D'$q #  RUST_ICON '\uE7A8'$q #  PYTHON_ICON '\UE73C ' #  - CHEZMOI_ICON '\Uf015' #  + CHEZMOI_ICON '\uF015'$s #  SWIFT_ICON '\uE755' #  GO_ICON '\uE626' #  GOLANG_ICON '\uE626' #  @@ -660,7 +660,7 @@ function _p9k_init_icons() { VCS_SVN_ICON '\uE72D'$q #  RUST_ICON '\uE7A8'$q #  PYTHON_ICON '\UE73C ' #  - CHEZMOI_ICON '\Uf015' #  + CHEZMOI_ICON '\uF015'$s #  SWIFT_ICON '\uE755' #  GO_ICON '\uE626' #  GOLANG_ICON '\uE626' #  @@ -795,6 +795,7 @@ function _p9k_init_icons() { VCS_SVN_ICON '' RUST_ICON 'rust' PYTHON_ICON 'py' + CHEZMOI_ICON 'chezmoi' SWIFT_ICON 'swift' GO_ICON 'go' GOLANG_ICON 'go' @@ -931,6 +932,7 @@ function _p9k_init_icons() { VCS_SVN_ICON '' RUST_ICON 'R' PYTHON_ICON 'Py' + CHEZMOI_ICON 'Chez' SWIFT_ICON 'Swift' GO_ICON 'Go' GOLANG_ICON 'Go' diff --git a/internal/p10k.zsh b/internal/p10k.zsh index b41c6ebb..ca735e50 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4260,19 +4260,17 @@ instant_prompt_vi_mode() { fi } -################################################################ -# Segment to display chezmoi information. -# More information: https://www.chezmoi.io/ -prompt_chezmoi() { - _p9k_prompt_segment "$0" "black" "white" 'CHEZMOI_ICON' 0 '' "chezmoi" +# Chezmoi shell indicator: https://www.chezmoi.io/ +prompt_chezmoi_shell() { + _p9k_prompt_segment $0 blue $_p9k_color1 CHEZMOI_ICON 0 '' '' } -_p9k_prompt_chezmoi_init() { +_p9k_prompt_chezmoi_shell_init() { typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$CHEZMOI' } -function instant_prompt_chezmoi() { - _p9k_prompt_segment prompt_chezmoi "black" "white" CHEZMOI_ICON 0 '' 'chezmoi' +function instant_prompt_chezmoi_shell() { + _p9k_prompt_segment prompt_chezmoi_shell blue $_p9k_color1 CHEZMOI_ICON 1 '$CHEZMOI_ICON' '' } ################################################################ From 944f52fc430259ff49f497f3516a3ddfb45a0a6b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 11 Jun 2023 09:09:24 +0200 Subject: [PATCH 275/380] move chezmoi_shell in the docs closer to other shell indicator segments --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a4aff1fc..d4cbc457 100644 --- a/README.md +++ b/README.md @@ -314,7 +314,6 @@ enable as many segments as you like. It won't slow down your prompt or Zsh start | `azure` | [azure](https://docs.microsoft.com/en-us/cli/azure) account name | | `background_jobs` | presence of background jobs | | `battery` | internal battery state and charge level (yep, batteries *literally* included) | -| `chezmoi_shell` | [chezmoi](https://www.chezmoi.io/) shell | | `command_execution_time` | duration (wall time) of the last command | | `context` | user@hostname | | `cpu_arch` | CPU architecture | @@ -339,6 +338,7 @@ enable as many segments as you like. It won't slow down your prompt or Zsh start | `nix_shell` | [nix shell](https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) indicator | | `nnn` | [nnn](https://github.com/jarun/nnn) shell | | `lf` | [lf](https://github.com/gokcehan/lf) shell | +| `chezmoi_shell` | [chezmoi](https://www.chezmoi.io/) shell | | `nodeenv` | node.js environment from [nodeenv](https://github.com/ekalinin/nodeenv) | | `nodenv` | node.js environment from [nodenv](https://github.com/nodenv/nodenv) | | `node_version` | [node.js](https://nodejs.org/) version | From 360dcd3907a7556a2ffa841380142e1f9dc6ec33 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 15 Jun 2023 08:44:50 +0200 Subject: [PATCH 276/380] respect XDG_DATA_HOME when looking for the timewarrior data directory (#2344) The logic for finding the data directory is as follows: 1. Find the root directory: 1.1 If TIMEWARRIORDB is set, use that. 1.2 Else if ~/.timewarrior is an existing directory, use that. 1.3 Else if XDG_DATA_HOME is set, use $XDG_DATA_HOME/timewarrior. 1.4 Else use ~/.local/share/timewarrior. 2. Append "/data" to the root directory. --- internal/p10k.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index ca735e50..a6cd9afe 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5084,8 +5084,11 @@ function _p9k_timewarrior_clear() { } function prompt_timewarrior() { + local dir + [[ -n ${dir::=$TIMEWARRIORDB} || -n ${dir::=~/.timewarrior}(#qN/) ]] || + dir=${XDG_DATA_HOME:-~/.local/share}/timewarrior + dir+=/data local -a stat - local dir=${TIMEWARRIORDB:-~/.timewarrior}/data [[ $dir == $_p9k_timewarrior_dir ]] || _p9k_timewarrior_clear if [[ -n $_p9k_timewarrior_file_name ]]; then zstat -A stat +mtime -- $dir $_p9k_timewarrior_file_name 2>/dev/null || stat=() From ab8bac01e2a90e1cd749d4936e4decbdba3c2727 Mon Sep 17 00:00:00 2001 From: Koen van Zuijlen <8818390+kvanzuijlen@users.noreply.github.com> Date: Sat, 17 Jun 2023 10:46:55 +0200 Subject: [PATCH 277/380] Add sparkctl to POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND (#2346) --- config/p10k-classic.zsh | 2 +- config/p10k-lean-8colors.zsh | 2 +- config/p10k-lean.zsh | 2 +- config/p10k-rainbow.zsh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 5ea3dba3..4e80e407 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1263,7 +1263,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl|sparkctl' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 3ce3f2c9..08cccfef 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1202,7 +1202,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl|sparkctl' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index e08237bf..fe7d7448 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1198,7 +1198,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl|sparkctl' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 48fdacfd..c60e95b4 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1337,7 +1337,7 @@ #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl|sparkctl' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. From 017395a266aa15011c09e64e44a1c98ed91c478c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 23 Jun 2023 07:44:27 +0200 Subject: [PATCH 278/380] release v1.19.0 --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index a6cd9afe..da9c92c0 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -9367,7 +9367,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.18.1 +typeset -g P9K_VERSION=1.19.0 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From 20323d6f8cd267805a793dafc840d22330653867 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 26 Jun 2023 10:33:21 +0200 Subject: [PATCH 279/380] display `=` in git status if up to date with the remote (#2361) --- README.md | 1 + config/p10k-classic.zsh | 16 +++++++++++----- config/p10k-lean-8colors.zsh | 16 +++++++++++----- config/p10k-lean.zsh | 16 +++++++++++----- config/p10k-rainbow.zsh | 16 +++++++++++----- 5 files changed, 45 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index d4cbc457..25fccedf 100644 --- a/README.md +++ b/README.md @@ -1135,6 +1135,7 @@ feature:master wip ⇣42⇡42 ⇠42⇢42 *42 merge ~42 +42 !42 ?42 | `feature` | current branch; replaced with `#tag` or `@commit` if not on a branch | `git status --ignore-submodules=dirty` | | `master` | remote tracking branch; only shown if different from local branch | `git rev-parse --abbrev-ref --symbolic-full-name @{upstream}` | | `wip` | the latest commit's summary contains "wip" or "WIP" | `git show --pretty=%s --no-patch HEAD` | +| `=` | up to date with the remote (neither ahead nor behind) | `git rev-list --count HEAD...@{upstream}` | | `⇣42` | this many commits behind the remote | `git rev-list --right-only --count HEAD...@{upstream}` | | `⇡42` | this many commits ahead of the remote | `git rev-list --left-only --count HEAD...@{upstream}` | | `⇠42` | this many commits behind the push remote | `git rev-list --right-only --count HEAD...@{push}` | diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 4e80e407..a14c150a 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -427,11 +427,17 @@ res+=" ${modified}wip" fi - # ⇣42 if behind the remote. - (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" - # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. - (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " - (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" + if (( VCS_STATUS_COMMITS_AHEAD || VCS_STATUS_COMMITS_BEHIND )); then + # ⇣42 if behind the remote. + (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" + # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. + (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " + (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" + elif [[ -n $VCS_STATUS_REMOTE_BRANCH ]]; then + # = if up to date with the remote. + res+=" ${clean}=" + fi + # ⇠42 if behind the push remote. (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}" (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 08cccfef..484de217 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -422,11 +422,17 @@ res+=" ${modified}wip" fi - # ⇣42 if behind the remote. - (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" - # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. - (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " - (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" + if (( VCS_STATUS_COMMITS_AHEAD || VCS_STATUS_COMMITS_BEHIND )); then + # ⇣42 if behind the remote. + (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" + # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. + (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " + (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" + elif [[ -n $VCS_STATUS_REMOTE_BRANCH ]]; then + # = if up to date with the remote. + res+=" ${clean}=" + fi + # ⇠42 if behind the push remote. (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}" (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index fe7d7448..ed6c1dec 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -418,11 +418,17 @@ res+=" ${modified}wip" fi - # ⇣42 if behind the remote. - (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" - # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. - (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " - (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" + if (( VCS_STATUS_COMMITS_AHEAD || VCS_STATUS_COMMITS_BEHIND )); then + # ⇣42 if behind the remote. + (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" + # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. + (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " + (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" + elif [[ -n $VCS_STATUS_REMOTE_BRANCH ]]; then + # = if up to date with the remote. + res+=" ${clean}=" + fi + # ⇠42 if behind the push remote. (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}" (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index c60e95b4..33dff0d3 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -428,11 +428,17 @@ res+=" ${modified}wip" fi - # ⇣42 if behind the remote. - (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" - # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. - (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " - (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" + if (( VCS_STATUS_COMMITS_AHEAD || VCS_STATUS_COMMITS_BEHIND )); then + # ⇣42 if behind the remote. + (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" + # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. + (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " + (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" + elif [[ -n $VCS_STATUS_REMOTE_BRANCH ]]; then + # = if up to date with the remote. + res+=" ${clean}=" + fi + # ⇠42 if behind the push remote. (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}" (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " From 4dca4bdfbb118953b73a131f511094462165971d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 9 Jul 2023 09:42:35 +0200 Subject: [PATCH 280/380] bug fix: honor POWERLEVEL9K_LEFT_SEGMENT_END_SEPARATOR in instant prompt (#2376) --- internal/p10k.zsh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index da9c92c0..41cee213 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8490,7 +8490,14 @@ function _p9k_init_cacheable() { _p9k_transient_prompt+='${${P9K_CONTENT::="❯"}+}' _p9k_param prompt_prompt_char_ERROR_VIINS CONTENT_EXPANSION '${P9K_CONTENT}' _p9k_transient_prompt+='${:-"'$_p9k__ret'"}' - _p9k_transient_prompt+=')%b%k%f%s%u ' + _p9k_transient_prompt+=')%b%k%f%s%u' + _p9k_get_icon '' LEFT_SEGMENT_END_SEPARATOR + if [[ $_p9k__ret != (| ) ]]; then + _p9k__ret+=%b%k%f + # Not escaped for historical reasons. + _p9k__ret='${:-"'$_p9k__ret'"}' + fi + _p9k_transient_prompt+=$_p9k__ret if (( _POWERLEVEL9K_TERM_SHELL_INTEGRATION )); then _p9k_transient_prompt=$'%{\e]133;A\a%}'$_p9k_transient_prompt$'%{\e]133;B\a%}' if (( $+_z4h_iterm_cmd && _z4h_can_save_restore_screen == 1 )); then @@ -9367,7 +9374,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.19.0 +typeset -g P9K_VERSION=1.19.1 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From 0c28fec137b2a505667d1980ece0c1943a033000 Mon Sep 17 00:00:00 2001 From: BEN MANSOUR Mohamed Rafik Date: Mon, 10 Jul 2023 22:07:28 +0200 Subject: [PATCH 281/380] fix pattern coloration for azure defined classes --- config/p10k-classic.zsh | 31 +++++++++++++++++++++++++++++-- internal/p10k.zsh | 1 + 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index a14c150a..01a518bd 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1404,8 +1404,35 @@ # Show azure only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show azure. typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' - # Azure account name color. - typeset -g POWERLEVEL9K_AZURE_FOREGROUND=32 + + # POWERLEVEL9K_AZURE_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current AZURE subscription gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_AZURE_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_AZURE_CLASSES defines the profile class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_AZURE_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' DEFAULT) + # + # If your current AZURE subscription is "company_test", its class is TEST + # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_AZURE_TEST_FOREGROUND=28 + # typeset -g POWERLEVEL9K_AZURE_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AZURE_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_AZURE_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_AZURE_DEFAULT_FOREGROUND=32 # Custom icon. # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 41cee213..c020cd9a 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4655,6 +4655,7 @@ prompt_azure() { fi local pat class state for pat class in "${_POWERLEVEL9K_AZURE_CLASSES[@]}"; do + name="${_p9k__cache_val[1]//\%/%%}" if [[ $name == ${~pat} ]]; then [[ -n $class ]] && state=_${${(U)class}//İ/I} break From 078497570f58aa9fc4fe3a7cfd5951a67d7c8f5d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 11 Jul 2023 10:53:52 +0200 Subject: [PATCH 282/380] clean up the handling of POWERLEVEL9K_AZURE_CLASSES and put it in all configs (#2379) This reverts commit 343d4f44e524e9674ecfb6f0df9114563232b889, reversing changes made to 4dca4bdfbb118953b73a131f511094462165971d. --- config/p10k-classic.zsh | 18 ++++++++++-------- config/p10k-lean-8colors.zsh | 33 +++++++++++++++++++++++++++++++-- config/p10k-lean.zsh | 33 +++++++++++++++++++++++++++++++-- config/p10k-rainbow.zsh | 36 +++++++++++++++++++++++++++++++++--- internal/p10k.zsh | 14 +++++++------- 5 files changed, 112 insertions(+), 22 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 01a518bd..1f262731 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1406,11 +1406,11 @@ typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' # POWERLEVEL9K_AZURE_CLASSES is an array with even number of elements. The first element - # in each pair defines a pattern against which the current AZURE subscription gets matched. + # in each pair defines a pattern against which the current azure account name gets matched. # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) # that gets matched. If you unset all POWERLEVEL9K_AZURE_*CONTENT_EXPANSION parameters, # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_AZURE_CLASSES defines the profile class. Patterns are tried in order. The + # POWERLEVEL9K_AZURE_CLASSES defines the account class. Patterns are tried in order. The # first match wins. # # For example, given these settings: @@ -1418,10 +1418,10 @@ # typeset -g POWERLEVEL9K_AZURE_CLASSES=( # '*prod*' PROD # '*test*' TEST - # '*' DEFAULT) + # '*' OTHER) # - # If your current AZURE subscription is "company_test", its class is TEST - # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'. + # If your current azure account is "project_test", its class is TEST because "project_test" + # doesn't match the pattern '*prod*' but does match '*test*'. # # You can define different colors, icons and content expansions for different classes: # @@ -1431,10 +1431,12 @@ typeset -g POWERLEVEL9K_AZURE_CLASSES=( # '*prod*' PROD # These values are examples that are unlikely # '*test*' TEST # to match your needs. Customize them as needed. - '*' DEFAULT) - typeset -g POWERLEVEL9K_AZURE_DEFAULT_FOREGROUND=32 + '*' OTHER) + + # Azure account name color. + typeset -g POWERLEVEL9K_AZURE_OTHER_FOREGROUND=32 # Custom icon. - # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AZURE_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### # Show gcloud only when the command you are typing invokes one of these tools. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 484de217..4f22754f 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1382,10 +1382,39 @@ # Show azure only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show azure. typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' + + # POWERLEVEL9K_AZURE_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current azure account name gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_AZURE_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_AZURE_CLASSES defines the account class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_AZURE_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' OTHER) + # + # If your current azure account is "project_test", its class is TEST because "project_test" + # doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_AZURE_TEST_FOREGROUND=2 + # typeset -g POWERLEVEL9K_AZURE_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AZURE_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_AZURE_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' OTHER) + # Azure account name color. - typeset -g POWERLEVEL9K_AZURE_FOREGROUND=4 + typeset -g POWERLEVEL9K_AZURE_OTHER_FOREGROUND=4 # Custom icon. - # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AZURE_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### # Show gcloud only when the command you are typing invokes one of these tools. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index ed6c1dec..b21400bf 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1378,10 +1378,39 @@ # Show azure only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show azure. typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' + + # POWERLEVEL9K_AZURE_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current azure account name gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_AZURE_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_AZURE_CLASSES defines the account class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_AZURE_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' OTHER) + # + # If your current azure account is "project_test", its class is TEST because "project_test" + # doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_AZURE_TEST_FOREGROUND=28 + # typeset -g POWERLEVEL9K_AZURE_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AZURE_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_AZURE_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' OTHER) + # Azure account name color. - typeset -g POWERLEVEL9K_AZURE_FOREGROUND=32 + typeset -g POWERLEVEL9K_AZURE_OTHER_FOREGROUND=32 # Custom icon. - # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AZURE_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### # Show gcloud only when the command you are typing invokes one of these tools. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 33dff0d3..8e8074f7 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1482,11 +1482,41 @@ # Show azure only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show azure. typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' + + # POWERLEVEL9K_AZURE_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current azure account name gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_AZURE_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_AZURE_CLASSES defines the account class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_AZURE_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' OTHER) + # + # If your current azure account is "project_test", its class is TEST because "project_test" + # doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_AZURE_TEST_FOREGROUND=2 + # typeset -g POWERLEVEL9K_AZURE_TEST_BACKGROUND=0 + # typeset -g POWERLEVEL9K_AZURE_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AZURE_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_AZURE_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' OTHER) + # Azure account name color. - typeset -g POWERLEVEL9K_AZURE_FOREGROUND=7 - typeset -g POWERLEVEL9K_AZURE_BACKGROUND=4 + typeset -g POWERLEVEL9K_AZURE_OTHER_FOREGROUND=7 + typeset -g POWERLEVEL9K_AZURE_OTHER_BACKGROUND=4 # Custom icon. - # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AZURE_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### # Show gcloud only when the command you are typing invokes one of these tools. diff --git a/internal/p10k.zsh b/internal/p10k.zsh index c020cd9a..3ab76e3e 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4643,9 +4643,10 @@ _p9k_prompt_java_version_init() { } prompt_azure() { - local cfg=${AZURE_CONFIG_DIR:-$HOME/.azure}/azureProfile.json - if ! _p9k_cache_stat_get $0 $cfg; then - local name + local name cfg=${AZURE_CONFIG_DIR:-$HOME/.azure}/azureProfile.json + if _p9k_cache_stat_get $0 $cfg; then + name=$_p9k__cache_val[1] + else if (( $+commands[jq] )) && name="$(jq -r '[.subscriptions[]|select(.isDefault==true)|.name][]|strings' $cfg 2>/dev/null)"; then name=${name%%$'\n'*} elif ! name="$(az account show --query name --output tsv 2>/dev/null)"; then @@ -4653,16 +4654,15 @@ prompt_azure() { fi _p9k_cache_stat_set "$name" fi + [[ -n $name ]] || return local pat class state for pat class in "${_POWERLEVEL9K_AZURE_CLASSES[@]}"; do - name="${_p9k__cache_val[1]//\%/%%}" if [[ $name == ${~pat} ]]; then [[ -n $class ]] && state=_${${(U)class}//İ/I} break fi done - [[ -n $_p9k__cache_val[1] ]] || return - _p9k_prompt_segment "$0$state" "blue" "white" "AZURE_ICON" 0 '' "${_p9k__cache_val[1]//\%/%%}" + _p9k_prompt_segment "$0$state" "blue" "white" "AZURE_ICON" 0 '' "${name//\%/%%}" } _p9k_prompt_azure_init() { @@ -9375,7 +9375,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.19.1 +typeset -g P9K_VERSION=1.19.2 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From 93d97b7eba9fb4e0866dd8e4e2eda9a89226bd84 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 11 Jul 2023 11:11:21 +0200 Subject: [PATCH 283/380] better comments --- config/p10k-classic.zsh | 2 +- config/p10k-lean-8colors.zsh | 2 +- config/p10k-lean.zsh | 2 +- config/p10k-rainbow.zsh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 1f262731..b61212ca 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1420,7 +1420,7 @@ # '*test*' TEST # '*' OTHER) # - # If your current azure account is "project_test", its class is TEST because "project_test" + # If your current azure account is "company_test", its class is TEST because "company_test" # doesn't match the pattern '*prod*' but does match '*test*'. # # You can define different colors, icons and content expansions for different classes: diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 4f22754f..10b63cc7 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1398,7 +1398,7 @@ # '*test*' TEST # '*' OTHER) # - # If your current azure account is "project_test", its class is TEST because "project_test" + # If your current azure account is "company_test", its class is TEST because "company_test" # doesn't match the pattern '*prod*' but does match '*test*'. # # You can define different colors, icons and content expansions for different classes: diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index b21400bf..936854d8 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1394,7 +1394,7 @@ # '*test*' TEST # '*' OTHER) # - # If your current azure account is "project_test", its class is TEST because "project_test" + # If your current azure account is "company_test", its class is TEST because "company_test" # doesn't match the pattern '*prod*' but does match '*test*'. # # You can define different colors, icons and content expansions for different classes: diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 8e8074f7..14dee5aa 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1498,7 +1498,7 @@ # '*test*' TEST # '*' OTHER) # - # If your current azure account is "project_test", its class is TEST because "project_test" + # If your current azure account is "company_test", its class is TEST because "company_test" # doesn't match the pattern '*prod*' but does match '*test*'. # # You can define different colors, icons and content expansions for different classes: From 932954a8b1e31ae540e9df5e5e464100d46e53ec Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 12 Jul 2023 15:01:32 +0200 Subject: [PATCH 284/380] do not display an indicator when a git branch is up to date with a remote https://github.com/romkatv/powerlevel10k/issues/2361 requested an indicator for up to date branches, which was added in 20323d6f8cd267805a793dafc840d22330653867. Since then, 3 users complained about the new indicator: - https://github.com/romkatv/powerlevel10k/issues/2377 - https://github.com/romkatv/powerlevel10k/issues/2380 - https://github.com/romkatv/powerlevel10k/issues/2361#issuecomment-1630731045 On one hand we have one request to add a feature. On the other hand we have three complaints about the feature's existence. The feature is going away. --- config/p10k-classic.zsh | 4 ++-- config/p10k-lean-8colors.zsh | 4 ++-- config/p10k-lean.zsh | 4 ++-- config/p10k-rainbow.zsh | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index b61212ca..14ebd38c 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -434,8 +434,8 @@ (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" elif [[ -n $VCS_STATUS_REMOTE_BRANCH ]]; then - # = if up to date with the remote. - res+=" ${clean}=" + # Tip: Uncomment the next line to display '=' if up to date with the remote. + # res+=" ${clean}=" fi # ⇠42 if behind the push remote. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 10b63cc7..917fe714 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -429,8 +429,8 @@ (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" elif [[ -n $VCS_STATUS_REMOTE_BRANCH ]]; then - # = if up to date with the remote. - res+=" ${clean}=" + # Tip: Uncomment the next line to display '=' if up to date with the remote. + # res+=" ${clean}=" fi # ⇠42 if behind the push remote. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 936854d8..97c7e288 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -425,8 +425,8 @@ (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" elif [[ -n $VCS_STATUS_REMOTE_BRANCH ]]; then - # = if up to date with the remote. - res+=" ${clean}=" + # Tip: Uncomment the next line to display '=' if up to date with the remote. + # res+=" ${clean}=" fi # ⇠42 if behind the push remote. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 14dee5aa..53606ff2 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -435,8 +435,8 @@ (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" elif [[ -n $VCS_STATUS_REMOTE_BRANCH ]]; then - # = if up to date with the remote. - res+=" ${clean}=" + # Tip: Uncomment the next line to display '=' if up to date with the remote. + # res+=" ${clean}=" fi # ⇠42 if behind the push remote. From 2453fd27e20e9c1e4bac43eb1b8b9476749e429f Mon Sep 17 00:00:00 2001 From: hugo <102398135+hugivar@users.noreply.github.com> Date: Fri, 21 Jul 2023 16:18:24 -0400 Subject: [PATCH 285/380] Update README.md as Terminus is now known as Tabby --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 25fccedf..fda818b8 100644 --- a/README.md +++ b/README.md @@ -669,7 +669,7 @@ If you are using a different terminal, proceed with manual font installation. *Meslo Nerd Font*. - **Blink**: Type `config`, go to *Appearance*, tap *Add a new font*, tap *Open Gallery*, select *MesloLGS NF.css*, tap *import* and type `exit` in the home view to reload the font. - - **Terminus**: Open *Settings → Appearance* and set *Font* to `MesloLGS NF`. + - **Tabby**: Open *Settings → Appearance* and set *Font* to `MesloLGS NF`. - **Terminator**: Open *Preferences* using the context menu. Under *Profiles* select the *General* tab (should be selected already), uncheck *Use the system fixed width font* (if not already) and select `MesloLGS NF Regular`. Exit the Preferences dialog by clicking *Close*. From 646bae0dd629045e08928c3ba7baa54fbbe79faa Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 21 Jul 2023 22:48:11 +0200 Subject: [PATCH 286/380] docs: Terminus is now called Tabby --- README.md | 2 +- font.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fda818b8..f5713b64 100644 --- a/README.md +++ b/README.md @@ -669,7 +669,7 @@ If you are using a different terminal, proceed with manual font installation. *Meslo Nerd Font*. - **Blink**: Type `config`, go to *Appearance*, tap *Add a new font*, tap *Open Gallery*, select *MesloLGS NF.css*, tap *import* and type `exit` in the home view to reload the font. - - **Tabby**: Open *Settings → Appearance* and set *Font* to `MesloLGS NF`. + - **Tabby** (formerly **Terminus**): Open *Settings → Appearance* and set *Font* to `MesloLGS NF`. - **Terminator**: Open *Preferences* using the context menu. Under *Profiles* select the *General* tab (should be selected already), uncheck *Use the system fixed width font* (if not already) and select `MesloLGS NF Regular`. Exit the Preferences dialog by clicking *Close*. diff --git a/font.md b/font.md index e7505ef4..2fb2f8be 100644 --- a/font.md +++ b/font.md @@ -62,7 +62,7 @@ If you are using a different terminal, proceed with manual font installation. *Meslo Nerd Font*. - **Blink**: Type `config`, go to *Appearance*, tap *Add a new font*, tap *Open Gallery*, select *MesloLGS NF.css*, tap *import* and type `exit` in the home view to reload the font. - - **Terminus**: Open *Settings → Appearance* and set *Font* to `MesloLGS NF`. + - **Tabby** (formerly **Terminus**): Open *Settings → Appearance* and set *Font* to `MesloLGS NF`. - **Terminator**: Open *Preferences* using the context menu. Under *Profiles* select the *General* tab (should be selected already), uncheck *Use the system fixed width font* (if not already) and select `MesloLGS NF Regular`. Exit the Preferences dialog by clicking *Close*. From e8aa8cce7f3c2017a21e62f502217be22e066aea Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 25 Jul 2023 07:54:38 +0200 Subject: [PATCH 287/380] unquote ID in /etc/os-release (#2388) --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 3ab76e3e..341356f6 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8525,7 +8525,7 @@ function _p9k_init_cacheable() { if [[ -r /etc/os-release ]]; then local lines=(${(f)"$(/dev/null fi -typeset -g P9K_VERSION=1.19.2 +typeset -g P9K_VERSION=1.19.3 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From 1d96f5e066a5dd569ddd24787d7e9a3c3abe3024 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 25 Jul 2023 07:55:26 +0200 Subject: [PATCH 288/380] unquote ID in /etc/os-release (#2388) --- internal/p10k.zsh | 2 +- internal/wizard.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 341356f6..33b36df4 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -9375,7 +9375,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.19.3 +typeset -g P9K_VERSION=1.19.4 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 2265b07c..f32de395 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1126,7 +1126,7 @@ function os_icon_name() { if [[ -r /etc/os-release ]]; then local lines=(${(f)"$( Date: Tue, 25 Jul 2023 13:25:19 +0200 Subject: [PATCH 289/380] new segment: per_directory_history (#2384) --- config/p10k-classic.zsh | 14 ++++++++++++++ config/p10k-lean-8colors.zsh | 14 ++++++++++++++ config/p10k-lean.zsh | 14 ++++++++++++++ config/p10k-rainbow.zsh | 16 ++++++++++++++++ internal/icons.zsh | 7 +++++++ internal/p10k.zsh | 27 ++++++++++++++++++++++++++- 6 files changed, 91 insertions(+), 1 deletion(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 14ebd38c..aacb22d4 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -97,6 +97,7 @@ todo # todo items (https://github.com/todotxt/todo.txt-cli) timewarrior # timewarrior tracking status (https://timewarrior.net/) taskwarrior # taskwarrior task count (https://taskwarrior.org/) + per_directory_history # Oh My Zsh per-directory-history local/global indicator # cpu_arch # CPU architecture # time # current time # =========================[ Line #2 ]========================= @@ -887,6 +888,19 @@ # Custom icon. # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + ######[ per_directory_history: Oh My Zsh per-directory-history local/global indicator ]####### + # Color when using local/global history. + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_FOREGROUND=135 + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_FOREGROUND=130 + + # Tip: Uncomment the next two lines to hide "local"/"global" text and leave just the icon. + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_CONTENT_EXPANSION='' + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_CONTENT_EXPANSION='' + + # Custom icon. + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ################################[ cpu_arch: CPU architecture ]################################ # CPU architecture color. typeset -g POWERLEVEL9K_CPU_ARCH_FOREGROUND=172 diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 917fe714..9d1d3003 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -96,6 +96,7 @@ todo # todo items (https://github.com/todotxt/todo.txt-cli) timewarrior # timewarrior tracking status (https://timewarrior.net/) taskwarrior # taskwarrior task count (https://taskwarrior.org/) + per_directory_history # Oh My Zsh per-directory-history local/global indicator # cpu_arch # CPU architecture # time # current time # =========================[ Line #2 ]========================= @@ -865,6 +866,19 @@ # Custom icon. # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + ######[ per_directory_history: Oh My Zsh per-directory-history local/global indicator ]####### + # Color when using local/global history. + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_FOREGROUND=5 + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_FOREGROUND=3 + + # Tip: Uncomment the next two lines to hide "local"/"global" text and leave just the icon. + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_CONTENT_EXPANSION='' + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_CONTENT_EXPANSION='' + + # Custom icon. + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ################################[ cpu_arch: CPU architecture ]################################ # CPU architecture color. typeset -g POWERLEVEL9K_CPU_ARCH_FOREGROUND=3 diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 97c7e288..1581c170 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -96,6 +96,7 @@ todo # todo items (https://github.com/todotxt/todo.txt-cli) timewarrior # timewarrior tracking status (https://timewarrior.net/) taskwarrior # taskwarrior task count (https://taskwarrior.org/) + per_directory_history # Oh My Zsh per-directory-history local/global indicator # cpu_arch # CPU architecture # time # current time # =========================[ Line #2 ]========================= @@ -861,6 +862,19 @@ # Custom icon. # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + ######[ per_directory_history: Oh My Zsh per-directory-history local/global indicator ]####### + # Color when using local/global history. + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_FOREGROUND=135 + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_FOREGROUND=130 + + # Tip: Uncomment the next two lines to hide "local"/"global" text and leave just the icon. + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_CONTENT_EXPANSION='' + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_CONTENT_EXPANSION='' + + # Custom icon. + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ################################[ cpu_arch: CPU architecture ]################################ # CPU architecture color. typeset -g POWERLEVEL9K_CPU_ARCH_FOREGROUND=172 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 53606ff2..3fe2dfaf 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -97,6 +97,7 @@ todo # todo items (https://github.com/todotxt/todo.txt-cli) timewarrior # timewarrior tracking status (https://timewarrior.net/) taskwarrior # taskwarrior task count (https://taskwarrior.org/) + per_directory_history # Oh My Zsh per-directory-history local/global indicator # cpu_arch # CPU architecture # time # current time # =========================[ Line #2 ]========================= @@ -924,6 +925,21 @@ # Custom icon. # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + ######[ per_directory_history: Oh My Zsh per-directory-history local/global indicator ]####### + # Color when using local/global history. + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_BACKGROUND=5 + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_BACKGROUND=3 + + # Tip: Uncomment the next two lines to hide "local"/"global" text and leave just the icon. + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_CONTENT_EXPANSION='' + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_CONTENT_EXPANSION='' + + # Custom icon. + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ################################[ cpu_arch: CPU architecture ]################################ # CPU architecture color. typeset -g POWERLEVEL9K_CPU_ARCH_FOREGROUND=0 diff --git a/internal/icons.zsh b/internal/icons.zsh index 4fce1ee0..3172ed2f 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -153,6 +153,7 @@ function _p9k_init_icons() { SCALA_ICON 'scala' TOOLBOX_ICON '\u2B22' # ⬢ ARCH_ICON 'arch' + HISTORY_ICON 'hist' ) ;; 'awesome-fontconfig') @@ -290,6 +291,7 @@ function _p9k_init_icons() { SCALA_ICON 'scala' TOOLBOX_ICON '\u2B22' # ⬢ ARCH_ICON 'arch' + HISTORY_ICON 'hist' ) ;; 'awesome-mapped-fontconfig') @@ -430,6 +432,7 @@ function _p9k_init_icons() { SCALA_ICON 'scala' TOOLBOX_ICON '\u2B22' # ⬢ ARCH_ICON 'arch' + HISTORY_ICON 'hist' ) ;; 'nerdfont-v3') @@ -568,6 +571,7 @@ function _p9k_init_icons() { SCALA_ICON '\uE737' #  TOOLBOX_ICON '\uE20F'$s #  ARCH_ICON '\uE266' #  + HISTORY_ICON '\uF1DA'$s #  ) ;; 'nerdfont-complete'|'nerdfont-fontconfig') @@ -706,6 +710,7 @@ function _p9k_init_icons() { SCALA_ICON '\uE737' #  TOOLBOX_ICON '\uE20F'$s #  ARCH_ICON '\uE266' #  + HISTORY_ICON '\uF1DA'$s #  ) ;; ascii) @@ -841,6 +846,7 @@ function _p9k_init_icons() { SCALA_ICON 'scala' TOOLBOX_ICON 'toolbox' ARCH_ICON 'arch' + HISTORY_ICON 'hist' ) ;; *) @@ -978,6 +984,7 @@ function _p9k_init_icons() { SCALA_ICON 'scala' TOOLBOX_ICON '\u2B22' # ⬢ ARCH_ICON 'arch' + HISTORY_ICON 'hist' ) ;; esac diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 33b36df4..97c14710 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5731,6 +5731,31 @@ _p9k_prompt_cpu_arch_init() { typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$commands[machine]$commands[arch]' } +################################################################ +# Oh My Zsh per-directory-history local/global indicator +prompt_per_directory_history() { + if [[ $_per_directory_history_is_global == true ]]; then + _p9k_prompt_segment ${0}_GLOBAL 3 $_p9k_color1 HISTORY_ICON 0 '' global + else + _p9k_prompt_segment ${0}_LOCAL 5 $_p9k_color1 HISTORY_ICON 0 '' local + fi +} + +instant_prompt_per_directory_history() { + case $HISTORY_START_WITH_GLOBAL in + true) + _p9k_prompt_segment prompt_per_directory_history_GLOBAL 3 $_p9k_color1 HISTORY_ICON 0 '' global + ;; + ?*) + _p9k_prompt_segment prompt_per_directory_history_LOCAL 5 $_p9k_color1 HISTORY_ICON 0 '' local + ;; + esac +} + +_p9k_prompt_per_directory_history_init() { + typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$PER_DIRECTORY_HISTORY_TOGGLE' +} + # Use two preexec hooks to survive https://github.com/MichaelAquilina/zsh-you-should-use with # YSU_HARDCORE=1. See https://github.com/romkatv/powerlevel10k/issues/427. _p9k_preexec1() { @@ -9375,7 +9400,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.19.4 +typeset -g P9K_VERSION=1.19.5 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From 12aa3fa3c423fa2aaaf9fe22d8c2021af1d73ecb Mon Sep 17 00:00:00 2001 From: Markus Kurtz Date: Tue, 25 Jul 2023 20:50:59 +0200 Subject: [PATCH 290/380] Add rocky icon --- internal/icons.zsh | 7 +++++++ internal/p10k.zsh | 1 + 2 files changed, 8 insertions(+) diff --git a/internal/icons.zsh b/internal/icons.zsh index 3172ed2f..69a721f0 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -73,6 +73,7 @@ function _p9k_init_icons() { LINUX_RHEL_ICON '\uE271'$s #  LINUX_AMZN_ICON '\uE271'$s #  LINUX_ENDEAVOUROS_ICON '\uE271'$s #  + LINUX_ROCKY_ICON '\uE271'$s #  SUNOS_ICON '\U1F31E'$q # 🌞 HOME_ICON '\uE12C'$s #  HOME_SUB_ICON '\uE18D'$s #  @@ -215,6 +216,7 @@ function _p9k_init_icons() { LINUX_RHEL_ICON '\uF17C'$s #  LINUX_AMZN_ICON '\uF17C'$s #  LINUX_ENDEAVOUROS_ICON '\uF17C'$s #  + LINUX_ROCKY_ICON '\uF17C'$s #  SUNOS_ICON '\uF185 ' #  HOME_ICON '\uF015'$s #  HOME_SUB_ICON '\uF07C'$s #  @@ -358,6 +360,7 @@ function _p9k_init_icons() { LINUX_RHEL_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" LINUX_AMZN_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" LINUX_ENDEAVOUROS_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" + LINUX_ROCKY_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" SUNOS_ICON "${CODEPOINT_OF_AWESOME_SUN_O:+\\u$CODEPOINT_OF_AWESOME_SUN_O }" HOME_ICON "${CODEPOINT_OF_AWESOME_HOME:+\\u$CODEPOINT_OF_AWESOME_HOME$s}" HOME_SUB_ICON "${CODEPOINT_OF_AWESOME_FOLDER_OPEN:+\\u$CODEPOINT_OF_AWESOME_FOLDER_OPEN$s}" @@ -494,6 +497,7 @@ function _p9k_init_icons() { LINUX_RHEL_ICON '\uF316'$s #  LINUX_AMZN_ICON '\uF270'$s #  LINUX_ENDEAVOUROS_ICON '\UF322'$s #  + LINUX_ROCKY_ICON '\UF32b'$s #  LINUX_ICON '\uF17C' #  SUNOS_ICON '\uF185 ' #  HOME_ICON '\uF015'$s #  @@ -633,6 +637,7 @@ function _p9k_init_icons() { LINUX_RHEL_ICON '\uF316'$s #  LINUX_AMZN_ICON '\uF270'$s #  LINUX_ENDEAVOUROS_ICON '\uF17C' #  + LINUX_ROCKY_ICON '\uF17C' #  LINUX_ICON '\uF17C' #  SUNOS_ICON '\uF185 ' #  HOME_ICON '\uF015'$s #  @@ -770,6 +775,7 @@ function _p9k_init_icons() { LINUX_RHEL_ICON 'rhel' LINUX_AMZN_ICON 'amzn' LINUX_ENDEAVOUROS_ICON 'edvos' + LINUX_ROCKY_ICON 'rocky' SUNOS_ICON 'sunos' HOME_ICON '' HOME_SUB_ICON '' @@ -908,6 +914,7 @@ function _p9k_init_icons() { LINUX_RHEL_ICON 'RH' LINUX_AMZN_ICON 'Amzn' LINUX_ENDEAVOUROS_ICON 'Edv' + LINUX_ROCKY_ICON 'Roc' SUNOS_ICON 'Sun' HOME_ICON '' HOME_SUB_ICON '' diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 97c14710..c3d96561 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8580,6 +8580,7 @@ function _p9k_init_cacheable() { *rhel*) _p9k_set_os Linux LINUX_RHEL_ICON;; amzn) _p9k_set_os Linux LINUX_AMZN_ICON;; endeavouros) _p9k_set_os Linux LINUX_ENDEAVOUROS_ICON;; + rocky) _p9k_set_os Linux LINUX_ROCKY_ICON;; *) _p9k_set_os Linux LINUX_ICON;; esac ;; From 367c667de66e8227d55b4726390d07aa45c4b3f6 Mon Sep 17 00:00:00 2001 From: Markus Kurtz Date: Tue, 25 Jul 2023 21:36:13 +0200 Subject: [PATCH 291/380] Add rocky icon to wizard --- internal/wizard.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index f32de395..87c45378 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1156,6 +1156,7 @@ function os_icon_name() { *rhel*) echo LINUX_RHEL_ICON;; amzn) echo LINUX_AMZN_ICON;; endeavouros) echo LINUX_ENDEAVOUROS_ICON;; + rocky) echo LINUX_ROCKY_ICON;; *) echo LINUX_ICON;; esac ;; From 68104494a7d407d4b8044cb445eea09e111120ac Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 25 Jul 2023 21:42:48 +0200 Subject: [PATCH 292/380] bump version + cleanup (#2391) --- internal/icons.zsh | 2 +- internal/p10k.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/icons.zsh b/internal/icons.zsh index 69a721f0..5beb5f4d 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -497,7 +497,7 @@ function _p9k_init_icons() { LINUX_RHEL_ICON '\uF316'$s #  LINUX_AMZN_ICON '\uF270'$s #  LINUX_ENDEAVOUROS_ICON '\UF322'$s #  - LINUX_ROCKY_ICON '\UF32b'$s #  + LINUX_ROCKY_ICON '\UF32B'$s #  LINUX_ICON '\uF17C' #  SUNOS_ICON '\uF185 ' #  HOME_ICON '\uF015'$s #  diff --git a/internal/p10k.zsh b/internal/p10k.zsh index c3d96561..be6c2e9f 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -9401,7 +9401,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.19.5 +typeset -g P9K_VERSION=1.19.6 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From a8fa0e2a1b67513331f19dab96de92333ad832f5 Mon Sep 17 00:00:00 2001 From: Farid Zakaria Date: Wed, 26 Jul 2023 17:07:17 +0000 Subject: [PATCH 293/380] Add documentation explaining lack of support for skipHash libgit2 does not support skipHash which causes the prompt to be incorrect for repos that have it toggled. Add the documentation for this gap. fixes #2387 --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index f5713b64..fa5fa267 100644 --- a/README.md +++ b/README.md @@ -1511,6 +1511,7 @@ Powerlevel10k are released. This may change in the future but not soon. - [Horrific mess when resizing terminal window](#horrific-mess-when-resizing-terminal-window) - [Icons cut off in Konsole](#icons-cut-off-in-konsole) - [Arch Linux logo has a dot in the bottom right corner](#arch-linux-logo-has-a-dot-in-the-bottom-right-corner) +- [Git status looks incorrect](#git-status-looks-incorrect) ### Question mark in prompt @@ -2020,3 +2021,15 @@ Some fonts have this incorrect dotted icon in bold typeface. There are two ways ```zsh typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='${P9K_CONTENT}' # not bold ``` + +### Git status looks incorrect + +Powerlevel10k uses [gitstatus](https://github.com/romkatv/gitstatus) to provide a much faster response to traditional `git status`. +The project relies on the [libgit2](https://github.com/libgit2/libgit2) library however which has some gaps in it's implementation. + +#### skipHash not supported + +If your `.git/config` has `skipHash` enabled, then you will likely see an incorrect status prompt as this is not supported +by libgit2 at the moment. [issue](https://github.com/libgit2/libgit2/issues/6531) + +Note: `skipHash` can be set by implicitly by other configuration toggles such as `feature.manyFiles` From 9bb15e9ffbf43663a77949ea31d6f18c74e8981c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 26 Jul 2023 19:24:52 +0200 Subject: [PATCH 294/380] docs: rephrase "Git status looks incorrect" section --- README.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index fa5fa267..5fa806c6 100644 --- a/README.md +++ b/README.md @@ -1511,7 +1511,7 @@ Powerlevel10k are released. This may change in the future but not soon. - [Horrific mess when resizing terminal window](#horrific-mess-when-resizing-terminal-window) - [Icons cut off in Konsole](#icons-cut-off-in-konsole) - [Arch Linux logo has a dot in the bottom right corner](#arch-linux-logo-has-a-dot-in-the-bottom-right-corner) -- [Git status looks incorrect](#git-status-looks-incorrect) +- [Incorrect git status in prompt](#incorrect-git-status-in-prompt) ### Question mark in prompt @@ -2022,14 +2022,15 @@ Some fonts have this incorrect dotted icon in bold typeface. There are two ways typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='${P9K_CONTENT}' # not bold ``` -### Git status looks incorrect +### Incorrect git status in prompt -Powerlevel10k uses [gitstatus](https://github.com/romkatv/gitstatus) to provide a much faster response to traditional `git status`. -The project relies on the [libgit2](https://github.com/libgit2/libgit2) library however which has some gaps in it's implementation. +Powerlevel10k uses [gitstatusd](https://github.com/romkatv/gitstatus) to inspect the state of git +repositories. The project relies on the [libgit2](https://github.com/libgit2/libgit2) library, which +has some gaps in its implementation. Under some conditions, this may result in discrepancies between +the real state of a git repository (reflected by `git status`) and what gets shown in the +Powerlevel10k prompt. -#### skipHash not supported - -If your `.git/config` has `skipHash` enabled, then you will likely see an incorrect status prompt as this is not supported -by libgit2 at the moment. [issue](https://github.com/libgit2/libgit2/issues/6531) - -Note: `skipHash` can be set by implicitly by other configuration toggles such as `feature.manyFiles` +Most notably, [libgit2 does not support `skipHash`](https://github.com/libgit2/libgit2/issues/6531). +If you see incorrect git status in prompt, run `git config -l` and check whether `skipHash` is +enabled. If it is, consider disabling it. Keep in mind that `skipHash` may be implicitly enabled +when activating ceratin git features, such as `manyFiles`. From f851f41fc14d5bd66266b4b4af917d50c1c8b7fe Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 29 Jul 2023 17:01:40 +0200 Subject: [PATCH 295/380] remove MULTIBYTE requirement from the configuration wizard (#2397) --- README.md | 13 +++++++++---- internal/configure.zsh | 1 - internal/wizard.zsh | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5fa806c6..f819c204 100644 --- a/README.md +++ b/README.md @@ -1696,10 +1696,15 @@ and make sure that `TERM` environment variable is set correctly. Verify with If there is no UTF-8 locale on the system, configuration wizard won't offer prompt styles that use Unicode characters. *Fix*: Install a UTF-8 locale. Verify with `locale -a`. -When a UTF-8 locale is available, the first few questions asked by the configuration wizard assess -capabilities of the terminal font. If your answers indicate that some glyphs don't render correctly, -configuration wizard won't offer prompt styles that use them. *Fix*: Restart your terminal and -install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). Verify by running +Another case in which configuration wizard may not offer Unicode prompt styles is when the +`MULTIBYTE` shell option is disabled. *Fix*: Enable the `MULTIBYTE` option, or rather don't disable +it (this option is enabled in Zsh by default). Verify with `print -r -- ${options[MULTIBYTE]}`. + +When `MULTIBYTE` is enabled and a UTF-8 locale is available, the first few questions asked by the +configuration wizard assess capabilities of the terminal font. If your answers indicate that some +glyphs don't render correctly, configuration wizard won't offer prompt styles that use them. *Fix*: +Restart your terminal and install +[the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). Verify by running `p10k configure` and checking that all glyphs render correctly. ### Cannot install the recommended font diff --git a/internal/configure.zsh b/internal/configure.zsh index 3e880f23..0e13bdec 100644 --- a/internal/configure.zsh +++ b/internal/configure.zsh @@ -18,7 +18,6 @@ function _p9k_can_configure() { typeset -g __p9k_cfg_path=${__p9k_cfg_path_o:A} typeset -g __p9k_cfg_path_u=${${${(q)__p9k_cfg_path_o}/#(#b)${(q)HOME}(|\/*)/'~'$match[1]}//\%/%%} { - [[ -o multibyte ]] || { $0_error "multibyte option is not set"; return 1 } [[ -e $__p9k_zd ]] || { $0_error "$__p9k_zd_u does not exist"; return 1 } [[ -d $__p9k_zd ]] || { $0_error "$__p9k_zd_u is not a directory"; return 1 } [[ ! -d $__p9k_cfg_path ]] || { $0_error "$__p9k_cfg_path_u is a directory"; return 1 } diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 87c45378..c7a03844 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -2107,7 +2107,7 @@ while true; do unset pure_use_rprompt - if [[ $TERM != (dumb|linux) && $langinfo[CODESET] == (utf|UTF)(-|)8 ]]; then + if [[ -o multibyte && $TERM != (dumb|linux) && $langinfo[CODESET] == (utf|UTF)(-|)8 ]]; then ask_font || continue ask_diamond || continue if [[ $AWESOME_GLYPHS_LOADED == 1 ]]; then From 717f9a1881c1bd179658951b8628f1b395c1cb11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Criado-P=C3=A9rez?= Date: Thu, 10 Aug 2023 09:31:37 +0200 Subject: [PATCH 296/380] fix typos in docs and comments --- README.md | 4 ++-- internal/p10k.zsh | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f819c204..3fdb339f 100644 --- a/README.md +++ b/README.md @@ -1187,7 +1187,7 @@ completes, Powerlevel10k refreshes prompt with new information, this time with c When using *Rainbow* style, Git status is displayed as black on grey while it's still being computed. Depending on the terminal color palette, this may be difficult to read. In this case you -might want to change the background color to something ligher for more contrast. To do that, open +might want to change the background color to something lighter for more contrast. To do that, open `~/.p10k.zsh`, search for `POWERLEVEL9K_VCS_LOADING_BACKGROUND`, uncomment it if it's commented out, and change the value. @@ -2038,4 +2038,4 @@ Powerlevel10k prompt. Most notably, [libgit2 does not support `skipHash`](https://github.com/libgit2/libgit2/issues/6531). If you see incorrect git status in prompt, run `git config -l` and check whether `skipHash` is enabled. If it is, consider disabling it. Keep in mind that `skipHash` may be implicitly enabled -when activating ceratin git features, such as `manyFiles`. +when activating certain git features, such as `manyFiles`. diff --git a/internal/p10k.zsh b/internal/p10k.zsh index be6c2e9f..2514ae5d 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -532,7 +532,7 @@ _p9k_get_icon() { _p9k_translate_color() { if [[ $1 == <-> ]]; then # decimal color code: 255 _p9k__ret=${(l.3..0.)1} - elif [[ $1 == '#'[[:xdigit:]]## ]]; then # hexademical color code: #ffffff + elif [[ $1 == '#'[[:xdigit:]]## ]]; then # hexadecimal color code: #ffffff _p9k__ret=${${(L)1}//ı/i} else # named color: red # Strip prifixes if there are any. @@ -2420,7 +2420,7 @@ function _p9k_cached_cmd() { } ################################################################ -# Segment to diplay Node version +# Segment to display Node version prompt_node_version() { _p9k_upglob package.json -. local -i idx=$? @@ -3718,7 +3718,7 @@ function +vi-hg-bookmarks() { if [[ -n "${hgbmarks[@]}" ]]; then hook_com[hg-bookmark-string]=" $(print_icon 'VCS_BOOKMARK_ICON')${hgbmarks[@]}" - # To signal that we want to use the sting we just generated, set the special + # To signal that we want to use the string we just generated, set the special # variable `ret' to something other than the default zero: ret=1 return 0 @@ -3962,7 +3962,7 @@ function _p9k_vcs_render() { fi # It's weird that removing vcs-detect-changes from POWERLEVEL9K_VCS_GIT_HOOKS gets rid - # of the GIT icon. That's what vcs_info does, so we do the same in the name of compatiblity. + # of the GIT icon. That's what vcs_info does, so we do the same in the name of compatibility. _p9k_vcs_icon icon=$_p9k__ret fi From 22cb2f79ddb89a368dd823e815fa1b0587ff1b6a Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 10 Aug 2023 09:32:33 +0200 Subject: [PATCH 297/380] Squashed 'gitstatus/' changes from 4b47ca047..abb4f6a52 abb4f6a52 fix typos in docs and comments 958ae4e6d docs: explicitly mention that core.fsmonitor was disable in git benchmarks (#370) git-subtree-dir: gitstatus git-subtree-split: abb4f6a5225d12f51ffd8196060804b0c770482e --- README.md | 4 ++-- gitstatus.plugin.sh | 2 +- gitstatus.plugin.zsh | 2 +- src/check.h | 2 +- src/dir.h | 2 +- src/options.cc | 6 +++--- src/options.h | 2 +- src/repo.cc | 2 +- src/tag_db.cc | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 82a19981..a6631f63 100644 --- a/README.md +++ b/README.md @@ -255,7 +255,7 @@ repository was checked out to an ext4 filesystem on M.2 SSD. Three functionally equivalent tools for computing git status were benchmarked: * `gitstatusd` -* `git` with untracked cache enabled +* `git` with `core.untrackedcache` enabled and `core.fsmonitor` disabled * `lg2` -- a demo/example executable from [libgit2](https://github.com/romkatv/libgit2) that implements a subset of `git` functionality on top of libgit2 API; for the purposes of this benchmark the subset is sufficient to generate the same data as the other tools @@ -381,7 +381,7 @@ generated with the same tools and the same flags as the profile of libgit2. Since both profiles were generated from the same workload, absolute numbers can be compared. We can see that gitstatusd took 62 seconds in total compared to libgit2's 232 seconds. System calls at the -core of the algorithm are cleary visible. `__GI___fxstatat` is a flavor of `stat()`, and the other +core of the algorithm are clearly visible. `__GI___fxstatat` is a flavor of `stat()`, and the other three calls -- `__libc_openat64`, `__libc_close` and `__GI___fxstat` are responsible for opening directories and finding untracked files. Notice that there is almost nothing else in the profile apart from these calls. The rest of the code accounts for 3.77 seconds of CPU time -- 32 times less diff --git a/gitstatus.plugin.sh b/gitstatus.plugin.sh index 37b78f44..bfe16dc2 100644 --- a/gitstatus.plugin.sh +++ b/gitstatus.plugin.sh @@ -290,7 +290,7 @@ function gitstatus_stop() { unset _GITSTATUS_DIRTY_MAX_INDEX_SIZE _GITSTATUS_CLIENT_PID } -# Retrives status of a git repository from a directory under its working tree. +# Retrieves status of a git repository from a directory under its working tree. # # Usage: gitstatus_query [OPTION]... # diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index 228fea74..b74396d3 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -59,7 +59,7 @@ zmodload -F zsh/files b:zf_rm || return typeset -g _gitstatus_plugin_dir"${1:-}"="${${(%):-%x}:A:h}" -# Retrives status of a git repo from a directory under its working tree. +# Retrieves status of a git repo from a directory under its working tree. # ## Usage: gitstatus_query [OPTION]... NAME # diff --git a/src/check.h b/src/check.h index 82dceae1..682675a2 100644 --- a/src/check.h +++ b/src/check.h @@ -23,7 +23,7 @@ #include // The argument must be an expression convertible to bool. -// Does nothing if the expression evalutes to true. Otherwise +// Does nothing if the expression evaluates to true. Otherwise // it's equivalent to LOG(FATAL). #define CHECK(cond...) \ static_cast(0), (!!(cond)) ? static_cast(0) : LOG(FATAL) << #cond << ": " diff --git a/src/dir.h b/src/dir.h index 4d4cf3da..2a7533a3 100644 --- a/src/dir.h +++ b/src/dir.h @@ -25,7 +25,7 @@ namespace gitstatus { -// On error, leaves entries unchaged and returns false. Does not throw. +// On error, leaves entries unchanged and returns false. Does not throw. // // On success, appends names of files from the specified directory to entries and returns true. // Every appended entry is a null-terminated string. At -1 offset is its d_type. All elements diff --git a/src/options.cc b/src/options.cc index 46f3845c..b7abe5db 100644 --- a/src/options.cc +++ b/src/options.cc @@ -61,7 +61,7 @@ size_t ParseSizeT(const char* s) { void PrintUsage() { std::cout << "Usage: gitstatusd [OPTION]...\n" - << "Print machine-readable status of the git repos for directores in stdin.\n" + << "Print machine-readable status of the git repos for directories in stdin.\n" << "\n" << "OPTIONS\n" << " -l, --lock-fd=NUM [default=-1]\n" @@ -78,7 +78,7 @@ void PrintUsage() { << " maximum performance.\n" << "\n" << " -v, --log-level=STR [default=INFO]\n" - << " Don't write entires to log whose log level is below this. Log levels in\n" + << " Don't write entries to log whose log level is below this. Log levels in\n" << " increasing order: DEBUG, INFO, WARN, ERROR, FATAL.\n" << "\n" << " -r, --repo-ttl-seconds=NUM [default=3600]\n" @@ -141,7 +141,7 @@ void PrintUsage() { << "\n" << " 1. Request ID. Any string. Can be empty.\n" << " 2. Path to the directory for which git stats are being requested.\n" - << " If the first character is ':', it is removed and the remaning path\n" + << " If the first character is ':', it is removed and the remaining path\n" << " is treated as GIT_DIR.\n" << " 3. (Optional) '1' to disable computation of anything that requires reading\n" << " git index; '0' for the default behavior of computing everything.\n" diff --git a/src/options.h b/src/options.h index fd561e11..bb373155 100644 --- a/src/options.h +++ b/src/options.h @@ -62,7 +62,7 @@ struct Options : Limits { // If non-negative, send signal 0 to the specified PID when not receiving any requests for one // second; exit if signal sending fails. int parent_pid = -1; - // Don't write entires to log whose log level is below this. Log levels in increasing order: + // Don't write entries to log whose log level is below this. Log levels in increasing order: // DEBUG, INFO, WARN, ERROR, FATAL. LogLevel log_level = INFO; // Close git repositories that haven't been used for this long. This is meant to release resources diff --git a/src/repo.cc b/src/repo.cc index d7ea7d3e..a81594a4 100644 --- a/src/repo.cc +++ b/src/repo.cc @@ -155,7 +155,7 @@ IndexStats Repo::GetIndexStats(const git_oid* head, git_config* cfg) { VERIFY(!git_repository_index(&git_index_, repo_)) << GitError(); // Query an attribute (doesn't matter which) to initialize repo's attribute // cache. It's a workaround for synchronization bugs (data races) in libgit2 - // that result from lazy cache initialization without synchrnonization. + // that result from lazy cache initialization without synchronization. // Thankfully, subsequent cache reads and writes are properly synchronized. const char* attr; VERIFY(!git_attr_get(&attr, repo_, 0, "x", "x")) << GitError(); diff --git a/src/tag_db.cc b/src/tag_db.cc index 52cbaede..8bd445c7 100644 --- a/src/tag_db.cc +++ b/src/tag_db.cc @@ -268,7 +268,7 @@ void TagDb::ParsePack() { } if (!std::is_sorted(name2id_.begin(), name2id_.end(), ByName)) { - // "sorted" in the header of packed-refs promisses that this won't trigger. + // "sorted" in the header of packed-refs promises that this won't trigger. std::sort(name2id_.begin(), name2id_.end(), ByName); } From 9401ed17c0a8c3d1654214a204b8d5b5f7ccf386 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 10 Aug 2023 11:48:54 +0200 Subject: [PATCH 298/380] Squashed 'gitstatus/' changes from abb4f6a52..bdaad2e8d bdaad2e8d Makefile: remove the explicit check for the existence of $(CXX) 6d32e0272 Merge branch 'criadoperez-fix/makefile' c0e3c250e improved Makefile git-subtree-dir: gitstatus git-subtree-split: bdaad2e8d0e6e2f9928e067c85de8096b87e21fa --- Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Makefile b/Makefile index 450d5ea0..fede08af 100644 --- a/Makefile +++ b/Makefile @@ -44,3 +44,14 @@ pkg: zwc GITSTATUS_DAEMON= GITSTATUS_CACHE_DIR=$(shell pwd)/usrbin ./install -f -include $(OBJS:.o=.dep) + +.PHONY: help + +help: + @echo "Usage: make [TARGET]" + @echo "Available targets:" + @echo " all Build $(APPNAME) (default target)" + @echo " clean Remove generated files and directories" + @echo " zwc Compile Zsh files" + @echo " minify Remove unnecessary files and folders" + @echo " pkg Create a package" From d8041e4700ace779aaf42e19c3de2d25a14dbae8 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 15 Aug 2023 10:30:02 +0200 Subject: [PATCH 299/380] Squashed 'gitstatus/' changes from bdaad2e8d..38d35b959 38d35b959 cleanup 7e7b5e807 bash prompt: set PROMPT_COMMAND in a nicer and more robust manner (#403) 7ee9227de Merge branch 'samiam-append_prompt' 198ed58ce Revert "Update README to append to PROMPT_COMMAND" 8b6a229fa Switch to using var assignment for backward compatibility 693f9efa0 Update README to append to PROMPT_COMMAND a48175ce1 Append to PROMPT_COMMAND to play nice with other prompt programs git-subtree-dir: gitstatus git-subtree-split: 38d35b95926e09d07b8cf78edade7cee7a9a1dcf --- gitstatus.prompt.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gitstatus.prompt.sh b/gitstatus.prompt.sh index 8ee28de0..f54c11ac 100644 --- a/gitstatus.prompt.sh +++ b/gitstatus.prompt.sh @@ -2,7 +2,7 @@ # Source gitstatus.plugin.sh from $GITSTATUS_DIR or from the same directory # in which the current script resides if the variable isn't set. -if [[ -n "${GITSTATUS_DIR:-}" ]]; then +if [[ -n "${GITSTATUS_DIR-}" ]]; then source "$GITSTATUS_DIR" || return elif [[ "${BASH_SOURCE[0]}" == */* ]]; then source "${BASH_SOURCE[0]%/*}/gitstatus.plugin.sh" || return @@ -85,7 +85,14 @@ function gitstatus_prompt_update() { gitstatus_stop && gitstatus_start -s -1 -u -1 -c -1 -d -1 # On every prompt, fetch git status and set GITSTATUS_PROMPT. -PROMPT_COMMAND=gitstatus_prompt_update +if [[ -z "${PROMPT_COMMAND[*]}" ]]; then + PROMPT_COMMAND=gitstatus_prompt_update +elif [[ ! "${PROMPT_COMMAND[*]}" =~ [[:space:]\;]?gitstatus_prompt_update[[:space:]\;]? ]]; then + # Note: If PROMPT_COMMAND is an array, this will modify its first element. + PROMPT_COMMAND=$'gitstatus_prompt_update\n'"$PROMPT_COMMAND" +fi + +# Retain 3 trailing components of the current directory. PROMPT_DIRTRIM=3 # Enable promptvars so that ${GITSTATUS_PROMPT} in PS1 is expanded. From 011b8469ab716d7d6fd1dc050ebdff81b6b830b0 Mon Sep 17 00:00:00 2001 From: Nanda Lopes Date: Sun, 27 Aug 2023 10:42:57 -0300 Subject: [PATCH 300/380] typo: s/.tool-version/.tool-versions/ in all configs --- config/p10k-classic.zsh | 2 +- config/p10k-lean-8colors.zsh | 2 +- config/p10k-lean.zsh | 2 +- config/p10k-rainbow.zsh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index aacb22d4..5ea8faec 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -242,7 +242,7 @@ .java-version .perl-version .php-version - .tool-version + .tool-versions .shorten_folder_marker .svn .terraform diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 9d1d3003..38328c4e 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -233,7 +233,7 @@ .java-version .perl-version .php-version - .tool-version + .tool-versions .shorten_folder_marker .svn .terraform diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 1581c170..7cb97e90 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -233,7 +233,7 @@ .java-version .perl-version .php-version - .tool-version + .tool-versions .shorten_folder_marker .svn .terraform diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 3fe2dfaf..ab36838f 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -242,7 +242,7 @@ .java-version .perl-version .php-version - .tool-version + .tool-versions .shorten_folder_marker .svn .terraform From f8595a35bf062279a639b6bdbecc478c18c3f009 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 7 Sep 2023 13:58:03 +0200 Subject: [PATCH 301/380] use powerlevel10k from homebrew/core when installing with brew --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3fdb339f..4eb75685 100644 --- a/README.md +++ b/README.md @@ -509,7 +509,7 @@ Add `plug "romkatv/powerlevel10k"` to `~/.zshrc`. ### Homebrew ```zsh -brew install romkatv/powerlevel10k/powerlevel10k +brew install powerlevel10k echo "source $(brew --prefix)/opt/powerlevel10k/powerlevel10k.zsh-theme" >>~/.zshrc ``` @@ -894,8 +894,8 @@ The command to update Powerlevel10k depends on how it was installed. | [Zplugin](#zplugin) | `zplugin delete romkatv/powerlevel10k` | | [Zinit](#zinit) | `zinit delete romkatv/powerlevel10k` | | [Zi](#zi) | `zi delete romkatv/powerlevel10k` | - | [Zap](#zap) | `zsh -ic 'zap clean'` | - | [Homebrew](#homebrew) | `brew uninstall powerlevel10k; brew untap romkatv/powerlevel10k` | + | [Zap](#zap) | `zsh -ic 'zap clean'` | + | [Homebrew](#homebrew) | `brew uninstall powerlevel10k` | | [Arch Linux](#arch-linux) | `yay -R --noconfirm zsh-theme-powerlevel10k-git` | | [Alpine Linux](#alpine-linux) | `apk del zsh-theme-powerlevel10k` | 6. Restart Zsh. [Do not use `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc). From be4c68fd0a6cc139cb02e24294c96a2a5e50576d Mon Sep 17 00:00:00 2001 From: Jussi Timperi <236182+Ban3@users.noreply.github.com> Date: Fri, 8 Sep 2023 13:11:37 +0300 Subject: [PATCH 302/380] add Guix System icon (#2424) --- internal/icons.zsh | 7 +++++++ internal/p10k.zsh | 1 + internal/wizard.zsh | 1 + 3 files changed, 9 insertions(+) diff --git a/internal/icons.zsh b/internal/icons.zsh index 5beb5f4d..616b9e49 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -74,6 +74,7 @@ function _p9k_init_icons() { LINUX_AMZN_ICON '\uE271'$s #  LINUX_ENDEAVOUROS_ICON '\uE271'$s #  LINUX_ROCKY_ICON '\uE271'$s #  + LINUX_GUIX_ICON '\uE271'$s #  SUNOS_ICON '\U1F31E'$q # 🌞 HOME_ICON '\uE12C'$s #  HOME_SUB_ICON '\uE18D'$s #  @@ -217,6 +218,7 @@ function _p9k_init_icons() { LINUX_AMZN_ICON '\uF17C'$s #  LINUX_ENDEAVOUROS_ICON '\uF17C'$s #  LINUX_ROCKY_ICON '\uF17C'$s #  + LINUX_GUIX_ICON '\uF17C'$s #  SUNOS_ICON '\uF185 ' #  HOME_ICON '\uF015'$s #  HOME_SUB_ICON '\uF07C'$s #  @@ -361,6 +363,7 @@ function _p9k_init_icons() { LINUX_AMZN_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" LINUX_ENDEAVOUROS_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" LINUX_ROCKY_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" + LINUX_GUIX_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" SUNOS_ICON "${CODEPOINT_OF_AWESOME_SUN_O:+\\u$CODEPOINT_OF_AWESOME_SUN_O }" HOME_ICON "${CODEPOINT_OF_AWESOME_HOME:+\\u$CODEPOINT_OF_AWESOME_HOME$s}" HOME_SUB_ICON "${CODEPOINT_OF_AWESOME_FOLDER_OPEN:+\\u$CODEPOINT_OF_AWESOME_FOLDER_OPEN$s}" @@ -498,6 +501,7 @@ function _p9k_init_icons() { LINUX_AMZN_ICON '\uF270'$s #  LINUX_ENDEAVOUROS_ICON '\UF322'$s #  LINUX_ROCKY_ICON '\UF32B'$s #  + LINUX_GUIX_ICON '\UF325'$s #  LINUX_ICON '\uF17C' #  SUNOS_ICON '\uF185 ' #  HOME_ICON '\uF015'$s #  @@ -638,6 +642,7 @@ function _p9k_init_icons() { LINUX_AMZN_ICON '\uF270'$s #  LINUX_ENDEAVOUROS_ICON '\uF17C' #  LINUX_ROCKY_ICON '\uF17C' #  + LINUX_GUIX_ICON '\uF325'$s #  LINUX_ICON '\uF17C' #  SUNOS_ICON '\uF185 ' #  HOME_ICON '\uF015'$s #  @@ -776,6 +781,7 @@ function _p9k_init_icons() { LINUX_AMZN_ICON 'amzn' LINUX_ENDEAVOUROS_ICON 'edvos' LINUX_ROCKY_ICON 'rocky' + LINUX_GUIX_ICON 'guix' SUNOS_ICON 'sunos' HOME_ICON '' HOME_SUB_ICON '' @@ -915,6 +921,7 @@ function _p9k_init_icons() { LINUX_AMZN_ICON 'Amzn' LINUX_ENDEAVOUROS_ICON 'Edv' LINUX_ROCKY_ICON 'Roc' + LINUX_GUIX_ICON 'Guix' SUNOS_ICON 'Sun' HOME_ICON '' HOME_SUB_ICON '' diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 2514ae5d..e4b0b328 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8581,6 +8581,7 @@ function _p9k_init_cacheable() { amzn) _p9k_set_os Linux LINUX_AMZN_ICON;; endeavouros) _p9k_set_os Linux LINUX_ENDEAVOUROS_ICON;; rocky) _p9k_set_os Linux LINUX_ROCKY_ICON;; + guix) _p9k_set_os Linux LINUX_GUIX_ICON;; *) _p9k_set_os Linux LINUX_ICON;; esac ;; diff --git a/internal/wizard.zsh b/internal/wizard.zsh index c7a03844..589e0cfe 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1157,6 +1157,7 @@ function os_icon_name() { amzn) echo LINUX_AMZN_ICON;; endeavouros) echo LINUX_ENDEAVOUROS_ICON;; rocky) echo LINUX_ROCKY_ICON;; + guix) echo LINUX_GUIX_ICON;; *) echo LINUX_ICON;; esac ;; From 215b20e08714ba0539a83be2723ff8ab17702c88 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 8 Sep 2023 12:16:35 +0200 Subject: [PATCH 303/380] bump version --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index e4b0b328..1193540e 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -9402,7 +9402,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.19.6 +typeset -g P9K_VERSION=1.19.7 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From 873c4ff09c559a507d33e528df7e27a8a48705d7 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 9 Sep 2023 11:41:14 +0200 Subject: [PATCH 304/380] fix the path to powerlevel10k when installing with homebrew (#2429) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4eb75685..6ff6f449 100644 --- a/README.md +++ b/README.md @@ -510,7 +510,7 @@ Add `plug "romkatv/powerlevel10k"` to `~/.zshrc`. ```zsh brew install powerlevel10k -echo "source $(brew --prefix)/opt/powerlevel10k/powerlevel10k.zsh-theme" >>~/.zshrc +echo "source $(brew --prefix)/share/powerlevel10k/powerlevel10k.zsh-theme" >>~/.zshrc ``` ### Arch Linux From 862440ae112603c8e2d202f6edb94eeaa1509120 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 9 Oct 2023 10:17:06 +0200 Subject: [PATCH 305/380] add an icon for azure to vcs (#2447) --- internal/icons.zsh | 7 +++++++ internal/p10k.zsh | 15 +++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/internal/icons.zsh b/internal/icons.zsh index 616b9e49..308a01d8 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -105,6 +105,7 @@ function _p9k_init_icons() { VCS_GIT_GITHUB_ICON '\uE20E ' # VCS_GIT_BITBUCKET_ICON '\uE20E ' # VCS_GIT_GITLAB_ICON '\uE20E ' # + VCS_GIT_AZURE_ICON '\uE20E ' # VCS_HG_ICON '\uE1C3 ' #  VCS_SVN_ICON 'svn'$q RUST_ICON 'R' @@ -245,6 +246,7 @@ function _p9k_init_icons() { VCS_GIT_GITHUB_ICON '\uF113 ' #  VCS_GIT_BITBUCKET_ICON '\uF171 ' #  VCS_GIT_GITLAB_ICON '\uF296 ' #  + VCS_GIT_AZURE_ICON '\u2601 ' # ☁ VCS_HG_ICON '\uF0C3 ' #  VCS_SVN_ICON 'svn'$q RUST_ICON '\uE6A8' #  @@ -390,6 +392,7 @@ function _p9k_init_icons() { VCS_GIT_GITHUB_ICON "${CODEPOINT_OF_AWESOME_GITHUB_ALT:+\\u$CODEPOINT_OF_AWESOME_GITHUB_ALT }" VCS_GIT_BITBUCKET_ICON "${CODEPOINT_OF_AWESOME_BITBUCKET:+\\u$CODEPOINT_OF_AWESOME_BITBUCKET }" VCS_GIT_GITLAB_ICON "${CODEPOINT_OF_AWESOME_GITLAB:+\\u$CODEPOINT_OF_AWESOME_GITLAB }" + VCS_GIT_AZURE_ICON '\u2601 ' # ☁ VCS_HG_ICON "${CODEPOINT_OF_AWESOME_FLASK:+\\u$CODEPOINT_OF_AWESOME_FLASK }" VCS_SVN_ICON 'svn'$q RUST_ICON '\uE6A8' #  @@ -529,6 +532,7 @@ function _p9k_init_icons() { VCS_GIT_GITHUB_ICON '\uF113 ' #  VCS_GIT_BITBUCKET_ICON '\uE703 ' #  VCS_GIT_GITLAB_ICON '\uF296 ' #  + VCS_GIT_AZURE_ICON '\UF0805 ' # 󰠅 VCS_HG_ICON '\uF0C3 ' #  VCS_SVN_ICON '\uE72D'$q #  RUST_ICON '\uE7A8'$q #  @@ -670,6 +674,7 @@ function _p9k_init_icons() { VCS_GIT_GITHUB_ICON '\uF113 ' #  VCS_GIT_BITBUCKET_ICON '\uE703 ' #  VCS_GIT_GITLAB_ICON '\uF296 ' #  + VCS_GIT_AZURE_ICON '\uFD03 ' # ﴃ VCS_HG_ICON '\uF0C3 ' #  VCS_SVN_ICON '\uE72D'$q #  RUST_ICON '\uE7A8'$q #  @@ -808,6 +813,7 @@ function _p9k_init_icons() { VCS_GIT_GITHUB_ICON '' VCS_GIT_BITBUCKET_ICON '' VCS_GIT_GITLAB_ICON '' + VCS_GIT_AZURE_ICON '' VCS_HG_ICON '' VCS_SVN_ICON '' RUST_ICON 'rust' @@ -948,6 +954,7 @@ function _p9k_init_icons() { VCS_GIT_GITHUB_ICON '' VCS_GIT_BITBUCKET_ICON '' VCS_GIT_GITLAB_ICON '' + VCS_GIT_AZURE_ICON '' VCS_HG_ICON '' VCS_SVN_ICON '' RUST_ICON 'R' diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 1193540e..d105665e 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3874,11 +3874,14 @@ function _p9k_vcs_status_purge() { function _p9k_vcs_icon() { case "$VCS_STATUS_REMOTE_URL" in - *github*) _p9k__ret=VCS_GIT_GITHUB_ICON;; - *bitbucket*) _p9k__ret=VCS_GIT_BITBUCKET_ICON;; - *stash*) _p9k__ret=VCS_GIT_BITBUCKET_ICON;; - *gitlab*) _p9k__ret=VCS_GIT_GITLAB_ICON;; - *) _p9k__ret=VCS_GIT_ICON;; + *github*) _p9k__ret=VCS_GIT_GITHUB_ICON;; + *bitbucket*) _p9k__ret=VCS_GIT_BITBUCKET_ICON;; + *stash*) _p9k__ret=VCS_GIT_BITBUCKET_ICON;; + *gitlab*) _p9k__ret=VCS_GIT_GITLAB_ICON;; + # https://learn.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate + (|*@)vs-ssh.visualstudio.com(|:*)) _p9k__ret=VCS_GIT_AZURE_ICON;; # old + (|*@)ssh.dev.azure.com(|:*)) _p9k__ret=VCS_GIT_AZURE_ICON;; # new + *) _p9k__ret=VCS_GIT_ICON;; esac } @@ -9402,7 +9405,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.19.7 +typeset -g P9K_VERSION=1.19.8 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From c7fa7d6748cf6935ff7aeaa4d0d76a1ed2bfb852 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 23 Oct 2023 10:09:41 +0200 Subject: [PATCH 306/380] make rust_version segment compatible with the new rustup toolchain file (#2413) --- internal/p10k.zsh | 105 ++++++++++++++++++++-------------------------- 1 file changed, 46 insertions(+), 59 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index d105665e..dbc69c41 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3186,70 +3186,57 @@ instant_prompt_root_indicator() { prompt_root_indicator; } ################################################################ # Segment to display Rust version number prompt_rust_version() { - unset P9K_RUST_VERSION - if (( _POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY )); then - _p9k_upglob Cargo.toml -. && return - fi - local rustc=$commands[rustc] toolchain deps=() - if (( $+commands[ldd] )); then - if ! _p9k_cache_stat_get $0_so $rustc; then - local line so - for line in "${(@f)$(ldd $rustc 2>/dev/null)}"; do - [[ $line == (#b)[[:space:]]#librustc_driver[^[:space:]]#.so' => '(*)' (0x'[[:xdigit:]]#')' ]] || continue - so=$match[1] - break - done - _p9k_cache_stat_set "$so" - fi - deps+=$_p9k__cache_val[1] - fi - if (( $+commands[rustup] )); then - local rustup=$commands[rustup] - local rustup_home=${RUSTUP_HOME:-~/.rustup} - local cfg=($rustup_home/settings.toml(.N)) - deps+=($cfg $rustup_home/update-hashes/*(.N)) - if [[ -z ${toolchain::=$RUSTUP_TOOLCHAIN} ]]; then - if ! _p9k_cache_stat_get $0_overrides $rustup $cfg; then - local lines=(${(f)"$(rustup override list 2>/dev/null)"}) - if [[ $lines[1] == "no overrides" ]]; then - _p9k_cache_stat_set - else - local MATCH - local keys=(${(@)${lines%%[[:space:]]#[^[:space:]]#}/(#m)*/${(b)MATCH}/}) - local vals=(${(@)lines/(#m)*/$MATCH[(I)/] ${MATCH##*[[:space:]]}}) - _p9k_cache_stat_set ${keys:^vals} - fi - fi - local -A overrides=($_p9k__cache_val) - _p9k_upglob rust-toolchain -. - local dir=$_p9k__parent_dirs[$?] - local -i n m=${dir[(I)/]} - local pair - for pair in ${overrides[(K)$_p9k__cwd/]}; do - n=${pair%% *} - (( n <= m )) && continue - m=n - toolchain=${pair#* } - done - if [[ -z $toolchain && -n $dir ]]; then - _p9k_read_word $dir/rust-toolchain - toolchain=$_p9k__ret - fi - fi - fi - if ! _p9k_cache_stat_get $0_v$toolchain $rustc $deps; then - _p9k_cache_stat_set "$($rustc --version 2>/dev/null)" - fi - local v=${${_p9k__cache_val[1]#rustc }%% *} - [[ -n $v ]] || return - typeset -g P9K_RUST_VERSION=$_p9k__cache_val[1] - _p9k_prompt_segment "$0" "darkorange" "$_p9k_color1" 'RUST_ICON' 0 '' "${v//\%/%%}" + local -i len=$#_p9k__prompt _p9k__has_upglob + _p9k_prompt_segment $0 darkorange $_p9k_color1 RUST_ICON 1 '$P9K_RUST_VERSION' '${P9K_RUST_VERSION//\%/%%}' + (( _p9k__has_upglob )) || typeset -g "_p9k__segment_val_${_p9k__prompt_side}[_p9k__segment_index]"=$_p9k__prompt[len+1,-1] } -_p9k_prompt_rust_version_init() { +function _p9k_prompt_rust_version_init() { + _p9k__async_segments_compute+='_p9k_rust_version_prefetch' typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$commands[rustc]' } +_p9k_rust_version_prefetch() { + local rustc=$commands[rustc] + if [[ -z $rustc ]] || + { (( _POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY )) && _p9k_upglob Cargo.toml -. }; then + unset P9K_RUST_VERSION + return + fi + _p9k_worker_invoke rust_version \ + "_p9k_prompt_rust_version_compute ${(q)P9K_RUST_VERSION} ${(q)rustc} ${(q)_p9k__cwd_a}" +} + +_p9k_prompt_rust_version_compute() { + _p9k_worker_async \ + "_p9k_prompt_rust_version_async ${(q)1} ${(q)2} ${(q)3}" \ + _p9k_prompt_rust_version_sync +} + +_p9k_prompt_rust_version_async() { + typeset -g P9K_RUST_VERSION=$1 + local rustc=$2 cwd=$3 v + if pushd -q -- $cwd; then + { + v=${${"$($rustc --version)"#rustc }%% *} || v= + } always { + popd -q + } + fi + + [[ $v != $P9K_RUST_VERSION ]] || return + typeset -g P9K_RUST_VERSION=$v + _p9k_print_params P9K_RUST_VERSION + echo -E - 'reset=1' +} + +_p9k_prompt_rust_version_sync() { + if [[ -n $REPLY ]]; then + eval $REPLY + _p9k_worker_reply $REPLY + fi +} + # RSpec test ratio prompt_rspec_stats() { if [[ -d app && -d spec ]]; then From 430616734aa06ff3def48cb511fb43db7466a64e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 23 Oct 2023 10:44:15 +0200 Subject: [PATCH 307/380] make terraform_version compatible with tfenv (#2049) --- internal/p10k.zsh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index dbc69c41..09985e0b 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5021,12 +5021,16 @@ _p9k_prompt_terraform_init() { } function prompt_terraform_version() { - _p9k_cached_cmd 0 '' terraform --version || return - local v=${_p9k__ret#Terraform v} - (( $#v < $#_p9k__ret )) || return - v=${v%%$'\n'*} + local v cfg terraform=${commands[terraform]} + _p9k_upglob .terraform-version -. || cfg=$_p9k__parent_dirs[$?]/.terraform-version + if _p9k_cache_stat_get $0.$TFENV_TERRAFORM_VERSION $terraform $cfg; then + v=$_p9k__cache_val[1] + else + v=${${"$(terraform --version 2>/dev/null)"#Terraform v}%%$'\n'*} || v= + _p9k_cache_stat_set "$v" + fi [[ -n $v ]] || return - _p9k_prompt_segment $0 $_p9k_color1 blue TERRAFORM_ICON 0 '' $v + _p9k_prompt_segment $0 $_p9k_color1 blue TERRAFORM_ICON 0 '' ${v//\%/%%} } _p9k_prompt_terraform_version_init() { From 18f0bec1bbdcd595a6cc8155dc09c44acee06d32 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 1 Nov 2023 10:37:54 +0100 Subject: [PATCH 308/380] use newer icons for azure and azure devops (#2472) --- internal/icons.zsh | 4 ++-- internal/p10k.zsh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/icons.zsh b/internal/icons.zsh index 308a01d8..f01b991d 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -532,7 +532,7 @@ function _p9k_init_icons() { VCS_GIT_GITHUB_ICON '\uF113 ' #  VCS_GIT_BITBUCKET_ICON '\uE703 ' #  VCS_GIT_GITLAB_ICON '\uF296 ' #  - VCS_GIT_AZURE_ICON '\UF0805 ' # 󰠅 + VCS_GIT_AZURE_ICON '\uEBE8 ' #  VCS_HG_ICON '\uF0C3 ' #  VCS_SVN_ICON '\uE72D'$q #  RUST_ICON '\uE7A8'$q #  @@ -560,7 +560,7 @@ function _p9k_init_icons() { PROXY_ICON '\u2194' # ↔ DOTNET_ICON '\uE77F' #  DOTNET_CORE_ICON '\uE77F' #  - AZURE_ICON '\UF0805' # 󰠅 + AZURE_ICON '\uEBD8 ' #  DIRENV_ICON '\u25BC' # ▼ FLUTTER_ICON 'F' # F GCLOUD_ICON '\UF02AD' # 󰊭 diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 09985e0b..aea27f4c 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -9396,7 +9396,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.19.8 +typeset -g P9K_VERSION=1.19.9 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From 174ce9bf0166c657404a21f4dc9608da935f7325 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 1 Nov 2023 10:44:43 +0100 Subject: [PATCH 309/380] recognize azure devops git remote HTTPS URLs (#2472) --- internal/p10k.zsh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index aea27f4c..e50bcce5 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3865,9 +3865,11 @@ function _p9k_vcs_icon() { *bitbucket*) _p9k__ret=VCS_GIT_BITBUCKET_ICON;; *stash*) _p9k__ret=VCS_GIT_BITBUCKET_ICON;; *gitlab*) _p9k__ret=VCS_GIT_GITLAB_ICON;; + # Azure DevOps: visualstudio.com is the old hostname, dev.azure.com is the new one. # https://learn.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate - (|*@)vs-ssh.visualstudio.com(|:*)) _p9k__ret=VCS_GIT_AZURE_ICON;; # old - (|*@)ssh.dev.azure.com(|:*)) _p9k__ret=VCS_GIT_AZURE_ICON;; # new + (|*@|*.)(visualstudio.com|dev.azure.com)(|:*|/*)) + _p9k__ret=VCS_GIT_AZURE_ICON + ;; # old *) _p9k__ret=VCS_GIT_ICON;; esac } @@ -9396,7 +9398,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.19.9 +typeset -g P9K_VERSION=1.19.10 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From 92bee796428eac486c8766e7fc7c2a2e4b712dfd Mon Sep 17 00:00:00 2001 From: hasecilu Date: Thu, 23 Nov 2023 16:49:36 -0600 Subject: [PATCH 310/380] Add icons for VCS_GIT usage The icons are from organizations that manage a git instance by themselves. --- internal/icons.zsh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/internal/icons.zsh b/internal/icons.zsh index f01b991d..1865b836 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -247,6 +247,15 @@ function _p9k_init_icons() { VCS_GIT_BITBUCKET_ICON '\uF171 ' #  VCS_GIT_GITLAB_ICON '\uF296 ' #  VCS_GIT_AZURE_ICON '\u2601 ' # ☁ + VCS_GIT_ARCH_ICON '\uF303 ' #  + VCS_GIT_CODEBERG_ICON '\uF330 ' #  + VCS_GIT_DEBIAN_ICON '\uF306 ' #  + VCS_GIT_FREEBSD_ICON '\UF30C ' #  + VCS_GIT_FREEDESKTOP_ICON '\uF360 ' #  + VCS_GIT_GNOME_ICON '\uF361 ' #  + VCS_GIT_GNU_ICON '\uE779 ' #  + VCS_GIT_KDE_ICON '\uF332 ' #  + VCS_GIT_LINUX_ICON '\uF17C ' #  VCS_HG_ICON '\uF0C3 ' #  VCS_SVN_ICON 'svn'$q RUST_ICON '\uE6A8' #  @@ -533,6 +542,15 @@ function _p9k_init_icons() { VCS_GIT_BITBUCKET_ICON '\uE703 ' #  VCS_GIT_GITLAB_ICON '\uF296 ' #  VCS_GIT_AZURE_ICON '\uEBE8 ' #  + VCS_GIT_ARCH_ICON '\uF303 ' #  + VCS_GIT_CODEBERG_ICON '\uF330 ' #  + VCS_GIT_DEBIAN_ICON '\uF306 ' #  + VCS_GIT_FREEBSD_ICON '\UF30C ' #  + VCS_GIT_FREEDESKTOP_ICON '\uF360 ' #  + VCS_GIT_GNOME_ICON '\uF361 ' #  + VCS_GIT_GNU_ICON '\uE779 ' #  + VCS_GIT_KDE_ICON '\uF332 ' #  + VCS_GIT_LINUX_ICON '\uF17C ' #  VCS_HG_ICON '\uF0C3 ' #  VCS_SVN_ICON '\uE72D'$q #  RUST_ICON '\uE7A8'$q #  @@ -675,6 +693,15 @@ function _p9k_init_icons() { VCS_GIT_BITBUCKET_ICON '\uE703 ' #  VCS_GIT_GITLAB_ICON '\uF296 ' #  VCS_GIT_AZURE_ICON '\uFD03 ' # ﴃ + VCS_GIT_ARCH_ICON '\uF303 ' #  + VCS_GIT_CODEBERG_ICON '\uF330 ' #  + VCS_GIT_DEBIAN_ICON '\uF306 ' #  + VCS_GIT_FREEBSD_ICON '\UF30C ' #  + VCS_GIT_FREEDESKTOP_ICON '\uF360 ' #  + VCS_GIT_GNOME_ICON '\uF361 ' #  + VCS_GIT_GNU_ICON '\uE779 ' #  + VCS_GIT_KDE_ICON '\uF332 ' #  + VCS_GIT_LINUX_ICON '\uF17C ' #  VCS_HG_ICON '\uF0C3 ' #  VCS_SVN_ICON '\uE72D'$q #  RUST_ICON '\uE7A8'$q #  @@ -814,6 +841,15 @@ function _p9k_init_icons() { VCS_GIT_BITBUCKET_ICON '' VCS_GIT_GITLAB_ICON '' VCS_GIT_AZURE_ICON '' + VCS_GIT_ARCH_ICON '' + VCS_GIT_CODEBERG_ICON '' + VCS_GIT_DEBIAN_ICON '' + VCS_GIT_FREEBSD_ICON '' + VCS_GIT_FREEDESKTOP_ICON '' + VCS_GIT_GNOME_ICON '' + VCS_GIT_GNU_ICON '' + VCS_GIT_KDE_ICON '' + VCS_GIT_LINUX_ICON '' VCS_HG_ICON '' VCS_SVN_ICON '' RUST_ICON 'rust' @@ -955,6 +991,15 @@ function _p9k_init_icons() { VCS_GIT_BITBUCKET_ICON '' VCS_GIT_GITLAB_ICON '' VCS_GIT_AZURE_ICON '' + VCS_GIT_ARCH_ICON '' + VCS_GIT_CODEBERG_ICON '' + VCS_GIT_DEBIAN_ICON '' + VCS_GIT_FREEBSD_ICON '' + VCS_GIT_FREEDESKTOP_ICON '' + VCS_GIT_GNOME_ICON '' + VCS_GIT_GNU_ICON '' + VCS_GIT_KDE_ICON '' + VCS_GIT_LINUX_ICON '' VCS_HG_ICON '' VCS_SVN_ICON '' RUST_ICON 'R' From 47d5397baa7473db2b4d8f9c59cef8fa51c78376 Mon Sep 17 00:00:00 2001 From: hasecilu Date: Thu, 23 Nov 2023 16:55:36 -0600 Subject: [PATCH 311/380] Add various remote git server instances Currently only icons for big providers of git hosting service are available. Organizations of open source software usually manage their own instances. Adding the remote addresses of some of this organizations will let us to identify via a glyph icon the provider of the source code. --- internal/p10k.zsh | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index e50bcce5..62c71ab3 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3723,7 +3723,27 @@ function +vi-vcs-detect-changes() { elif [[ "$remote" =~ "stash" ]] then vcs_visual_identifier='VCS_GIT_BITBUCKET_ICON' elif [[ "$remote" =~ "gitlab" ]] then - vcs_visual_identifier='VCS_GIT_GITLAB_ICON' + elif [[ "$remote" =~ "archlinux" ]] then + vcs_visual_identifier='VCS_GIT_ARCH_ICON' + if [[ "$remote" =~ "freedesktop" ]] then + vcs_visual_identifier='VCS_GIT_FREEDESKTOP_ICON' + elif [[ "$remote" =~ "gnome" ]] then + vcs_visual_identifier='VCS_GIT_GNOME_ICON' + else + vcs_visual_identifier='VCS_GITLAB_ICON' + fi + elif [[ "$remote" =~ "codeberg" ]] then + vcs_visual_identifier='VCS_GIT_CODEBERG_ICON' + elif [[ "$remote" =~ "debian" ]] then + vcs_visual_identifier='VCS_GIT_DEBIAN_ICON' + elif [[ "$remote" =~ "freebsd" ]] then + vcs_visual_identifier='VCS_GIT_FREEBSD_ICON' + elif [[ "$remote" =~ "gnu" ]] then + vcs_visual_identifier='VCS_GIT_GNU_ICON' + elif [[ "$remote" =~ "kde" ]] then + vcs_visual_identifier='VCS_GIT_KDE_ICON' + elif [[ "$remote" =~ "kernel" ]] then + vcs_visual_identifier='VCS_GIT_LINUX_ICON' else vcs_visual_identifier='VCS_GIT_ICON' fi @@ -3864,7 +3884,16 @@ function _p9k_vcs_icon() { *github*) _p9k__ret=VCS_GIT_GITHUB_ICON;; *bitbucket*) _p9k__ret=VCS_GIT_BITBUCKET_ICON;; *stash*) _p9k__ret=VCS_GIT_BITBUCKET_ICON;; + *archlinux*) _p9k__ret=VCS_GIT_ARCH_ICON;; + *freedesktop*) _p9k__ret=VCS_GIT_FREEDESKTOP_ICON;; + *gnome*) _p9k__ret=VCS_GIT_GNOME_ICON;; *gitlab*) _p9k__ret=VCS_GIT_GITLAB_ICON;; + *codeberg*) _p9k__ret=VCS_GIT_CODEBERG_ICON;; + *debian*) _p9k__ret=VCS_GIT_DEBIAN_ICON;; + (#i)*freebsd*) _p9k__ret=VCS_GIT_FREEBSD_ICON;; + *gnu*) _p9k__ret=VCS_GIT_GNU_ICON;; + *kde*) _p9k__ret=VCS_GIT_KDE_ICON;; + *kernel*) _p9k__ret=VCS_GIT_LINUX_ICON;; # Azure DevOps: visualstudio.com is the old hostname, dev.azure.com is the new one. # https://learn.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate (|*@|*.)(visualstudio.com|dev.azure.com)(|:*|/*)) From 211c90343f51884ed1655de4284ebe12342db9d8 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 30 Nov 2023 09:47:34 +0100 Subject: [PATCH 312/380] wizard: recognize `source -- ~.p10k.zsh` in .zshrc --- internal/wizard.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 589e0cfe..b87f0dfc 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -2026,7 +2026,7 @@ function check_zshrc_integration() { local h9='"$ZDOTDIR"/.p10k.zsh' local h10='$POWERLEVEL9K_CONFIG_FILE' local h11='"$POWERLEVEL9K_CONFIG_FILE"' - if [[ -n ${(@M)lines:#(#b)[^#]#([^[:IDENT:]]|)source[[:space:]]##($f1|$f2|$f3|$f4|$g1|$h0|$h1|$h2|$h3|$h4|$h5|$h6|$h7|$h8|$h9|$h10|$h11)(|[[:space:]]*|'#'*)} ]]; then + if [[ -n ${(@M)lines:#(#b)[^#]#([^[:IDENT:]]|)source[[:space:]]##(|--[[:space:]]##)($f1|$f2|$f3|$f4|$g1|$h0|$h1|$h2|$h3|$h4|$h5|$h6|$h7|$h8|$h9|$h10|$h11)(|[[:space:]]*|'#'*)} ]]; then zshrc_has_cfg=1 fi local pre='${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh' From 096a731db3947caa69f350243f5f2ea0ce2da47e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 2 Dec 2023 09:44:17 +0100 Subject: [PATCH 313/380] define usable defaults for VCS_*_ICON (#2493) --- internal/icons.zsh | 56 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/internal/icons.zsh b/internal/icons.zsh index 1865b836..ebf017a2 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -106,6 +106,15 @@ function _p9k_init_icons() { VCS_GIT_BITBUCKET_ICON '\uE20E ' # VCS_GIT_GITLAB_ICON '\uE20E ' # VCS_GIT_AZURE_ICON '\uE20E ' # + VCS_GIT_ARCH_ICON '\uE20E ' # + VCS_GIT_CODEBERG_ICON '\uE20E ' # + VCS_GIT_DEBIAN_ICON '\uE20E ' # + VCS_GIT_FREEBSD_ICON '\uE20E ' # + VCS_GIT_FREEDESKTOP_ICON '\uE20E ' # + VCS_GIT_GNOME_ICON '\uE20E ' # + VCS_GIT_GNU_ICON '\uE20E ' # + VCS_GIT_KDE_ICON '\uE20E ' # + VCS_GIT_LINUX_ICON '\uE20E ' # VCS_HG_ICON '\uE1C3 ' #  VCS_SVN_ICON 'svn'$q RUST_ICON 'R' @@ -247,15 +256,15 @@ function _p9k_init_icons() { VCS_GIT_BITBUCKET_ICON '\uF171 ' #  VCS_GIT_GITLAB_ICON '\uF296 ' #  VCS_GIT_AZURE_ICON '\u2601 ' # ☁ - VCS_GIT_ARCH_ICON '\uF303 ' #  - VCS_GIT_CODEBERG_ICON '\uF330 ' #  - VCS_GIT_DEBIAN_ICON '\uF306 ' #  - VCS_GIT_FREEBSD_ICON '\UF30C ' #  - VCS_GIT_FREEDESKTOP_ICON '\uF360 ' #  - VCS_GIT_GNOME_ICON '\uF361 ' #  - VCS_GIT_GNU_ICON '\uE779 ' #  - VCS_GIT_KDE_ICON '\uF332 ' #  - VCS_GIT_LINUX_ICON '\uF17C ' #  + VCS_GIT_ARCH_ICON '\uF1D3 ' #  + VCS_GIT_CODEBERG_ICON '\uF1D3 ' #  + VCS_GIT_DEBIAN_ICON '\uF1D3 ' #  + VCS_GIT_FREEBSD_ICON '\uF1D3 ' #  + VCS_GIT_FREEDESKTOP_ICON '\uF1D3 ' #  + VCS_GIT_GNOME_ICON '\uF1D3 ' #  + VCS_GIT_GNU_ICON '\uF1D3 ' #  + VCS_GIT_KDE_ICON '\uF1D3 ' #  + VCS_GIT_LINUX_ICON '\uF1D3 ' #  VCS_HG_ICON '\uF0C3 ' #  VCS_SVN_ICON 'svn'$q RUST_ICON '\uE6A8' #  @@ -402,6 +411,15 @@ function _p9k_init_icons() { VCS_GIT_BITBUCKET_ICON "${CODEPOINT_OF_AWESOME_BITBUCKET:+\\u$CODEPOINT_OF_AWESOME_BITBUCKET }" VCS_GIT_GITLAB_ICON "${CODEPOINT_OF_AWESOME_GITLAB:+\\u$CODEPOINT_OF_AWESOME_GITLAB }" VCS_GIT_AZURE_ICON '\u2601 ' # ☁ + VCS_GIT_ARCH_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }" + VCS_GIT_CODEBERG_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }" + VCS_GIT_DEBIAN_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }" + VCS_GIT_FREEBSD_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }" + VCS_GIT_FREEDESKTOP_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }" + VCS_GIT_GNOME_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }" + VCS_GIT_GNU_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }" + VCS_GIT_KDE_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }" + VCS_GIT_LINUX_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }" VCS_HG_ICON "${CODEPOINT_OF_AWESOME_FLASK:+\\u$CODEPOINT_OF_AWESOME_FLASK }" VCS_SVN_ICON 'svn'$q RUST_ICON '\uE6A8' #  @@ -543,13 +561,17 @@ function _p9k_init_icons() { VCS_GIT_GITLAB_ICON '\uF296 ' #  VCS_GIT_AZURE_ICON '\uEBE8 ' #  VCS_GIT_ARCH_ICON '\uF303 ' #  - VCS_GIT_CODEBERG_ICON '\uF330 ' #  + # v3.1 has \uF330. + VCS_GIT_CODEBERG_ICON '\uF1D3 ' #  VCS_GIT_DEBIAN_ICON '\uF306 ' #  VCS_GIT_FREEBSD_ICON '\UF30C ' #  - VCS_GIT_FREEDESKTOP_ICON '\uF360 ' #  - VCS_GIT_GNOME_ICON '\uF361 ' #  + # v3.1 has \uF360. + VCS_GIT_FREEDESKTOP_ICON '\uF296 ' #  + # v3.1 has \uF361. + VCS_GIT_GNOME_ICON '\uF296 ' #  VCS_GIT_GNU_ICON '\uE779 ' #  - VCS_GIT_KDE_ICON '\uF332 ' #  + # v3.1 has \uF332. + VCS_GIT_KDE_ICON '\uF296 ' #  VCS_GIT_LINUX_ICON '\uF17C ' #  VCS_HG_ICON '\uF0C3 ' #  VCS_SVN_ICON '\uE72D'$q #  @@ -694,13 +716,13 @@ function _p9k_init_icons() { VCS_GIT_GITLAB_ICON '\uF296 ' #  VCS_GIT_AZURE_ICON '\uFD03 ' # ﴃ VCS_GIT_ARCH_ICON '\uF303 ' #  - VCS_GIT_CODEBERG_ICON '\uF330 ' #  + VCS_GIT_CODEBERG_ICON '\uF1D3 ' #  VCS_GIT_DEBIAN_ICON '\uF306 ' #  VCS_GIT_FREEBSD_ICON '\UF30C ' #  - VCS_GIT_FREEDESKTOP_ICON '\uF360 ' #  - VCS_GIT_GNOME_ICON '\uF361 ' #  + VCS_GIT_FREEDESKTOP_ICON '\uF296 ' #  + VCS_GIT_GNOME_ICON '\uF296 ' #  VCS_GIT_GNU_ICON '\uE779 ' #  - VCS_GIT_KDE_ICON '\uF332 ' #  + VCS_GIT_KDE_ICON '\uF296 ' #  VCS_GIT_LINUX_ICON '\uF17C ' #  VCS_HG_ICON '\uF0C3 ' #  VCS_SVN_ICON '\uE72D'$q #  From c39e5304a13760804ee41cce52c4b49946baa2e7 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 2 Dec 2023 09:49:50 +0100 Subject: [PATCH 314/380] add VCS_GIT_GITEA_ICON and VCS_GIT_SOURCEHUT_ICON (#2493) --- internal/icons.zsh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/internal/icons.zsh b/internal/icons.zsh index ebf017a2..87db7cec 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -115,6 +115,8 @@ function _p9k_init_icons() { VCS_GIT_GNU_ICON '\uE20E ' # VCS_GIT_KDE_ICON '\uE20E ' # VCS_GIT_LINUX_ICON '\uE20E ' # + VCS_GIT_GITEA_ICON '\uE20E ' # + VCS_GIT_SOURCEHUT_ICON '\uE20E ' # VCS_HG_ICON '\uE1C3 ' #  VCS_SVN_ICON 'svn'$q RUST_ICON 'R' @@ -265,6 +267,8 @@ function _p9k_init_icons() { VCS_GIT_GNU_ICON '\uF1D3 ' #  VCS_GIT_KDE_ICON '\uF1D3 ' #  VCS_GIT_LINUX_ICON '\uF1D3 ' #  + VCS_GIT_GITEA_ICON '\uF1D3 ' #  + VCS_GIT_SOURCEHUT_ICON '\uF1D3 ' #  VCS_HG_ICON '\uF0C3 ' #  VCS_SVN_ICON 'svn'$q RUST_ICON '\uE6A8' #  @@ -420,6 +424,8 @@ function _p9k_init_icons() { VCS_GIT_GNU_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }" VCS_GIT_KDE_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }" VCS_GIT_LINUX_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }" + VCS_GIT_GITEA_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }" + VCS_GIT_SOURCEHUT_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }" VCS_HG_ICON "${CODEPOINT_OF_AWESOME_FLASK:+\\u$CODEPOINT_OF_AWESOME_FLASK }" VCS_SVN_ICON 'svn'$q RUST_ICON '\uE6A8' #  @@ -573,6 +579,9 @@ function _p9k_init_icons() { # v3.1 has \uF332. VCS_GIT_KDE_ICON '\uF296 ' #  VCS_GIT_LINUX_ICON '\uF17C ' #  + # v3.1 has \uF339. + VCS_GIT_GITEA_ICON '\uF1D3 ' #  + VCS_GIT_SOURCEHUT_ICON '\uF1DB ' #  VCS_HG_ICON '\uF0C3 ' #  VCS_SVN_ICON '\uE72D'$q #  RUST_ICON '\uE7A8'$q #  @@ -724,6 +733,8 @@ function _p9k_init_icons() { VCS_GIT_GNU_ICON '\uE779 ' #  VCS_GIT_KDE_ICON '\uF296 ' #  VCS_GIT_LINUX_ICON '\uF17C ' #  + VCS_GIT_GITEA_ICON '\uF1D3 ' #  + VCS_GIT_SOURCEHUT_ICON '\uF1DB ' #  VCS_HG_ICON '\uF0C3 ' #  VCS_SVN_ICON '\uE72D'$q #  RUST_ICON '\uE7A8'$q #  @@ -872,6 +883,8 @@ function _p9k_init_icons() { VCS_GIT_GNU_ICON '' VCS_GIT_KDE_ICON '' VCS_GIT_LINUX_ICON '' + VCS_GIT_GITEA_ICON '' + VCS_GIT_SOURCEHUT_ICON '' VCS_HG_ICON '' VCS_SVN_ICON '' RUST_ICON 'rust' @@ -1022,6 +1035,8 @@ function _p9k_init_icons() { VCS_GIT_GNU_ICON '' VCS_GIT_KDE_ICON '' VCS_GIT_LINUX_ICON '' + VCS_GIT_GITEA_ICON '' + VCS_GIT_SOURCEHUT_ICON '' VCS_HG_ICON '' VCS_SVN_ICON '' RUST_ICON 'R' From 9547f228224e73b4b34c365e1937f096b06da830 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 2 Dec 2023 11:50:18 +0100 Subject: [PATCH 315/380] s/VCS_GIT_ARCH_ICON/VCS_GIT_ARCHLINUX_ICON/ (#2493) --- internal/icons.zsh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/icons.zsh b/internal/icons.zsh index 87db7cec..dc3d675e 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -106,7 +106,7 @@ function _p9k_init_icons() { VCS_GIT_BITBUCKET_ICON '\uE20E ' # VCS_GIT_GITLAB_ICON '\uE20E ' # VCS_GIT_AZURE_ICON '\uE20E ' # - VCS_GIT_ARCH_ICON '\uE20E ' # + VCS_GIT_ARCHLINUX_ICON '\uE20E ' # VCS_GIT_CODEBERG_ICON '\uE20E ' # VCS_GIT_DEBIAN_ICON '\uE20E ' # VCS_GIT_FREEBSD_ICON '\uE20E ' # @@ -258,7 +258,7 @@ function _p9k_init_icons() { VCS_GIT_BITBUCKET_ICON '\uF171 ' #  VCS_GIT_GITLAB_ICON '\uF296 ' #  VCS_GIT_AZURE_ICON '\u2601 ' # ☁ - VCS_GIT_ARCH_ICON '\uF1D3 ' #  + VCS_GIT_ARCHLINUX_ICON '\uF1D3 ' #  VCS_GIT_CODEBERG_ICON '\uF1D3 ' #  VCS_GIT_DEBIAN_ICON '\uF1D3 ' #  VCS_GIT_FREEBSD_ICON '\uF1D3 ' #  @@ -415,7 +415,7 @@ function _p9k_init_icons() { VCS_GIT_BITBUCKET_ICON "${CODEPOINT_OF_AWESOME_BITBUCKET:+\\u$CODEPOINT_OF_AWESOME_BITBUCKET }" VCS_GIT_GITLAB_ICON "${CODEPOINT_OF_AWESOME_GITLAB:+\\u$CODEPOINT_OF_AWESOME_GITLAB }" VCS_GIT_AZURE_ICON '\u2601 ' # ☁ - VCS_GIT_ARCH_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }" + VCS_GIT_ARCHLINUX_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }" VCS_GIT_CODEBERG_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }" VCS_GIT_DEBIAN_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }" VCS_GIT_FREEBSD_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }" @@ -566,7 +566,7 @@ function _p9k_init_icons() { VCS_GIT_BITBUCKET_ICON '\uE703 ' #  VCS_GIT_GITLAB_ICON '\uF296 ' #  VCS_GIT_AZURE_ICON '\uEBE8 ' #  - VCS_GIT_ARCH_ICON '\uF303 ' #  + VCS_GIT_ARCHLINUX_ICON '\uF303 ' #  # v3.1 has \uF330. VCS_GIT_CODEBERG_ICON '\uF1D3 ' #  VCS_GIT_DEBIAN_ICON '\uF306 ' #  @@ -724,7 +724,7 @@ function _p9k_init_icons() { VCS_GIT_BITBUCKET_ICON '\uE703 ' #  VCS_GIT_GITLAB_ICON '\uF296 ' #  VCS_GIT_AZURE_ICON '\uFD03 ' # ﴃ - VCS_GIT_ARCH_ICON '\uF303 ' #  + VCS_GIT_ARCHLINUX_ICON '\uF303 ' #  VCS_GIT_CODEBERG_ICON '\uF1D3 ' #  VCS_GIT_DEBIAN_ICON '\uF306 ' #  VCS_GIT_FREEBSD_ICON '\UF30C ' #  @@ -874,7 +874,7 @@ function _p9k_init_icons() { VCS_GIT_BITBUCKET_ICON '' VCS_GIT_GITLAB_ICON '' VCS_GIT_AZURE_ICON '' - VCS_GIT_ARCH_ICON '' + VCS_GIT_ARCHLINUX_ICON '' VCS_GIT_CODEBERG_ICON '' VCS_GIT_DEBIAN_ICON '' VCS_GIT_FREEBSD_ICON '' @@ -1026,7 +1026,7 @@ function _p9k_init_icons() { VCS_GIT_BITBUCKET_ICON '' VCS_GIT_GITLAB_ICON '' VCS_GIT_AZURE_ICON '' - VCS_GIT_ARCH_ICON '' + VCS_GIT_ARCHLINUX_ICON '' VCS_GIT_CODEBERG_ICON '' VCS_GIT_DEBIAN_ICON '' VCS_GIT_FREEBSD_ICON '' From 7fd76370f53f87f956c811766a452c83ced4014b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 2 Dec 2023 11:56:37 +0100 Subject: [PATCH 316/380] be a lot more strict when matching the remote git URL (#2493) When you choose "Many icons" option in the configuration wizard, git repositories with a remote receive an icon that depends on the remote's URL. In the past the matching of the URL was rather lax: both https://foo.bar/github.com and https://github.com.foo.bar/ were recognized as belonging to github.com. This is no longer the case. If you start seeing the plain "git" icon where you were used to seeing a github/gitlab/etc logo, please open an issue. Make sure to mention the remote URL of your repo. This change also allows you to specify the mapping from remote URLs to icons. Here's an example: typeset -g POWERLEVEL9K_VCS_GIT_REMOTE_ICONS=( '*@my-company.com:*' VCS_GIT_MY_COMPANY_ICON '?*' VCS_GIT_ICON '*' '' ) POWERLEVEL9K_VCS_GIT_MY_COMPANY_ICON='my-company-logo' The matching is done in the specified order: the first match wins. --- internal/p10k.zsh | 100 ++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 57 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 62c71ab3..3c784625 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3714,40 +3714,9 @@ function +vi-hg-bookmarks() { function +vi-vcs-detect-changes() { if [[ "${hook_com[vcs]}" == "git" ]]; then - local remote="$(git ls-remote --get-url 2> /dev/null)" - if [[ "$remote" =~ "github" ]] then - vcs_visual_identifier='VCS_GIT_GITHUB_ICON' - elif [[ "$remote" =~ "bitbucket" ]] then - vcs_visual_identifier='VCS_GIT_BITBUCKET_ICON' - elif [[ "$remote" =~ "stash" ]] then - vcs_visual_identifier='VCS_GIT_BITBUCKET_ICON' - elif [[ "$remote" =~ "gitlab" ]] then - elif [[ "$remote" =~ "archlinux" ]] then - vcs_visual_identifier='VCS_GIT_ARCH_ICON' - if [[ "$remote" =~ "freedesktop" ]] then - vcs_visual_identifier='VCS_GIT_FREEDESKTOP_ICON' - elif [[ "$remote" =~ "gnome" ]] then - vcs_visual_identifier='VCS_GIT_GNOME_ICON' - else - vcs_visual_identifier='VCS_GITLAB_ICON' - fi - elif [[ "$remote" =~ "codeberg" ]] then - vcs_visual_identifier='VCS_GIT_CODEBERG_ICON' - elif [[ "$remote" =~ "debian" ]] then - vcs_visual_identifier='VCS_GIT_DEBIAN_ICON' - elif [[ "$remote" =~ "freebsd" ]] then - vcs_visual_identifier='VCS_GIT_FREEBSD_ICON' - elif [[ "$remote" =~ "gnu" ]] then - vcs_visual_identifier='VCS_GIT_GNU_ICON' - elif [[ "$remote" =~ "kde" ]] then - vcs_visual_identifier='VCS_GIT_KDE_ICON' - elif [[ "$remote" =~ "kernel" ]] then - vcs_visual_identifier='VCS_GIT_LINUX_ICON' - else - vcs_visual_identifier='VCS_GIT_ICON' - fi - + _p9k_vcs_icon "$remote" + vcs_visual_identifier=$_p9k__ret elif [[ "${hook_com[vcs]}" == "hg" ]]; then vcs_visual_identifier='VCS_HG_ICON' elif [[ "${hook_com[vcs]}" == "svn" ]]; then @@ -3880,27 +3849,14 @@ function _p9k_vcs_status_purge() { } function _p9k_vcs_icon() { - case "$VCS_STATUS_REMOTE_URL" in - *github*) _p9k__ret=VCS_GIT_GITHUB_ICON;; - *bitbucket*) _p9k__ret=VCS_GIT_BITBUCKET_ICON;; - *stash*) _p9k__ret=VCS_GIT_BITBUCKET_ICON;; - *archlinux*) _p9k__ret=VCS_GIT_ARCH_ICON;; - *freedesktop*) _p9k__ret=VCS_GIT_FREEDESKTOP_ICON;; - *gnome*) _p9k__ret=VCS_GIT_GNOME_ICON;; - *gitlab*) _p9k__ret=VCS_GIT_GITLAB_ICON;; - *codeberg*) _p9k__ret=VCS_GIT_CODEBERG_ICON;; - *debian*) _p9k__ret=VCS_GIT_DEBIAN_ICON;; - (#i)*freebsd*) _p9k__ret=VCS_GIT_FREEBSD_ICON;; - *gnu*) _p9k__ret=VCS_GIT_GNU_ICON;; - *kde*) _p9k__ret=VCS_GIT_KDE_ICON;; - *kernel*) _p9k__ret=VCS_GIT_LINUX_ICON;; - # Azure DevOps: visualstudio.com is the old hostname, dev.azure.com is the new one. - # https://learn.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate - (|*@|*.)(visualstudio.com|dev.azure.com)(|:*|/*)) - _p9k__ret=VCS_GIT_AZURE_ICON - ;; # old - *) _p9k__ret=VCS_GIT_ICON;; - esac + local pat icon + for pat icon in "${(@)_POWERLEVEL9K_VCS_GIT_REMOTE_ICONS}"; do + if [[ $1 == $~pat ]]; then + _p9k__ret=$icon + return + fi + done + _p9k__ret= } function _p9k_vcs_render() { @@ -3930,7 +3886,7 @@ function _p9k_vcs_render() { state=CLEAN fi fi - _p9k_vcs_icon + _p9k_vcs_icon "$VCS_STATUS_REMOTE_URL" _p9k_prompt_segment prompt_vcs_$state "${__p9k_vcs_states[$state]}" "$_p9k_color1" "$_p9k__ret" 0 '' "" return 0 fi @@ -3984,7 +3940,7 @@ function _p9k_vcs_render() { # It's weird that removing vcs-detect-changes from POWERLEVEL9K_VCS_GIT_HOOKS gets rid # of the GIT icon. That's what vcs_info does, so we do the same in the name of compatibility. - _p9k_vcs_icon + _p9k_vcs_icon "$VCS_STATUS_REMOTE_URL" icon=$_p9k__ret fi @@ -7435,6 +7391,36 @@ _p9k_init_params() { _p9k_declare -b POWERLEVEL9K_VCS_CONFLICTED_STATE 0 _p9k_declare -b POWERLEVEL9K_HIDE_BRANCH_ICON 0 _p9k_declare -b POWERLEVEL9K_VCS_HIDE_TAGS 0 + _p9k_declare -a POWERLEVEL9K_VCS_GIT_REMOTE_ICONS + if (( $+_POWERLEVEL9K_VCS_GIT_REMOTE_ICONS )); then + (( $#_POWERLEVEL9K_VCS_GIT_REMOTE_ICONS & 1 )) && _POWERLEVEL9K_VCS_GIT_REMOTE_ICONS+=('') + else + local domain= icon= domain2icon=( + 'archlinux.org' VCS_GIT_ARCHLINUX_ICON + 'dev.azure.com|visualstudio.com' VCS_GIT_AZURE_ICON + 'bitbucket.org' VCS_GIT_BITBUCKET_ICON + 'codeberg.org' VCS_GIT_CODEBERG_ICON + 'debian.org' VCS_GIT_DEBIAN_ICON + 'freebsd.org' VCS_GIT_FREEBSD_ICON + 'freedesktop.org' VCS_GIT_FREEDESKTOP_ICON + 'gitea.com|gitea.io' VCS_GIT_GITEA_ICON + 'github.com' VCS_GIT_GITHUB_ICON + 'gitlab.com' VCS_GIT_GITLAB_ICON + 'gnome.org' VCS_GIT_GNOME_ICON + 'gnu.org' VCS_GIT_GNU_ICON + 'kde.org' VCS_GIT_KDE_ICON + 'kernel.org' VCS_GIT_LINUX_ICON + 'sourcehut.org' VCS_GIT_SOURCEHUT_ICON + ) + typeset -ga _POWERLEVEL9K_VCS_GIT_REMOTE_ICONS + for domain icon in "${domain2icon[@]}"; do + _POWERLEVEL9K_VCS_GIT_REMOTE_ICONS+=( + '(|[A-Za-z0-9][A-Za-z0-9+.-]#://)(|[^:/?#]#[.@])((#i)'$domain')(|[/:?#]*)' + $icon + ) + done + _POWERLEVEL9K_VCS_GIT_REMOTE_ICONS+=('*' VCS_GIT_ICON) + fi _p9k_declare -i POWERLEVEL9K_CHANGESET_HASH_LENGTH 8 # Specifies the maximum number of elements in the cache. When the cache grows over this limit, # it gets cleared. This is meant to avoid memory leaks when a rogue prompt is filling the cache @@ -9427,7 +9413,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.19.10 +typeset -g P9K_VERSION=1.19.11 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From b9a2d846efff427fd13b7e95d83a5761666329ac Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 3 Dec 2023 16:47:50 +0100 Subject: [PATCH 317/380] docs: clarify that powerlevel10k does not install new commands (#2498) --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6ff6f449..ef57b974 100644 --- a/README.md +++ b/README.md @@ -300,10 +300,11 @@ To ~~ridiculous~~ extravagant: ### Batteries included -Powerlevel10k comes with dozens of built-in high quality segments. When you run `p10k configure` -and choose any style except [Pure](#pure-compatibility), many of these segments get enabled by -default while others can be manually enabled by opening `~/.p10k.zsh` and uncommenting them. You can -enable as many segments as you like. It won't slow down your prompt or Zsh startup. +Powerlevel10k comes with dozens of built-in high quality prompt segments that can display +information from a variety of sources. When you run `p10k configure` and choose any style +except [Pure](#pure-compatibility), many of these segments get enabled by +default while others can be manually enabled by opening `~/.p10k.zsh` and uncommenting them. +You can enable as many segments as you like. It won't slow down your prompt or Zsh startup. | Segment | Meaning | |--------:|---------| @@ -968,6 +969,8 @@ Powerlevel10k does not affect: - Prompt parameters other than `PS1` and `RPS1`. - Zsh options other than those [related to prompt]( http://zsh.sourceforge.net/Doc/Release/Options.html#Prompting). +- The set of available commands. Powerlevel10k does not install any new commands + with the only exception of `p10k`. ### I'm using Powerlevel9k with Oh My Zsh. How do I migrate? From 47b0187a675afed6b49007fe1915b2c0fe94b7bc Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 6 Dec 2023 08:59:36 +0100 Subject: [PATCH 318/380] docs: add a note about `p10k reload` (#2006) --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index ef57b974..ee4786f3 100644 --- a/README.md +++ b/README.md @@ -397,6 +397,11 @@ it out of the box. Type `p10k help segment` for reference. +*Note*: If you modify `POWERLEVEL9K_*` parameters in an already initialized interactive shell (as +opposed to editing `~/.p10k.zsh`), the changes might not be immediately effective. To apply the +modifications, invoke `p10k reload`. Setting `POWERLEVEL9K_DISABLE_HOT_RELOAD=false` eliminates the +necessity for `p10k reload` but results in a marginally slower prompt. + *Tip*: Prefix names of your own segments with `my_` to avoid clashes with future versions of Powerlevel10k. From 44f754d711c108dbbbfc2e0612961cd44afb71ea Mon Sep 17 00:00:00 2001 From: Dominic Reich Date: Fri, 8 Dec 2023 18:49:24 +0100 Subject: [PATCH 319/380] use "rm" instead of "unlink" to delete old config file --- internal/wizard.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index b87f0dfc..9dd48e42 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1950,7 +1950,7 @@ function generate_config() { command mkdir -p -- ${__p9k_cfg_path:h} || return if [[ -e $__p9k_cfg_path ]]; then - unlink $__p9k_cfg_path || return + rm $__p9k_cfg_path || return fi print -lr -- "$header" "$lines[@]" >$__p9k_cfg_path } From 36cce9a088c8cd7d7b1a3adccc74cf2a130c51e0 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 9 Dec 2023 09:38:45 +0100 Subject: [PATCH 320/380] wizard: replace rm with zf_rm (#2504) --- internal/wizard.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 9dd48e42..e07225e0 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1950,7 +1950,7 @@ function generate_config() { command mkdir -p -- ${__p9k_cfg_path:h} || return if [[ -e $__p9k_cfg_path ]]; then - rm $__p9k_cfg_path || return + zf_rm -f -- $__p9k_cfg_path || return fi print -lr -- "$header" "$lines[@]" >$__p9k_cfg_path } From dec881651ccbd90f7f68b2a2012cf4870741d0dd Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 10 Dec 2023 12:15:00 +0100 Subject: [PATCH 321/380] Squashed 'gitstatus/' changes from 38d35b959..215063d47 215063d47 update libgit2 ref (#414) git-subtree-dir: gitstatus git-subtree-split: 215063d4703b944f66cc7cc92543205586a35485 --- build.info | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.info b/build.info index baa30b07..9a4967e8 100644 --- a/build.info +++ b/build.info @@ -18,5 +18,5 @@ gitstatus_version="v1.5.4" # # If sha256 of ./deps/libgit2-${libgit2_version}.tar.gz doesn't match, # build gets aborted. -libgit2_version="tag-0ad3d776aa86dd607dc86dcd7f77ad3ed7ebec61" -libgit2_sha256="c5d0117ae74d3ef244c26f10cce022019077dbc4563e6251fa9f56d36868ce74" +libgit2_version="tag-2ecf33948a4df9ef45a66c68b8ef24a5e60eaac6" +libgit2_sha256="4ce11d71ee576dbbc410b9fa33a9642809cc1fa687b315f7c23eeb825b251e93" From cc6ed4be416b70fe4e3f97d17061c751abaca04f Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 16 Dec 2023 08:36:29 +0100 Subject: [PATCH 322/380] add `cdk` to POWERLEVEL9K_AWS_SHOW_ON_COMMAND (#1104) --- config/p10k-classic.zsh | 2 +- config/p10k-lean-8colors.zsh | 2 +- config/p10k-lean.zsh | 2 +- config/p10k-rainbow.zsh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 5ea8faec..0e950d30 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1370,7 +1370,7 @@ #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# # Show aws only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show aws. - typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' + typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|cdk|terraform|pulumi|terragrunt' # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element # in each pair defines a pattern against which the current AWS profile gets matched. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 38328c4e..ca6e3d61 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1348,7 +1348,7 @@ #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# # Show aws only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show aws. - typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' + typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|cdk|terraform|pulumi|terragrunt' # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element # in each pair defines a pattern against which the current AWS profile gets matched. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 7cb97e90..e129c98a 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1344,7 +1344,7 @@ #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# # Show aws only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show aws. - typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' + typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|cdk|terraform|pulumi|terragrunt' # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element # in each pair defines a pattern against which the current AWS profile gets matched. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index ab36838f..6b932c9e 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1448,7 +1448,7 @@ #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# # Show aws only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show aws. - typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' + typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|cdk|terraform|pulumi|terragrunt' # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element # in each pair defines a pattern against which the current AWS profile gets matched. From d804048efc46b8b248693fa3a7bfc9f863bb1254 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 5 Jan 2024 05:27:33 +0100 Subject: [PATCH 323/380] fix a bug in DCS detection within instant prompt output (#2518) --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 3c784625..a8297bc2 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6629,7 +6629,7 @@ function _p9k_clear_instant_prompt() { fi print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed] local unexpected=${${content//$'\e[?'<->'c'}//$'\e['<->' q'} - unexpected=${(S)unexpected//$'\eP'*[^$'\e']#($'\e\\')} + unexpected=${(S)unexpected//$'\eP'(|*[^$'\e'])($'\e\e')#$'\e\\'} unexpected=${(S)unexpected//$'\e'[^$'\a\e']#($'\a'|$'\e\\')} # Visual Studio Code prints this garbage. unexpected=${${unexpected//$'\033[1;32mShell integration activated\033[0m\n'}//$'\r'} From 651033c3df5465b56f40f019a78dac1ef9807a57 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 15 Jan 2024 15:11:55 +0100 Subject: [PATCH 324/380] work around a bug in laravel that results in colorized output (#2534) --- internal/p10k.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index a8297bc2..c21b27f9 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -2317,6 +2317,10 @@ prompt_laravel_version() { [[ -r $app ]] || return if ! _p9k_cache_stat_get $0 $dir/artisan $app; then local v="$(php $dir/artisan --version 2> /dev/null)" + v="${${(M)v:#Laravel Framework *}#Laravel Framework }" + # In some versions the output is colorized. + # https://github.com/romkatv/powerlevel10k/issues/2534 + v=${${v#$'\e['<->m}%$'\e['<->m} _p9k_cache_stat_set "${${(M)v:#Laravel Framework *}#Laravel Framework }" fi [[ -n $_p9k__cache_val[1] ]] || return @@ -9413,7 +9417,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.19.11 +typeset -g P9K_VERSION=1.19.12 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From f5d5abfe1f89e5ea0d6f7cde6f3d9cd4b7c89d14 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 15 Jan 2024 17:17:14 +0100 Subject: [PATCH 325/380] fix a silly bug introduced in the last commit (#2534) --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index c21b27f9..2f723824 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -2321,7 +2321,7 @@ prompt_laravel_version() { # In some versions the output is colorized. # https://github.com/romkatv/powerlevel10k/issues/2534 v=${${v#$'\e['<->m}%$'\e['<->m} - _p9k_cache_stat_set "${${(M)v:#Laravel Framework *}#Laravel Framework }" + _p9k_cache_stat_set "$v" fi [[ -n $_p9k__cache_val[1] ]] || return _p9k_prompt_segment "$0" "maroon" "white" 'LARAVEL_ICON' 0 '' "${_p9k__cache_val[1]//\%/%%}" From cda24b72b790b0bec54a6090ab85a0f23caea8b6 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 15 Jan 2024 17:18:10 +0100 Subject: [PATCH 326/380] bump version --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 2f723824..5496864e 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -9417,7 +9417,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.19.12 +typeset -g P9K_VERSION=1.19.13 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From 9be438f8625139d58877ef00a5d414c809608672 Mon Sep 17 00:00:00 2001 From: Rhea Date: Mon, 15 Jan 2024 16:16:32 -0500 Subject: [PATCH 327/380] add foot font instructions This adds instructions to the README for users of [foot](https://codeberg.org/dnkl/foot) to enable the MesloLGS Nerd Font as the default in their terminal. --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index ee4786f3..3660a946 100644 --- a/README.md +++ b/README.md @@ -700,6 +700,15 @@ If you are using a different terminal, proceed with manual font installation. normal: family: "MesloLGS NF" ``` + - **foot**: Create or open `~/.config/foot/foot.ini` and add the following section + to it: + ```ini + font=MesloLGS NF + ``` + or to specify a custom font size, e.g. 12, + ```ini + font=MesloLGS NF:size=12 + `` - **kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following line to it: ```text font_family MesloLGS NF From c180a5e040d078eab501a71dc455a8eadc43fd44 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 16 Jan 2024 08:22:08 +0100 Subject: [PATCH 328/380] font: fix foot instructions (#2536) --- README.md | 11 +++-------- font.md | 4 ++++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3660a946..3f712732 100644 --- a/README.md +++ b/README.md @@ -700,16 +700,11 @@ If you are using a different terminal, proceed with manual font installation. normal: family: "MesloLGS NF" ``` - - **foot**: Create or open `~/.config/foot/foot.ini` and add the following section - to it: - ```ini - font=MesloLGS NF - ``` - or to specify a custom font size, e.g. 12, + - **foot**: Create or open `~/.config/foot/foot.ini` and add the following section to it: ```ini font=MesloLGS NF:size=12 - `` - - **kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following line to it: + ``` + - **kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following line to it: ```text font_family MesloLGS NF ``` diff --git a/font.md b/font.md index 2fb2f8be..82ae1a4f 100644 --- a/font.md +++ b/font.md @@ -87,6 +87,10 @@ If you are using a different terminal, proceed with manual font installation. normal: family: "MesloLGS NF" ``` + - **foot**: Create or open `~/.config/foot/foot.ini` and add the following section to it: + ```ini + font=MesloLGS NF:size=12 + ``` - **kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following line to it: ```text font_family MesloLGS NF From 4d7925c983c923e83f3f87ab6da5a279d6a8173c Mon Sep 17 00:00:00 2001 From: Mikalai Rahachou Date: Fri, 19 Jan 2024 16:31:44 +0100 Subject: [PATCH 329/380] Add parsing of pyvenv.cfg --- internal/p10k.zsh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 5496864e..26df0e1f 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4254,6 +4254,26 @@ function instant_prompt_chezmoi_shell() { _p9k_prompt_segment prompt_chezmoi_shell blue $_p9k_color1 CHEZMOI_ICON 1 '$CHEZMOI_ICON' '' } +function _p9k_parse_virtualenv_cfg() { + local cfg=$1 + echo $cfg + typeset -g reply + [[ -f $cfg && -r $cfg ]] || return + + local -a lines + lines=(${(f)"$(<$cfg)"}) || return + + local line prompt + local -a match mbegin mend + for line in $lines; do + if [[ $line =~ 'prompt = (.*)' ]]; then + prompt=$match[1] + eval "reply=$prompt" + return + fi + done +} + ################################################################ # Virtualenv: current working virtualenv # More information on virtualenv (Python): @@ -4269,6 +4289,15 @@ prompt_virtualenv() { elif [[ $v == $~_POWERLEVEL9K_VIRTUALENV_GENERIC_NAMES ]]; then v=${VIRTUAL_ENV:h:t} fi + local cfg="$VIRTUAL_ENV/pyvenv.cfg" + if ! _p9k_cache_stat_get $0 $cfg; then + local -a reply + _p9k_parse_virtualenv_cfg $cfg + _p9k_cache_stat_set $reply + fi + if [[ -n $_p9k__cache_val[1] ]]; then + v=$_p9k__cache_val[1] + fi msg+="$_POWERLEVEL9K_VIRTUALENV_LEFT_DELIMITER${v//\%/%%}$_POWERLEVEL9K_VIRTUALENV_RIGHT_DELIMITER" case $_POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV in false) From 30ba16ecd84cde5ef8b7eaef407d26f909371f3a Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 20 Jan 2024 09:19:22 +0100 Subject: [PATCH 330/380] font: update alacritty instructions (#2539) Alacritty has switched from yaml to toml for its config file. --- README.md | 11 +++++------ font.md | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 3f712732..2aba3755 100644 --- a/README.md +++ b/README.md @@ -693,12 +693,11 @@ If you are using a different terminal, proceed with manual font installation. - **Yakuake**: Click *≡* → *Manage Profiles* → *New* → *Appearance*. Click *Choose* next to the *Font* dropdown, select `MesloLGS NF` and click *OK*. Click *OK* to save the profile. Select the new profile and click *Set as Default*. - - **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and add the following section - to it: - ```yaml - font: - normal: - family: "MesloLGS NF" + - **Alacritty**: Create or open `~/.config/alacritty/alacritty.toml` and add the following + section to it: + ```toml + [font.normal] + family = "MesloLGS NF" ``` - **foot**: Create or open `~/.config/foot/foot.ini` and add the following section to it: ```ini diff --git a/font.md b/font.md index 82ae1a4f..c80df910 100644 --- a/font.md +++ b/font.md @@ -80,12 +80,11 @@ If you are using a different terminal, proceed with manual font installation. - **Yakuake**: Click *≡* → *Manage Profiles* → *New* → *Appearance*. Click *Choose* next to the *Font* dropdown, select `MesloLGS NF` and click *OK*. Click *OK* to save the profile. Select the new profile and click *Set as Default*. - - **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and add the following section - to it: - ```yaml - font: - normal: - family: "MesloLGS NF" + - **Alacritty**: Create or open `~/.config/alacritty/alacritty.toml` and add the following + section to it: + ```toml + [font.normal] + family = "MesloLGS NF" ``` - **foot**: Create or open `~/.config/foot/foot.ini` and add the following section to it: ```ini From 8fefef228571c08ce8074d42304adec3b0876819 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 20 Jan 2024 10:30:56 +0100 Subject: [PATCH 331/380] rewrite the handling of custom prompt in virtualenv (#2540) --- internal/p10k.zsh | 61 ++++++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 26df0e1f..0b003853 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4255,23 +4255,33 @@ function instant_prompt_chezmoi_shell() { } function _p9k_parse_virtualenv_cfg() { - local cfg=$1 - echo $cfg - typeset -g reply - [[ -f $cfg && -r $cfg ]] || return + typeset -ga reply=(0) + [[ -f $1 && -r $1 ]] || return - local -a lines - lines=(${(f)"$(<$cfg)"}) || return + local cfg + cfg=$(<$1) || return - local line prompt local -a match mbegin mend - for line in $lines; do - if [[ $line =~ 'prompt = (.*)' ]]; then - prompt=$match[1] - eval "reply=$prompt" - return - fi - done + [[ $'\n'$cfg$'\n' == (#b)*$'\n'prompt[$' \t']#=[$' \t']#([^$' \t']#)[$' \t']#$'\n'* ]] || return + local res=$match[1] + if [[ $res == (\"*\"|\'*\') ]]; then + # The string is quoted in python style, which isn't the same as quoting in zsh. + # For example, the literal 'foo"\'bar' denotes foo"'bar in python but in zsh + # it is malformed. + # + # We cheat a bit and impelement not exactly correct unquoting. It may produce + # different visual results but won't perform unintended expansions or bleed out + # any escape sequences. + # + # Note that venv performs unusual and obviously unintended expansions on the + # value of `prompt`: single-word expansions are performed twice by `activate`, + # and then again on every prompt if `prompt_subst` is in effect. While in general + # I am OK with being bug-compatible with other software, the bugs in venv are a + # bit too extreme for my comfort. I am going to disable all expansions and + # display the configured prompt literally. + res=${(Vg:e:)${res[2,-2]}} + fi + reply=(1 "$res") } ################################################################ @@ -4283,20 +4293,21 @@ prompt_virtualenv() { if (( _POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION )) && _p9k_python_version; then msg="${_p9k__ret//\%/%%} " fi - local v=${VIRTUAL_ENV:t} - if [[ $VIRTUAL_ENV_PROMPT == '('?*') ' && $VIRTUAL_ENV_PROMPT != "($v) " ]]; then - v=$VIRTUAL_ENV_PROMPT[2,-3] - elif [[ $v == $~_POWERLEVEL9K_VIRTUALENV_GENERIC_NAMES ]]; then - v=${VIRTUAL_ENV:h:t} - fi - local cfg="$VIRTUAL_ENV/pyvenv.cfg" + local cfg=$VIRTUAL_ENV/pyvenv.cfg if ! _p9k_cache_stat_get $0 $cfg; then local -a reply _p9k_parse_virtualenv_cfg $cfg - _p9k_cache_stat_set $reply + _p9k_cache_stat_set "${reply[@]}" fi - if [[ -n $_p9k__cache_val[1] ]]; then - v=$_p9k__cache_val[1] + if (( _p9k__cache_val[1] )); then + local v=$_p9k__cache_val[2] + else + local v=${VIRTUAL_ENV:t} + if [[ $VIRTUAL_ENV_PROMPT == '('?*') ' && $VIRTUAL_ENV_PROMPT != "($v) " ]]; then + v=$VIRTUAL_ENV_PROMPT[2,-3] + elif [[ $v == $~_POWERLEVEL9K_VIRTUALENV_GENERIC_NAMES ]]; then + v=${VIRTUAL_ENV:h:t} + fi fi msg+="$_POWERLEVEL9K_VIRTUALENV_LEFT_DELIMITER${v//\%/%%}$_POWERLEVEL9K_VIRTUALENV_RIGHT_DELIMITER" case $_POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV in @@ -9446,7 +9457,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.19.13 +typeset -g P9K_VERSION=1.19.14 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From ab6a863e231b1d85c89e152165719bfe826bc449 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 22 Jan 2024 18:28:28 +0100 Subject: [PATCH 332/380] docs: mention truecolor --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2aba3755..69dafff9 100644 --- a/README.md +++ b/README.md @@ -1322,12 +1322,19 @@ terminals. Many terminals also support customization of these colors through col Type `source ~/.p10k.zsh` to apply your changes to the current Zsh session. -To see how different colors look in your terminal, run the following command: +To see how different numbered colors look in your terminal, run the following command: ```zsh for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done ``` +If your terminal supports truecolor, you can use 24-bit colors in the `#RRGGBB` format in addition +to the numbered colors. + +```zsh +typeset -g POWERLEVEL9K_TIME_FOREGROUND='#FF0000' +``` + *Related:* - [Directory is difficult to see in prompt when using Rainbow style.]( #directory-is-difficult-to-see-in-prompt-when-using-rainbow-style) From a6fa4e43049715141df7390964b97b618421338c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 23 Jan 2024 08:52:57 +0100 Subject: [PATCH 333/380] faq: [oh-my-zsh] theme 'powerlevel10k/powerlevel10k' not found --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 69dafff9..ee011ba5 100644 --- a/README.md +++ b/README.md @@ -1509,6 +1509,7 @@ Powerlevel10k are released. This may change in the future but not soon. ## Troubleshooting +- [`[oh-my-zsh] theme 'powerlevel10k/powerlevel10k' not found`](#oh-my-zsh-theme-powerlevel10k-powerlevel10k-not-found) - [Question mark in prompt](#question-mark-in-prompt) - [Icons, glyphs or powerline symbols don't render](#icons-glyphs-or-powerline-symbols-dont-render) - [Sub-pixel imperfections around powerline symbols](#sub-pixel-imperfections-around-powerline-symbols) @@ -1531,6 +1532,27 @@ Powerlevel10k are released. This may change in the future but not soon. - [Arch Linux logo has a dot in the bottom right corner](#arch-linux-logo-has-a-dot-in-the-bottom-right-corner) - [Incorrect git status in prompt](#incorrect-git-status-in-prompt) +### `[oh-my-zsh] theme 'powerlevel10k/powerlevel10k' not found` + +When opening a terminal, or starting zsh manually, you may encounter this error message: + +```text +[oh-my-zsh] theme 'powerlevel10k/powerlevel10k' not found +``` + +1. First, run `typeset -p P9K_VERSION` to check whether Powerlevel10k has been loaded. + - If `typeset -p P9K_VERSION` succeeds and prints something like `typeset P9K_VERSION=1.19.14` + (the version could be different), remove the following line from `~/.zshrc`: + ```zsh + ZSH_THEME="powerlevel10k/powerlevel10k" + ``` + - If `typeset -p P9K_VERSION` fails with the error `typeset: no such variable: P9K_VERSION`, run + the following command: + ```zsh + git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k + ``` +2. Restart Zsh with `exec zsh`. + ### Question mark in prompt If it looks like a regular `?`, that's normal. It means you have untracked files in the current Git From bd0fa8a08f62a6e49f8a2ef47f5103fa840d2198 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 23 Jan 2024 08:53:43 +0100 Subject: [PATCH 334/380] docs: fix a link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ee011ba5..b01936b8 100644 --- a/README.md +++ b/README.md @@ -1509,7 +1509,7 @@ Powerlevel10k are released. This may change in the future but not soon. ## Troubleshooting -- [`[oh-my-zsh] theme 'powerlevel10k/powerlevel10k' not found`](#oh-my-zsh-theme-powerlevel10k-powerlevel10k-not-found) +- [`[oh-my-zsh] theme 'powerlevel10k/powerlevel10k' not found`](#oh-my-zsh-theme-powerlevel10kpowerlevel10k-not-found) - [Question mark in prompt](#question-mark-in-prompt) - [Icons, glyphs or powerline symbols don't render](#icons-glyphs-or-powerline-symbols-dont-render) - [Sub-pixel imperfections around powerline symbols](#sub-pixel-imperfections-around-powerline-symbols) From 35833ea15f14b71dbcebc7e54c104d8d56ca5268 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 26 Jan 2024 07:58:05 +0100 Subject: [PATCH 335/380] docs: document per_directory_history segment (#2384) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b01936b8..13cd994e 100644 --- a/README.md +++ b/README.md @@ -347,6 +347,7 @@ You can enable as many segments as you like. It won't slow down your prompt or Z | `nvm` | node.js environment from [nvm](https://github.com/nvm-sh/nvm) | | `os_icon` | your OS logo (apple for macOS, swirl for debian, etc.) | | `package` | `name@version` from [package.json](https://docs.npmjs.com/files/package.json) | +| `per_directory_history` | Oh My Zsh [per-directory-history](https://github.com/jimhester/per-directory-history) local/global indicator | | `perlbrew` | perl version from [perlbrew](https://github.com/gugod/App-perlbrew) | | `phpenv` | php environment from [phpenv](https://github.com/phpenv/phpenv) | | `php_version` | [php](https://www.php.net/) version | From 307bce24d19fa09d971a0d33c39f3c9fda82924e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 26 Jan 2024 09:24:27 +0100 Subject: [PATCH 336/380] docs: fix a link to zsh-theme-powerlevel10k archlinux package --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 13cd994e..c864fb7f 100644 --- a/README.md +++ b/README.md @@ -531,7 +531,7 @@ echo 'source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme' >>~/.zs referenced above is the official Powerlevel10k package. There is also [zsh-theme-powerlevel10k]( - https://www.archlinux.org/packages/community/x86_64/zsh-theme-powerlevel10k/) community package. + https://www.archlinux.org/packages/extra/x86_64/zsh-theme-powerlevel10k/) package. Historically, [it has been breaking often and for extended periods of time]( https://github.com/romkatv/powerlevel10k/pull/786). **Do not use it.** From 6f4520cc13cd203fef81ecc7f095cd45c7960766 Mon Sep 17 00:00:00 2001 From: Andrea Date: Wed, 31 Jan 2024 23:43:11 +0100 Subject: [PATCH 337/380] add neon support --- internal/icons.zsh | 7 ++++++ internal/p10k.zsh | 53 ++++++--------------------------------------- internal/wizard.zsh | 1 + 3 files changed, 15 insertions(+), 46 deletions(-) diff --git a/internal/icons.zsh b/internal/icons.zsh index dc3d675e..f733c7f6 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -75,6 +75,7 @@ function _p9k_init_icons() { LINUX_ENDEAVOUROS_ICON '\uE271'$s #  LINUX_ROCKY_ICON '\uE271'$s #  LINUX_GUIX_ICON '\uE271'$s #  + LINUX_NEON_ICON '\uE271'$s #  SUNOS_ICON '\U1F31E'$q # 🌞 HOME_ICON '\uE12C'$s #  HOME_SUB_ICON '\uE18D'$s #  @@ -231,6 +232,7 @@ function _p9k_init_icons() { LINUX_ENDEAVOUROS_ICON '\uF17C'$s #  LINUX_ROCKY_ICON '\uF17C'$s #  LINUX_GUIX_ICON '\uF17C'$s #  + LINUX_NEON_ICON '\uF17C'$s #  SUNOS_ICON '\uF185 ' #  HOME_ICON '\uF015'$s #  HOME_SUB_ICON '\uF07C'$s #  @@ -388,6 +390,7 @@ function _p9k_init_icons() { LINUX_ENDEAVOUROS_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" LINUX_ROCKY_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" LINUX_GUIX_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" + LINUX_NEON_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" SUNOS_ICON "${CODEPOINT_OF_AWESOME_SUN_O:+\\u$CODEPOINT_OF_AWESOME_SUN_O }" HOME_ICON "${CODEPOINT_OF_AWESOME_HOME:+\\u$CODEPOINT_OF_AWESOME_HOME$s}" HOME_SUB_ICON "${CODEPOINT_OF_AWESOME_FOLDER_OPEN:+\\u$CODEPOINT_OF_AWESOME_FOLDER_OPEN$s}" @@ -538,6 +541,7 @@ function _p9k_init_icons() { LINUX_ENDEAVOUROS_ICON '\UF322'$s #  LINUX_ROCKY_ICON '\UF32B'$s #  LINUX_GUIX_ICON '\UF325'$s #  + LINUX_NEON_ICON '\UF331'$s #  LINUX_ICON '\uF17C' #  SUNOS_ICON '\uF185 ' #  HOME_ICON '\uF015'$s #  @@ -696,6 +700,7 @@ function _p9k_init_icons() { LINUX_ENDEAVOUROS_ICON '\uF17C' #  LINUX_ROCKY_ICON '\uF17C' #  LINUX_GUIX_ICON '\uF325'$s #  + LINUX_NEON_ICON '\UF331'$s #  LINUX_ICON '\uF17C' #  SUNOS_ICON '\uF185 ' #  HOME_ICON '\uF015'$s #  @@ -847,6 +852,7 @@ function _p9k_init_icons() { LINUX_ENDEAVOUROS_ICON 'edvos' LINUX_ROCKY_ICON 'rocky' LINUX_GUIX_ICON 'guix' + LINUX_NEON_ICON 'neon' SUNOS_ICON 'sunos' HOME_ICON '' HOME_SUB_ICON '' @@ -999,6 +1005,7 @@ function _p9k_init_icons() { LINUX_ENDEAVOUROS_ICON 'Edv' LINUX_ROCKY_ICON 'Roc' LINUX_GUIX_ICON 'Guix' + LINUX_NEON_ICON 'Neon' SUNOS_ICON 'Sun' HOME_ICON '' HOME_SUB_ICON '' diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 0b003853..8e6e9d03 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4254,36 +4254,6 @@ function instant_prompt_chezmoi_shell() { _p9k_prompt_segment prompt_chezmoi_shell blue $_p9k_color1 CHEZMOI_ICON 1 '$CHEZMOI_ICON' '' } -function _p9k_parse_virtualenv_cfg() { - typeset -ga reply=(0) - [[ -f $1 && -r $1 ]] || return - - local cfg - cfg=$(<$1) || return - - local -a match mbegin mend - [[ $'\n'$cfg$'\n' == (#b)*$'\n'prompt[$' \t']#=[$' \t']#([^$' \t']#)[$' \t']#$'\n'* ]] || return - local res=$match[1] - if [[ $res == (\"*\"|\'*\') ]]; then - # The string is quoted in python style, which isn't the same as quoting in zsh. - # For example, the literal 'foo"\'bar' denotes foo"'bar in python but in zsh - # it is malformed. - # - # We cheat a bit and impelement not exactly correct unquoting. It may produce - # different visual results but won't perform unintended expansions or bleed out - # any escape sequences. - # - # Note that venv performs unusual and obviously unintended expansions on the - # value of `prompt`: single-word expansions are performed twice by `activate`, - # and then again on every prompt if `prompt_subst` is in effect. While in general - # I am OK with being bug-compatible with other software, the bugs in venv are a - # bit too extreme for my comfort. I am going to disable all expansions and - # display the configured prompt literally. - res=${(Vg:e:)${res[2,-2]}} - fi - reply=(1 "$res") -} - ################################################################ # Virtualenv: current working virtualenv # More information on virtualenv (Python): @@ -4293,21 +4263,11 @@ prompt_virtualenv() { if (( _POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION )) && _p9k_python_version; then msg="${_p9k__ret//\%/%%} " fi - local cfg=$VIRTUAL_ENV/pyvenv.cfg - if ! _p9k_cache_stat_get $0 $cfg; then - local -a reply - _p9k_parse_virtualenv_cfg $cfg - _p9k_cache_stat_set "${reply[@]}" - fi - if (( _p9k__cache_val[1] )); then - local v=$_p9k__cache_val[2] - else - local v=${VIRTUAL_ENV:t} - if [[ $VIRTUAL_ENV_PROMPT == '('?*') ' && $VIRTUAL_ENV_PROMPT != "($v) " ]]; then - v=$VIRTUAL_ENV_PROMPT[2,-3] - elif [[ $v == $~_POWERLEVEL9K_VIRTUALENV_GENERIC_NAMES ]]; then - v=${VIRTUAL_ENV:h:t} - fi + local v=${VIRTUAL_ENV:t} + if [[ $VIRTUAL_ENV_PROMPT == '('?*') ' && $VIRTUAL_ENV_PROMPT != "($v) " ]]; then + v=$VIRTUAL_ENV_PROMPT[2,-3] + elif [[ $v == $~_POWERLEVEL9K_VIRTUALENV_GENERIC_NAMES ]]; then + v=${VIRTUAL_ENV:h:t} fi msg+="$_POWERLEVEL9K_VIRTUALENV_LEFT_DELIMITER${v//\%/%%}$_POWERLEVEL9K_VIRTUALENV_RIGHT_DELIMITER" case $_POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV in @@ -8637,6 +8597,7 @@ function _p9k_init_cacheable() { endeavouros) _p9k_set_os Linux LINUX_ENDEAVOUROS_ICON;; rocky) _p9k_set_os Linux LINUX_ROCKY_ICON;; guix) _p9k_set_os Linux LINUX_GUIX_ICON;; + neon) _p9k_set_os Linux LINUX_NEON_ICON;; *) _p9k_set_os Linux LINUX_ICON;; esac ;; @@ -9457,7 +9418,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.19.14 +typeset -g P9K_VERSION=1.19.13 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh diff --git a/internal/wizard.zsh b/internal/wizard.zsh index e07225e0..2efd26b7 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1158,6 +1158,7 @@ function os_icon_name() { endeavouros) echo LINUX_ENDEAVOUROS_ICON;; rocky) echo LINUX_ROCKY_ICON;; guix) echo LINUX_GUIX_ICON;; + neon) echo LINUX_NEON_ICON;; *) echo LINUX_ICON;; esac ;; From adc238fa1d188d075e8803ea85dcca44d2deff4f Mon Sep 17 00:00:00 2001 From: Andrea Date: Wed, 31 Jan 2024 23:49:13 +0100 Subject: [PATCH 338/380] neon support --- internal/p10k.zsh | 52 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 8e6e9d03..d7be4d0a 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4254,6 +4254,36 @@ function instant_prompt_chezmoi_shell() { _p9k_prompt_segment prompt_chezmoi_shell blue $_p9k_color1 CHEZMOI_ICON 1 '$CHEZMOI_ICON' '' } +function _p9k_parse_virtualenv_cfg() { + typeset -ga reply=(0) + [[ -f $1 && -r $1 ]] || return + + local cfg + cfg=$(<$1) || return + + local -a match mbegin mend + [[ $'\n'$cfg$'\n' == (#b)*$'\n'prompt[$' \t']#=[$' \t']#([^$' \t']#)[$' \t']#$'\n'* ]] || return + local res=$match[1] + if [[ $res == (\"*\"|\'*\') ]]; then + # The string is quoted in python style, which isn't the same as quoting in zsh. + # For example, the literal 'foo"\'bar' denotes foo"'bar in python but in zsh + # it is malformed. + # + # We cheat a bit and impelement not exactly correct unquoting. It may produce + # different visual results but won't perform unintended expansions or bleed out + # any escape sequences. + # + # Note that venv performs unusual and obviously unintended expansions on the + # value of `prompt`: single-word expansions are performed twice by `activate`, + # and then again on every prompt if `prompt_subst` is in effect. While in general + # I am OK with being bug-compatible with other software, the bugs in venv are a + # bit too extreme for my comfort. I am going to disable all expansions and + # display the configured prompt literally. + res=${(Vg:e:)${res[2,-2]}} + fi + reply=(1 "$res") +} + ################################################################ # Virtualenv: current working virtualenv # More information on virtualenv (Python): @@ -4263,11 +4293,21 @@ prompt_virtualenv() { if (( _POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION )) && _p9k_python_version; then msg="${_p9k__ret//\%/%%} " fi - local v=${VIRTUAL_ENV:t} - if [[ $VIRTUAL_ENV_PROMPT == '('?*') ' && $VIRTUAL_ENV_PROMPT != "($v) " ]]; then - v=$VIRTUAL_ENV_PROMPT[2,-3] - elif [[ $v == $~_POWERLEVEL9K_VIRTUALENV_GENERIC_NAMES ]]; then - v=${VIRTUAL_ENV:h:t} + local cfg=$VIRTUAL_ENV/pyvenv.cfg + if ! _p9k_cache_stat_get $0 $cfg; then + local -a reply + _p9k_parse_virtualenv_cfg $cfg + _p9k_cache_stat_set "${reply[@]}" + fi + if (( _p9k__cache_val[1] )); then + local v=$_p9k__cache_val[2] + else + local v=${VIRTUAL_ENV:t} + if [[ $VIRTUAL_ENV_PROMPT == '('?*') ' && $VIRTUAL_ENV_PROMPT != "($v) " ]]; then + v=$VIRTUAL_ENV_PROMPT[2,-3] + elif [[ $v == $~_POWERLEVEL9K_VIRTUALENV_GENERIC_NAMES ]]; then + v=${VIRTUAL_ENV:h:t} + fi fi msg+="$_POWERLEVEL9K_VIRTUALENV_LEFT_DELIMITER${v//\%/%%}$_POWERLEVEL9K_VIRTUALENV_RIGHT_DELIMITER" case $_POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV in @@ -9418,7 +9458,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.19.13 +typeset -g P9K_VERSION=1.19.14 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From 62341054d8aa40ade03fc55bdbc95b9ff2d8d2b6 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 1 Feb 2024 06:44:39 +0100 Subject: [PATCH 339/380] set the default value of LINUX_NEON_ICON to a glyph that exists in the recommended font (#2553) --- internal/icons.zsh | 4 ++-- internal/p10k.zsh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/icons.zsh b/internal/icons.zsh index f733c7f6..81c215e6 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -541,7 +541,7 @@ function _p9k_init_icons() { LINUX_ENDEAVOUROS_ICON '\UF322'$s #  LINUX_ROCKY_ICON '\UF32B'$s #  LINUX_GUIX_ICON '\UF325'$s #  - LINUX_NEON_ICON '\UF331'$s #  + LINUX_NEON_ICON '\uF17C' #  LINUX_ICON '\uF17C' #  SUNOS_ICON '\uF185 ' #  HOME_ICON '\uF015'$s #  @@ -700,7 +700,7 @@ function _p9k_init_icons() { LINUX_ENDEAVOUROS_ICON '\uF17C' #  LINUX_ROCKY_ICON '\uF17C' #  LINUX_GUIX_ICON '\uF325'$s #  - LINUX_NEON_ICON '\UF331'$s #  + LINUX_NEON_ICON '\uF17C' #  LINUX_ICON '\uF17C' #  SUNOS_ICON '\uF185 ' #  HOME_ICON '\uF015'$s #  diff --git a/internal/p10k.zsh b/internal/p10k.zsh index d7be4d0a..a4a4c00b 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8637,7 +8637,7 @@ function _p9k_init_cacheable() { endeavouros) _p9k_set_os Linux LINUX_ENDEAVOUROS_ICON;; rocky) _p9k_set_os Linux LINUX_ROCKY_ICON;; guix) _p9k_set_os Linux LINUX_GUIX_ICON;; - neon) _p9k_set_os Linux LINUX_NEON_ICON;; + neon) _p9k_set_os Linux LINUX_NEON_ICON;; *) _p9k_set_os Linux LINUX_ICON;; esac ;; @@ -9458,7 +9458,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.19.14 +typeset -g P9K_VERSION=1.19.15 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From 34ee1c6bbb6b8e2372c4937d9ea7afa1855957de Mon Sep 17 00:00:00 2001 From: Ulices Date: Sat, 3 Feb 2024 11:13:23 +0000 Subject: [PATCH 340/380] fix: use correct sourcehut repository url (#2556) sourcehut.org is the website of the organization but sr.ht is the website were the repositories are hosted. --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index a4a4c00b..411e5aad 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7454,7 +7454,7 @@ _p9k_init_params() { 'gnu.org' VCS_GIT_GNU_ICON 'kde.org' VCS_GIT_KDE_ICON 'kernel.org' VCS_GIT_LINUX_ICON - 'sourcehut.org' VCS_GIT_SOURCEHUT_ICON + 'sr.ht' VCS_GIT_SOURCEHUT_ICON ) typeset -ga _POWERLEVEL9K_VCS_GIT_REMOTE_ICONS for domain icon in "${domain2icon[@]}"; do From ce7c242337c6e1002c0af64d43b8c8904007055b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 3 Feb 2024 12:14:58 +0100 Subject: [PATCH 341/380] bump versions --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 411e5aad..cb11b3f1 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -9458,7 +9458,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.19.15 +typeset -g P9K_VERSION=1.20.0 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From 5bba4b849b04da665d9776930f47371ebb9974a4 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 6 Feb 2024 09:55:40 +0100 Subject: [PATCH 342/380] skip batteries with "Unknown" status (#2562) --- internal/p10k.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index cb11b3f1..8a44b01d 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1410,6 +1410,9 @@ _p9k_prompt_battery_set_args() { local -i is_full=1 is_calculating is_charching local dir for dir in $bats; do + _p9k_read_file $dir/status(N) && local bat_status=$_p9k__ret || continue + # Skip batteries with "Unknown" status: https://github.com/romkatv/powerlevel10k/pull/2562. + [[ $bat_status == Unknown ]] && continue local -i pow=0 full=0 if _p9k_read_file $dir/(energy_full|charge_full|charge_counter)(N); then (( energy_full += ${full::=_p9k__ret} )) @@ -1422,7 +1425,6 @@ _p9k_prompt_battery_set_args() { elif _p9k_read_file $dir/(energy|charge)_now(N); then (( energy_now += _p9k__ret )) fi - _p9k_read_file $dir/status(N) && local bat_status=$_p9k__ret || continue [[ $bat_status != Full ]] && is_full=0 [[ $bat_status == Charging ]] && is_charching=1 [[ $bat_status == (Charging|Discharging) && $pow == 0 ]] && is_calculating=1 @@ -9458,7 +9460,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.20.0 +typeset -g P9K_VERSION=1.20.1 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From 1aa91f0069bcfbdb82ebdded74eb1730ad0674e1 Mon Sep 17 00:00:00 2001 From: weirdgiraffe Date: Mon, 12 Feb 2024 09:49:34 +0100 Subject: [PATCH 343/380] add icon for yazi level --- internal/icons.zsh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/icons.zsh b/internal/icons.zsh index 81c215e6..ec5b8721 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -139,6 +139,7 @@ function _p9k_init_icons() { JAVA_ICON '\U2615' # ☕︎ LARAVEL_ICON '' RANGER_ICON '\u2B50' # ⭐ + YAZI_ICON '\u2B50' # ⭐ MIDNIGHT_COMMANDER_ICON 'mc' VIM_ICON 'vim' TERRAFORM_ICON 'tf' @@ -292,6 +293,7 @@ function _p9k_init_icons() { JAVA_ICON '\U2615' # ☕︎ LARAVEL_ICON '' RANGER_ICON '\u2B50' # ⭐ + YAZI_ICON '\u2B50' # ⭐ MIDNIGHT_COMMANDER_ICON 'mc' VIM_ICON 'vim' TERRAFORM_ICON 'tf' @@ -448,6 +450,7 @@ function _p9k_init_icons() { JAVA_ICON '\U2615' # ☕︎ LARAVEL_ICON '' RANGER_ICON '\u2B50' # ⭐ + YAZI_ICON '\u2B50' # ⭐ MIDNIGHT_COMMANDER_ICON 'mc' VIM_ICON 'vim' TERRAFORM_ICON 'tf' @@ -607,6 +610,7 @@ function _p9k_init_icons() { JAVA_ICON '\uE738' #  LARAVEL_ICON '\ue73f'$q #  RANGER_ICON '\uF00b ' #  + YAZI_ICON '\uF00b ' #  MIDNIGHT_COMMANDER_ICON 'mc' # mc VIM_ICON '\uE62B' #  TERRAFORM_ICON '\uF1BB ' #  @@ -761,6 +765,7 @@ function _p9k_init_icons() { JAVA_ICON '\uE738' #  LARAVEL_ICON '\ue73f'$q #  RANGER_ICON '\uF00b ' #  + YAZI_ICON '\uF00b ' #  MIDNIGHT_COMMANDER_ICON 'mc' VIM_ICON '\uE62B' #  TERRAFORM_ICON '\uF1BB ' #  @@ -912,6 +917,7 @@ function _p9k_init_icons() { JAVA_ICON 'java' LARAVEL_ICON '' RANGER_ICON 'ranger' + YAZI_ICON 'yazi' MIDNIGHT_COMMANDER_ICON 'mc' VIM_ICON 'vim' TERRAFORM_ICON 'tf' @@ -1065,6 +1071,7 @@ function _p9k_init_icons() { JAVA_ICON '\U2615' # ☕︎ LARAVEL_ICON '' RANGER_ICON '\u2B50' # ⭐ + YAZI_ICON '\u2B50' # ⭐ MIDNIGHT_COMMANDER_ICON 'mc' VIM_ICON 'vim' TERRAFORM_ICON 'tf' From eb8f96f8080cbab3786425a24b7ad64695a59e91 Mon Sep 17 00:00:00 2001 From: weirdgiraffe Date: Mon, 12 Feb 2024 09:51:22 +0100 Subject: [PATCH 344/380] add prompt segment for yazi levels --- internal/p10k.zsh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 8a44b01d..976d695a 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4955,6 +4955,18 @@ function instant_prompt_ranger() { _p9k_prompt_segment prompt_ranger $_p9k_color1 yellow RANGER_ICON 1 '$RANGER_LEVEL' '$RANGER_LEVEL' } +function prompt_yazi() { + _p9k_prompt_segment $0 $_p9k_color1 yellow YAZI_ICON 0 '' $YAZI_LEVEL +} + +_p9k_prompt_yazi_init() { + typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$YAZI_LEVEL' +} + +function instant_prompt_yazi() { + _p9k_prompt_segment prompt_yazi $_p9k_color1 yellow YAZI_ICON 1 '$YAZI_LEVEL' '$YAZI_LEVEL' +} + function prompt_midnight_commander() { local -i len=$#_p9k__prompt _p9k__has_upglob _p9k_prompt_segment $0 $_p9k_color1 yellow MIDNIGHT_COMMANDER_ICON 0 '' '' From 67cedd3edcd54aa8edf392d72d9b637fa01eec9f Mon Sep 17 00:00:00 2001 From: weirdgiraffe Date: Mon, 12 Feb 2024 10:16:30 +0100 Subject: [PATCH 345/380] add visual expansion to wizard --- internal/wizard.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 2efd26b7..2714eec2 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1743,6 +1743,8 @@ function generate_config() { sub NORDVPN_VISUAL_IDENTIFIER_EXPANSION "'nord'" uncomment 'typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION' sub RANGER_VISUAL_IDENTIFIER_EXPANSION "'▲'" + uncomment 'typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION' + sub YAZI_VISUAL_IDENTIFIER_EXPANSION "'▲'" uncomment 'typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION' sub KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION "'○'" uncomment 'typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION' From 665257d05925bf399741126fd457d471a41e7ccd Mon Sep 17 00:00:00 2001 From: weirdgiraffe Date: Mon, 12 Feb 2024 10:26:42 +0100 Subject: [PATCH 346/380] add themes support --- config/p10k-classic.zsh | 8 ++++++++ config/p10k-lean-8colors.zsh | 7 +++++++ config/p10k-lean.zsh | 7 +++++++ config/p10k-rainbow.zsh | 10 +++++++++- 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 0e950d30..e0d32d84 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -81,6 +81,7 @@ context # user@hostname nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) + yazi # yazi shell (https://github.com/sxyazi/yazi) nnn # nnn shell (https://github.com/jarun/nnn) lf # lf shell (https://github.com/gokcehan/lf) xplr # xplr shell (https://github.com/sayanarijit/xplr) @@ -728,6 +729,12 @@ typeset -g POWERLEVEL9K_RANGER_FOREGROUND=178 # Custom icon. # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]#################### + # Yazi shell color. + typeset -g POWERLEVEL9K_YAZI_FOREGROUND=178 + # Custom icon. + # typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐' ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### # Nnn shell color. @@ -807,6 +814,7 @@ # Custom icon. # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐' ######################################[ ram: free RAM ]####################################### # RAM color. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index ca6e3d61..3e6d3d95 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -81,6 +81,7 @@ context # user@hostname nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) + yazi # yazi shell (https://github.com/sxyazi/yazi) nnn # nnn shell (https://github.com/jarun/nnn) lf # lf shell (https://github.com/gokcehan/lf) xplr # xplr shell (https://github.com/sayanarijit/xplr) @@ -723,6 +724,12 @@ typeset -g POWERLEVEL9K_RANGER_FOREGROUND=3 # Custom icon. # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]################### + # Yazi shell color. + typeset -g POWERLEVEL9K_YAZI_FOREGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐' ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### # Nnn shell color. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index e129c98a..7674f2c5 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -81,6 +81,7 @@ context # user@hostname nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) + yazi # yazi shell (https://github.com/sxyazi/yazi) nnn # nnn shell (https://github.com/jarun/nnn) lf # lf shell (https://github.com/gokcehan/lf) xplr # xplr shell (https://github.com/sayanarijit/xplr) @@ -719,6 +720,12 @@ typeset -g POWERLEVEL9K_RANGER_FOREGROUND=178 # Custom icon. # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]################### + # Yazi shell color. + typeset -g POWERLEVEL9K_YAZI_FOREGROUND=178 + # Custom icon. + # typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐' ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### # Nnn shell color. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 6b932c9e..325f9879 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -81,6 +81,7 @@ context # user@hostname nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) + yazi # yazi shell (https://github.com/sxyazi/yazi) nnn # nnn shell (https://github.com/jarun/nnn) lf # lf shell (https://github.com/gokcehan/lf) xplr # xplr shell (https://github.com/sayanarijit/xplr) @@ -747,7 +748,14 @@ typeset -g POWERLEVEL9K_RANGER_BACKGROUND=0 # Custom icon. # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' - + + ######################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]################### + # Yazi shell color. + typeset -g POWERLEVEL9K_YAZI_FOREGROUND=3 + typeset -g POWERLEVEL9K_YAZI_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐' + ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### # Nnn shell color. typeset -g POWERLEVEL9K_NNN_FOREGROUND=0 From f880e18769409ffe407b725c6004c5a8e849408d Mon Sep 17 00:00:00 2001 From: weirdgiraffe Date: Mon, 12 Feb 2024 10:28:49 +0100 Subject: [PATCH 347/380] update readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c864fb7f..76b0a422 100644 --- a/README.md +++ b/README.md @@ -358,6 +358,7 @@ You can enable as many segments as you like. It won't slow down your prompt or Z | `pyenv` | python environment from [pyenv](https://github.com/pyenv/pyenv) | | `ram` | free RAM | | `ranger` | [ranger](https://github.com/ranger/ranger) shell | +| `yazi` | [yazi](https://github.com/sxyazi/yazi)) shell | | `rbenv` | ruby environment from [rbenv](https://github.com/rbenv/rbenv) | | `rust_version` | [rustc](https://www.rust-lang.org) version | | `rvm` | ruby environment from [rvm](https://rvm.io) | From 8e2a22d80ba9f5fd6c784f66dc52c21385eb2642 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 12 Feb 2024 10:45:18 +0100 Subject: [PATCH 348/380] cleanup and bump version (#2572) --- config/p10k-classic.zsh | 6 ++---- config/p10k-lean-8colors.zsh | 2 +- config/p10k-lean.zsh | 2 +- config/p10k-rainbow.zsh | 4 +++- internal/p10k.zsh | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index e0d32d84..bc957abe 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -730,7 +730,7 @@ # Custom icon. # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' - #####################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]#################### + ####################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]##################### # Yazi shell color. typeset -g POWERLEVEL9K_YAZI_FOREGROUND=178 # Custom icon. @@ -811,10 +811,8 @@ # Text and color for insert vi mode. typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING= typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=66 - # Custom icon. - # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_VI_MODE_VISUAL_IDENTIFIER_EXPANSION='⭐' ######################################[ ram: free RAM ]####################################### # RAM color. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 3e6d3d95..593c3239 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -725,7 +725,7 @@ # Custom icon. # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' - ######################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]################### + ####################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]##################### # Yazi shell color. typeset -g POWERLEVEL9K_YAZI_FOREGROUND=3 # Custom icon. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 7674f2c5..8c724090 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -721,7 +721,7 @@ # Custom icon. # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' - ######################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]################### + ####################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]##################### # Yazi shell color. typeset -g POWERLEVEL9K_YAZI_FOREGROUND=178 # Custom icon. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 325f9879..65f07c96 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -749,7 +749,7 @@ # Custom icon. # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' - ######################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]################### + ####################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]##################### # Yazi shell color. typeset -g POWERLEVEL9K_YAZI_FOREGROUND=3 typeset -g POWERLEVEL9K_YAZI_BACKGROUND=0 @@ -843,6 +843,8 @@ # Text and color for insert vi mode. typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING= typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=8 + # Custom icon. + # typeset -g POWERLEVEL9K_VI_MODE_VISUAL_IDENTIFIER_EXPANSION='⭐' ######################################[ ram: free RAM ]####################################### # RAM color. diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 976d695a..2804bb26 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -9472,7 +9472,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.20.1 +typeset -g P9K_VERSION=1.20.2 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From 17cd9e354a283edeb657d340e1bbc0a30de5f967 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 15 Feb 2024 15:32:29 +0100 Subject: [PATCH 349/380] when looking for .fvm/flutter_sdk, require that the last segment is a symlink rather than .fvm (#2573) --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 2804bb26..f2ab0e69 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1314,7 +1314,7 @@ function _p9k_fvm_old() { } function _p9k_fvm_new() { - _p9k_upglob .fvm @ && return 1 + _p9k_upglob .fvm/flutter_sdk @ && return 1 local sdk=$_p9k__parent_dirs[$?]/.fvm/flutter_sdk if [[ ${sdk:A} == (#b)*/versions/([^/]##) ]]; then _p9k_prompt_segment prompt_fvm blue $_p9k_color1 FLUTTER_ICON 0 '' ${match[1]//\%/%%} @@ -9472,7 +9472,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.20.2 +typeset -g P9K_VERSION=1.20.3 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From 9e3418d319b1700c768b5c3c94c73ec70351ab09 Mon Sep 17 00:00:00 2001 From: Adam Schumacher Date: Sat, 17 Feb 2024 21:26:53 -0500 Subject: [PATCH 350/380] Detect rpi os based on apt source --- internal/p10k.zsh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index f2ab0e69..5a52a3a1 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8627,8 +8627,13 @@ function _p9k_init_cacheable() { *arch*) _p9k_set_os Linux LINUX_ARCH_ICON;; *debian*) _p9k_set_os Linux LINUX_DEBIAN_ICON;; *raspbian*) _p9k_set_os Linux LINUX_RASPBIAN_ICON;; - *ubuntu*) _p9k_set_os Linux LINUX_UBUNTU_ICON;; - *elementary*) _p9k_set_os Linux LINUX_ELEMENTARY_ICON;; + *debian*) + if [[ -f /etc/apt/sources.list.d/raspi.list ]]; then + _p9k_set_os Linux LINUX_RASPBIAN_ICON + else + _p9k_set_os Linux LINUX_RASPBIAN_ICON + fi + ;; *elementary*) _p9k_set_os Linux LINUX_ELEMENTARY_ICON;; *fedora*) _p9k_set_os Linux LINUX_FEDORA_ICON;; *coreos*) _p9k_set_os Linux LINUX_COREOS_ICON;; *kali*) _p9k_set_os Linux LINUX_KALI_ICON;; From 12e0592ac8f1d017b2dc7183b7720d98d8e41ed4 Mon Sep 17 00:00:00 2001 From: Adam Schumacher Date: Sat, 17 Feb 2024 21:29:14 -0500 Subject: [PATCH 351/380] Still keep debian --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 5a52a3a1..e941eebb 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8631,7 +8631,7 @@ function _p9k_init_cacheable() { if [[ -f /etc/apt/sources.list.d/raspi.list ]]; then _p9k_set_os Linux LINUX_RASPBIAN_ICON else - _p9k_set_os Linux LINUX_RASPBIAN_ICON + _p9k_set_os Linux LINUX_DEBIAN_ICON fi ;; *elementary*) _p9k_set_os Linux LINUX_ELEMENTARY_ICON;; *fedora*) _p9k_set_os Linux LINUX_FEDORA_ICON;; From bfbc65e63d071220dfbdb708bbde859ac7c64184 Mon Sep 17 00:00:00 2001 From: Adam Schumacher Date: Sat, 17 Feb 2024 21:38:10 -0500 Subject: [PATCH 352/380] whitespace --- internal/p10k.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index e941eebb..c14db837 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8633,7 +8633,8 @@ function _p9k_init_cacheable() { else _p9k_set_os Linux LINUX_DEBIAN_ICON fi - ;; *elementary*) _p9k_set_os Linux LINUX_ELEMENTARY_ICON;; + ;; + *elementary*) _p9k_set_os Linux LINUX_ELEMENTARY_ICON;; *fedora*) _p9k_set_os Linux LINUX_FEDORA_ICON;; *coreos*) _p9k_set_os Linux LINUX_COREOS_ICON;; *kali*) _p9k_set_os Linux LINUX_KALI_ICON;; From 31d99b694c97107a3db5ee4a8c33ab1308bff107 Mon Sep 17 00:00:00 2001 From: Adam Schumacher Date: Sat, 17 Feb 2024 22:15:53 -0500 Subject: [PATCH 353/380] Fix in wizard.zsh --- internal/p10k.zsh | 1 - internal/wizard.zsh | 9 ++++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index c14db837..776e3fb5 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8625,7 +8625,6 @@ function _p9k_init_cacheable() { fi case $os_release_id in *arch*) _p9k_set_os Linux LINUX_ARCH_ICON;; - *debian*) _p9k_set_os Linux LINUX_DEBIAN_ICON;; *raspbian*) _p9k_set_os Linux LINUX_RASPBIAN_ICON;; *debian*) if [[ -f /etc/apt/sources.list.d/raspi.list ]]; then diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 2714eec2..3b854b3b 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1132,7 +1132,14 @@ function os_icon_name() { fi case $os_release_id in *arch*) echo LINUX_ARCH_ICON;; - *debian*) echo LINUX_DEBIAN_ICON;; + *raspbian*) echo LINUX_RASPBIAN_ICON;; + *debian*) + if [[ -f /etc/apt/sources.list.d/raspi.list ]]; then + echo LINUX_RASPBIAN_ICON + else + echo LINUX_DEBIAN_ICON + fi + ;; *raspbian*) echo LINUX_RASPBIAN_ICON;; *ubuntu*) echo LINUX_UBUNTU_ICON;; *elementary*) echo LINUX_ELEMENTARY_ICON;; From bb16e366c3f7d68f73fa9129f3593524ff6420ac Mon Sep 17 00:00:00 2001 From: Adam Schumacher Date: Sat, 17 Feb 2024 22:17:50 -0500 Subject: [PATCH 354/380] Undelete ubuntu. I shouldn't code this tired. --- internal/p10k.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 776e3fb5..1811061a 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8633,6 +8633,7 @@ function _p9k_init_cacheable() { _p9k_set_os Linux LINUX_DEBIAN_ICON fi ;; + *ubuntu*) _p9k_set_os Linux LINUX_UBUNTU_ICON;; *elementary*) _p9k_set_os Linux LINUX_ELEMENTARY_ICON;; *fedora*) _p9k_set_os Linux LINUX_FEDORA_ICON;; *coreos*) _p9k_set_os Linux LINUX_COREOS_ICON;; From b973805f019cb9a4ecb1ccdf8879d89eb2b1b111 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 18 Feb 2024 17:18:59 +0100 Subject: [PATCH 355/380] cleanup and bump version (#2576) --- internal/p10k.zsh | 4 ++-- internal/wizard.zsh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 1811061a..d42501df 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8632,7 +8632,7 @@ function _p9k_init_cacheable() { else _p9k_set_os Linux LINUX_DEBIAN_ICON fi - ;; + ;; *ubuntu*) _p9k_set_os Linux LINUX_UBUNTU_ICON;; *elementary*) _p9k_set_os Linux LINUX_ELEMENTARY_ICON;; *fedora*) _p9k_set_os Linux LINUX_FEDORA_ICON;; @@ -9478,7 +9478,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.20.3 +typeset -g P9K_VERSION=1.20.4 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 3b854b3b..09459203 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1139,7 +1139,7 @@ function os_icon_name() { else echo LINUX_DEBIAN_ICON fi - ;; + ;; *raspbian*) echo LINUX_RASPBIAN_ICON;; *ubuntu*) echo LINUX_UBUNTU_ICON;; *elementary*) echo LINUX_ELEMENTARY_ICON;; From 0cc19ac2ede35fd8accff590fa71df580dc7e109 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 23 Feb 2024 06:03:55 +0100 Subject: [PATCH 356/380] use nf-md-redhat as the RHEL logo when on nerdfont-v3 (#2583) --- internal/icons.zsh | 2 +- internal/p10k.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/icons.zsh b/internal/icons.zsh index ec5b8721..d34b2c0e 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -539,7 +539,7 @@ function _p9k_init_icons() { LINUX_ARTIX_ICON '\UF31F'$s #  LINUX_UBUNTU_ICON '\uF31b'$s #  LINUX_KALI_ICON '\uF327'$s #  - LINUX_RHEL_ICON '\uF316'$s #  + LINUX_RHEL_ICON '\UF111B'$s # 󱄛 LINUX_AMZN_ICON '\uF270'$s #  LINUX_ENDEAVOUROS_ICON '\UF322'$s #  LINUX_ROCKY_ICON '\UF32B'$s #  diff --git a/internal/p10k.zsh b/internal/p10k.zsh index d42501df..64e08c47 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -9478,7 +9478,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.20.4 +typeset -g P9K_VERSION=1.20.5 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From d39e4268355f7a10f7758982db2a59e485d2659a Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 12 Mar 2024 08:07:40 +0100 Subject: [PATCH 357/380] docs: mention sessions in the font instructions for MobaXterm (#2599) --- README.md | 4 +++- font.md | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 76b0a422..b05d2ab1 100644 --- a/README.md +++ b/README.md @@ -685,7 +685,9 @@ If you are using a different terminal, proceed with manual font installation. tab, uncheck *Use the system fixed width font* (if not already) and select `MesloLGS NF Regular`. Exit the Preferences dialog by clicking *Close*. - **MobaXterm**: Open *Settings* → *Configuration* → *Terminal* → (under *Terminal look and feel*) - and change *Font* to `MesloLGS NF`. + and change *Font* to `MesloLGS NF`. If you have *sessions*, you need to change the font in each + of them through *Settings* → right click on an individual session → *Edit Session* → *Terminal + Settings* → *Font settings*. - **Asbrú Connection Manager**: Open *Preferences → Local Shell Options → Look and Feel*, enable *Use these personal options* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`. To change the font for the remote host connections, go to *Preferences → Terminal Options → diff --git a/font.md b/font.md index c80df910..d025bde0 100644 --- a/font.md +++ b/font.md @@ -70,7 +70,9 @@ If you are using a different terminal, proceed with manual font installation. tab, uncheck *Use the system fixed width font* (if not already) and select `MesloLGS NF Regular`. Exit the Preferences dialog by clicking *Close*. - **MobaXterm**: Open *Settings* → *Configuration* → *Terminal* → (under *Terminal look and feel*) - and change *Font* to `MesloLGS NF`. + and change *Font* to `MesloLGS NF`. If you have *sessions*, you need to change the font in each + of them through *Settings* → right click on an individual session → *Edit Session* → *Terminal + Settings* → *Font settings*. - **Asbrú Connection Manager**: Open *Preferences → Local Shell Options → Look and Feel*, enable *Use these personal options* and change *Font:* under *Terminal UI* to `MesloLGS NF Regular`. To change the font for the remote host connections, go to *Preferences → Terminal Options → From 0fdca5b1e606cc9ab083d2f41262fa10adcbfb21 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 16 Mar 2024 13:40:56 +0100 Subject: [PATCH 358/380] always offer the flat heads option in the wizard (#2600) --- internal/wizard.zsh | 55 +++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 09459203..630051f4 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1289,54 +1289,51 @@ function ask_heads() { fi local extra add_widget 0 flowing -c "%BPrompt Heads%b" - if (( cap_diamond )); then - add_widget 0 print -Pl " head" "%B(1) Sharp.%b |" " v" - add_widget 3 print -P "%B(1) Sharp.%b" - add_prompt_n left_head=$right_triangle right_head=$left_triangle - add_widget 0 print - add_widget 2 - else - add_widget 0 print - add_widget 1 - add_widget 0 print -P "%B(1) Flat.%b" - add_prompt left_head= right_head= - fi + add_widget 0 print -Pl " head" "%B(1) Flat.%b |" " v" + add_widget 3 print -P "%B(1) Flat.%b" + add_prompt_n left_head= right_head= + add_widget 0 print + add_widget 2 add_widget 0 print -P "%B(2) Blurred.%b" add_prompt left_head=$fade_out right_head=$fade_in - if [[ $POWERLEVEL9K_MODE == nerdfont-* ]]; then + if (( cap_diamond )); then extra+=3 - add_widget 0 print -P "%B(3) Slanted.%b" - add_prompt left_head=$down_triangle right_head=$up_triangle - extra+=4 - add_widget 0 print -P "%B(4) Round.%b" - add_prompt left_head=$right_circle right_head=$left_circle + add_widget 0 print -P "%B(3) Sharp.%b" + add_prompt left_head=$right_triangle right_head=$left_triangle + if [[ $POWERLEVEL9K_MODE == nerdfont-* ]]; then + extra+=4 + add_widget 0 print -P "%B(4) Slanted.%b" + add_prompt left_head=$down_triangle right_head=$up_triangle + extra+=5 + add_widget 0 print -P "%B(5) Round.%b" + add_prompt left_head=$right_circle right_head=$left_circle + fi fi add_widget 0 print -P "(r) Restart from the beginning." ask 12${extra}r case $choice in r) return 1;; 1) - if (( cap_diamond )); then - left_head=$right_triangle - right_head=$left_triangle - options+='sharp heads' - else - left_head= - right_head= - options+='flat heads' - fi + left_head= + right_head= + options+='flat heads' ;; 2) + left_head=$right_triangle + right_head=$left_triangle + options+='sharp heads' + ;; + 3) left_head=$fade_out right_head=$fade_in options+='blurred heads' ;; - 3) + 4) left_head=$down_triangle right_head=$up_triangle options+='slanted heads' ;; - 4) + 5) left_head=$right_circle right_head=$left_circle options+='round heads' From 6836bfe2da51bf32472b67df062347cfc4b1952e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 16 Mar 2024 16:03:55 +0100 Subject: [PATCH 359/380] fix heads in the wizard (#2605) fixed on the phone, hence the dumb diff --- internal/wizard.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 630051f4..1840962f 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1318,12 +1318,12 @@ function ask_heads() { right_head= options+='flat heads' ;; - 2) + 3) left_head=$right_triangle right_head=$left_triangle options+='sharp heads' ;; - 3) + 2) left_head=$fade_out right_head=$fade_in options+='blurred heads' From 07a971d310821fd50ef91281543ff8fa446bd76c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 18 Mar 2024 13:25:39 +0100 Subject: [PATCH 360/380] remove `DISABLE_UPDATE_PROMPT=true` from instant prompt If this breaks your shell, it means you are using an old version of oh-my-zsh, which predates this commit: https://github.com/ohmyzsh/ohmyzsh/commit/fe0dd8226d6f58ea98f9f84b279e6c3859993fb9 You need to upgrade oh-my-zsh by running the following command: omz update --- internal/p10k.zsh | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 64e08c47..c443674f 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6515,7 +6515,6 @@ _p9k_dump_instant_prompt() { } zshexit_functions=(_p9k_instant_prompt_cleanup $zshexit_functions) precmd_functions=(_p9k_instant_prompt_precmd_first $precmd_functions) - DISABLE_UPDATE_PROMPT=true } && unsetopt prompt_cr prompt_sp && typeset -gi __p9k_instant_prompt_sourced='$__p9k_instant_prompt_version' || typeset -gi __p9k_instant_prompt_sourced=${__p9k_instant_prompt_sourced:-0}' } always { From 93d074a82bcf5ac3dfe50b53b483381b8e330e01 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 18 Mar 2024 15:40:38 +0100 Subject: [PATCH 361/380] add p10k-deactivate-instant-prompt Function p10k-deactivate-instant-prompt is defined when and only when instant prompt is active. Invoking it erases and deactivates instant prompt. --- internal/p10k.zsh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index c443674f..c0f1918c 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6467,6 +6467,12 @@ _p9k_dump_instant_prompt() { exec {__p9k_fd_0}<&0 {__p9k_fd_1}>&1 {__p9k_fd_2}>&2 0<&$fd_null 1>$__p9k_instant_prompt_output exec 2>&1 {fd_null}>&- typeset -gi __p9k_instant_prompt_active=1 + function p10k-deactivate-instant-prompt() { + '$__p9k_intro_no_locale' + _p9k_clear_instant_prompt + builtin unset __p9k_instant_prompt_active + builtin unfunction p10k-deactivate-instant-prompt + } if (( _z4h_can_save_restore_screen == 1 )); then typeset -g _z4h_saved_screen -z4h-save-screen @@ -6479,6 +6485,7 @@ _p9k_dump_instant_prompt() { (( ZSH_SUBSHELL == 0 && ${+__p9k_instant_prompt_active} )) || return 0 '$__p9k_intro_no_locale' unset __p9k_instant_prompt_active + (( $+functions[p10k-deactivate-instant-prompt] )) && unfunction p10k-deactivate-instant-prompt exec 0<&$__p9k_fd_0 1>&$__p9k_fd_1 2>&$__p9k_fd_2 {__p9k_fd_0}>&- {__p9k_fd_1}>&- {__p9k_fd_2}>&- unset __p9k_fd_0 __p9k_fd_1 __p9k_fd_2 typeset -gi __p9k_instant_prompt_erased=1 @@ -6906,10 +6913,7 @@ function _p9k_on_expand() { (( _p9k__fully_initialized )) || _p9k_wrap_widgets fi - if (( $+__p9k_instant_prompt_active )); then - _p9k_clear_instant_prompt - unset __p9k_instant_prompt_active - fi + (( $+functions[p10k-deactivate-instant-prompt] )) && p10k-deactivate-instant-prompt if (( ! _p9k__expanded )); then _p9k__expanded=1 @@ -6981,8 +6985,7 @@ _p9k_precmd_impl() { _p9k_can_configure -q local -i ret=$? if (( ret == 2 && $+__p9k_instant_prompt_active )); then - _p9k_clear_instant_prompt - unset __p9k_instant_prompt_active + p10k-deactivate-instant-prompt _p9k_delete_instant_prompt zf_rm -f -- $__p9k_dump_file{,.zwc} 2>/dev/null () { @@ -9437,10 +9440,7 @@ function p10k() { return 1 ;; clear-instant-prompt) - if (( $+__p9k_instant_prompt_active )); then - _p9k_clear_instant_prompt - unset __p9k_instant_prompt_active - fi + (( $+functions[p10k-deactivate-instant-prompt] )) && p10k-deactivate-instant-prompt return 0 ;; *) @@ -9477,7 +9477,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.20.5 +typeset -g P9K_VERSION=1.20.6 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From a3f7dabcae10f30f9cac402a4c4265c70be16846 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 18 Mar 2024 15:46:27 +0100 Subject: [PATCH 362/380] cleanup --- internal/wizard.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 1840962f..f20a7af1 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1318,16 +1318,16 @@ function ask_heads() { right_head= options+='flat heads' ;; - 3) - left_head=$right_triangle - right_head=$left_triangle - options+='sharp heads' - ;; 2) left_head=$fade_out right_head=$fade_in options+='blurred heads' ;; + 3) + left_head=$right_triangle + right_head=$left_triangle + options+='sharp heads' + ;; 4) left_head=$down_triangle right_head=$up_triangle From 50794faba46cc695ec6dc168793db08a50ea811b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 18 Mar 2024 16:21:07 +0100 Subject: [PATCH 363/380] Revert "add p10k-deactivate-instant-prompt" This reverts commit 93d074a82bcf5ac3dfe50b53b483381b8e330e01. --- internal/p10k.zsh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index c0f1918c..c443674f 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6467,12 +6467,6 @@ _p9k_dump_instant_prompt() { exec {__p9k_fd_0}<&0 {__p9k_fd_1}>&1 {__p9k_fd_2}>&2 0<&$fd_null 1>$__p9k_instant_prompt_output exec 2>&1 {fd_null}>&- typeset -gi __p9k_instant_prompt_active=1 - function p10k-deactivate-instant-prompt() { - '$__p9k_intro_no_locale' - _p9k_clear_instant_prompt - builtin unset __p9k_instant_prompt_active - builtin unfunction p10k-deactivate-instant-prompt - } if (( _z4h_can_save_restore_screen == 1 )); then typeset -g _z4h_saved_screen -z4h-save-screen @@ -6485,7 +6479,6 @@ _p9k_dump_instant_prompt() { (( ZSH_SUBSHELL == 0 && ${+__p9k_instant_prompt_active} )) || return 0 '$__p9k_intro_no_locale' unset __p9k_instant_prompt_active - (( $+functions[p10k-deactivate-instant-prompt] )) && unfunction p10k-deactivate-instant-prompt exec 0<&$__p9k_fd_0 1>&$__p9k_fd_1 2>&$__p9k_fd_2 {__p9k_fd_0}>&- {__p9k_fd_1}>&- {__p9k_fd_2}>&- unset __p9k_fd_0 __p9k_fd_1 __p9k_fd_2 typeset -gi __p9k_instant_prompt_erased=1 @@ -6913,7 +6906,10 @@ function _p9k_on_expand() { (( _p9k__fully_initialized )) || _p9k_wrap_widgets fi - (( $+functions[p10k-deactivate-instant-prompt] )) && p10k-deactivate-instant-prompt + if (( $+__p9k_instant_prompt_active )); then + _p9k_clear_instant_prompt + unset __p9k_instant_prompt_active + fi if (( ! _p9k__expanded )); then _p9k__expanded=1 @@ -6985,7 +6981,8 @@ _p9k_precmd_impl() { _p9k_can_configure -q local -i ret=$? if (( ret == 2 && $+__p9k_instant_prompt_active )); then - p10k-deactivate-instant-prompt + _p9k_clear_instant_prompt + unset __p9k_instant_prompt_active _p9k_delete_instant_prompt zf_rm -f -- $__p9k_dump_file{,.zwc} 2>/dev/null () { @@ -9440,7 +9437,10 @@ function p10k() { return 1 ;; clear-instant-prompt) - (( $+functions[p10k-deactivate-instant-prompt] )) && p10k-deactivate-instant-prompt + if (( $+__p9k_instant_prompt_active )); then + _p9k_clear_instant_prompt + unset __p9k_instant_prompt_active + fi return 0 ;; *) @@ -9477,7 +9477,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.20.6 +typeset -g P9K_VERSION=1.20.5 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From 55c8f74c386b2cf54d3ca914cd451e22342e8d8a Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 18 Mar 2024 16:21:24 +0100 Subject: [PATCH 364/380] Revert "remove `DISABLE_UPDATE_PROMPT=true` from instant prompt" This reverts commit 07a971d310821fd50ef91281543ff8fa446bd76c. --- internal/p10k.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index c443674f..64e08c47 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6515,6 +6515,7 @@ _p9k_dump_instant_prompt() { } zshexit_functions=(_p9k_instant_prompt_cleanup $zshexit_functions) precmd_functions=(_p9k_instant_prompt_precmd_first $precmd_functions) + DISABLE_UPDATE_PROMPT=true } && unsetopt prompt_cr prompt_sp && typeset -gi __p9k_instant_prompt_sourced='$__p9k_instant_prompt_version' || typeset -gi __p9k_instant_prompt_sourced=${__p9k_instant_prompt_sourced:-0}' } always { From a7f13e420e8bc929dcd7f1dc719f7b632fd5356c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 18 Mar 2024 16:21:57 +0100 Subject: [PATCH 365/380] bump version --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 64e08c47..48eab915 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -9478,7 +9478,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.20.5 +typeset -g P9K_VERSION=1.20.7 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From 45627c528b4e3d8949a1e5c72ee3fe7cac516d8d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 18 Mar 2024 16:53:55 +0100 Subject: [PATCH 366/380] Squashed 'gitstatus/' changes from 215063d4..62177e89 62177e89 build: drop -Werror git-subtree-dir: gitstatus git-subtree-split: 62177e89b2b04baf242cd1526cc2661041dda0fb --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fede08af..adb20e9d 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ VERSION ?= $(shell . ./build.info && printf "%s" "$$gitstatus_version") # # Sized delete is implemented as __ZdlPvm in /usr/lib/libc++.1.dylib but this symbol is # missing in macOS prior to 10.13. -CXXFLAGS += -std=c++14 -funsigned-char -O3 -DNDEBUG -DGITSTATUS_VERSION=$(VERSION) -Wall -Werror # -g -fsanitize=thread +CXXFLAGS += -std=c++14 -funsigned-char -O3 -DNDEBUG -DGITSTATUS_VERSION=$(VERSION) -Wall # -g -fsanitize=thread LDFLAGS += -pthread # -fsanitize=thread LDLIBS += -lgit2 # -lprofiler -lunwind From da9b03777c4f2390c7e3f5c720ee4689336f811b Mon Sep 17 00:00:00 2001 From: Mohammad Al Zouabi Date: Tue, 19 Mar 2024 16:13:16 +0800 Subject: [PATCH 367/380] remove duplicate POWERLEVEL9K_DIR_SHOW_WRITABLE from p10k-lean-8colors.zsh (#2610) --- config/p10k-lean-8colors.zsh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 593c3239..d60b6c9d 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -277,10 +277,6 @@ # the full directory that was used in previous commands. typeset -g POWERLEVEL9K_DIR_HYPERLINK=false - # Enable special styling for non-writable directories. See POWERLEVEL9K_LOCK_ICON and - # POWERLEVEL9K_DIR_CLASSES below. - typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v2 - # Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON # and POWERLEVEL9K_DIR_CLASSES below. typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3 From d6a0fed1d9b2ff8746d1535eb6c7e83bfe0df093 Mon Sep 17 00:00:00 2001 From: Hodei Navarro Date: Fri, 5 Apr 2024 19:59:32 +0200 Subject: [PATCH 368/380] Ease regex pattern when reading pyenv.cfg prompt value This commit provides support for virtualenv-like pyenv.cfg configuration files, where the `prompt` value is a plain text rather than a quoted string. Before the commit, `prompt = My custom prompt` would not match the regex, returning a fallback of the $VIRTUAL_ENV directory name. After the commit, both venv-like `prompt = 'My custom prompt'` and virtualenv-like `prompt = My custom prompt` are supported. Closes #2628 --- internal/p10k.zsh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 48eab915..2d05a727 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4260,18 +4260,23 @@ function _p9k_parse_virtualenv_cfg() { typeset -ga reply=(0) [[ -f $1 && -r $1 ]] || return - local cfg - cfg=$(<$1) || return + local line res="" + while IFS= read -r line; do + if [[ "$line" =~ '^prompt[[:space:]]*=[[:space:]]*(.*)' ]]; then + res="${match[1]}" + break + fi + done < "$1" + + # Return if res is empty, meaning no match was found + [[ -z "$res" ]] && return - local -a match mbegin mend - [[ $'\n'$cfg$'\n' == (#b)*$'\n'prompt[$' \t']#=[$' \t']#([^$' \t']#)[$' \t']#$'\n'* ]] || return - local res=$match[1] if [[ $res == (\"*\"|\'*\') ]]; then # The string is quoted in python style, which isn't the same as quoting in zsh. # For example, the literal 'foo"\'bar' denotes foo"'bar in python but in zsh # it is malformed. # - # We cheat a bit and impelement not exactly correct unquoting. It may produce + # We cheat a bit and implement not exactly correct unquoting. It may produce # different visual results but won't perform unintended expansions or bleed out # any escape sequences. # From aeff1153d405ebc9f60d4a8cb7afce5451c07358 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 5 Apr 2024 20:42:59 +0200 Subject: [PATCH 369/380] handle unquoted `prompt` when parsing pyenv.cfg --- internal/p10k.zsh | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 2d05a727..dbad3275 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4260,23 +4260,18 @@ function _p9k_parse_virtualenv_cfg() { typeset -ga reply=(0) [[ -f $1 && -r $1 ]] || return - local line res="" - while IFS= read -r line; do - if [[ "$line" =~ '^prompt[[:space:]]*=[[:space:]]*(.*)' ]]; then - res="${match[1]}" - break - fi - done < "$1" - - # Return if res is empty, meaning no match was found - [[ -z "$res" ]] && return + local cfg + cfg=$(<$1) || return + local -a match mbegin mend + [[ $'\n'$cfg$'\n' == (#b)*$'\n'prompt[$' \t']#=([^$'\n']#)$'\n'* ]] || return + local res=${${match[1]##[$' \t']#}%%[$' \t']#} if [[ $res == (\"*\"|\'*\') ]]; then # The string is quoted in python style, which isn't the same as quoting in zsh. # For example, the literal 'foo"\'bar' denotes foo"'bar in python but in zsh # it is malformed. # - # We cheat a bit and implement not exactly correct unquoting. It may produce + # We cheat a bit and impelement not exactly correct unquoting. It may produce # different visual results but won't perform unintended expansions or bleed out # any escape sequences. # @@ -9483,7 +9478,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.20.7 +typeset -g P9K_VERSION=1.20.8 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From bcef7cafdf3005a3d59335df618f89474ef4dd8b Mon Sep 17 00:00:00 2001 From: Alexander Blum Date: Sun, 7 Apr 2024 15:58:13 +0000 Subject: [PATCH 370/380] fixes taskwarrior init data for taskwarrior v3 (#2635) --- internal/p10k.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index dbad3275..6e25ad0c 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5234,7 +5234,10 @@ function _p9k_taskwarrior_check_data() { } function _p9k_taskwarrior_init_data() { - local -a stat files=($_p9k_taskwarrior_data_dir/{pending,completed}.data) + local -a stat files=( + $_p9k_taskwarrior_data_dir/{pending,completed}.data + $_p9k_taskwarrior_data_dir/taskchampion.sqlite3 + ) _p9k_taskwarrior_data_files=($^files(N)) _p9k_taskwarrior_data_non_files=(${files:|_p9k_taskwarrior_data_files}) if (( $#_p9k_taskwarrior_data_files )); then From 178fcda3487afb3bd540d784cf472c60ec0de94a Mon Sep 17 00:00:00 2001 From: Alejandro Armas <58491232+mycroftsnm@users.noreply.github.com> Date: Tue, 9 Apr 2024 03:12:31 -0300 Subject: [PATCH 371/380] Update README.md Fix Typo (#2637) Removes the extra ')' in the yazi segment meaning --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b05d2ab1..8b8c5861 100644 --- a/README.md +++ b/README.md @@ -358,7 +358,7 @@ You can enable as many segments as you like. It won't slow down your prompt or Z | `pyenv` | python environment from [pyenv](https://github.com/pyenv/pyenv) | | `ram` | free RAM | | `ranger` | [ranger](https://github.com/ranger/ranger) shell | -| `yazi` | [yazi](https://github.com/sxyazi/yazi)) shell | +| `yazi` | [yazi](https://github.com/sxyazi/yazi) shell | | `rbenv` | ruby environment from [rbenv](https://github.com/rbenv/rbenv) | | `rust_version` | [rustc](https://www.rust-lang.org) version | | `rvm` | ruby environment from [rvm](https://rvm.io) | From 808ba80ab005cdb66be19d2c22695c9bab9747f3 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 23 Apr 2024 08:11:19 +0200 Subject: [PATCH 372/380] fail more gracefully on timewarrior v3.0.1 (#2648) --- internal/p10k.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 6e25ad0c..344f8b35 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5264,7 +5264,9 @@ function _p9k_taskwarrior_init_data() { local -a ts ts=($(command task +PENDING -OVERDUE list rc.verbose=nothing rc.color=0 rc._forcecolor=0 \ rc.report.list.labels= rc.report.list.columns=due.epoch /dev/null)) || ts=() - if (( $#ts )); then + # The second condition is a workaround for a bug in timewarrior v3.0.1. + # https://github.com/romkatv/powerlevel10k/issues/2648. + if (( $#ts && ! ${#${(@)ts:#(|-)<->(|.<->)}} )); then _p9k_taskwarrior_next_due=${${(on)ts}[1]} (( _p9k_taskwarrior_next_due > EPOCHSECONDS )) || _p9k_taskwarrior_next_due=$((EPOCHSECONDS+60)) fi From 01e3f0b4baeb499c63909e3caeaff575c79d51ce Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 23 Apr 2024 08:11:49 +0200 Subject: [PATCH 373/380] bump version --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 344f8b35..c1e1d4e7 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5264,7 +5264,7 @@ function _p9k_taskwarrior_init_data() { local -a ts ts=($(command task +PENDING -OVERDUE list rc.verbose=nothing rc.color=0 rc._forcecolor=0 \ rc.report.list.labels= rc.report.list.columns=due.epoch /dev/null)) || ts=() - # The second condition is a workaround for a bug in timewarrior v3.0.1. + # The second condition is a workaround for a bug in taskwarrior v3.0.1. # https://github.com/romkatv/powerlevel10k/issues/2648. if (( $#ts && ! ${#${(@)ts:#(|-)<->(|.<->)}} )); then _p9k_taskwarrior_next_due=${${(on)ts}[1]} @@ -9483,7 +9483,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.20.8 +typeset -g P9K_VERSION=1.20.9 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From b28d68f44b42f25703673fac514d0777f0af9d8a Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 25 Apr 2024 12:13:02 +0200 Subject: [PATCH 374/380] allow ~/.timewarrior to be a symbolic link (#2603) --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index c1e1d4e7..0ea81791 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5125,7 +5125,7 @@ function _p9k_timewarrior_clear() { function prompt_timewarrior() { local dir - [[ -n ${dir::=$TIMEWARRIORDB} || -n ${dir::=~/.timewarrior}(#qN/) ]] || + [[ -n ${dir::=$TIMEWARRIORDB} || -n ${dir::=~/.timewarrior}(#q-/N) ]] || dir=${XDG_DATA_HOME:-~/.local/share}/timewarrior dir+=/data local -a stat @@ -9483,7 +9483,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi -typeset -g P9K_VERSION=1.20.9 +typeset -g P9K_VERSION=1.20.10 unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From 3395c828b27f2cf528b3cec6e48f97a986c5f086 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 6 May 2024 08:37:53 +0200 Subject: [PATCH 375/380] docs: mention that vscode terminal does not respect foreground colors chosen by the user by default --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 8b8c5861..ebdc521d 100644 --- a/README.md +++ b/README.md @@ -1342,6 +1342,12 @@ typeset -g POWERLEVEL9K_TIME_FOREGROUND='#FF0000' *Related:* - [Directory is difficult to see in prompt when using Rainbow style.]( #directory-is-difficult-to-see-in-prompt-when-using-rainbow-style) + - [Incorrect foreground color in VSCode Terminal.](#incorrect-foreground-color-in-vscode-terminal) + +By default, VSCode Terminal may arbitrarily replace the foreground color of your choice with a +different color. This behavior can be +[turned off](https://code.visualstudio.com/docs/terminal/appearance#_minimum-contrast-ratio) in +VSCode settings. ### Why does Powerlevel10k spawn extra processes? @@ -1531,6 +1537,7 @@ Powerlevel10k are released. This may change in the future but not soon. - [Transient prompt stops working after some time](#transient-prompt-stops-working-after-some-time) - [Cannot make Powerlevel10k work with my plugin manager](#cannot-make-powerlevel10k-work-with-my-plugin-manager) - [Directory is difficult to see in prompt when using Rainbow style](#directory-is-difficult-to-see-in-prompt-when-using-rainbow-style) +- [Incorrect foreground color in VSCode Terminal.](#incorrect-foreground-color-in-vscode-terminal) - [Horrific mess when resizing terminal window](#horrific-mess-when-resizing-terminal-window) - [Icons cut off in Konsole](#icons-cut-off-in-konsole) - [Arch Linux logo has a dot in the bottom right corner](#arch-linux-logo-has-a-dot-in-the-bottom-right-corner) @@ -1874,6 +1881,15 @@ There are several ways to fix this. `POWERLEVEL9K_DIR_ANCHOR_FOREGROUND` and `POWERLEVEL9K_DIR_ANCHOR_BOLD`. You can find them in `~/.p10k.zsh`. +*Related*: [Incorrect foreground color in VSCode Terminal.](#incorrect-foreground-color-in-vscode-terminal) + +### Incorrect foreground color in VSCode Terminal + +By default, VSCode Terminal may arbitrarily replace the foreground color of your choice with a +different color. This behavior can be +[turned off](https://code.visualstudio.com/docs/terminal/appearance#_minimum-contrast-ratio) in +VSCode settings. + ### Horrific mess when resizing terminal window When you resize a terminal window horizontally back and forth a few times, you might see this ugly From 16e58484262de745723ed114e09217094655eaaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Tue, 7 May 2024 12:39:44 +0300 Subject: [PATCH 376/380] Doc: Use shorter readme link (#2671) Since it links to readme on default branch (permalink), can just omit that all making links shorter. --- config/p10k-classic.zsh | 4 ++-- config/p10k-lean-8colors.zsh | 4 ++-- config/p10k-lean.zsh | 4 ++-- config/p10k-pure.zsh | 2 +- config/p10k-rainbow.zsh | 4 ++-- config/p10k-robbyrussell.zsh | 2 +- internal/p10k.zsh | 8 ++++---- internal/wizard.zsh | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index bc957abe..d7be6722 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1677,7 +1677,7 @@ # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job # is to generate the prompt segment for display in instant prompt. See - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # https://github.com/romkatv/powerlevel10k#instant-prompt. # # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k @@ -1713,7 +1713,7 @@ # it incompatible with your zsh configuration files. # - quiet: Enable instant prompt and don't print warnings when detecting console output # during zsh initialization. Choose this if you've read and understood - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # https://github.com/romkatv/powerlevel10k#instant-prompt. # - verbose: Enable instant prompt and print a warning when detecting console output during # zsh initialization. Choose this if you've never tried instant prompt, haven't # seen the warning, or if you are unsure what this all means. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index d60b6c9d..bf469df7 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1652,7 +1652,7 @@ # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job # is to generate the prompt segment for display in instant prompt. See - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # https://github.com/romkatv/powerlevel10k#instant-prompt. # # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k @@ -1688,7 +1688,7 @@ # it incompatible with your zsh configuration files. # - quiet: Enable instant prompt and don't print warnings when detecting console output # during zsh initialization. Choose this if you've read and understood - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # https://github.com/romkatv/powerlevel10k#instant-prompt. # - verbose: Enable instant prompt and print a warning when detecting console output during # zsh initialization. Choose this if you've never tried instant prompt, haven't # seen the warning, or if you are unsure what this all means. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 8c724090..1595a377 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1652,7 +1652,7 @@ # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job # is to generate the prompt segment for display in instant prompt. See - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # https://github.com/romkatv/powerlevel10k#instant-prompt. # # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k @@ -1688,7 +1688,7 @@ # it incompatible with your zsh configuration files. # - quiet: Enable instant prompt and don't print warnings when detecting console output # during zsh initialization. Choose this if you've read and understood - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # https://github.com/romkatv/powerlevel10k#instant-prompt. # - verbose: Enable instant prompt and print a warning when detecting console output during # zsh initialization. Choose this if you've never tried instant prompt, haven't # seen the warning, or if you are unsure what this all means. diff --git a/config/p10k-pure.zsh b/config/p10k-pure.zsh index 97c1a207..7a4d2441 100644 --- a/config/p10k-pure.zsh +++ b/config/p10k-pure.zsh @@ -169,7 +169,7 @@ # it incompatible with your zsh configuration files. # - quiet: Enable instant prompt and don't print warnings when detecting console output # during zsh initialization. Choose this if you've read and understood - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # https://github.com/romkatv/powerlevel10k#instant-prompt. # - verbose: Enable instant prompt and print a warning when detecting console output during # zsh initialization. Choose this if you've never tried instant prompt, haven't # seen the warning, or if you are unsure what this all means. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 65f07c96..355ee9bb 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1774,7 +1774,7 @@ # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job # is to generate the prompt segment for display in instant prompt. See - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # https://github.com/romkatv/powerlevel10k#instant-prompt. # # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k @@ -1811,7 +1811,7 @@ # it incompatible with your zsh configuration files. # - quiet: Enable instant prompt and don't print warnings when detecting console output # during zsh initialization. Choose this if you've read and understood - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # https://github.com/romkatv/powerlevel10k#instant-prompt. # - verbose: Enable instant prompt and print a warning when detecting console output during # zsh initialization. Choose this if you've never tried instant prompt, haven't # seen the warning, or if you are unsure what this all means. diff --git a/config/p10k-robbyrussell.zsh b/config/p10k-robbyrussell.zsh index a59e222b..6a204d29 100644 --- a/config/p10k-robbyrussell.zsh +++ b/config/p10k-robbyrussell.zsh @@ -87,7 +87,7 @@ # it incompatible with your zsh configuration files. # - quiet: Enable instant prompt and don't print warnings when detecting console output # during zsh initialization. Choose this if you've read and understood - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # https://github.com/romkatv/powerlevel10k#instant-prompt. # - verbose: Enable instant prompt and print a warning when detecting console output during # zsh initialization. Choose this if you've never tried instant prompt, haven't # seen the warning, or if you are unsure what this all means. diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 0ea81791..d2d261b2 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6740,9 +6740,9 @@ function _p9k_clear_instant_prompt() { echo -E - "" echo -E - "${(%):-For details, see:}" if (( _p9k_term_has_href )); then - echo - "${(%):-\e]8;;https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt\ahttps://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt\e]8;;\a}" + echo - "${(%):-\e]8;;https://github.com/romkatv/powerlevel10k#instant-prompt\ahttps://github.com/romkatv/powerlevel10k#instant-prompt\e]8;;\a}" else - echo - "${(%):-https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt}" + echo - "${(%):-https://github.com/romkatv/powerlevel10k#instant-prompt}" fi echo -E - "" echo - "${(%):-%3F-- console output produced during zsh initialization follows --%f}" @@ -9007,9 +9007,9 @@ _p9k_init() { >&2 echo -E - "" >&2 echo -E - "${(%):- - %BRecommended%b: Change the way Powerlevel10k is loaded from %B$__p9k_zshrc_u%b.}" if (( _p9k_term_has_href )); then - >&2 echo - "${(%):- See \e]8;;https://github.com/romkatv/powerlevel10k/blob/master/README.md#installation\ahttps://github.com/romkatv/powerlevel10k/blob/master/README.md#installation\e]8;;\a.}" + >&2 echo - "${(%):- See \e]8;;https://github.com/romkatv/powerlevel10k#installation\ahttps://github.com/romkatv/powerlevel10k#installation\e]8;;\a.}" else - >&2 echo - "${(%):- See https://github.com/romkatv/powerlevel10k/blob/master/README.md#installation.}" + >&2 echo - "${(%):- See https://github.com/romkatv/powerlevel10k#installation.}" fi if (( $+zsh_defer_options )); then >&2 echo -E - "" diff --git a/internal/wizard.zsh b/internal/wizard.zsh index f20a7af1..de416794 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1506,7 +1506,7 @@ function ask_empty_line() { } function print_instant_prompt_link() { - local link='https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt' + local link='https://github.com/romkatv/powerlevel10k#instant-prompt' (( wizard_columns < $#link )) && return print flowing -c "$(href $link)" From bde5ca4c2aa6e0c52dd7f15cf216dffdb1ec788c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 21 May 2024 20:26:39 +0200 Subject: [PATCH 377/380] docs: the project is on life support --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index ebdc521d..70f68869 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,11 @@ [![Gitter](https://badges.gitter.im/powerlevel10k/community.svg)]( https://gitter.im/powerlevel10k/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) +- **THE PROJECT HAS VERY LIMITED SUPPORT** +- **NO NEW FEATURES ARE IN THE WORKS** +- **MOST BUGS WILL GO UNFIXED** +- **HELP REQUESTS WILL BE IGNORED** + Powerlevel10k is a theme for Zsh. It emphasizes [speed](#uncompromising-performance), [flexibility](#extremely-customizable) and [out-of-the-box experience](#configuration-wizard). From df8ed163438c1989da4daeb4174bfcb30abb285e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 28 Jun 2024 08:06:46 +0200 Subject: [PATCH 378/380] wizard: prefer POWERLEVEL9K_MODE=nerdfont-v3 over nerdfont-complete" The preference for nerdfont-complete was necessitated by a bug in Windows Terminal that has since been fixed. This reverts commit b474978b2e9435c10ca66f8281352ebc825264f4. wizard: prefer POWERLEVEL9K_MODE=nerdfont-complete over nerdfont-v3 See the reverted commit for details on the Windows Terminal bug. --- internal/wizard.zsh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index de416794..8d20675c 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -2142,16 +2142,16 @@ while true; do elif (( ! cap_diamond )); then POWERLEVEL9K_MODE=awesome-fontconfig else - ask_arrow '\uFC35' || continue + ask_arrow '\UF0737' || continue if (( cap_arrow )); then - POWERLEVEL9K_MODE=nerdfont-complete + ask_width || continue + fi + if (( cap_arrow )); then + POWERLEVEL9K_MODE=nerdfont-v3 else - ask_arrow '\UF0737' "Let's try another one." || continue + ask_arrow '\uFC35' "Let's try another one." || continue if (( cap_arrow )); then - ask_width || continue - fi - if (( cap_arrow )); then - POWERLEVEL9K_MODE=nerdfont-v3 + POWERLEVEL9K_MODE=nerdfont-complete else POWERLEVEL9K_MODE=awesome-fontconfig ask_python || continue From 4a2ef610ef893b47a539327195050adb50cbaf06 Mon Sep 17 00:00:00 2001 From: Eli Weiss Date: Sun, 30 Jun 2024 10:01:00 -0400 Subject: [PATCH 379/380] Add instructions on setting Conemu font Add instructions on setting font to MesloLGS NF in Conemu --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 70f68869..884cb21f 100644 --- a/README.md +++ b/README.md @@ -675,6 +675,7 @@ If you are using a different terminal, proceed with manual font installation. - **Windows Terminal** by Microsoft (the new thing): Open *Settings* (Ctrl+,), click either on the selected profile under *Profiles* or on *Defaults*, click *Appearance* and set *Font face* to `MesloLGS NF`. + - **Conemu**: Open *Setup → General → Fonts* and set *Main console font* to `MesloLGS NF`. - **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor → Color Scheme → Console Font*. Select *Use console font instead of the default* and set the font name to `MesloLGS NF`. From 2b7da93df04acd04d84f5de827e5b14077839a4b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 1 Jul 2024 08:34:13 +0200 Subject: [PATCH 380/380] docs: fixup for #2718 --- font.md | 1 + 1 file changed, 1 insertion(+) diff --git a/font.md b/font.md index d025bde0..7a7cb005 100644 --- a/font.md +++ b/font.md @@ -55,6 +55,7 @@ If you are using a different terminal, proceed with manual font installation. - **Windows Terminal** by Microsoft (the new thing): Open *Settings* (Ctrl+,), click either on the selected profile under *Profiles* or on *Defaults*, click *Appearance* and set *Font face* to `MesloLGS NF`. + - **Conemu**: Open *Setup → General → Fonts* and set *Main console font* to `MesloLGS NF`. - **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor → Color Scheme → Console Font*. Select *Use console font instead of the default* and set the font name to `MesloLGS NF`.