summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md13
-rw-r--r--config/p10k-classic.zsh10
-rw-r--r--config/p10k-lean-8colors.zsh10
-rw-r--r--config/p10k-lean.zsh10
-rw-r--r--config/p10k-rainbow.zsh10
-rw-r--r--internal/configure.zsh20
-rw-r--r--internal/p10k.zsh29
-rw-r--r--internal/wizard.zsh68
8 files changed, 111 insertions, 59 deletions
diff --git a/README.md b/README.md
index bb617755..2baa3509 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 or kogito.
-typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito'
+# 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'
```
To customize when different prompt segments are shown, open `~/.p10k.zsh`, search for
@@ -697,6 +697,7 @@ Powerlevel10k does not affect:
- Colors used by `ls`.
- Content and style of command completions.
- Command line colors (syntax highlighting, autosuggestions, etc.).
+- Key bindings.
- Prompt parameters other than `PS1` and `RPS1`.
- Zsh options other than those [related to prompt](
http://zsh.sourceforge.net/Doc/Release/Options.html#Prompting).
@@ -708,7 +709,7 @@ Powerlevel10k does not affect:
# Add powerlevel10k to the list of Oh My Zsh themes.
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
# Replace ZSH_THEME="powerlevel9k/powerlevel9k" with ZSH_THEME="powerlevel10k/powerlevel10k".
-sed 's/powerlevel9k/powerlevel10k/g' -i ~/.zshrc
+sed -i.bak 's/powerlevel9k/powerlevel10k/g' ~/.zshrc
# Restart Zsh.
exec zsh
```
@@ -927,8 +928,8 @@ a relevant tool.
```zsh
# Show prompt segment "kubecontext" only when the command you are typing
-# invokes kubectl, helm, kubens, kubectx, oc, istioctl or kogito.
-typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito'
+# 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'
```
Configs created by `p10k configure` may contain parameters of this kind. To customize when different
@@ -944,7 +945,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'
+ POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile'
fi
p10k reload
if zle; then
diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh
index a6398782..d17791c4 100644
--- a/config/p10k-classic.zsh
+++ b/config/p10k-classic.zsh
@@ -1165,7 +1165,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'
+ typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile'
# Kubernetes context classes for the purpose of using different colors, icons and expansions with
# different contexts.
@@ -1252,7 +1252,7 @@
#[ 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.
- typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi'
+ typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|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.
@@ -1293,7 +1293,7 @@
##########[ 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.
# Tip: Remove the next line to always show azure.
- typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi'
+ typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt'
# Azure account name color.
typeset -g POWERLEVEL9K_AZURE_FOREGROUND=32
# Custom icon.
@@ -1343,7 +1343,7 @@
#[ 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.
# Tip: Remove the next line to always show google_app_cred.
- typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi'
+ typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt'
# Google application credentials classes for the purpose of using different colors, icons and
# expansions with different credentials.
@@ -1408,7 +1408,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='(wg|(.*tun))[0-9]*'
+ typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun))[0-9]*'
# 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 88d6ee8b..3302276a 100644
--- a/config/p10k-lean-8colors.zsh
+++ b/config/p10k-lean-8colors.zsh
@@ -1109,7 +1109,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'
+ typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile'
# Kubernetes context classes for the purpose of using different colors, icons and expansions with
# different contexts.
@@ -1229,7 +1229,7 @@
#[ 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.
- typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi'
+ typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|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.
@@ -1270,7 +1270,7 @@
##########[ 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.
# Tip: Remove the next line to always show azure.
- typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi'
+ typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt'
# Azure account name color.
typeset -g POWERLEVEL9K_AZURE_FOREGROUND=4
# Custom icon.
@@ -1320,7 +1320,7 @@
#[ 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.
# Tip: Remove the next line to always show google_app_cred.
- typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi'
+ typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt'
# Google application credentials classes for the purpose of using different colors, icons and
# expansions with different credentials.
@@ -1385,7 +1385,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='(wg|(.*tun))[0-9]*'
+ typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun))[0-9]*'
# 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 41396029..e86d68ed 100644
--- a/config/p10k-lean.zsh
+++ b/config/p10k-lean.zsh
@@ -1109,7 +1109,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'
+ typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile'
# Kubernetes context classes for the purpose of using different colors, icons and expansions with
# different contexts.
@@ -1229,7 +1229,7 @@
#[ 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.
- typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi'
+ typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|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.
@@ -1270,7 +1270,7 @@
##########[ 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.
# Tip: Remove the next line to always show azure.
- typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi'
+ typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt'
# Azure account name color.
typeset -g POWERLEVEL9K_AZURE_FOREGROUND=32
# Custom icon.
@@ -1320,7 +1320,7 @@
#[ 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.
# Tip: Remove the next line to always show google_app_cred.
- typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi'
+ typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt'
# Google application credentials classes for the purpose of using different colors, icons and
# expansions with different credentials.
@@ -1385,7 +1385,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='(wg|(.*tun))[0-9]*'
+ typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun))[0-9]*'
# 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 e50d09a0..c538f7ac 100644
--- a/config/p10k-rainbow.zsh
+++ b/config/p10k-rainbow.zsh
@@ -1229,7 +1229,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'
+ typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile'
# Kubernetes context classes for the purpose of using different colors, icons and expansions with
# different contexts.
@@ -1318,7 +1318,7 @@
#[ 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.
- typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi'
+ typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|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.
@@ -1361,7 +1361,7 @@
##########[ 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.
# Tip: Remove the next line to always show azure.
- typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi'
+ typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt'
# Azure account name color.
# typeset -g POWERLEVEL9K_AZURE_FOREGROUND=7
# typeset -g POWERLEVEL9K_AZURE_BACKGROUND=4
@@ -1413,7 +1413,7 @@
#[ 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.
# Tip: Remove the next line to always show google_app_cred.
- typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi'
+ typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt'
# Google application credentials classes for the purpose of using different colors, icons and
# expansions with different credentials.
@@ -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='(wg|(.*tun))[0-9]*'
+ typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun))[0-9]*'
# 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/internal/configure.zsh b/internal/configure.zsh
index 9c92c233..4fb7cb6e 100644
--- a/internal/configure.zsh
+++ b/internal/configure.zsh
@@ -1,5 +1,7 @@
-typeset -gr __p9k_wizard_columns=51
-typeset -gr __p9k_wizard_lines=12
+# Fewer than 47 columns will probably work. Haven't tried it.
+typeset -gr __p9k_wizard_columns=47
+# The bottleneck is ask_tails with nerd fonts. Everything else works fine with 12 lines.
+typeset -gr __p9k_wizard_lines=14
typeset -gr __p9k_zd=${ZDOTDIR:-$HOME}
typeset -gr __p9k_zd_u=${${${(q)__p9k_zd}/#(#b)${(q)HOME}(|\/*)/'~'$match[1]}//\%/%%}
typeset -gr __p9k_zshrc=${${:-$__p9k_zd/.zshrc}:A}
@@ -19,10 +21,20 @@ function _p9k_can_configure() {
[[ -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 }
- [[ -w $__p9k_zd ]] || { $0_error "$__p9k_zd_u is not writable"; return 1 }
[[ ! -d $__p9k_cfg_path ]] || { $0_error "$__p9k_cfg_path_u is a directory"; return 1 }
[[ ! -d $__p9k_zshrc ]] || { $0_error "$__p9k_zshrc_u is a directory"; return 1 }
+ local dir=${__p9k_cfg_path:h}
+ while [[ ! -e $dir && $dir != ${dir:h} ]]; do dir=${dir:h}; done
+ if [[ ! -d $dir ]]; then
+ $0_error "cannot create $__p9k_cfg_path_u because ${dir//\%/%%} is not a directory"
+ return 1
+ fi
+ if [[ ! -w $dir ]]; then
+ $0_error "cannot create $__p9k_cfg_path_u because ${dir//\%/%%} is readonly"
+ return 1
+ fi
+
[[ ! -e $__p9k_cfg_path || -f $__p9k_cfg_path || -h $__p9k_cfg_path ]] || {
$0_error "$__p9k_cfg_path_u is a special file"
return 1
@@ -44,7 +56,7 @@ function _p9k_can_configure() {
done
(( LINES >= __p9k_wizard_lines && COLUMNS >= __p9k_wizard_columns )) || {
- $0_error "terminal size too small; must be at least $__p9k_wizard_columns x $__p9k_wizard_lines"
+ $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 }
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 24d756ac..0820a5f4 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -1384,7 +1384,7 @@ _p9k_prompt_battery_set_args() {
;;
esac
- (( bat_percent >= _POWERLEVEL9K_BATTERY_HIDE_ABOVE_THRESHOLD )) && return
+ (( bat_percent >= _POWERLEVEL9K_BATTERY_${state}_HIDE_ABOVE_THRESHOLD )) && return
local msg="$bat_percent%%"
[[ $_POWERLEVEL9K_BATTERY_VERBOSE == 1 && -n $remain ]] && msg+=" ($remain)"
@@ -5381,8 +5381,8 @@ function _p9k_prompt_net_iface_async() {
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=(<->)'<'* ]]; then
- [[ $match[2] == *[13579] ]] && iface=$match[1] || iface=
+ 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=
@@ -6913,6 +6913,7 @@ _p9k_init_params() {
esac
local state
for state in CHARGED CHARGING LOW DISCONNECTED; do
+ _p9k_declare -i POWERLEVEL9K_BATTERY_${state}_HIDE_ABOVE_THRESHOLD $_POWERLEVEL9K_BATTERY_HIDE_ABOVE_THRESHOLD
local var=POWERLEVEL9K_BATTERY_${state}_STAGES
case $parameters[$var] in
scalar*) eval "typeset -ga _$var=(${(@qq)${(@s::)${(g::)${(P)var}}}})";;
@@ -7034,7 +7035,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 "(wg|(.*tun))[0-9]*"
+ _p9k_declare -s POWERLEVEL9K_VPN_IP_INTERFACE "(gpd|wg|(.*tun))[0-9]*"
: ${_POWERLEVEL9K_VPN_IP_INTERFACE:='.*'}
_p9k_segment_in_use vpn_ip || _POWERLEVEL9K_VPN_IP_INTERFACE=
_p9k_declare -b POWERLEVEL9K_VPN_IP_SHOW_ALL 0
@@ -7285,6 +7286,10 @@ function _p9k_on_widget_zle-line-finish() {
_p9k__line_finished='%{%}'
}
+function _p9k_on_widget_send-break() {
+ _p9k_on_widget_zle-line-finish int
+}
+
# Usage example: _p9k_display_segment 58 _p9k__1rkubecontext hide
function _p9k_display_segment() {
[[ $_p9k__display_v[$1] == $3 ]] && return
@@ -7376,6 +7381,14 @@ function _p9k_widget() {
return res
}
+function _p9k_widget_send-break() {
+ (( ! __p9k_enabled )) || [[ $CONTEXT != start ]] || {
+ _p9k_widget_hook send-break "$@"
+ }
+ local f=${widgets[._p9k_orig_send-break]:-}
+ [[ -z $f ]] || zle ._p9k_orig_send-break -- "$@"
+}
+
typeset -gi __p9k_widgets_wrapped=0
function _p9k_wrap_widgets() {
@@ -7394,6 +7407,7 @@ function _p9k_wrap_widgets() {
visual-line-mode
deactivate-region
clear-screen
+ send-break
$_POWERLEVEL9K_HOOK_WIDGETS
)
else
@@ -7410,6 +7424,7 @@ function _p9k_wrap_widgets() {
zle-line-finish
zle-history-line-set
zle-keymap-select
+ send-break
$_POWERLEVEL9K_HOOK_WIDGETS
${${${(f)"$(<$tmp)"}##* }:#(*\"|.*)}
)
@@ -7419,7 +7434,9 @@ function _p9k_wrap_widgets() {
fi
local widget
for widget in $widget_list; do
- functions[_p9k_widget_$widget]='_p9k_widget '${(q)widget}' "$@"'
+ 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
@@ -7786,7 +7803,7 @@ _p9k_must_init() {
[[ $sig == $_p9k__param_sig ]] && return 1
_p9k_deinit
fi
- _p9k__param_pat=$'v104\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1'
+ _p9k__param_pat=$'v106\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'
diff --git a/internal/wizard.zsh b/internal/wizard.zsh
index 4ef373a7..cd62a384 100644
--- a/internal/wizard.zsh
+++ b/internal/wizard.zsh
@@ -281,6 +281,7 @@ function quit() {
}
local screen_widgets=()
+local -i max_priority
local -i prompt_idx
local choice
@@ -289,6 +290,7 @@ function add_widget() {
shift
local render="${(j: :)${(@q)*}}"
screen_widgets+=("$priority" "$render")
+ (( priority <= max_priority )) || max_priority=priority
}
function render_screen_pass() {
@@ -327,7 +329,7 @@ function render_screen() {
else
break
fi
- while (( (COLUMNS > 88 ? 88 : COLUMNS) == wizard_columns && LINES == wizard_lines )); do
+ while (( get_columns() == wizard_columns && LINES == wizard_lines )); do
sleep 1
done
done
@@ -356,7 +358,7 @@ function render_screen() {
flowing -c %1FNot enough vertical space.%f
print
flowing Make terminal window %Btaller%b or press %BCtrl-C%b to abort Powerlevel10k configuration wizard.
- while (( (COLUMNS > 88 ? 88 : COLUMNS) == wizard_columns && LINES == wizard_lines )); do
+ while (( get_columns() == wizard_columns && LINES == wizard_lines )); do
sleep 1
done
done
@@ -389,6 +391,7 @@ function ask() {
local -i lines columns wizard_lines wizard_columns
add_widget 0 print -P "(q) Quit and do nothing."
add_widget 0 print
+ add_widget $((max_priority + 1))
add_widget 0 print -P "%BChoice [${choices}q]: %b"
while true; do
=true
@@ -404,6 +407,7 @@ function ask() {
fi
if [[ $choices == *$choice* ]]; then
screen_widgets=()
+ max_priority=0
prompt_idx=0
return
fi
@@ -501,19 +505,19 @@ function install_font() {
clear
case $terminal in
Termux)
- mkdir -p ~/.termux || quit -c
+ command mkdir -p -- ~/.termux || quit -c
run_command "Downloading %BMesloLGS NF Regular.ttf%b" \
curl -fsSL -o ~/.termux/font.ttf "$font_base_url/MesloLGS%20NF%20Regular.ttf"
run_command "Reloading %BTermux%b settings" termux-reload-settings
;;
iTerm2)
- mkdir -p ~/Library/Fonts || quit -c
+ command mkdir -p -- ~/Library/Fonts || quit -c
local style
for style in Regular Bold Italic 'Bold Italic'; do
local file="MesloLGS NF ${style}.ttf"
run_command "Downloading %B$file%b" \
curl -fsSL -o ~/Library/Fonts/$file.tmp "$font_base_url/${file// /%20}"
- zf_mv -f -- ~/Library/Fonts/$file{.tmp,} || quit -c
+ command mv -f -- ~/Library/Fonts/$file{.tmp,} || quit -c
done
print -nP -- "Changing %BiTerm2%b settings ..."
local size=$iterm2_font_size
@@ -666,13 +670,13 @@ function ask_diamond() {
add_widget 0 print
add_widget 0 flowing -c -- "---> \uE0B2\uE0B0 <---"
add_widget 0 print
- add_widget 1
+ add_widget 3
add_widget 0 print -P "%B(y) Yes.%b"
add_widget 0 print
add_widget 1
add_widget 0 print -P "%B(n) No.%b"
add_widget 0 print
- add_widget 1
+ add_widget 2
if (( can_install_font )); then
extra+=r
add_widget 0 print -P "(r) Restart from the beginning."
@@ -694,10 +698,13 @@ function ask_lock() {
add_widget 0 print
add_widget 0 flowing -c -- "---> $1 <---"
add_widget 0 print
+ add_widget 3
add_widget 0 print -P "%B(y) Yes.%b"
add_widget 0 print
+ add_widget 1
add_widget 0 print -P "%B(n) No.%b"
add_widget 0 print
+ add_widget 2
add_widget 0 print -P "(r) Restart from the beginning."
ask ynr
case $choice in
@@ -714,10 +721,13 @@ function ask_python() {
add_widget 0 print -P ""
add_widget 0 flowing -c -- "---> \uE63C <---"
add_widget 0 print -P ""
+ add_widget 3
add_widget 0 print -P "%B(y) Yes.%b"
add_widget 0 print -P ""
+ add_widget 1
add_widget 0 print -P "%B(n) No.%b"
add_widget 0 print -P ""
+ add_widget 2
add_widget 0 print -P "(r) Restart from the beginning."
ask ynr
case $choice in
@@ -733,10 +743,13 @@ function ask_arrow() {
add_widget 0 print -P ""
add_widget 0 flowing -c -- "---> \u276F\u276E <---"
add_widget 0 print -P ""
+ add_widget 3
add_widget 0 print -P "%B(y) Yes.%b"
add_widget 0 print -P ""
+ add_widget 1
add_widget 0 print -P "%B(n) No.%b"
add_widget 0 print -P ""
+ add_widget 2
add_widget 0 print -P "(r) Restart from the beginning."
ask ynr
case $choice in
@@ -753,10 +766,13 @@ function ask_debian() {
add_widget 0 print -P ""
add_widget 0 flowing -c -- "---> \uF306 <---"
add_widget 0 print -P ""
+ add_widget 3
add_widget 0 print -P "%B(y) Yes.%b"
add_widget 0 print -P ""
+ add_widget 1
add_widget 0 print -P "%B(n) No.%b"
add_widget 0 print -P ""
+ add_widget 2
add_widget 0 print -P "(r) Restart from the beginning."
ask ynr
case $choice in
@@ -787,10 +803,13 @@ function ask_icon_padding() {
add_widget 0 print -P ""
add_widget 0 flowing -c -- "---> $text <---"
add_widget 0 print -P ""
+ add_widget 3
add_widget 0 flowing +c -i 5 "%B(y) Yes." Icons are very close to the crosses but there is "%b%2Fno overlap%f%B.%b"
add_widget 0 print -P ""
+ add_widget 1
add_widget 0 flowing +c -i 5 "%B(n) No." Some icons "%b%2Foverlap%f%B" neighbouring crosses.%b
add_widget 0 print -P ""
+ add_widget 2
add_widget 0 print -P "(r) Restart from the beginning."
ask ynr
case $choice in
@@ -1392,16 +1411,16 @@ function ask_empty_line() {
add_widget 0 print -P "%B(1) Compact.%b"
add_widget 0 print
add_widget 1
- add_widget 0 print_prompt
- add_widget 0 print_prompt
+ add_prompt_n
+ add_prompt_n
add_widget 0 print
add_widget 2
add_widget 0 print -P "%B(2) Sparse.%b"
add_widget 0 print
add_widget 1
- add_widget 0 print_prompt
+ add_prompt_n
add_widget 0 print
- add_widget 0 print_prompt
+ add_prompt_n
add_widget 0 print
add_widget 2
add_widget 0 print -P "(r) Restart from the beginning."
@@ -1437,27 +1456,24 @@ function ask_instant_prompt() {
add_widget 1
add_widget 0 print
add_widget 2
- add_widget 0 flowing +c -i 5 "%B(1) Off.%b" Disable instant prompt. Choose this if you\'ve \
- tried instant prompt and found it incompatible with your zsh configuration files.
+ add_widget 0 flowing +c -i 5 "%B(1) Verbose (recommended).%b"
add_widget 0 print
add_widget 1
- add_widget 0 flowing +c -i 5 "%B(2) Quiet.%b" Enable instant prompt and %Bdon\'t print \
- warnings%b when detecting console output during zsh initialization. Choose this if you\'ve \
- read and understood instant prompt documentation.
+ add_widget 0 flowing +c -i 5 "%B(2) Quiet.%b" Choose this if you\'ve read and understood \
+ instant prompt documentation.
add_widget 0 print
add_widget 1
- add_widget 0 flowing +c -i 5 "%B(3) Verbose.%b" Enable instant prompt and %Bprint a warning%b \
- when detecting console output during zsh initialization. %BChoose this if you\'ve never tried \
- instant prompt, haven\'t seen the warning, or if you are unsure what this all means%b.
+ add_widget 0 flowing +c -i 5 "%B(3) Off.%b" Choose this if you\'ve tried instant prompt \
+ and found it incompatible with your zsh configuration files.
add_widget 0 print
add_widget 2
add_widget 0 print -P "(r) Restart from the beginning."
ask 123r
case $choice in
r) return 1;;
- 1) instant_prompt=off; options+=instant_prompt=off;;
+ 1) instant_prompt=verbose; options+=instant_prompt=verbose;;
2) instant_prompt=quiet; options+=instant_prompt=quiet;;
- 3) instant_prompt=verbose; options+=instant_prompt=verbose;;
+ 3) instant_prompt=off; options+=instant_prompt=off;;
esac
return 0
}
@@ -1574,7 +1590,11 @@ function ask_zshrc_edit() {
add_widget 0 print -P ""
add_widget 1
local modifiable=y
- if [[ -e $__p9k_zshrc && ! -w $__p9k_zshrc ]]; then
+ if [[ ! -w $__p9k_zd ]]; then
+ modifiable=
+ add_widget 0 flowing -c %3FWARNING:%f %2F${__p9k_zd_u//\\/\\\\}%f %3Fis readonly.%f
+ add_widget 0 print -P ""
+ elif [[ -e $__p9k_zshrc && ! -w $__p9k_zshrc ]]; then
local -a stat
zstat -A stat +uid -- $__p9k_zshrc || quit -c
if (( stat[1] == EUID )); then
@@ -1859,6 +1879,8 @@ function generate_config() {
header+=$line
header+=$'.\n# Type `p10k configure` to generate another config.\n#'
+ command mkdir -p -- ${__p9k_cfg_path:h} || return
+
if [[ -e $__p9k_cfg_path ]]; then
unlink $__p9k_cfg_path || return
fi
@@ -1898,7 +1920,7 @@ fi" || return
[[ ! -f ${(%)__p9k_cfg_path_u} ]] || source ${(%)__p9k_cfg_path_u}" || return
fi
(( writable )) || chmod u-w -- $tmp || return
- zf_mv -f -- $tmp $__p9k_zshrc || return
+ command mv -f -- $tmp $__p9k_zshrc || return
} always {
zf_rm -f -- $tmp
}