From b305649e5388924cd83bd11f8659966c8807e1c2 Mon Sep 17 00:00:00 2001 From: romkatv Date: Sun, 10 May 2020 16:58:41 +0200 Subject: [PATCH 001/659] docs --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3f0cae42..fe01d2e5 100644 --- a/README.md +++ b/README.md @@ -1121,9 +1121,9 @@ The following code should work. If it doesn't, please open an issue. new versions are released.* ```zsh -curl -fsSLO https://github.com/romkatv/powerlevel10k/archive/v1.0.0.tar.gz -tar -xzf v1.0.0.tar.gz -cd powerlevel10k-1.0.0 +curl -fsSLO https://github.com/romkatv/powerlevel10k/archive/v1.8.0.tar.gz +tar -xzf v1.8.0.tar.gz +cd powerlevel10k-1.8.0 ( cd gitstatus . ./build.info From bc85e46f8b8a548379144732a3218bfe686f2f63 Mon Sep 17 00:00:00 2001 From: romkatv Date: Sun, 10 May 2020 17:44:24 +0200 Subject: [PATCH 002/659] Squashed 'gitstatus/' changes from 32b7b674..6a4f0fc0 6a4f0fc0 add missing \n in error messages d2fd0166 update build instructions git-subtree-dir: gitstatus git-subtree-split: 6a4f0fc0cadc214bbe4051bf87d87033558aeed8 --- README.md | 5 ++++- install | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4acd2869..f6a00bf1 100644 --- a/README.md +++ b/README.md @@ -473,6 +473,9 @@ want to build in docker (`-d docker`) or to allow automatic downloading of libgi The following code should work. If it doesn't, please open an issue. +**IMPORTANT:** *Change version to what you want to package. This example doesn't get updated when +new versions are released.* + ```zsh curl -fsSLO https://github.com/romkatv/gitstatus/archive/v1.0.0.tar.gz tar -xzf v1.0.0.tar.gz @@ -485,7 +488,7 @@ cd gitstatus-1.0.0 ) ./build rm deps/libgit2-*.tar.gz -for file in gitstatus.plugin.zsh gitstatus.prompt.zsh install; do +for file in *.zsh install; do zsh -fc "zcompile -R -- $file.zwc $file" done ``` diff --git a/install b/install index 464ab821..f747015c 100755 --- a/install +++ b/install @@ -209,13 +209,13 @@ END if command -v curl >/dev/null 2>&1; then if ! err="$(command curl -fsSLo "$archive" -- "$url" 2>&1)"; then >&2 echo "[gitstatus] error: failed to download gitstatusd: $url" - >&2 printf "%s" "$err" + >&2 printf "%s\n" "$err" return 1 fi elif command -v wget >/dev/null 2>&1; then if ! err="$(command wget -O "$archive" -- "$url" 2>&1)"; then >&2 echo "[gitstatus] error: failed to download gitstatusd: $url" - >&2 printf "%s" "$err" + >&2 printf "%s\n" "$err" return 1 fi else From d047ed87a1093b27aff3324ba57860c9c42f7b65 Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 11 May 2020 15:29:08 +0200 Subject: [PATCH 003/659] Squashed 'gitstatus/' changes from 6a4f0fc0..cd5673b4 cd5673b4 increase default gitstatus_start timeout from 5s to 30s git-subtree-dir: gitstatus git-subtree-split: cd5673b4971bf1a6d9aa8d57963e954e619b950e --- gitstatus.plugin.sh | 4 ++-- gitstatus.plugin.zsh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gitstatus.plugin.sh b/gitstatus.plugin.sh index 7385defa..75bc2688 100644 --- a/gitstatus.plugin.sh +++ b/gitstatus.plugin.sh @@ -8,7 +8,7 @@ # Usage: gitstatus_start [OPTION]... # # -t FLOAT Fail the self-check on initialization if not getting a response from -# gitstatusd for this this many seconds. Defaults to 5. +# gitstatusd for this this many seconds. Defaults to 30. # # -s INT Report at most this many staged changes; negative value means infinity. # Defaults to 1. @@ -37,7 +37,7 @@ # changes for repositories with bash.showDirtyState = false. function gitstatus_start() { unset OPTIND - local opt timeout=5 max_dirty=-1 extra_flags + local opt timeout=30 max_dirty=-1 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 diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index 5dc8d737..d1d74469 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -445,7 +445,7 @@ function _gitstatus_daemon"${1:-}"() { # Usage: gitstatus_start [OPTION]... NAME # # -t FLOAT Fail the self-check on initialization if not getting a response from gitstatusd for -# this this many seconds. Defaults to 5. +# this this many seconds. Defaults to 30. # # -s INT Report at most this many staged changes; negative value means infinity. # Defaults to 1. @@ -480,7 +480,7 @@ function gitstatus_start"${1:-}"() { local opt OPTARG local -i OPTIND - local -F timeout=5 + local -F timeout=30 local -i async=0 local -a args=() local -i dirty_max_index_size=-1 From 1db7094966bc86658166709db26b7750d8fc2821 Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 11 May 2020 18:19:51 +0200 Subject: [PATCH 004/659] Squashed 'gitstatus/' changes from cd5673b4..d3bc3e34 d3bc3e34 work around bugs in curl on cygwin; see #706 61a67c66 print error message from curl/wget before the summary git-subtree-dir: gitstatus git-subtree-split: d3bc3e346cc71ee1a29d0c4316449feb3dcb3116 --- install | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/install b/install index f747015c..1ae8d8dd 100755 --- a/install +++ b/install @@ -207,15 +207,17 @@ END local url="https://github.com/romkatv/gitstatus/releases/download/$version/$file.tar.gz" local archive="$cache_dir"/"$file".tmp.$$.tar.gz if command -v curl >/dev/null 2>&1; then - if ! err="$(command curl -fsSLo "$archive" -- "$url" 2>&1)"; then - >&2 echo "[gitstatus] error: failed to download gitstatusd: $url" + # `cd` is a workaround for Cygwin. It cannot handle -o with slashes. + if ! err="$(cd ${ZSH_VERSION:+-q} -- "$cache_dir" 2>&1 && + command curl -fsSLo "${archive##*/}" -- "$url" 2>&1)"; then >&2 printf "%s\n" "$err" + >&2 echo "[gitstatus] error: failed to download gitstatusd: $url" return 1 fi elif command -v wget >/dev/null 2>&1; then if ! err="$(command wget -O "$archive" -- "$url" 2>&1)"; then - >&2 echo "[gitstatus] error: failed to download gitstatusd: $url" >&2 printf "%s\n" "$err" + >&2 echo "[gitstatus] error: failed to download gitstatusd: $url" return 1 fi else From bda74564e3b1b9bbaa77f840215f7d99d0b77ed8 Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 11 May 2020 19:27:10 +0200 Subject: [PATCH 005/659] Squashed 'gitstatus/' changes from d3bc3e34..901c366b 901c366b survive `cd` being a function that fails instead of doing its job; see #123 git-subtree-dir: gitstatus git-subtree-split: 901c366b8ecb736e579784b132442ee51bcb0840 --- install | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/install b/install index 1ae8d8dd..1ef27cbb 100755 --- a/install +++ b/install @@ -205,31 +205,30 @@ END [ -d "$cache_dir" ] || mkdir -p -- "$cache_dir" || return local url="https://github.com/romkatv/gitstatus/releases/download/$version/$file.tar.gz" - local archive="$cache_dir"/"$file".tmp.$$.tar.gz - if command -v curl >/dev/null 2>&1; then - # `cd` is a workaround for Cygwin. It cannot handle -o with slashes. - if ! err="$(cd ${ZSH_VERSION:+-q} -- "$cache_dir" 2>&1 && - command curl -fsSLo "${archive##*/}" -- "$url" 2>&1)"; then - >&2 printf "%s\n" "$err" - >&2 echo "[gitstatus] error: failed to download gitstatusd: $url" - return 1 - fi - elif command -v wget >/dev/null 2>&1; then - if ! err="$(command wget -O "$archive" -- "$url" 2>&1)"; then - >&2 printf "%s\n" "$err" - >&2 echo "[gitstatus] error: failed to download gitstatusd: $url" - return 1 - fi - else - >&2 echo "[gitstatus] error: please install curl or wget" - return 1 - fi ( if [ -n "${ZSH_VERSION:-}" ]; then - builtin cd -q -- "$cache_dir" || return + builtin cd -q -- "$cache_dir" || exit else - cd -- "$cache_dir" || return + cd -- "$cache_dir" || exit + fi + + local archive="$file".tmp.$$.tar.gz + local err + + if command -v curl >/dev/null 2>&1; then + err="$(command curl -fsSLo "$archive" -- "$url" 2>&1)" + elif command -v wget >/dev/null 2>&1; then + err="$(command wget -O "$archive" -- "$url" 2>&1)" + else + >&2 echo "[gitstatus] error: please install curl or wget" + exit 1 + fi + + if [ $? != 0 ]; then + >&2 printf "%s\n" "$err" + >&2 echo "[gitstatus] error: failed to download gitstatusd: $url" + exit 1 fi local old= @@ -240,7 +239,7 @@ END [ -e "$old" ] || break i="$((i+1))" done - command mv -f -- "$daemon" "$old" || return + command mv -f -- "$daemon" "$old" || exit fi command tar -xzf "$archive" From d075b5a5cb8918cedfc2b744dfd7d449a0824974 Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 12 May 2020 08:34:01 +0200 Subject: [PATCH 006/659] disable aliases before calling zcompile --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fe01d2e5..42186e0c 100644 --- a/README.md +++ b/README.md @@ -1134,7 +1134,7 @@ cd powerlevel10k-1.8.0 rm deps/libgit2-*.tar.gz ) for file in *.zsh-theme internal/*.zsh gitstatus/*.zsh gitstatus/install; do - zsh -fc "zcompile -R -- $file.zwc $file" + zsh -fc "emulate zsh -o no_aliases && zcompile -R -- $file.zwc $file" done ``` From 16b44fd9da931458bebe7830ee033b370e4d086a Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 12 May 2020 21:52:51 +0200 Subject: [PATCH 007/659] add `p10k clear-instant-prompt`; disable instant prompt when gitstatus is likely to download a new binary --- internal/p10k.zsh | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 21217fd1..f5df728c 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5577,7 +5577,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=21 +typeset -gri __p9k_instant_prompt_version=22 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -5599,6 +5599,11 @@ _p9k_dump_instant_prompt() { for ((i = 6; i <= $#display_v; i+=2)); do display_v[i]=show; done display_v[2]=hide display_v[4]=hide + local gitstatus_dir=${${_POWERLEVEL9K_GITSTATUS_DIR:A}:-${__p9k_root_dir}/gitstatus} + local gitstatus_header + if [[ -r $gitstatus_dir/install.info ]]; then + IFS= read -r gitstatus_header <$gitstatus_dir/install.info || return + fi >&$fd print -r -- "() { $__p9k_intro_no_locale (( ! \$+__p9k_instant_prompt_disabled )) || return @@ -5607,6 +5612,8 @@ _p9k_dump_instant_prompt() { \$TERM_PROGRAM $hyper 'Hyper' && \$+VTE_VERSION == $+VTE_VERSION && \$POWERLEVEL9K_DISABLE_INSTANT_PROMPT != 'true' && \$POWERLEVEL9K_INSTANT_PROMPT != 'off' ]] || { __p9k_instant_prompt_sourced=0; return 1; } + local gitstatus_dir=${(q)gitstatus_dir} + local gitstatus_header=${(q)gitstatus_header} local -i ZLE_RPROMPT_INDENT=${ZLE_RPROMPT_INDENT:-1} 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 @@ -5614,6 +5621,14 @@ _p9k_dump_instant_prompt() { local -i height=$_POWERLEVEL9K_INSTANT_PROMPT_COMMAND_LINES local prompt_dir=${(q)prompt_dir}" >&$fd print -r -- ' + 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 + fi + if [[ $real_gitstatus_header != $gitstatus_header ]]; then + __p9k_instant_prompt_sourced=0 + return 1 + fi zmodload zsh/langinfo if [[ $langinfo[CODESET] != (utf|UTF)(-|)8 ]]; then local loc_cmd=$commands[locale] @@ -8371,6 +8386,13 @@ function p10k() { print -rP -- $__p9k_p10k_finalize_usage >&2 return 1 ;; + clear-instant-prompt) + if (( $+__p9k_instant_prompt_active )); then + _p9k_clear_instant_prompt + unset __p9k_instant_prompt_active + fi + return 0 + ;; *) print -rP -- $__p9k_p10k_usage >&2 return 1 From d23b2c3792712662408c332a52547dc903cc5c43 Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 12 May 2020 21:55:25 +0200 Subject: [PATCH 008/659] Squashed 'gitstatus/' changes from 901c366b..f81313e2 f81313e2 move gitee disable higher 8cfb83f3 print [ok] after download when stderr is not tty d185a2ab disable gitee mirror until there is sha256 verification in place fb88a401 show progress when downloading gitstatusd ae988158 add a mirror for gitstatusd release files c673d327 disable aliases before calling zcompile git-subtree-dir: gitstatus git-subtree-split: f81313e27271ee1fb3fd22b8e72382e9516776ef --- README.md | 2 +- gitstatus.plugin.sh | 46 ++++++++++++--- gitstatus.plugin.zsh | 68 +++++++++++++++++++--- install | 135 ++++++++++++++++++++++++++++++++++++------- install.info | 5 ++ 5 files changed, 217 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index f6a00bf1..0063dca9 100644 --- a/README.md +++ b/README.md @@ -489,7 +489,7 @@ cd gitstatus-1.0.0 ./build rm deps/libgit2-*.tar.gz for file in *.zsh install; do - zsh -fc "zcompile -R -- $file.zwc $file" + zsh -fc "emulate zsh -o no_aliases && zcompile -R -- $file.zwc $file" done ``` diff --git a/gitstatus.plugin.sh b/gitstatus.plugin.sh index 75bc2688..c05f6cca 100644 --- a/gitstatus.plugin.sh +++ b/gitstatus.plugin.sh @@ -8,7 +8,7 @@ # Usage: gitstatus_start [OPTION]... # # -t FLOAT Fail the self-check on initialization if not getting a response from -# gitstatusd for this this many seconds. Defaults to 30. +# gitstatusd for this this many seconds. Defaults to 5. # # -s INT Report at most this many staged changes; negative value means infinity. # Defaults to 1. @@ -37,7 +37,7 @@ # changes for repositories with bash.showDirtyState = false. function gitstatus_start() { unset OPTIND - local opt timeout=30 max_dirty=-1 extra_flags + local opt timeout=5 max_dirty=-1 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 @@ -117,7 +117,10 @@ function gitstatus_start() { { ( + trap '' INT + [[ "$GITSTATUS_DAEMON_LOG" == /dev/null ]] || set -x builtin cd / + ( local fd_in fd_out exec {fd_in}<"$req_fifo" {fd_out}>"$resp_fifo" || exit @@ -131,14 +134,15 @@ function gitstatus_start() { _gitstatus_bash_downloaded="$3" } - set -- -d "$gitstatus_plugin_dir" -s "$uname_s" -m "$uname_m" -- _gitstatus_set_daemon + set -- -d "$gitstatus_plugin_dir" -s "$uname_s" -m "$uname_m" \ + -p "printf '.\036' >&$fd_out" -- _gitstatus_set_daemon [[ "${GITSTATUS_AUTO_INSTALL:-1}" -ne 0 ]] || set -- -n "$@" source "$gitstatus_plugin_dir"/install || return [[ -n "$_gitstatus_bash_daemon" ]] || return [[ -n "$_gitstatus_bash_version" ]] || return [[ "$_gitstatus_bash_downloaded" == [01] ]] || return - local sig=(INT QUIT TERM EXIT ILL PIPE) + local sig=(QUIT TERM EXIT ILL PIPE) if [[ -x "$_gitstatus_bash_daemon" ]]; then "$_gitstatus_bash_daemon" \ @@ -174,9 +178,9 @@ function gitstatus_start() { wait "$pid" trap - ${sig[@]} echo -nE $'bye\x1f0\x1e' >&"$fd_out" - ) & - ) & disown - } 0/dev/null + ) & disown + ) & disown + } 0$GITSTATUS_DAEMON_LOG exec {_GITSTATUS_REQ_FD}>"$req_fifo" {_GITSTATUS_RESP_FD}<"$resp_fifo" || return command rm "$req_fifo" "$resp_fifo" || return @@ -186,8 +190,32 @@ function gitstatus_start() { local reply echo -nE $'hello\x1f\x1e' >&$_GITSTATUS_REQ_FD || return - IFS='' read -rd $'\x1e' -u $_GITSTATUS_RESP_FD -t "$timeout" reply || return - [[ "$reply" == $'hello\x1f0' ]] || return + local dl= + while true; do + IFS='' read -rd $'\x1e' -u $_GITSTATUS_RESP_FD -t "$timeout" reply || return + [[ "$reply" == $'hello\x1f0' ]] && break + [[ "$reply" == . ]] || return + if [[ -z "$dl" ]]; then + dl=1 + if [[ -t 2 ]]; then + local spinner=('\b\033[33m-\033[0m' '\b\033[33m\\\033[0m' '\b\033[33m|\033[0m' '\b\033[33m/\033[0m') + >&2 printf '[\033[33mgitstatus\033[0m] fetching \033[32mgitstatusd\033[0m .. ' + else + local spinner=('.') + >&2 printf '[gitstatus] fetching gitstatusd ..' + fi + fi + >&2 printf "${spinner[0]}" + spinner=("${spinner[@]:1}" "${spinner[0]}") + done + + if [[ -n "$dl" ]]; then + if [[ -t 2 ]]; then + >&2 printf '\b[\033[32mok\033[0m]\n' + else + >&2 echo ' [ok]' + fi + fi _GITSTATUS_DIRTY_MAX_INDEX_SIZE=$max_dirty _GITSTATUS_CLIENT_PID="$BASHPID" diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index d1d74469..0ee9f136 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -383,6 +383,11 @@ function _gitstatus_daemon"${1:-}"() { args+=(-t $((cpus > 16 ? 32 : cpus > 0 ? 2 * cpus : 16))) fi + mkfifo -- $file_prefix.fifo || return + print -rnu $pipe_fd -- ${(l:20:)pgid} || return + exec <$file_prefix.fifo || return + zf_rm -- $file_prefix.fifo || return + local _gitstatus_zsh_daemon _gitstatus_zsh_version _gitstatus_zsh_downloaded function _gitstatus_set_daemon$fsuf() { @@ -393,18 +398,14 @@ function _gitstatus_daemon"${1:-}"() { local gitstatus_plugin_dir_var=_gitstatus_plugin_dir$fsuf local gitstatus_plugin_dir=${(P)gitstatus_plugin_dir_var} - set -- -d $gitstatus_plugin_dir -s $uname_s -m $uname_m -- _gitstatus_set_daemon$fsuf + set -- -d $gitstatus_plugin_dir -s $uname_s -m $uname_m -p "printf . >&$pipe_fd" -- \ + _gitstatus_set_daemon$fsuf [[ ${GITSTATUS_AUTO_INSTALL:-1} == (|-|+)<1-> ]] || set -- -n "$@" source $gitstatus_plugin_dir/install || return [[ -n $_gitstatus_zsh_daemon ]] || return [[ -n $_gitstatus_zsh_version ]] || return [[ $_gitstatus_zsh_downloaded == [01] ]] || return - mkfifo -- $file_prefix.fifo || return - print -rnu $pipe_fd -- ${(l:20:)pgid} || return - exec <$file_prefix.fifo || return - zf_rm -- $file_prefix.fifo || return - if [[ -x $_gitstatus_zsh_daemon ]]; then $_gitstatus_zsh_daemon -G $_gitstatus_zsh_version "${(@)args}" >&$pipe_fd local -i ret=$? @@ -445,7 +446,7 @@ function _gitstatus_daemon"${1:-}"() { # Usage: gitstatus_start [OPTION]... NAME # # -t FLOAT Fail the self-check on initialization if not getting a response from gitstatusd for -# this this many seconds. Defaults to 30. +# this this many seconds. Defaults to 5. # # -s INT Report at most this many staged changes; negative value means infinity. # Defaults to 1. @@ -480,7 +481,7 @@ function gitstatus_start"${1:-}"() { local opt OPTARG local -i OPTIND - local -F timeout=30 + local -F timeout=5 local -i async=0 local -a args=() local -i dirty_max_index_size=-1 @@ -647,6 +648,57 @@ function gitstatus_start"${1:-}"() { print -nru $req_fd -- $'hello\x1f\x1e' || return local expected=$'hello\x1f0\x1e' actual + if (( $+functions[p10k] )) && [[ ! -t 1 && ! -t 0 ]]; then + local -F deadline='EPOCHREALTIME + 4' + else + local -F deadline='1' + fi + while true; do + [[ -t $resp_fd ]] + sysread -s 1 -t $timeout -i $resp_fd actual || return + [[ $actual == h ]] && break + [[ $actual == . ]] || return + (( EPOCHREALTIME < deadline )) && continue + if (( deadline > 0 )); then + deadline=0 + if (( stderr_fd )); then + unsetopt xtrace + exec 2>&$stderr_fd {stderr_fd}>&- + stderr_fd=0 + fi + if (( $+functions[p10k] )); then + p10k clear-instant-prompt || return + fi + if [[ $name == POWERLEVEL9K ]]; then + local label=powerlevel10k + else + local label=gitstatus + fi + if [[ -t 2 ]]; then + local spinner=($'\b%3F-%f' $'\b%3F\\%f' $'\b%3F|%f' $'\b%3F/%f') + print -Prnu2 -- "[%3F$label%f] fetching %2Fgitstatusd%f .. " + else + local spinner=('.') + print -rnu2 -- "[$label] fetching gitstatusd .." + fi + fi + print -Prnu2 -- $spinner[1] + spinner=($spinner[2,-1] $spinner[1]) + done + + if (( deadline == 0 )); then + if [[ -t 2 ]]; then + print -Pru2 -- $'\b[%2Fok%f]' + else + print -ru2 -- ' [ok]' + fi + if [[ $xtrace != /dev/null && -o no_xtrace ]]; then + exec {stderr_fd}>&2 || return + exec 2>>$xtrace || return + setopt xtrace + fi + fi + while (( $#actual < $#expected )); do [[ -t $resp_fd ]] sysread -s $(($#expected - $#actual)) -t $timeout -i $resp_fd 'actual[$#actual+1]' || return diff --git a/install b/install index 1ef27cbb..cc408354 100755 --- a/install +++ b/install @@ -12,14 +12,14 @@ _gitstatus_install_main() { local argv1=$1 shift - local no_check= no_install= uname_s= uname_m= gitstatus_dir= + local no_check= no_install= uname_s= uname_m= gitstatus_dir= dl_status= local opt= OPTARG= OPTIND=1 - while getopts ':s:m:d:fnh' opt "$@"; do + while getopts ':s:m:d:p:fnh' opt "$@"; do case "$opt" in h) command cat <<\END -Usage: install [-s KERNEL] [-m ARCH] [-d DIR] [-f|-n] [-- CMD [ARG]...] +Usage: install [-s KERNEL] [-m ARCH] [-d DIR] [-p CMD] [-f|-n] [-- CMD [ARG]...] If positional arguments are specified, call this on success: @@ -35,6 +35,7 @@ Options: -s KERNEL use this instead of lowercase `uname -s` -m ARCH use this instead of lowercase `uname -m` -d DIR use this instead of `dirname "$0"` + -p CMD eval this every second while downloading gitstatusd -f download gitstatusd even if there is one locally -n do not download gitstatusd (fail instead) END @@ -65,6 +66,17 @@ END fi gitstatus_dir="$OPTARG" ;; + p) + if [ -n "$dl_status" ]; then + >&2 echo "[gitstatus] error: duplicate option: -$opt" + return 1 + fi + if [ -z "$OPTARG" ]; then + >&2 echo "[error] incorrect value of -$opt: $OPTARG" + return 1 + fi + dl_status="$OPTARG" + ;; m) if [ -n "$uname_m" ]; then >&2 echo "[gitstatus] error: duplicate option: -$opt" @@ -204,30 +216,108 @@ END fi [ -d "$cache_dir" ] || mkdir -p -- "$cache_dir" || return - local url="https://github.com/romkatv/gitstatus/releases/download/$version/$file.tar.gz" - ( + local fetch + if command -v curl >/dev/null 2>&1; then + fetch="command curl -fsSLo" + elif command -v wget >/dev/null 2>&1; then + fetch="command wget -O" + else + >&2 echo "[gitstatus] error: please install curl or wget" + exit 1 + fi + + local url1="https://github.com/romkatv/gitstatus/releases/download/$version/$file.tar.gz" + local url2="https://gitee.com/romkatv/gitstatus/raw/release-$version/release/$file.tar.gz" + local tmp="$file".tmp.$$ + if [ -n "${ZSH_VERSION:-}" ]; then builtin cd -q -- "$cache_dir" || exit else cd -- "$cache_dir" || exit fi - local archive="$file".tmp.$$.tar.gz - local err + cleanup() { + local n + for n in "$@"; do + command rm -rf -- "$tmp"."$n".tar.gz "$tmp"."$n".status || return + done + } - if command -v curl >/dev/null 2>&1; then - err="$(command curl -fsSLo "$archive" -- "$url" 2>&1)" - elif command -v wget >/dev/null 2>&1; then - err="$(command wget -O "$archive" -- "$url" 2>&1)" - else - >&2 echo "[gitstatus] error: please install curl or wget" - exit 1 - fi + local sig='INT QUIT TERM ILL PIPE' - if [ $? != 0 ]; then - >&2 printf "%s\n" "$err" - >&2 echo "[gitstatus] error: failed to download gitstatusd: $url" + fetch() { + local trapped= + trap 'trapped=1' $sig + # TODO: enable this after adding sha256 verification. + [ "$1" = 1 ] || return + if [ "$1" != 1 ] && command -v sleep >/dev/null 2>/dev/null; then + sleep "$1" + fi + $fetch "$tmp"."$1".tar.gz -- "$2" 2>/dev/null & + local pid=$! + local die="trap - $sig; kill -- $pid 2>/dev/null; cleanup $1; exit 1" + trap "$die" $sig + [ -z "$trapped" ] || eval "$die" + wait -- "$pid" 2>/dev/null + local ret="$?" + echo -n >"$tmp"."$1".status + trap - $sig + return "$ret" + } + + local trapped= + trap 'trapped=1' $sig + fetch 1 "$url1" & + local pid1=$! + fetch 2 "$url2" & + local pid2=$! + + local die="trap - $sig; kill -- $pid1 $pid2 2>/dev/null; cleanup 1 2; exit 1" + trap "$die" $sig + [ -z "$trapped" ] || eval "$die" + + local n= + while true; do + [ -z "$dl_status" ] || eval "$dl_status" || eval "$die" + if command -v sleep >/dev/null 2>/dev/null; then + command sleep 1 + elif command -v true >/dev/null 2>/dev/null; then + command true + fi + if [ -n "$pid1" -a -e "$tmp".1.status ]; then + wait -- "$pid1" 2>/dev/null + local ret="$?" + pid1= + if [ "$ret" = 0 ]; then + [ -z "$pid2" ] || kill -- "$pid2" 2>/dev/null + n=1 + break + elif [ -z "$pid2" ]; then + break + fi + elif [ -n "$pid2" -a -e "$tmp".2.status ]; then + wait -- "$pid2" 2>/dev/null + local ret="$?" + pid2= + if [ "$ret" = 0 ]; then + [ -z "$pid1" ] || kill -- "$pid1" 2>/dev/null + n=2 + break + elif [ -z "$pid1" ]; then + break + fi + fi + done + + trap - $sig + + if [ -z "$n" ]; then + >&2 echo "[gitstatus] error: failed to download gitstatusd from any mirror" + >&2 echo "" + >&2 echo " 1. $url1" + >&2 echo " 2. $url2" + cleanup 1 2 exit 1 fi @@ -239,12 +329,15 @@ END [ -e "$old" ] || break i="$((i+1))" done - command mv -f -- "$daemon" "$old" || exit + if ! command mv -f -- "$daemon" "$old"; then + cleanup 1 2 + exit 1 + fi fi - command tar -xzf "$archive" + command tar -xzf "$tmp"."$n".tar.gz local ret=$? - command rm -f -- "$archive" + cleanup 1 2 if [ -n "$old" ]; then if [ "$ret" = 0 ]; then command rm -f -- "$old" 2>/dev/null diff --git a/install.info b/install.info index 853d4056..96458f0d 100644 --- a/install.info +++ b/install.info @@ -1,4 +1,9 @@ +# ae988158e1044abb1626a15d6a27751cd80c13be +# # This file is used by ./install and indirectly by shell bindings. +# +# The first line is read by powerlevel10k instant prompt. It must +# be updated whenever the content of this file changes. # Official gitstatusd binaries. uname_s_glob="cygwin_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; From a6009c74a92f1c01d725364635aa38eba67bc15a Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 13 May 2020 09:40:53 +0200 Subject: [PATCH 009/659] Squashed 'gitstatus/' changes from f81313e2..1a80249d 1a80249d build: verify libgit2 tarball sha256 74c3d56f bash: call mktemp only once and avoid `mktemp -u` b139dec4 install: use mktemp if available 9f594d24 bash: block SIGQUIT and SIGTSTP in daemon 73f47ea3 add sha256 verification for downloaded gitstatusd; enable gitee mirror git-subtree-dir: gitstatus git-subtree-split: 1a80249d2b6a53fd076ae846f8fcc501183ca5a5 --- build | 150 +++++++++++++++++++++++++++++--------------- build.info | 8 ++- gitstatus.plugin.sh | 27 ++++---- install | 110 ++++++++++++++++++-------------- install.info | 38 +++++------ mbuild | 2 +- 6 files changed, 201 insertions(+), 134 deletions(-) diff --git a/build b/build index 1a591a8c..39daaedd 100755 --- a/build +++ b/build @@ -9,7 +9,7 @@ if [ -n "${ZSH_VERSION:-}" ]; then emulate sh -o err_exit -o no_unset fi -usage="$(cat <<\END +usage="$(command cat <<\END Usage: build [-m ARCH] [-c CPU] [-d CMD] [-i IMAGE] [-s] [-w] Options: @@ -32,18 +32,18 @@ Options: END )" -build="$(cat <<\END -outdir="$(pwd)" +build="$(command cat <<\END +outdir="$(command pwd)" if command -v mktemp >/dev/null 2>&1; then - workdir="$(mktemp -d "${TMPDIR:-/tmp}"/gitstatus-build.XXXXXXXXXX)" + workdir="$(command mktemp -d "${TMPDIR:-/tmp}"/gitstatus-build.XXXXXXXXXX)" else workdir="${TMPDIR:-/tmp}/gitstatus-build.tmp.$$" - mkdir -- "$workdir" + command mkdir -- "$workdir" fi cd -- "$workdir" -workdir="$(pwd)" +workdir="$(command pwd)" narg() { echo $#; } @@ -57,22 +57,22 @@ libgit2_tmp="$outdir"/deps/"$appname".libgit2.tmp cleanup() { cd / - rm -rf -- "$workdir" "$outdir"/usrbin/"$appname".tmp "$libgit2_tmp" - trap - INT QUIT TERM EXIT ILL PIPE + command rm -rf -- "$workdir" "$outdir"/usrbin/"$appname".tmp "$libgit2_tmp" + trap - INT QUIT TERM ILL PIPE } -trap cleanup INT QUIT TERM EXIT ILL PIPE +trap cleanup INT QUIT TERM ILL PIPE if [ -n "$gitstatus_install_tools" ]; then case "$gitstatus_kernel" in linux) - apk update - apk add binutils cmake gcc g++ git make musl-dev + command apk update + command apk add binutils cmake gcc g++ git make musl-dev perl-utils ;; freebsd) - pkg install -y cmake gmake binutils gcc git + command pkg install -y cmake gmake binutils gcc git perl5 ;; netbsd) - pkgin -y install cmake gmake binutils git + command pkgin -y install cmake gmake binutils git ;; darwin) if ! command -v make >/dev/null 2>&1 || ! command -v gcc >/dev/null 2>&1; then @@ -84,16 +84,16 @@ if [ -n "$gitstatus_install_tools" ]; then exit 1 fi for formula in libiconv cmake git wget; do - if brew list "$formula" &>/dev/null; then - brew upgrade "$formula" + if command brew list "$formula" &>/dev/null; then + command brew upgrade "$formula" else - brew install "$formula" + command brew install "$formula" fi done ;; msys*|mingw*) - pacman -Syu --noconfirm - pacman -S --needed --noconfirm binutils cmake gcc git make + command pacman -Syu --noconfirm + command pacman -S --needed --noconfirm binutils cmake gcc git make perl ;; *) >&2 echo "[internal error] unhandled kernel: $gitstatus_kernel" @@ -102,7 +102,9 @@ if [ -n "$gitstatus_install_tools" ]; then esac fi -cpus="$(getconf _NPROCESSORS_ONLN)" || cpus="$(sysctl -n hw.ncpu)" || cpus=8 +cpus="$(command getconf _NPROCESSORS_ONLN 2>/dev/null)" || + cpus="$(command sysctl -n hw.ncpu 2>/dev/null)" || + cpus=8 libgit2_cmake_flags= libgit2_cflags="-march=$gitstatus_cpu" @@ -126,8 +128,8 @@ case "$gitstatus_kernel" in gitstatus_ldflags="$gitstatus_ldflags -static" ;; darwin) - mkdir -- "$workdir"/lib - ln -s -- /usr/local/opt/libiconv/lib/libiconv.a "$workdir"/lib + command mkdir -- "$workdir"/lib + command ln -s -- /usr/local/opt/libiconv/lib/libiconv.a "$workdir"/lib libgit2_cmake_flags="$libgit2_cmake_flags -DUSE_ICONV=ON" libgit2_cflags="$libgit2_cflags -I/usr/local/opt/libiconv/include" gitstatus_cxxflags="$gitstatus_cxxflags -I/usr/local/opt/libiconv/include" @@ -146,7 +148,7 @@ case "$gitstatus_kernel" in ;; esac -for cmd in cmake gcc g++ git ld "$gitstatus_make" wget; do +for cmd in cat cmake gcc g++ 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" @@ -159,45 +161,89 @@ for cmd in cmake gcc g++ git ld "$gitstatus_make" wget; do done . "$outdir"/build.info -if [ -z "$libgit2_version" ]; then +if [ -z "${libgit2_version:-}" ]; then >&2 echo "[internal error] libgit2_version not set" exit 1 fi +if [ -z "${libgit2_sha256:-}" ]; then + >&2 echo "[internal error] libgit2_sha256 not set" + exit 1 +fi libgit2_tarball="$outdir"/deps/libgit2-"$libgit2_version".tar.gz if [ ! -e "$libgit2_tarball" ]; then if [ -n "$gitstatus_download_deps" ]; then + if ! command -v wget >/dev/null 2>&1; then + if [ -n "$gitstatus_install_tools" ]; then + >&2 echo "[internal error] wget not found" + exit 1 + else + >&2 echo "[error] command not found: wget" + exit 1 + fi + fi libgit2_url=https://github.com/romkatv/libgit2/archive/"$libgit2_version".tar.gz - wget -O "$libgit2_tmp" -- "$libgit2_url" - mv -f -- "$libgit2_tmp" "$libgit2_tarball" + command wget -O "$libgit2_tmp" -- "$libgit2_url" + command mv -f -- "$libgit2_tmp" "$libgit2_tarball" else >&2 echo "[error] file not found: deps/libgit2-"$libgit2_version".tar.gz" exit 1 fi fi +libgit2_actual_sha256= +if command -v shasum >/dev/null 2>/dev/null; then + libgit2_actual_sha256="$(command shasum -b -a 256 -- "$libgit2_tarball")" + libgit2_actual_sha256="${libgit2_actual_sha256%% *}" +elif command -v sha256sum >/dev/null 2>/dev/null; then + libgit2_actual_sha256="$(command sha256sum -b -- "$libgit2_tarball")" + libgit2_actual_sha256="${libgit2_actual_sha256%% *}" +elif command -v sha256 >/dev/null 2>/dev/null; then + libgit2_actual_sha256="$(command sha256 -- "$libgit2_tarball" &2 echo "[error] command not found: shasum or sha256sum" + exit 1 +fi + +if [ "$libgit2_actual_sha256" != "$libgit2_sha256" ]; then + >&2 echo "[error] sha256 mismatch" + >&2 echo "" + >&2 echo " file : deps/libgit2-$libgit2_version.tar.gz" + >&2 echo " expected: $libgit2_sha256" + >&2 echo " actual : $libgit2_actual_sha256" + exit 1 +fi + cd -- "$workdir" -tar -xzf "$libgit2_tarball" -mv -- libgit2-"$libgit2_version" libgit2 -mkdir libgit2/build +command tar -xzf "$libgit2_tarball" +command mv -- libgit2-"$libgit2_version" libgit2 +command mkdir libgit2/build cd libgit2/build -CFLAGS="$libgit2_cflags" cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DZERO_NSEC=ON \ - -DTHREADSAFE=ON \ - -DUSE_BUNDLED_ZLIB=ON \ - -DREGEX_BACKEND=builtin \ - -DUSE_HTTP_PARSER=builtin \ - -DUSE_SSH=OFF \ - -DUSE_HTTPS=OFF \ - -DBUILD_CLAR=OFF \ - -DUSE_GSSAPI=OFF \ - -DUSE_NTLMCLIENT=OFF \ - -DBUILD_SHARED_LIBS=OFF \ - -DENABLE_REPRODUCIBLE_BUILDS=OFF \ - $libgit2_cmake_flags \ +CFLAGS="$libgit2_cflags" command cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DZERO_NSEC=ON \ + -DTHREADSAFE=ON \ + -DUSE_BUNDLED_ZLIB=ON \ + -DREGEX_BACKEND=builtin \ + -DUSE_HTTP_PARSER=builtin \ + -DUSE_SSH=OFF \ + -DUSE_HTTPS=OFF \ + -DBUILD_CLAR=OFF \ + -DUSE_GSSAPI=OFF \ + -DUSE_NTLMCLIENT=OFF \ + -DBUILD_SHARED_LIBS=OFF \ + -DENABLE_REPRODUCIBLE_BUILDS=OFF \ + $libgit2_cmake_flags \ .. -make -j "$cpus" VERBOSE=1 +command make -j "$cpus" VERBOSE=1 APPNAME="$appname".tmp \ OBJDIR="$workdir"/gitstatus \ @@ -205,16 +251,16 @@ APPNAME="$appname".tmp \ CXXFLAGS="$gitstatus_cxxflags" \ LDFLAGS="$gitstatus_ldflags" \ LDLIBS="$gitstatus_ldlibs" \ - "$gitstatus_make" -C "$outdir" -j "$cpus" + command "$gitstatus_make" -C "$outdir" -j "$cpus" app="$outdir"/usrbin/"$appname" -strip "$app".tmp +command strip "$app".tmp -mkdir -- "$workdir"/repo -git -C "$workdir"/repo init -- -git -C "$workdir"/repo config user.email "you@example.com" -git -C "$workdir"/repo commit --allow-empty --allow-empty-message -m '' +command mkdir -- "$workdir"/repo +command git -C "$workdir"/repo init -- +command git -C "$workdir"/repo config user.email "you@example.com" +command git -C "$workdir"/repo commit --allow-empty --allow-empty-message -m '' resp="$(printf "hello\037$workdir/repo\036" | "$app".tmp)" [ -n "$resp" -a -z "${resp##hello*1*$workdir/repo*master*}" ] @@ -222,11 +268,11 @@ resp="$(printf "hello\037$workdir/repo\036" | "$app".tmp)" resp="$(printf 'hello\037\036' | "$app".tmp)" [ -n "$resp" -a -z "${resp##hello*0*}" ] -mv -f -- "$app".tmp "$app" +command mv -f -- "$app".tmp "$app" cleanup -cat >&2 <<-END +command cat >&2 <<-END ------------------------------------------------- SUCCESS: created usrbin/$appname END diff --git a/build.info b/build.info index b38192c5..80dbc452 100644 --- a/build.info +++ b/build.info @@ -5,8 +5,8 @@ # ./install) when gitstatusd is from ./usrbin. gitstatus_version="v1.0.0" -# libgit2 is a build time dependency of gitstatusd. The value of -# libgit2_version is read by ./build. +# libgit2 is a build time dependency of gitstatusd. The values of +# libgit2_version and libgit2_sha256 are read by ./build. # # If ./deps/libgit2-${libgit2_version}.tar.gz doesn't exist, build # downloads it from the following location: @@ -15,4 +15,8 @@ gitstatus_version="v1.0.0" # # Once downloaded, the tarball is stored at the path indicated # above so that repeated builds don't consume network bandwidth. +# +# If sha256 of ./deps/libgit2-${libgit2_version}.tar.gz doesn't match, +# build gets aborted. libgit2_version="tag-005f77dca6dbe8788e55139fa1199fc94cc04f9a" +libgit2_sha256="6af7c839640ed5474fef9761a80b5c24bcdd87abc771406e31d5c2bf27f48be5" diff --git a/gitstatus.plugin.sh b/gitstatus.plugin.sh index c05f6cca..4c9b70f0 100644 --- a/gitstatus.plugin.sh +++ b/gitstatus.plugin.sh @@ -69,7 +69,7 @@ function gitstatus_start() { local gitstatus_plugin_dir="$PWD" fi - local req_fifo resp_fifo + local tmpdir req_fifo resp_fifo function gitstatus_start_impl() { local log_level="${GITSTATUS_LOG_LEVEL:-}" @@ -104,20 +104,22 @@ function gitstatus_start() { --dirty-max-index-size="$max_dirty" $extra_flags) + tmpdir="$(mktemp -d "${TMPDIR:-/tmp}"/gitstatus.bash.$$.XXXXXXXXXX)" || return + if [[ -n "$log_level" ]]; then - GITSTATUS_DAEMON_LOG=$(mktemp "${TMPDIR:-/tmp}"/gitstatus.$$.log.XXXXXXXXXX) || return + GITSTATUS_DAEMON_LOG="$tmpdir"/daemon.log [[ "$log_level" == INFO ]] || daemon_args+=(--log-level="$log_level") else GITSTATUS_DAEMON_LOG=/dev/null fi - req_fifo=$(mktemp -u "${TMPDIR:-/tmp}"/gitstatus.$$.pipe.req.XXXXXXXXXX) || return - resp_fifo=$(mktemp -u "${TMPDIR:-/tmp}"/gitstatus.$$.pipe.resp.XXXXXXXXXX) || return - mkfifo "$req_fifo" "$resp_fifo" || return + req_fifo="$tmpdir"/req.fifo + resp_fifo="$tmpdir"/resp.fifo + mkfifo -- "$req_fifo" "$resp_fifo" || return { ( - trap '' INT + trap '' INT QUIT TSTP [[ "$GITSTATUS_DAEMON_LOG" == /dev/null ]] || set -x builtin cd / @@ -142,7 +144,7 @@ function gitstatus_start() { [[ -n "$_gitstatus_bash_version" ]] || return [[ "$_gitstatus_bash_downloaded" == [01] ]] || return - local sig=(QUIT TERM EXIT ILL PIPE) + local sig=(TERM ILL PIPE) if [[ -x "$_gitstatus_bash_daemon" ]]; then "$_gitstatus_bash_daemon" \ @@ -166,7 +168,7 @@ function gitstatus_start() { _gitstatus_bash_daemon= _gitstatus_bash_version= _gitstatus_bash_downloaded= - source "$gitstatus_plugin_dir"/install || return + source "$gitstatus_plugin_dir"/install || return [[ -n "$_gitstatus_bash_daemon" ]] || return [[ -n "$_gitstatus_bash_version" ]] || return [[ "$_gitstatus_bash_downloaded" == 1 ]] || return @@ -180,13 +182,14 @@ function gitstatus_start() { echo -nE $'bye\x1f0\x1e' >&"$fd_out" ) & disown ) & disown - } 0$GITSTATUS_DAEMON_LOG + } 0"$GITSTATUS_DAEMON_LOG" - exec {_GITSTATUS_REQ_FD}>"$req_fifo" {_GITSTATUS_RESP_FD}<"$resp_fifo" || return - command rm "$req_fifo" "$resp_fifo" || return + exec {_GITSTATUS_REQ_FD}>"$req_fifo" {_GITSTATUS_RESP_FD}<"$resp_fifo" || return + command rm -f -- "$req_fifo" "$resp_fifo" || return + [[ "$GITSTATUS_DAEMON_LOG" != /dev/null ]] || command rmdir -- "$tmpdir" 2>/dev/null IFS='' read -r -u $_GITSTATUS_RESP_FD GITSTATUS_DAEMON_PID || return - [[ $GITSTATUS_DAEMON_PID == [1-9]* ]] || return + [[ "$GITSTATUS_DAEMON_PID" == [1-9]* ]] || return local reply echo -nE $'hello\x1f\x1e' >&$_GITSTATUS_REQ_FD || return diff --git a/install b/install index cc408354..126b8339 100755 --- a/install +++ b/install @@ -159,10 +159,14 @@ END line="${line###*}" [ -n "$line" ] || continue - local uname_s_glob= uname_m_glob= file= version= + local uname_s_glob= uname_m_glob= file= version= sha256= eval "$line" || return - if [ -z "$uname_s_glob" -o -z "$uname_m_glob" -o -z "$file" -o -z "$version" ]; then + if [ -z "$uname_s_glob" -o \ + -z "$uname_m_glob" -o \ + -z "$file" -o \ + -z "$version" -o \ + -z "$sha256" ]; then >&2 echo "[gitstatus] internal error: invalid install.info line: $line" return 1 fi @@ -216,7 +220,20 @@ END fi [ -d "$cache_dir" ] || mkdir -p -- "$cache_dir" || return + local tmpdir + if ! command -v mktemp >/dev/null 2>&1 || + ! tmpdir="$(command mktemp -d "${TMPDIR:-/tmp}"/gitstatus-install.XXXXXXXXXX)"; then + tmpdir="${TMPDIR:-/tmp}/gitstatus-install.tmp.$$" + mkdir -p -- "$tmpdir" || return + fi + ( + if [ -n "${ZSH_VERSION:-}" ]; then + builtin cd -q -- "$tmpdir" || exit + else + cd -- "$tmpdir" || exit + fi + local fetch if command -v curl >/dev/null 2>&1; then fetch="command curl -fsSLo" @@ -229,19 +246,26 @@ END local url1="https://github.com/romkatv/gitstatus/releases/download/$version/$file.tar.gz" local url2="https://gitee.com/romkatv/gitstatus/raw/release-$version/release/$file.tar.gz" - local tmp="$file".tmp.$$ - if [ -n "${ZSH_VERSION:-}" ]; then - builtin cd -q -- "$cache_dir" || exit - else - cd -- "$cache_dir" || exit - fi - - cleanup() { - local n - for n in "$@"; do - command rm -rf -- "$tmp"."$n".tar.gz "$tmp"."$n".status || return - done + check_sha256() { + local file="$1".tar.gz + local hash= + if command -v shasum >/dev/null 2>/dev/null; then + hash="$(command shasum -b -a 256 -- "$file")" || hash= + hash="${hash%% *}" + elif command -v sha256sum >/dev/null 2>/dev/null; then + hash="$(command sha256sum -b -- "$file")" || hash= + hash="${hash%% *}" + elif command -v sha256 >/dev/null 2>/dev/null; then + hash="$(command sha256 -- "$file" /dev/null 2>/dev/null; then sleep "$1" fi - $fetch "$tmp"."$1".tar.gz -- "$2" 2>/dev/null & + $fetch "$1".tar.gz -- "$2" 2>/dev/null & local pid=$! - local die="trap - $sig; kill -- $pid 2>/dev/null; cleanup $1; exit 1" + local die="trap - $sig; kill -- $pid 2>/dev/null; exit 1" trap "$die" $sig [ -z "$trapped" ] || eval "$die" - wait -- "$pid" 2>/dev/null + wait -- "$pid" 2>/dev/null && check_sha256 "$1" local ret="$?" - echo -n >"$tmp"."$1".status + echo -n >"$1".status trap - $sig return "$ret" } @@ -273,7 +295,7 @@ END fetch 2 "$url2" & local pid2=$! - local die="trap - $sig; kill -- $pid1 $pid2 2>/dev/null; cleanup 1 2; exit 1" + local die="trap - $sig; kill -- $pid1 $pid2 2>/dev/null; exit 1" trap "$die" $sig [ -z "$trapped" ] || eval "$die" @@ -285,7 +307,7 @@ END elif command -v true >/dev/null 2>/dev/null; then command true fi - if [ -n "$pid1" -a -e "$tmp".1.status ]; then + if [ -n "$pid1" -a -e 1.status ]; then wait -- "$pid1" 2>/dev/null local ret="$?" pid1= @@ -296,7 +318,7 @@ END elif [ -z "$pid2" ]; then break fi - elif [ -n "$pid2" -a -e "$tmp".2.status ]; then + elif [ -n "$pid2" -a -e 2.status ]; then wait -- "$pid2" 2>/dev/null local ret="$?" pid2= @@ -317,36 +339,28 @@ END >&2 echo "" >&2 echo " 1. $url1" >&2 echo " 2. $url2" - cleanup 1 2 exit 1 fi - local old= - if [ -e "$daemon" ]; then - local i=1 - while :; do - old="$daemon"."$i" - [ -e "$old" ] || break - i="$((i+1))" - done - if ! command mv -f -- "$daemon" "$old"; then - cleanup 1 2 - exit 1 - fi + command tar -xzf "$n".tar.gz || exit + + local tmpfile + if ! command -v mktemp >/dev/null 2>&1 || + ! tmpfile="$(command mktemp "$cache_dir"/gitstatusd.XXXXXXXXXX)"; then + tmpfile="$cache_dir"/gitstatusd.tmp.$$ fi - command tar -xzf "$tmp"."$n".tar.gz - local ret=$? - cleanup 1 2 - if [ -n "$old" ]; then - if [ "$ret" = 0 ]; then - command rm -f -- "$old" 2>/dev/null - else - command mv -f -- "$old" "$daemon" - fi - fi - exit "$ret" - ) || return + command mv -f -- gitstatusd-* "$tmpfile" || exit + command mv -f -- "$tmpfile" "$cache_dir"/"$file" && exit + command rm -f -- "$cache_dir"/"$file" + command mv -f -- "$tmpfile" "$cache_dir"/"$file" && exit + command rm -f -- "$tmpfile" + exit 1 + ) + + local ret=$? + command rm -rf -- "$tmpdir" + [ "$ret" = 0 ] || return [ $# = 0 ] || "$@" "$daemon" "$version" 1 return diff --git a/install.info b/install.info index 96458f0d..35260b7f 100644 --- a/install.info +++ b/install.info @@ -6,24 +6,24 @@ # be updated whenever the content of this file changes. # Official gitstatusd binaries. -uname_s_glob="cygwin_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; -uname_s_glob="cygwin_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; -uname_s_glob="darwin"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; -uname_s_glob="freebsd"; uname_m_glob="amd64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; -uname_s_glob="linux"; uname_m_glob="aarch64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; -uname_s_glob="linux"; uname_m_glob="armv6l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; -uname_s_glob="linux"; uname_m_glob="armv7l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; -uname_s_glob="linux"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; -uname_s_glob="linux"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; -uname_s_glob="msys_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; -uname_s_glob="msys_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; +uname_s_glob="cygwin_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="c38342c7a70842067074710250fd8cebea87ae111f032277c2c70a77179b5355"; +uname_s_glob="cygwin_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="d30b455e371cd0895c9bd1ff87b8a27e6c3f3c2970b4e993e93fe1a6943962ad"; +uname_s_glob="darwin"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="c71b30027b3c763faa3ff7ad09d66c84403851fafcf798bf5e629b98c2b8384a"; +uname_s_glob="freebsd"; uname_m_glob="amd64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="a72d4c5da2f9594bf1c4153d841bf61a35cbcbb8b74818649b1375902e9d9534"; +uname_s_glob="linux"; uname_m_glob="aarch64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="eb7f125d43c29f955239ef4014ab652b9162bbbb6c81c40f1d5ead46a209866e"; +uname_s_glob="linux"; uname_m_glob="armv6l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="051a9448d9cb4bb1d95e93cff51a6ab48a085465ec30eec40046977d4213feff"; +uname_s_glob="linux"; uname_m_glob="armv7l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="adaa47c8e8dec1e1e8686c3044ee0f45afda15deaa8388efcb4952747b66246e"; +uname_s_glob="linux"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="c80355664e7361e11215e64b523ed75a3d39f72393fa2204fefa85eae0342a67"; +uname_s_glob="linux"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="e33867063f091d3c31ede9916fef079ff8cd6fdcc70d051914f962ab3b8f36fd"; +uname_s_glob="msys_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="2cf6ff92a5c50e4181ceb402217162bebd5e52144eb52eacfef2f6d47d5c20d4"; +uname_s_glob="msys_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="960c3d9d90d7b96257a9746f7168faffdf9b5fbda464e354e7b14c42cc473f15"; # Fallbacks to official gitstatusd binaries. -uname_s_glob="cygwin_nt-*"; uname_m_glob="i686"; file="gitstatusd-cygwin_nt-10.0-${uname_m}"; version="v1.0.0"; -uname_s_glob="cygwin_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-cygwin_nt-10.0-${uname_m}"; version="v1.0.0"; -uname_s_glob="mingw32_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0"; -uname_s_glob="mingw32_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0"; -uname_s_glob="mingw64_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0"; -uname_s_glob="mingw64_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0"; -uname_s_glob="msys_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0"; -uname_s_glob="msys_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0"; +uname_s_glob="cygwin_nt-*"; uname_m_glob="i686"; file="gitstatusd-cygwin_nt-10.0-${uname_m}"; version="v1.0.0"; sha256="c38342c7a70842067074710250fd8cebea87ae111f032277c2c70a77179b5355"; +uname_s_glob="cygwin_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-cygwin_nt-10.0-${uname_m}"; version="v1.0.0"; sha256="d30b455e371cd0895c9bd1ff87b8a27e6c3f3c2970b4e993e93fe1a6943962ad"; +uname_s_glob="mingw32_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0"; sha256="2cf6ff92a5c50e4181ceb402217162bebd5e52144eb52eacfef2f6d47d5c20d4"; +uname_s_glob="mingw32_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0"; sha256="960c3d9d90d7b96257a9746f7168faffdf9b5fbda464e354e7b14c42cc473f15"; +uname_s_glob="mingw64_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0"; sha256="2cf6ff92a5c50e4181ceb402217162bebd5e52144eb52eacfef2f6d47d5c20d4"; +uname_s_glob="mingw64_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0"; sha256="960c3d9d90d7b96257a9746f7168faffdf9b5fbda464e354e7b14c42cc473f15"; +uname_s_glob="msys_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0"; sha256="2cf6ff92a5c50e4181ceb402217162bebd5e52144eb52eacfef2f6d47d5c20d4"; +uname_s_glob="msys_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0"; sha256="960c3d9d90d7b96257a9746f7168faffdf9b5fbda464e354e7b14c42cc473f15"; diff --git a/mbuild b/mbuild index a1a8cda8..c5d5c87f 100755 --- a/mbuild +++ b/mbuild @@ -46,7 +46,7 @@ # ps> C:\msys64\autorebase.bat # - Install 64-bit and 32-bit cygwin: https://cygwin.com/install.html. # - Choose to install 32-bit to c:/cygwin32 instead of the default c:/cygwin. -# - Select these packages: binutils, cmake, gcc-core, gcc-g++, git, make, wget. +# - Select these packages: binutils, cmake, gcc-core, gcc-g++, git, make, perl, wget. # # IMPORTANT: Install msys2 and cygwin one at a time. # From d0f6cd0b500cad9d6dfad3873f21b4e8f0959cbb Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 13 May 2020 10:44:19 +0200 Subject: [PATCH 010/659] update build instructions --- README.md | 87 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 61 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 42186e0c..cf29c3cf 100644 --- a/README.md +++ b/README.md @@ -1112,46 +1112,81 @@ If everything goes well, four `ttf` files will appear in `./out`. ### How to package Powerlevel10k for distribution? -If you want to package Powerlevel10k, it's best to do it based off releases. In a nutshell, you -need to download Powerlevel10k tarball, build gitstatusd and compile zsh files. +If you want to package Powerlevel10k, it's best to do it based off [releases]( + https://github.com/romkatv/powerlevel10k/releases). -The following code should work. If it doesn't, please open an issue. +The following code should work without patching anything in Powerlevel10k sources. If it doesn't, +please open an issue. **IMPORTANT:** *Change version to what you want to package. This example doesn't get updated when new versions are released.* ```zsh -curl -fsSLO https://github.com/romkatv/powerlevel10k/archive/v1.8.0.tar.gz -tar -xzf v1.8.0.tar.gz -cd powerlevel10k-1.8.0 -( - cd gitstatus - . ./build.info - curl -fsSLo \ - deps/libgit2-"$libgit2_version".tar.gz \ - https://github.com/romkatv/libgit2/archive/"$libgit2_version".tar.gz - ./build - rm deps/libgit2-*.tar.gz -) +# Download and extract Powerlevel10k tarball. +powerlevel10k_version=1.8.2 # IMPORTANT: CHANGE VERSION TO WHAT YOU WANT +wget https://github.com/romkatv/powerlevel10k/archive/v"$powerlevel10k_version".tar.gz +tar -xzf v"$powerlevel10k_version".tar.gz +cd powerlevel10k-"$powerlevel10k_version" + +# Download libgit2 tarball and compile gitstatusd. +./gitstatus/build -w + +# Post-process. +rm ./gitstatus/deps/libgit2-*.tar.gz for file in *.zsh-theme internal/*.zsh gitstatus/*.zsh gitstatus/install; do zsh -fc "emulate zsh -o no_aliases && zcompile -R -- $file.zwc $file" done ``` -This needs binutils, cmake, gcc, g++, git, GNU make and zsh. - -Depending on your workflow, it might be easier to store the URL to the libgit2 tarball in the -same place where you are going to put the main powerlevel10k tarball URL. You'll need to update both -URLs at the same time when bumping package version. +This needs binutils, cmake, gcc, g++, git, GNU make, wget, zsh and either shasum or sha256sum. Once build completes, *do not delete or move any files*. Package the whole directory as is. Don't -add it (or any of its subdirectories) to `PATH`. +add the directory or any of its subdirectories to `PATH`. -Note that Powerlevel10k has an embedded version of gitstatus. It must stay that way. The embedded -gitstatus won't conflict with the standalone version. They can have different versions and can -coexist within the same Zsh process. Do not attempt to surgically remove gitstatus from -Powerlevel10k, package the result and then somehow force Powerlevel10k to use a separately packaged -gitstatus. +You probably don't want to build in docker, so don't pass `-d` to `./gitstatus/build`. + +gitstatus depends on a [custom fork of libgit2](https://github.com/romkatv/libgit2/). When you run +`./gitstatus/build -w`, it'll automatically download the appropriate libgit2 tarball and verify its +sha256. If you want to separate the downloading of source tarballs from compilation, you can +download the libgit2 tarball manually and invoke `./gitstatus/build` without `-w`. + +```zsh +# Download and extract Powerlevel10k tarball. +powerlevel10k_version=1.8.2 # IMPORTANT: CHANGE VERSION TO WHAT YOU WANT +wget https://github.com/romkatv/powerlevel10k/archive/v"$powerlevel10k_version".tar.gz +tar -xzf v"$powerlevel10k_version".tar.gz +cd powerlevel10k-"$powerlevel10k_version" + +# Download libgit2 tarball and place it where ./gitstatus/build expects it. +. ./gitstatus/build.info +libgit2_path=./gitstatus/deps/libgit2-"$libgit2_version".tar.gz +libgit2_url=https://github.com/romkatv/libgit2/archive/"$libgit2_version".tar.gz +wget -O "$libgit2_path" "$libgit2_url" + +# Compile gitstatusd. +./gitstatus/build + +# Post-process. +rm ./gitstatus/deps/libgit2-*.tar.gz +for file in *.zsh-theme internal/*.zsh gitstatus/*.zsh gitstatus/install; do + zsh -fc "emulate zsh -o no_aliases && zcompile -R -- $file.zwc $file" +done +``` + +Note that the URL and the content of the libgit2 tarball are fully defined by the main Powerlevel10k +tarball. Thus, you can set URLs and sha256 checksums of the two tarball in the same place (package +definition) and update them at the same time when bumping package version. In other words, you don't +have to extract `libgit2_version` programmatically. You can manually copy it from [build.info]( + https://github.com/romkatv/powerlevel10k/blob/master/gitstatus/build.info) to your package +definition, if you prefer. + +Powerlevel10k has an embedded version of [gitstatus](https://github.com/romkatv/gitstatus). It must +stay that way. If you decide to package both of them, follow the respective instructions from each +project. The embedded gitstatus in Powerlevel10k won't conflict with the standalone gitstatus. They +can have different versions and can coexist within the same Zsh process. Do not attempt to +surgically remove gitstatus from Powerlevel10k, package the result and then force Powerlevel10k to +use a separately packaged gitstatus. Instead, treat Powerlevel10k and gitstatus as independent +projects that don't depend on each other. ## Troubleshooting From 46c76dd7071bedab192aa65756ba09024e29da0c Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 13 May 2020 10:44:36 +0200 Subject: [PATCH 011/659] Squashed 'gitstatus/' changes from 1a80249d..caf5bfd3 caf5bfd3 update build instructions 8bbfd153 update build instructions git-subtree-dir: gitstatus git-subtree-split: caf5bfd3d4b6099aeed13604936976e610a08e18 --- README.md | 86 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 61 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 0063dca9..aa63eec5 100644 --- a/README.md +++ b/README.md @@ -468,45 +468,81 @@ this case you'll need to rebuild. ### Compiling for distribution -If you want to package gitstatus, it's best to do it based off releases. You also probably don't -want to build in docker (`-d docker`) or to allow automatic downloading of libgit2 tarballs (`-w`). +If you want to package gitstatus, it's best to do it based off [releases]( + https://github.com/romkatv/gitstatus/releases). -The following code should work. If it doesn't, please open an issue. +The following code should work without patching anything in gitstatus sources. If it doesn't, please +open an issue. **IMPORTANT:** *Change version to what you want to package. This example doesn't get updated when new versions are released.* ```zsh -curl -fsSLO https://github.com/romkatv/gitstatus/archive/v1.0.0.tar.gz -tar -xzf v1.0.0.tar.gz -cd gitstatus-1.0.0 -( - . ./build.info - curl -fsSLo \ - deps/libgit2-"$libgit2_version".tar.gz \ - https://github.com/romkatv/libgit2/archive/"$libgit2_version".tar.gz -) -./build -rm deps/libgit2-*.tar.gz +# Download and extract gitstatus tarball. +gitstatus_version=1.0.0 # IMPORTANT: CHANGE VERSION TO WHAT YOU WANT +wget https://github.com/romkatv/gitstatus/archive/v"$gitstatus_version".tar.gz +tar -xzf v"$gitstatus_version".tar.gz +cd gitstatus-"$gitstatus_version" + +# Download libgit2 tarball and compile gitstatusd. +./build -w + +# Post-process. +rm ./deps/libgit2-*.tar.gz for file in *.zsh install; do zsh -fc "emulate zsh -o no_aliases && zcompile -R -- $file.zwc $file" done ``` -This needs binutils, cmake, gcc, g++, git, GNU make and zsh. - -Depending on your workflow, it might be easier to store the URL to the libgit2 tarball in the -same place where you are going to put the main gitstatus tarball URL. You'll need to update both -URLs at the same time when bumping package version. +This needs binutils, cmake, gcc, g++, git, GNU make, wget, zsh and either shasum or sha256sum. Once build completes, *do not delete or move any files*. Package the whole directory as is. Don't -add it (or any of its subdirectories) to `PATH`. +add the directory or any of its subdirectories to `PATH`. -Note that Powerlevel10k has an embedded version of gitstatus. It must stay that way. The embedded -gitstatus won't conflict with the standalone version. They can have different versions and can -coexist within the same Zsh process. Do not attempt to surgically remove gitstatus from -Powerlevel10k, package the result and then somehow force Powerlevel10k to use a separately packaged -gitstatus. +You probably don't want to build in docker, so don't pass `-d` to `./build`. + +gitstatus depends on a [custom fork of libgit2](https://github.com/romkatv/libgit2/). When you run +`./build -w`, it'll automatically download the appropriate libgit2 tarball and verify its sha256. +If you want to separate the downloading of source tarballs from compilation, you can download the +libgit2 tarball manually and invoke `./build` without `-w`. + +```zsh +# Download and extract gitstatus tarball. +gitstatus_version=1.0.0 # IMPORTANT: CHANGE VERSION TO WHAT YOU WANT +wget https://github.com/romkatv/gitstatus/archive/v"$gitstatus_version".tar.gz +tar -xzf v"$gitstatus_version".tar.gz +cd gitstatus-"$gitstatus_version" + +# Download libgit2 tarball and place it where ./build expects it. +. ./build.info +libgit2_path=./deps/libgit2-"$libgit2_version".tar.gz +libgit2_url=https://github.com/romkatv/libgit2/archive/"$libgit2_version".tar.gz +wget -O "$libgit2_path" "$libgit2_url" + +# Compile gitstatusd. +./build + +# Post-process. +rm ./deps/libgit2-*.tar.gz +for file in *.zsh install; do + zsh -fc "emulate zsh -o no_aliases && zcompile -R -- $file.zwc $file" +done +``` + +Note that the URL and the content of the libgit2 tarball are fully defined by the main gitstatus +tarball. Thus, you can set URLs and sha256 checksums of the two tarball in the same place (package +definition) and update them at the same time when bumping package version. In other words, you don't +have to extract `libgit2_version` programmatically. You can manually copy it from [build.info]( + https://github.com/romkatv/gitstatus/blob/master/build.info) to your package definition, if you +prefer. + +[Powerlevel10k](https://github.com/romkatv/powerlevel10k) has an embedded version of gitstatus. It +must stay that way. If you decide to package both of them, follow the respective instructions from +each project. The embedded gitstatus in Powerlevel10k won't conflict with the standalone gitstatus. +They can have different versions and can coexist within the same Zsh process. Do not attempt to +surgically remove gitstatus from Powerlevel10k, package the result and then force Powerlevel10k to +use a separately packaged gitstatus. Instead, treat Powerlevel10k and gitstatus as independent +projects that don't depend on each other. ## License From 6f5e834b8ea1f21aae07783b8f85ca057d9753a0 Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 13 May 2020 12:48:04 +0200 Subject: [PATCH 012/659] update version in packaging instructions --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cf29c3cf..1c952a7a 100644 --- a/README.md +++ b/README.md @@ -1123,7 +1123,7 @@ new versions are released.* ```zsh # Download and extract Powerlevel10k tarball. -powerlevel10k_version=1.8.2 # IMPORTANT: CHANGE VERSION TO WHAT YOU WANT +powerlevel10k_version=1.9.0 # IMPORTANT: CHANGE VERSION TO WHAT YOU WANT wget https://github.com/romkatv/powerlevel10k/archive/v"$powerlevel10k_version".tar.gz tar -xzf v"$powerlevel10k_version".tar.gz cd powerlevel10k-"$powerlevel10k_version" @@ -1152,7 +1152,7 @@ download the libgit2 tarball manually and invoke `./gitstatus/build` without `-w ```zsh # Download and extract Powerlevel10k tarball. -powerlevel10k_version=1.8.2 # IMPORTANT: CHANGE VERSION TO WHAT YOU WANT +powerlevel10k_version=1.9.0 # IMPORTANT: CHANGE VERSION TO WHAT YOU WANT wget https://github.com/romkatv/powerlevel10k/archive/v"$powerlevel10k_version".tar.gz tar -xzf v"$powerlevel10k_version".tar.gz cd powerlevel10k-"$powerlevel10k_version" From 7e6abbb89174f1347c1f5bbe0b52204ec8b8b6b2 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 14 May 2020 09:55:13 +0200 Subject: [PATCH 013/659] maintain _p9k_dumped_instant_prompt_sigs invariant --- internal/p10k.zsh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index f5df728c..ff7f0c4f 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5577,7 +5577,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=22 +typeset -gri __p9k_instant_prompt_version=23 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -5879,7 +5879,9 @@ _p9k_dump_instant_prompt() { echo -nE - "${(%):-%b%k%f%s%u$mark${(pl.$fill.. .)}$cr%b%k%f%s%u%E}" fi zmodload -F zsh/files b:zf_rm - zf_rm -f -- $__p9k_instant_prompt_output ${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh{,.zwc} 2>/dev/null + local user=${(%):-%n} + local root_dir=${__p9k_instant_prompt_dump_file:h} + zf_rm -f -- $__p9k_instant_prompt_output $__p9k_instant_prompt_dump_file{,.zwc} $root_dir/p10k-instant-prompt-$user.zsh{,.zwc} $root_dir/p10k-$user/prompt-*(N) 2>/dev/null } setopt no_local_options prompt_cr prompt_sp } @@ -6024,6 +6026,7 @@ function _p9k_restore_state() { (( $+functions[gitstatus_stop_p9k_] )) && gitstatus_stop_p9k_ POWERLEVEL9K fi _p9k_delete_instant_prompt + zf_rm -f -- $__p9k_dump_file{,.zwc} 2>/dev/null fi } } @@ -6345,6 +6348,7 @@ _p9k_precmd_impl() { ;; 2) _p9k_delete_instant_prompt + zf_rm -f -- $__p9k_dump_file{,.zwc} 2>/dev/null instant_prompt_disabled=1 ;; esac @@ -7984,6 +7988,7 @@ _p9k_init() { if (( _POWERLEVEL9K_DISABLE_INSTANT_PROMPT )); then unset __p9k_instant_prompt_erased _p9k_delete_instant_prompt + _p9k_dumped_instant_prompt_sigs=() fi if (( $+__p9k_instant_prompt_erased )); then @@ -8422,11 +8427,14 @@ zmodload -F zsh/net/socket b:zsocket zmodload -F zsh/files b:zf_mv b:zf_rm if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_prompt_dump_file ]]; then - zf_rm -f -- $__p9k_instant_prompt_dump_file 2>/dev/null + _p9k_delete_instant_prompt + zf_rm -f -- $__p9k_dump_file{,.zwc} 2>/dev/null + zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null fi if [[ $+__p9k_instant_prompt_sourced == 1 && $__p9k_instant_prompt_sourced != $__p9k_instant_prompt_version ]]; then _p9k_delete_instant_prompt + zf_rm -f -- $__p9k_dump_file{,.zwc} 2>/dev/null fi _p9k_init_ssh From 574754eaf6132467516a0ad85b5142e16890c533 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 14 May 2020 11:24:30 +0200 Subject: [PATCH 014/659] abort instant prompt if wizard needs to run on startup --- internal/p10k.zsh | 47 ++++++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index ff7f0c4f..2153309c 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6333,25 +6333,34 @@ _p9k_precmd_impl() { __p9k_configured=1 if [[ -z "${parameters[(I)POWERLEVEL9K_*~(POWERLEVEL9K_MODE|POWERLEVEL9K_CONFIG_FILE)]}" ]]; then _p9k_can_configure -q - case $? in - 0) - ( - source "$__p9k_root_dir"/internal/wizard.zsh - ) - if (( $? )); then - instant_prompt_disabled=1 - else - source "$__p9k_cfg_path" - _p9k__force_must_init=1 - _p9k_must_init - fi - ;; - 2) - _p9k_delete_instant_prompt - zf_rm -f -- $__p9k_dump_file{,.zwc} 2>/dev/null + local -i ret=$? + if (( ret == 2 && $+__p9k_instant_prompt_active )); then + _p9k_clear_instant_prompt + unset __p9k_instant_prompt_active + _p9k_delete_instant_prompt + zf_rm -f -- $__p9k_dump_file{,.zwc} 2>/dev/null + () { + local key + while true; do + [[ -t 2 ]] + read -t0 -k key || break + done 2>/dev/null + } + _p9k_can_configure -q + ret=$? + fi + if (( ret == 0 )); then + ( + source "$__p9k_root_dir"/internal/wizard.zsh + ) + if (( $? )); then instant_prompt_disabled=1 - ;; - esac + else + source "$__p9k_cfg_path" + _p9k__force_must_init=1 + _p9k_must_init + fi + fi fi fi _p9k_init @@ -7985,7 +7994,7 @@ _p9k_init() { _p9k_init_vcs - if (( _POWERLEVEL9K_DISABLE_INSTANT_PROMPT )); then + if (( _p9k__instant_prompt_disabled )); then unset __p9k_instant_prompt_erased _p9k_delete_instant_prompt _p9k_dumped_instant_prompt_sigs=() From accbe293cb4de46139985dbb347133a453d6f7e2 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 14 May 2020 11:24:53 +0200 Subject: [PATCH 015/659] wizard: print a message when aborted with ctrl-c --- internal/wizard.zsh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index c33f6a11..9be45814 100755 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -23,6 +23,8 @@ else function restore_screen() {} fi +local -i success=0 + { # always local -ri force @@ -234,7 +236,10 @@ function show_cursor() { function consume_input() { local key - while read -t0 key; do true; done + while true; do + [[ -t 2 ]] + read -t0 -k key || break + done 2>/dev/null } function quit() { @@ -271,6 +276,7 @@ function quit() { print -P " %2Fp10k%f %Bconfigure%b" print -P "" fi + function quit() {} exit 1 } @@ -2051,7 +2057,10 @@ print -rP "" flowing +c File feature requests and bug reports at "$(href https://github.com/romkatv/powerlevel10k/issues)" print -rP "" +success=1 + } always { + (( success )) || quit consume_input stty echo 2>/dev/null show_cursor From 3ddb8025d5af9b31edf687098ecc41c5ed737c82 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 14 May 2020 12:06:46 +0200 Subject: [PATCH 016/659] fix POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN example --- README.md | 2 +- config/p10k-classic.zsh | 2 +- config/p10k-lean-8colors.zsh | 2 +- config/p10k-lean.zsh | 2 +- config/p10k-rainbow.zsh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1c952a7a..78ca7ec1 100644 --- a/README.md +++ b/README.md @@ -788,7 +788,7 @@ When using Lean, Classic or Rainbow style, `~/.p10k.zsh` contains the following ```zsh # Don't show Git status in prompt for repositories whose workdir matches this pattern. # For example, if set to '~', the Git repository at $HOME/.git will be ignored. -# Multiple patterns can be combined with '|': '~|~/some/dir'. +# Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' ``` diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 5f754231..2620f4a4 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -436,7 +436,7 @@ # Don't show Git status in prompt for repositories whose workdir matches this pattern. # For example, if set to '~', the Git repository at $HOME/.git will be ignored. - # Multiple patterns can be combined with '|': '~|~/some/dir'. + # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' # Disable the default Git status formatting. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index dc1530a0..9ba9ce25 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -430,7 +430,7 @@ # Don't show Git status in prompt for repositories whose workdir matches this pattern. # For example, if set to '~', the Git repository at $HOME/.git will be ignored. - # Multiple patterns can be combined with '|': '~|~/some/dir'. + # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' # Disable the default Git status formatting. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 6dcf87c9..0ef3e545 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -430,7 +430,7 @@ # Don't show Git status in prompt for repositories whose workdir matches this pattern. # For example, if set to '~', the Git repository at $HOME/.git will be ignored. - # Multiple patterns can be combined with '|': '~|~/some/dir'. + # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' # Disable the default Git status formatting. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 2162e2ca..327c99c5 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -436,7 +436,7 @@ # Don't show Git status in prompt for repositories whose workdir matches this pattern. # For example, if set to '~', the Git repository at $HOME/.git will be ignored. - # Multiple patterns can be combined with '|': '~|~/some/dir'. + # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' # Disable the default Git status formatting. From 2841cecaa9a9abe395f799aa519937548de960bd Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 14 May 2020 20:19:09 +0200 Subject: [PATCH 017/659] fix ask_python screen in the wizard --- internal/wizard.zsh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 9be45814..97a98ab2 100755 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -710,16 +710,16 @@ function ask_lock() { } function ask_python() { - add_widget 0 add_widget 0 flowing -c %BDoes this look like a "%b%2FPython logo%f%B?%b" - add_widget 0 add_widget 0 flowing -c reference: "$(href https://fontawesome.com/icons/python)" - add_widget 0 add_widget 0 print -P "" - add_widget 0 add_widget 0 flowing -c -- "---> \uE63C <---" - add_widget 0 add_widget 0 print -P "" - add_widget 0 add_widget 0 print -P "%B(y) Yes.%b" - add_widget 0 add_widget 0 print -P "" - add_widget 0 add_widget 0 print -P "%B(n) No.%b" - add_widget 0 add_widget 0 print -P "" - add_widget 0 add_widget 0 print -P "(r) Restart from the beginning." + add_widget 0 flowing -c %BDoes this look like a "%b%2FPython logo%f%B?%b" + add_widget 0 flowing -c reference: "$(href https://fontawesome.com/icons/python)" + add_widget 0 print -P "" + add_widget 0 flowing -c -- "---> \uE63C <---" + add_widget 0 print -P "" + add_widget 0 print -P "%B(y) Yes.%b" + add_widget 0 print -P "" + add_widget 0 print -P "%B(n) No.%b" + add_widget 0 print -P "" + add_widget 0 print -P "(r) Restart from the beginning." ask ynr case $choice in r) return 1;; From d9b90027ba74569780632bfba4c1b7e737838a40 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 14 May 2020 20:26:16 +0200 Subject: [PATCH 018/659] disable tty echo for the whole duration of wizard --- internal/wizard.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 97a98ab2..b72212d5 100755 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -310,7 +310,6 @@ functions -M get_columns 0 0 function render_screen() { { hide_cursor - stty -echo 2>/dev/null while true; do while true; do typeset -gi wizard_columns='get_columns()' @@ -362,7 +361,6 @@ function render_screen() { done done } always { - stty echo 2>/dev/null show_cursor } } @@ -1919,6 +1917,8 @@ else local -ir has_truecolor=0 fi +stty -echo 2>/dev/null + while true; do local instant_prompt=verbose zshrc_content= zshrc_backup= zshrc_backup_u= local -i zshrc_has_cfg=0 zshrc_has_instant_prompt=0 write_zshrc=0 From 9f33d6567bf835c84b717f3c3251ef576e61b065 Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 15 May 2020 06:59:29 +0200 Subject: [PATCH 019/659] work around bugs in zsh that break vim shell; see #717 --- internal/p10k.zsh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 2153309c..11433d8d 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5577,7 +5577,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=23 +typeset -gri __p9k_instant_prompt_version=24 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -5629,7 +5629,7 @@ _p9k_dump_instant_prompt() { __p9k_instant_prompt_sourced=0 return 1 fi - zmodload zsh/langinfo + zmodload zsh/langinfo zsh/terminfo zsh/system || return if [[ $langinfo[CODESET] != (utf|UTF)(-|)8 ]]; then local loc_cmd=$commands[locale] [[ -z $loc_cmd ]] && loc_cmd='${(q)commands[locale]}' @@ -5641,7 +5641,6 @@ _p9k_dump_instant_prompt() { fi fi fi - zmodload zsh/terminfo (( $+terminfo[cuu] && $+terminfo[cuf] && $+terminfo[ed] && $+terminfo[sc] && $+terminfo[rc] )) || return local pwd=${(%):-%/} local prompt_file=$prompt_dir/prompt-${#pwd} @@ -5657,8 +5656,8 @@ _p9k_dump_instant_prompt() { else >&$fd print -r -- ' typeset -gx P9K_TTY=old - zmodload -F zsh/stat b:zstat - zmodload zsh/datetime + zmodload -F zsh/stat b:zstat || return + zmodload zsh/datetime || return local -a stat if zstat -A stat +ctime -- $TTY 2>/dev/null && (( EPOCHREALTIME - stat[1] < '$_POWERLEVEL9K_NEW_TTY_MAX_AGE_SECONDS' )); then @@ -5784,11 +5783,10 @@ _p9k_dump_instant_prompt() { fi >&$fd print -r -- ' if (( LINES == '$bad_lines' && COLUMNS == '$bad_columns' )); then - zmodload -F zsh/stat b:zstat - zmodload zsh/datetime + zmodload -F zsh/stat b:zstat || return + zmodload zsh/datetime || return local -a tty_ctime if ! zstat -A tty_ctime +ctime -- $TTY 2>/dev/null || (( tty_ctime[1] + 2 > EPOCHREALTIME )); then - zmodload zsh/datetime local -F deadline=$((EPOCHREALTIME+0.025)) local tty_size while true; do @@ -5854,8 +5852,10 @@ _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 - exec {__p9k_fd_0}<&0 {__p9k_fd_1}>&1 {__p9k_fd_2}>&2 0$__p9k_instant_prompt_output - exec 2>&1 + 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 + exec 2>&1 {fd_null}>&- typeset -gi __p9k_instant_prompt_active=1 typeset -g __p9k_instant_prompt_dump_file=${XDG_CACHE_HOME:-~/.cache}/p10k-dump-${(%):-%n}.zsh if source $__p9k_instant_prompt_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then @@ -5878,7 +5878,7 @@ _p9k_dump_instant_prompt() { local -i fill=$((COLUMNS > _p9k__ret ? COLUMNS - _p9k__ret : 0)) echo -nE - "${(%):-%b%k%f%s%u$mark${(pl.$fill.. .)}$cr%b%k%f%s%u%E}" fi - zmodload -F zsh/files b:zf_rm + zmodload -F zsh/files b:zf_rm || return local user=${(%):-%n} local root_dir=${__p9k_instant_prompt_dump_file:h} zf_rm -f -- $__p9k_instant_prompt_output $__p9k_instant_prompt_dump_file{,.zwc} $root_dir/p10k-instant-prompt-$user.zsh{,.zwc} $root_dir/p10k-$user/prompt-*(N) 2>/dev/null @@ -6212,7 +6212,7 @@ function _p9k_on_expand() { if (( ! _p9k__expanded )); then if _p9k_should_dump; then - exec {_p9k__state_dump_fd} Date: Fri, 15 May 2020 18:06:30 +0200 Subject: [PATCH 020/659] Squashed 'gitstatus/' changes from caf5bfd3..4c1b9564 4c1b9564 Merge pull request #128 from carlosedp/arch 1d2816f2 Add support to build on ppc64le and riscv64 archs 5614639c update version in packaging instructions d728a1da add homebrew installation instructions; fixed #118 git-subtree-dir: gitstatus git-subtree-split: 4c1b95643bc78dfe8e4d9566823b72881637c2ef --- README.md | 24 ++++++++++++++++++++++-- build | 20 ++++++++++++++++---- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index aa63eec5..014b4e67 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,16 @@ git clone --depth=1 https://github.com/romkatv/gitstatus.git ~/gitstatus echo 'source ~/gitstatus/gitstatus.prompt.zsh' >>! ~/.zshrc ``` +Alternatively, on macOS you can install with Homebrew: + +```zsh +brew install romkatv/gitstatus/gitstatus +echo 'source /usr/local/opt/gitstatus/gitstatus.prompt.zsh' >>! ~/.zshrc +``` + +(If you choose this option, replace `~/gitstatus` with `/usr/local/opt/gitstatus` in all code +snippets below.) + _Make sure to disable your current theme if you have one._ This will give you a basic yet functional prompt with git status in it. It's @@ -118,6 +128,16 @@ git clone --depth=1 https://github.com/romkatv/gitstatus.git ~/gitstatus echo 'source ~/gitstatus/gitstatus.prompt.sh' >> ~/.bashrc ``` +Alternatively, on macOS you can install with Homebrew: + +```zsh +brew install romkatv/gitstatus/gitstatus +echo 'source /usr/local/opt/gitstatus/gitstatus.prompt.sh' >> ~/.bashrc +``` + +(If you choose this option, replace `~/gitstatus` with `/usr/local/opt/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. @@ -479,7 +499,7 @@ new versions are released.* ```zsh # Download and extract gitstatus tarball. -gitstatus_version=1.0.0 # IMPORTANT: CHANGE VERSION TO WHAT YOU WANT +gitstatus_version=1.1.0 # IMPORTANT: CHANGE VERSION TO WHAT YOU WANT wget https://github.com/romkatv/gitstatus/archive/v"$gitstatus_version".tar.gz tar -xzf v"$gitstatus_version".tar.gz cd gitstatus-"$gitstatus_version" @@ -508,7 +528,7 @@ libgit2 tarball manually and invoke `./build` without `-w`. ```zsh # Download and extract gitstatus tarball. -gitstatus_version=1.0.0 # IMPORTANT: CHANGE VERSION TO WHAT YOU WANT +gitstatus_version=1.1.0 # IMPORTANT: CHANGE VERSION TO WHAT YOU WANT wget https://github.com/romkatv/gitstatus/archive/v"$gitstatus_version".tar.gz tar -xzf v"$gitstatus_version".tar.gz cd gitstatus-"$gitstatus_version" diff --git a/build b/build index 39daaedd..b0caeff6 100755 --- a/build +++ b/build @@ -17,8 +17,8 @@ Options: -m ARCH `uname -m` from the target machine; defaults to `uname -m` from the local machine -c CPU generate machine instructions for CPU of this type; this - value gets passed as `-march` to gcc; inferred from ARCH - if not set explicitly + value gets passed as `-march` (or `-mcpu` for ppc64le) to gcc; + inferred from ARCH if not set explicitly -d CMD build in a Docker container and use CMD as the `docker` command; e.g., `-d docker` or `-d podman` -i IMAGE build in this Docker image; inferred from ARCH if not set @@ -106,11 +106,20 @@ cpus="$(command getconf _NPROCESSORS_ONLN 2>/dev/null)" || cpus="$(command sysctl -n hw.ncpu 2>/dev/null)" || cpus=8 +case "$gitstatus_cpu" in + ppc64le) + archflag="-mcpu" + ;; + *) + archflag="-march" + ;; +esac + libgit2_cmake_flags= -libgit2_cflags="-march=$gitstatus_cpu" +libgit2_cflags="$archflag=$gitstatus_cpu" gitstatus_cxx=g++ -gitstatus_cxxflags="-I${workdir}/libgit2/include -DGITSTATUS_ZERO_NSEC -D_GNU_SOURCE -march=$gitstatus_cpu" +gitstatus_cxxflags="-I${workdir}/libgit2/include -DGITSTATUS_ZERO_NSEC -D_GNU_SOURCE $archflag=$gitstatus_cpu" gitstatus_ldflags="-L${workdir}/libgit2/build" gitstatus_ldlibs= gitstatus_make=make @@ -377,6 +386,8 @@ if [ -z "$gitstatus_cpu" ]; then armv6l) gitstatus_cpu=armv6;; armv7l) gitstatus_cpu=armv7;; aarch64) gitstatus_cpu=armv8-a;; + ppc64le) gitstatus_cpu=powerpc64le;; + riscv64) gitstatus_cpu=rv64imafdc;; x86_64|amd64) gitstatus_cpu=x86-64;; i386|i586|i686) gitstatus_cpu="$gitstatus_arch";; *) @@ -411,6 +422,7 @@ case "$gitstatus_kernel" in 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;; *) >&2 echo '[error] unable to infer docker image' >&2 echo 'Please specify explicitly with `-i IMAGE`.' From af0b38718270daf46310fa1333587cc40e66690d Mon Sep 17 00:00:00 2001 From: romkatv Date: Sat, 16 May 2020 13:29:03 +0200 Subject: [PATCH 021/659] mention that powerlevel10k can be cloned from gitee.com; see #124 --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 78ca7ec1..e8094b0c 100644 --- a/README.md +++ b/README.md @@ -351,6 +351,13 @@ 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. + +```zsh +git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ~/powerlevel10k +echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc +``` + This is the simplest kind of installation and it works even if you are using a plugin manager. Just make sure to disable the current theme in your plugin manager. See [troubleshooting](#cannot-make-powerlevel10k-work-with-my-plugin-manager) for help. @@ -361,6 +368,12 @@ make sure to disable the current theme in your plugin manager. See git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k ``` +Users in mainland China can use the official mirror on gitee.com for faster download. + +```zsh +git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k +``` + Set `ZSH_THEME="powerlevel10k/powerlevel10k"` in `~/.zshrc`. ### Prezto From b62a164998f305dde318045cf53626906402d2d2 Mon Sep 17 00:00:00 2001 From: romkatv Date: Sat, 16 May 2020 13:39:48 +0200 Subject: [PATCH 022/659] add chinese translation for the reference to gitee.com See #124. Thanks, @ayalhw. --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e8094b0c..5de24fd4 100644 --- a/README.md +++ b/README.md @@ -351,7 +351,8 @@ 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 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 ~/powerlevel10k @@ -368,7 +369,8 @@ make sure to disable the current theme in your plugin manager. See git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k ``` -Users in mainland China can use the official mirror on gitee.com for faster download. +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:-~/.oh-my-zsh/custom}/themes/powerlevel10k From 6c83ace41ce41a362b68a58be45ce29164da8fa5 Mon Sep 17 00:00:00 2001 From: romkatv Date: Sun, 17 May 2020 08:27:28 +0200 Subject: [PATCH 023/659] uncomment POWERLEVEL9K_DIR_BACKGROUND --- 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 327c99c5..b946fea6 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -201,7 +201,7 @@ ##################################[ dir: current directory ]################################## # Current directory background color. - # typeset -g POWERLEVEL9K_DIR_BACKGROUND=4 + typeset -g POWERLEVEL9K_DIR_BACKGROUND=4 # Default current directory foreground color. typeset -g POWERLEVEL9K_DIR_FOREGROUND=254 # If directory is too long, shorten some of its segments to the shortest possible unique From 48c6ff4701eaf1a3c3570b01c09c30e6ed912a56 Mon Sep 17 00:00:00 2001 From: romkatv Date: Sun, 17 May 2020 08:27:40 +0200 Subject: [PATCH 024/659] expand dir color faq --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5de24fd4..314c7e25 100644 --- a/README.md +++ b/README.md @@ -1507,18 +1507,20 @@ This method of installation won't make anything slower or otherwise sub-par. ### Directory is difficult to see in prompt when using Rainbow style -In Classic style the current working directory is shown with bright white white text on blue -background. The white is fixed and always looks the same but the appearance of "blue" is defined -by your terminal color palette. If it's very light, it's difficult to see white text on it. +In Rainbow style the current working directory is shown with bright white text on blue background. +The white is fixed and always looks the same but the appearance of "blue" is defined by your +terminal color palette. If it's very light, it may be difficult to see white text on it. There are several ways to fix this. - Type `p10k configure` and choose a more readable prompt style. - [Change terminal color palette](#change-the-color-palette-used-by-your-terminal). Try Tango Dark or Solarized Dark, or change just the "blue" color. -- [Change directory background color](#set-colors-through-Powerlevel10k-configuration-parameters). - The parameter you are looking for is called `POWERLEVEL9K_DIR_BACKGROUND`. You can find it in - in `~/.p10k.zsh`. Uncomment it if it's commented out and try different values. +- [Change directory background and/or foreground color](#set-colors-through-Powerlevel10k-configuration-parameters). + 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`. ### Horrific mess when resizing terminal window From fdac99c57cb1c1ea27319f7e405b73af5c3a3c82 Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 18 May 2020 06:44:28 +0200 Subject: [PATCH 025/659] notes --- internal/notes.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/notes.md b/internal/notes.md index fbbaa5e9..3ef3a828 100644 --- a/internal/notes.md +++ b/internal/notes.md @@ -225,3 +225,12 @@ user=0.17s system=0.00s cpu=99% total=0.175 --- Add the equivalent of `P9K_PYTHON_VERSION` to all `*env` segments where it makes sense. + +--- + +Define `P9K_ICON` on initialization. Fill it with `$icon`. Duplicate every key that ends in `_ICON`. +Respect `POWERLEVEL9K_VCS_STASH_ICON` overrides but not anything with segment name or state. + +Define `POWERLEVEL9K_VCS_*` parameters in config templates for all symbols used in +`my_git_formatter`. Add missing entries to `icons`. Use `$P9K_ICON[...]` within `my_git_formatter`. +Add a screen to the wizard to choose between clear and circled icons. From 00d2cc7237d315f29a9be6f4cb2f5864242c548f Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 18 May 2020 06:56:46 +0200 Subject: [PATCH 026/659] add POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV --- internal/p10k.zsh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 11433d8d..855753e1 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4001,7 +4001,11 @@ prompt_virtualenv() { local v=${VIRTUAL_ENV:t} [[ $v == $~_POWERLEVEL9K_VIRTUALENV_GENERIC_NAMES ]] && v=${VIRTUAL_ENV:h:t} msg+="$_POWERLEVEL9K_VIRTUALENV_LEFT_DELIMITER${v//\%/%%}$_POWERLEVEL9K_VIRTUALENV_RIGHT_DELIMITER" - _p9k_prompt_segment "$0" "blue" "$_p9k_color1" 'PYTHON_ICON' 0 '' "$msg" + if (( _POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV )); then + _p9k_prompt_segment "$0" "blue" "$_p9k_color1" 'PYTHON_ICON' 0 '' "$msg" + else + _p9k_prompt_segment "$0" "blue" "$_p9k_color1" 'PYTHON_ICON' 0 '${(M)${#P9K_PYENV_PYTHON_VERSION}:#0}' "$msg" + fi } _p9k_prompt_virtualenv_init() { @@ -7008,6 +7012,7 @@ _p9k_init_params() { _p9k_declare -e POWERLEVEL9K_VI_VISUAL_MODE_STRING # OVERWRITE mode is shown as INSERT unless POWERLEVEL9K_VI_OVERWRITE_MODE_STRING is explicitly set. _p9k_declare -e POWERLEVEL9K_VI_OVERWRITE_MODE_STRING + _p9k_declare -b POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV 1 _p9k_declare -b POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION 1 _p9k_declare -e POWERLEVEL9K_VIRTUALENV_LEFT_DELIMITER "(" _p9k_declare -e POWERLEVEL9K_VIRTUALENV_RIGHT_DELIMITER ")" @@ -7620,7 +7625,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v84\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v85\1'${ZSH_VERSION}$'\1'${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\1${ZLE_RPROMPT_INDENT:-1}\1$__p9k_ksh_arrays\1' From f96c1eb5e591bc10fd2e4e5f0bcd016ab0aba809 Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 18 May 2020 07:00:11 +0200 Subject: [PATCH 027/659] add POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false to config templates See #730. --- config/p10k-classic.zsh | 2 ++ config/p10k-lean-8colors.zsh | 2 ++ config/p10k-lean.zsh | 2 ++ config/p10k-rainbow.zsh | 2 ++ 4 files changed, 8 insertions(+) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 2620f4a4..8eef2d59 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -846,6 +846,8 @@ typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=37 # Don't show Python version next to the virtual environment name. typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false + # Don't show virtualenv if pyenv is already shown. + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false # Separate environment name from Python version only with a space. typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= # Custom icon. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 9ba9ce25..1c1c9141 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -823,6 +823,8 @@ typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=6 # Don't show Python version next to the virtual environment name. typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false + # Don't show virtualenv if pyenv is already shown. + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false # Separate environment name from Python version only with a space. typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= # Custom icon. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 0ef3e545..69c1464d 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -823,6 +823,8 @@ typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=37 # Don't show Python version next to the virtual environment name. typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false + # Don't show virtualenv if pyenv is already shown. + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false # Separate environment name from Python version only with a space. typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= # Custom icon. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index b946fea6..b7694e6c 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -881,6 +881,8 @@ # typeset -g POWERLEVEL9K_VIRTUALENV_BACKGROUND=4 # Don't show Python version next to the virtual environment name. typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false + # Don't show virtualenv if pyenv is already shown. + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false # Separate environment name from Python version only with a space. typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= # Custom icon. From 6998d06a9168805a89b78ce403b70fac278d8454 Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 18 May 2020 07:10:33 +0200 Subject: [PATCH 028/659] pyenv: display python version alongside environment name if unequal See #730. --- config/p10k-classic.zsh | 13 +++++++++++++ config/p10k-lean-8colors.zsh | 13 +++++++++++++ config/p10k-lean.zsh | 13 +++++++++++++ config/p10k-rainbow.zsh | 13 +++++++++++++ 4 files changed, 52 insertions(+) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 8eef2d59..4682db14 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -873,6 +873,19 @@ typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false # If set to false, hide python version if it's equal to "system". typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true + + # Pyenv segment format. The following parameters are available within the expansion. + # + # - P9K_CONTENT Current pyenv environment (pyenv version-name). + # - P9K_PYENV_PYTHON_VERSION Current python version (python --version). + # + # 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}' + # Custom icon. # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 1c1c9141..240009a3 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -850,6 +850,19 @@ typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false # If set to false, hide python version if it's equal to "system". typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true + + # Pyenv segment format. The following parameters are available within the expansion. + # + # - P9K_CONTENT Current pyenv environment (pyenv version-name). + # - P9K_PYENV_PYTHON_VERSION Current python version (python --version). + # + # 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}' + # Custom icon. # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 69c1464d..ea78f5ce 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -850,6 +850,19 @@ typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false # If set to false, hide python version if it's equal to "system". typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true + + # Pyenv segment format. The following parameters are available within the expansion. + # + # - P9K_CONTENT Current pyenv environment (pyenv version-name). + # - P9K_PYENV_PYTHON_VERSION Current python version (python --version). + # + # 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}' + # Custom icon. # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index b7694e6c..2d8c751f 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -910,6 +910,19 @@ typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false # If set to false, hide python version if it's equal to "system". typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true + + # Pyenv segment format. The following parameters are available within the expansion. + # + # - P9K_CONTENT Current pyenv environment (pyenv version-name). + # - P9K_PYENV_PYTHON_VERSION Current python version (python --version). + # + # 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}' + # Custom icon. # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' From c0091537a940e2aa8fd5166c7df3cfafb18abc85 Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 18 May 2020 07:42:38 +0200 Subject: [PATCH 029/659] fix gcloud for the case when there are multiple configurations Fixes #731 --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 855753e1..7f93198a 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4369,7 +4369,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 list --configuration=$P9K_GCLOUD_CONFIGURATION \ + 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" @@ -7625,7 +7625,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v85\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v86\1'${ZSH_VERSION}$'\1'${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\1${ZLE_RPROMPT_INDENT:-1}\1$__p9k_ksh_arrays\1' From 5e932c225e0a44020c6d6d8e40c8cbfcda885767 Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 19 May 2020 07:45:04 +0200 Subject: [PATCH 030/659] bug fix: properly disable instant prompt when auto-wizard is aborted --- internal/p10k.zsh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 7f93198a..75a35456 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6156,6 +6156,7 @@ function _p9k_do_dump() { eval "$__p9k_intro" zle -F $1 exec {1}>&- + (( _p9k__state_dump_fd )) || return if (( ! _p9k__instant_prompt_disabled )); then _p9k__instant_prompt_sig=$_p9k__cwd:$P9K_SSH:${(%):-%#} _p9k_set_instant_prompt @@ -6367,8 +6368,8 @@ _p9k_precmd_impl() { fi fi fi + typeset -gi _p9k__instant_prompt_disabled=instant_prompt_disabled _p9k_init - _p9k__instant_prompt_disabled=$((_POWERLEVEL9K_DISABLE_INSTANT_PROMPT || instant_prompt_disabled)) fi if (( _p9k__timer_start )); then @@ -6608,7 +6609,6 @@ _p9k_init_vars() { typeset -gi _p9k__restore_prompt_fd typeset -gi _p9k__can_hide_cursor=$(( $+terminfo[civis] && $+terminfo[cnorm] )) typeset -gi _p9k__cursor_hidden - typeset -gi _p9k__instant_prompt_disabled typeset -gi _p9k__non_hermetic_expansion typeset -g _p9k__time typeset -g _p9k__date @@ -6733,6 +6733,8 @@ _p9k_init_params() { fi fi + (( _POWERLEVEL9K_DISABLE_INSTANT_PROMPT )) && _p9k__instant_prompt_disabled=1 + _p9k_declare -s POWERLEVEL9K_TRANSIENT_PROMPT off [[ $_POWERLEVEL9K_TRANSIENT_PROMPT == (off|always|same-dir) ]] || _POWERLEVEL9K_TRANSIENT_PROMPT=off @@ -7625,7 +7627,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v86\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v87\1'${ZSH_VERSION}$'\1'${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\1${ZLE_RPROMPT_INDENT:-1}\1$__p9k_ksh_arrays\1' From 5d1bfe8ed73e87b4604ea1ec8e4d4d18a1977405 Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 19 May 2020 07:59:57 +0200 Subject: [PATCH 031/659] cleanup --- internal/p10k.zsh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 75a35456..106432a4 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6021,10 +6021,9 @@ function _p9k_restore_state() { [[ $__p9k_cached_param_pat == $_p9k__param_pat && $__p9k_cached_param_sig == $_p9k__param_sig ]] || return (( $+functions[_p9k_restore_state_impl] )) || return _p9k_restore_state_impl - _p9k__state_restored=1 + return 0 } always { - unset __p9k_cached_param_sig - if (( !_p9k__state_restored )); then + if (( $? )); then if (( $+functions[_p9k_preinit] )); then unfunction _p9k_preinit (( $+functions[gitstatus_stop_p9k_] )) && gitstatus_stop_p9k_ POWERLEVEL9K @@ -6032,6 +6031,7 @@ function _p9k_restore_state() { _p9k_delete_instant_prompt zf_rm -f -- $__p9k_dump_file{,.zwc} 2>/dev/null fi + unset __p9k_cached_param_sig } } @@ -6618,7 +6618,6 @@ _p9k_init_vars() { typeset -gi _p9k__state_dump_scheduled typeset -gi _p9k__state_dump_fd typeset -gi _p9k__prompt_idx - typeset -gi _p9k__state_restored typeset -gi _p9k_reset_on_line_finish typeset -gF _p9k__timer_start typeset -gi _p9k__status From be5c06712557408a5145d9dc5a20e19a54ba4011 Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 19 May 2020 08:31:00 +0200 Subject: [PATCH 032/659] bug fix: vcs and vpn_ip weren't respecting hide/show state --- internal/p10k.zsh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 106432a4..423ceb1f 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -2147,7 +2147,7 @@ prompt_ip() { # Segment to display if VPN is active prompt_vpn_ip() { typeset -ga _p9k__vpn_ip_segments - _p9k__vpn_ip_segments+=($_p9k__prompt_side $_p9k__segment_index) + _p9k__vpn_ip_segments+=($_p9k__prompt_side $_p9k__line_index $_p9k__segment_index) local p='${(e)_p9k__vpn_ip_'$_p9k__prompt_side$_p9k__segment_index'}' _p9k__prompt+=$p typeset -g "_p9k__segment_val_${_p9k__prompt_side}[_p9k__segment_index]"=$p @@ -2156,7 +2156,7 @@ prompt_vpn_ip() { _p9k_vpn_ip_render() { local _p9k__segment_name=vpn_ip _p9k__prompt_side ip local -i _p9k__has_upglob _p9k__segment_index - for _p9k__prompt_side _p9k__segment_index in $_p9k__vpn_ip_segments; do + for _p9k__prompt_side _p9k__line_index _p9k__segment_index in $_p9k__vpn_ip_segments; do local _p9k__prompt= for ip in $_p9k__vpn_ip_ips; do _p9k_prompt_segment prompt_vpn_ip "cyan" "$_p9k_color1" 'VPN_ICON' 0 '' $ip @@ -3833,7 +3833,7 @@ function _p9k_vcs_resume() { if (( _p9k_vcs_index && $+GITSTATUS_DAEMON_PID_POWERLEVEL9K )); then local _p9k__prompt _p9k__prompt_side=$_p9k_vcs_side _p9k__segment_name=vcs - local -i _p9k__has_upglob _p9k__segment_index=_p9k_vcs_index + local -i _p9k__has_upglob _p9k__segment_index=_p9k_vcs_index _p9k__line_index=_p9k_vcs_line_index _p9k_vcs_render typeset -g _p9k__vcs=$_p9k__prompt else @@ -6441,7 +6441,7 @@ _p9k_precmd_impl() { fi if (( ! $+_p9k__vcs )); then local _p9k__prompt _p9k__prompt_side=$_p9k_vcs_side _p9k__segment_name=vcs - local -i _p9k__has_upglob _p9k__segment_index=_p9k_vcs_index + local -i _p9k__has_upglob _p9k__segment_index=_p9k_vcs_index _p9k__line_index=_p9k_vcs_line_index _p9k_vcs_render typeset -g _p9k__vcs=$_p9k__prompt fi @@ -6525,6 +6525,7 @@ _p9k_init_vars() { typeset -gi _p9k_term_has_href typeset -gi _p9k_vcs_index + typeset -gi _p9k_vcs_line_index typeset -g _p9k_vcs_side typeset -ga _p9k_taskwarrior_meta_files @@ -7825,8 +7826,9 @@ function _p9k_init_cacheable() { if [[ $#_POWERLEVEL9K_VCS_BACKENDS == 1 && $_POWERLEVEL9K_VCS_BACKENDS[1] == git ]]; then local elem line - local -i i=0 + local -i i=0 line_idx=0 for line in $_p9k_line_segments_left; do + (( ++line_idx )) for elem in ${${(0)line}%_joined}; do (( ++i )) if [[ $elem == vcs ]]; then @@ -7834,13 +7836,16 @@ function _p9k_init_cacheable() { _p9k_vcs_index=-1 else _p9k_vcs_index=i + _p9k_vcs_line_index=line_idx _p9k_vcs_side=left fi fi done done i=0 + line_idx=0 for line in $_p9k_line_segments_right; do + (( ++line_idx )) for elem in ${${(0)line}%_joined}; do (( ++i )) if [[ $elem == vcs ]]; then @@ -7848,6 +7853,7 @@ function _p9k_init_cacheable() { _p9k_vcs_index=-1 else _p9k_vcs_index=i + _p9k_vcs_line_index=line_idx _p9k_vcs_side=right fi fi @@ -7865,6 +7871,7 @@ function _p9k_init_cacheable() { fi if (( _p9k_vcs_index == -1 )); then _p9k_vcs_index=0 + _p9k_vcs_line_index=0 _p9k_vcs_side= fi fi From c0ff47bea59d58b027d546546509461812ae4cae Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 19 May 2020 09:00:42 +0200 Subject: [PATCH 033/659] don't print instant prompt warning when omz update fails --- internal/p10k.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 423ceb1f..5a980a3e 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6061,7 +6061,8 @@ function _p9k_clear_instant_prompt() { local omz1='[Oh My Zsh] Would you like to update? [Y/n]: ' local omz2='Updating Oh My Zsh' local omz3='https://shop.planetargon.com/collections/oh-my-zsh' - if [[ -n ${${unexpected/$omz1}/$omz2*$omz3($'\n'|)} ]]; then + local omz4='There was an error updating. Try again later?' + if [[ -n ${${unexpected/$omz1}/$omz2*($omz3|$omz4)[^$'\n']#($'\n'|)} ]]; then echo -E - "" echo -E - "${(%):-[%3FWARNING%f]: Console output during zsh initialization detected.}" echo -E - "" From e3beeea0ae8e2fdc5d997edeed4ffc3870b49bae Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 19 May 2020 10:10:43 +0200 Subject: [PATCH 034/659] block SIGINT in nested p10k calls; allow SIGINT in gitstatus_start --- internal/p10k.zsh | 36 ++++++++++++++++++++++++++---------- powerlevel10k.zsh-theme | 5 ++--- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 5a980a3e..025da391 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1,4 +1,4 @@ -if [[ $__p9k_sourced != 11 ]]; then +if [[ $__p9k_sourced != 12 ]]; then >&2 print -P "" >&2 print -P "[%F{1}ERROR%f]: Corrupted powerlevel10k installation." >&2 print -P "" @@ -7882,7 +7882,16 @@ _p9k_init_vcs() { _p9k_segment_in_use vcs || return _p9k_vcs_info_init if (( $+functions[_p9k_preinit] )); then - (( $+GITSTATUS_DAEMON_PID_POWERLEVEL9K )) && gitstatus_start_p9k_ POWERLEVEL9K + if (( $+GITSTATUS_DAEMON_PID_POWERLEVEL9K )); then + () { + trap 'return 130' INT + { + gitstatus_start_p9k_ POWERLEVEL9K + } always { + trap ':' INT + } + } + fi return 0 fi (( _POWERLEVEL9K_DISABLE_GITSTATUS )) && return @@ -7910,14 +7919,21 @@ _p9k_init_vcs() { -a POWERLEVEL9K }" source $gitstatus_dir/gitstatus.plugin.zsh _p9k_ || return - gitstatus_start_p9k_ \ - -s $_POWERLEVEL9K_VCS_STAGED_MAX_NUM \ - -u $_POWERLEVEL9K_VCS_UNSTAGED_MAX_NUM \ - -d $_POWERLEVEL9K_VCS_UNTRACKED_MAX_NUM \ - -c $_POWERLEVEL9K_VCS_CONFLICTED_MAX_NUM \ - -m $_POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY \ - ${${_POWERLEVEL9K_VCS_RECURSE_UNTRACKED_DIRS:#0}:+-e} \ - POWERLEVEL9K + () { + trap 'return 130' INT + { + gitstatus_start_p9k_ \ + -s $_POWERLEVEL9K_VCS_STAGED_MAX_NUM \ + -u $_POWERLEVEL9K_VCS_UNSTAGED_MAX_NUM \ + -d $_POWERLEVEL9K_VCS_UNTRACKED_MAX_NUM \ + -c $_POWERLEVEL9K_VCS_CONFLICTED_MAX_NUM \ + -m $_POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY \ + ${${_POWERLEVEL9K_VCS_RECURSE_UNTRACKED_DIRS:#0}:+-e} \ + POWERLEVEL9K + } always { + trap ':' INT + } + } } _p9k_init() { diff --git a/powerlevel10k.zsh-theme b/powerlevel10k.zsh-theme index 419d7e28..cd49dd4c 100644 --- a/powerlevel10k.zsh-theme +++ b/powerlevel10k.zsh-theme @@ -23,8 +23,7 @@ # __p9k_trapint is to work around bugs in zsh: https://www.zsh.org/mla/workers/2020/msg00612.html. # Likewise for `trap ":"` instead of the plain `trap ""`. typeset -gr __p9k_intro_base='emulate -L zsh -o no_hist_expand -o extended_glob -o no_prompt_bang -o prompt_percent -o no_prompt_subst -o no_aliases -o no_bg_nice -o typeset_silent - trap ":" INT - trap "trap ${(q)__p9k_trapint:--} INT" EXIT + (( $+__p9k_trapped )) || { local -i __p9k_trapped; trap : INT; trap "trap ${(q)__p9k_trapint:--} INT" EXIT } local -a match mbegin mend local -i MBEGIN MEND OPTIND local MATCH OPTARG IFS=$'\'' \t\n\0'\' @@ -58,7 +57,7 @@ function _p9k_init_locale() { if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file ]] && (( ! $+functions[_p9k_preinit] )) && source $__p9k_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then _p9k_preinit fi - typeset -gr __p9k_sourced=11 + typeset -gr __p9k_sourced=12 if [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]]; then if [[ -w $__p9k_root_dir && -w $__p9k_root_dir/internal && -w $__p9k_root_dir/gitstatus ]]; then local f From debacbf5307b6320ab95af4b52d0187069083dc5 Mon Sep 17 00:00:00 2001 From: xPMo Date: Tue, 19 May 2020 03:16:12 -0500 Subject: [PATCH 035/659] Fix warning for parameter _p9k__preexec_cmd (#735) With `setopt warn_create_global`, I get this warning: _p9k_preexec2:1: scalar parameter _p9k__preexec_cmd created globally in function _p9k_preexec2 --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 5a980a3e..41f6ac2a 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5253,7 +5253,7 @@ _p9k_preexec1() { } _p9k_preexec2() { - _p9k__preexec_cmd=$2 + typeset -g _p9k__preexec_cmd=$2 _p9k__timer_start=EPOCHREALTIME } From f3ae4032c1923404afc9fd8b6af2bf28bc406d61 Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 19 May 2020 10:25:42 +0200 Subject: [PATCH 036/659] Squashed 'gitstatus/' changes from 4c1b9564..c99d28aa c99d28aa block SIGINT in zle callback when being used from p10k f52fd5b5 wrap most of gitstatus_start code in `{..} always {...}` to handle SIGINT properly e4e88a5a mention that gitstatus can be cloned from gitee.com git-subtree-dir: gitstatus git-subtree-split: c99d28aa6be9db6f78c99c3f56626f2afcc3a466 --- README.md | 25 +++ gitstatus.plugin.zsh | 465 ++++++++++++++++++++++--------------------- 2 files changed, 259 insertions(+), 231 deletions(-) diff --git a/README.md b/README.md index 014b4e67..24ebf75d 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,14 @@ 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.
+中国大陆用户可以使用 gitee.com 上的官方镜像加速下载. + +```zsh +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: ```zsh @@ -128,6 +136,14 @@ 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.
+中国大陆用户可以使用 gitee.com 上的官方镜像加速下载. + +```bash +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: ```zsh @@ -475,6 +491,15 @@ cd gitstatus ./build -w -s -d docker ``` +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/gitstatus.git +cd gitstatus +./build -w -s -d docker +``` + - If it says that `-d docker` is not supported on your OS, remove this flag. - If it says that `-s` is not supported on your OS, remove this flag. - If it tell you to install docker but you cannot or don't want to, remove `-d docker`. diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index 0ee9f136..1fe219e9 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -525,259 +525,262 @@ function gitstatus_start"${1:-}"() { local -i lock_fd resp_fd stderr_fd local file_prefix xtrace=/dev/null daemon_log=/dev/null - if (( _GITSTATUS_STATE_$name )); then - (( async )) && return - (( _GITSTATUS_STATE_$name == 2 )) && return - lock_fd=_GITSTATUS_LOCK_FD_$name - resp_fd=_GITSTATUS_RESP_FD_$name - xtrace=${(P)${:-GITSTATUS_XTRACE_$name}} - daemon_log=${(P)${:-GITSTATUS_DAEMON_LOG_$name}} - file_prefix=${(P)${:-_GITSTATUS_FILE_PREFIX_$name}} - else - typeset -gi _GITSTATUS_START_COUNTER - local log_level=$GITSTATUS_LOG_LEVEL - local file_prefix=${${TMPDIR:-/tmp}:A}/gitstatus.$name.$EUID - file_prefix+=.$sysparams[pid].$EPOCHSECONDS.$((++_GITSTATUS_START_COUNTER)) - (( GITSTATUS_ENABLE_LOGGING )) && : ${log_level:=INFO} - if [[ -n $log_level ]]; then - xtrace=$file_prefix.xtrace.log - daemon_log=$file_prefix.daemon.log - fi - args+=(-v ${log_level:-FATAL}) - typeset -g GITSTATUS_XTRACE_$name=$xtrace - typeset -g GITSTATUS_DAEMON_LOG_$name=$daemon_log - typeset -g _GITSTATUS_FILE_PREFIX_$name=$file_prefix - typeset -gi _GITSTATUS_CLIENT_PID_$name="sysparams[pid]" - typeset -gi _GITSTATUS_DIRTY_MAX_INDEX_SIZE_$name=dirty_max_index_size - fi - () { - if [[ $xtrace != /dev/null && -o no_xtrace ]]; then - exec {stderr_fd}>&2 || return - exec 2>>$xtrace || return - setopt xtrace + { + if (( _GITSTATUS_STATE_$name )); then + (( async )) && return + (( _GITSTATUS_STATE_$name == 2 )) && return + lock_fd=_GITSTATUS_LOCK_FD_$name + resp_fd=_GITSTATUS_RESP_FD_$name + xtrace=${(P)${:-GITSTATUS_XTRACE_$name}} + daemon_log=${(P)${:-GITSTATUS_DAEMON_LOG_$name}} + file_prefix=${(P)${:-_GITSTATUS_FILE_PREFIX_$name}} + else + typeset -gi _GITSTATUS_START_COUNTER + local log_level=$GITSTATUS_LOG_LEVEL + local file_prefix=${${TMPDIR:-/tmp}:A}/gitstatus.$name.$EUID + file_prefix+=.$sysparams[pid].$EPOCHSECONDS.$((++_GITSTATUS_START_COUNTER)) + (( GITSTATUS_ENABLE_LOGGING )) && : ${log_level:=INFO} + if [[ -n $log_level ]]; then + xtrace=$file_prefix.xtrace.log + daemon_log=$file_prefix.daemon.log + fi + args+=(-v ${log_level:-FATAL}) + typeset -g GITSTATUS_XTRACE_$name=$xtrace + typeset -g GITSTATUS_DAEMON_LOG_$name=$daemon_log + typeset -g _GITSTATUS_FILE_PREFIX_$name=$file_prefix + typeset -gi _GITSTATUS_CLIENT_PID_$name="sysparams[pid]" + typeset -gi _GITSTATUS_DIRTY_MAX_INDEX_SIZE_$name=dirty_max_index_size fi - setopt monitor || return - - if (( ! _GITSTATUS_STATE_$name )); then - if [[ -r /proc/version && "$($file_prefix.lock || return - zsystem flock -f lock_fd $file_prefix.lock || return - [[ $lock_fd == <1-> ]] || return + () { + if [[ $xtrace != /dev/null && -o no_xtrace ]]; then + exec {stderr_fd}>&2 || return + exec 2>>$xtrace || return + setopt xtrace fi - typeset -gi _GITSTATUS_LOCK_FD_$name=lock_fd + setopt monitor || return - if [[ -n $USERPROFILE && -d /cygdrive && -d /proc/self/fd ]]; then - # Work around bugs in Cygwin 32-bit. - # - # This hangs: - # - # emulate -L zsh - # () { exec {fd}< $1 } <(:) - # =true # hangs here - # - # This hangs: - # - # sysopen -r -u fd <(:) - local -i fd - exec {fd}< <(_gitstatus_daemon$fsuf) || return - { - [[ -r /proc/self/fd/$fd ]] || return - sysopen -r -o cloexec -u resp_fd /proc/self/fd/$fd || return - } always { - exec {fd} >&- || return - } - else - sysopen -r -o cloexec -u resp_fd <(_gitstatus_daemon$fsuf) || return - fi - - typeset -gi GITSTATUS_DAEMON_PID_$name="${sysparams[procsubstpid]:--1}" - - [[ $resp_fd == <1-> ]] || return - typeset -gi _GITSTATUS_RESP_FD_$name=resp_fd - typeset -gi _GITSTATUS_STATE_$name=1 - fi - - if (( ! async )); then - (( _GITSTATUS_CLIENT_PID_$name == sysparams[pid] )) || return - - local pgid - while (( $#pgid < 20 )); do - [[ -t $resp_fd ]] - sysread -s $((20 - $#pgid)) -t $timeout -i $resp_fd 'pgid[$#pgid+1]' || return - done - [[ $pgid == ' '#<1-> ]] || return - typeset -gi GITSTATUS_DAEMON_PID_$name=pgid - - sysopen -w -o cloexec -u req_fd -- $file_prefix.fifo || return - [[ $req_fd == <1-> ]] || return - typeset -gi _GITSTATUS_REQ_FD_$name=req_fd - - function _gitstatus_process_response_$name-$fsuf() { - emulate -L zsh -o no_aliases -o extended_glob -o typeset_silent - local pair=${${(%):-%N}#_gitstatus_process_response_} - local name=${pair%%-*} - local fsuf=${pair#*-} - if (( ARGC == 1 )); then - _gitstatus_process_response$fsuf $name 0 '' + if (( ! _GITSTATUS_STATE_$name )); then + if [[ -r /proc/version && "$($file_prefix.lock || return + zsystem flock -f lock_fd $file_prefix.lock || return + [[ $lock_fd == <1-> ]] || return fi - } - if ! zle -F $resp_fd _gitstatus_process_response_$name-$fsuf; then - unfunction _gitstatus_process_response_$name-$fsuf - return 1 + + typeset -gi _GITSTATUS_LOCK_FD_$name=lock_fd + + if [[ -n $USERPROFILE && -d /cygdrive && -d /proc/self/fd ]]; then + # Work around bugs in Cygwin 32-bit. + # + # This hangs: + # + # emulate -L zsh + # () { exec {fd}< $1 } <(:) + # =true # hangs here + # + # This hangs: + # + # sysopen -r -u fd <(:) + local -i fd + exec {fd}< <(_gitstatus_daemon$fsuf) || return + { + [[ -r /proc/self/fd/$fd ]] || return + sysopen -r -o cloexec -u resp_fd /proc/self/fd/$fd || return + } always { + exec {fd} >&- || return + } + else + sysopen -r -o cloexec -u resp_fd <(_gitstatus_daemon$fsuf) || return + fi + + typeset -gi GITSTATUS_DAEMON_PID_$name="${sysparams[procsubstpid]:--1}" + + [[ $resp_fd == <1-> ]] || return + typeset -gi _GITSTATUS_RESP_FD_$name=resp_fd + typeset -gi _GITSTATUS_STATE_$name=1 fi - function _gitstatus_cleanup_$name-$fsuf() { - emulate -L zsh -o no_aliases -o extended_glob -o typeset_silent - local pair=${${(%):-%N}#_gitstatus_cleanup_} - local name=${pair%%-*} - local fsuf=${pair#*-} + if (( ! async )); then (( _GITSTATUS_CLIENT_PID_$name == sysparams[pid] )) || return - gitstatus_stop$fsuf $name - } - if ! add-zsh-hook zshexit _gitstatus_cleanup_$name-$fsuf; then - unfunction _gitstatus_cleanup_$name-$fsuf - return 1 - fi - print -nru $req_fd -- $'hello\x1f\x1e' || return - local expected=$'hello\x1f0\x1e' actual - if (( $+functions[p10k] )) && [[ ! -t 1 && ! -t 0 ]]; then - local -F deadline='EPOCHREALTIME + 4' - else - local -F deadline='1' - fi - while true; do - [[ -t $resp_fd ]] - sysread -s 1 -t $timeout -i $resp_fd actual || return - [[ $actual == h ]] && break - [[ $actual == . ]] || return - (( EPOCHREALTIME < deadline )) && continue - if (( deadline > 0 )); then - deadline=0 - if (( stderr_fd )); then - unsetopt xtrace - exec 2>&$stderr_fd {stderr_fd}>&- - stderr_fd=0 - fi - if (( $+functions[p10k] )); then - p10k clear-instant-prompt || return - fi - if [[ $name == POWERLEVEL9K ]]; then - local label=powerlevel10k - else - local label=gitstatus - fi - if [[ -t 2 ]]; then - local spinner=($'\b%3F-%f' $'\b%3F\\%f' $'\b%3F|%f' $'\b%3F/%f') - print -Prnu2 -- "[%3F$label%f] fetching %2Fgitstatusd%f .. " - else - local spinner=('.') - print -rnu2 -- "[$label] fetching gitstatusd .." - fi - fi - print -Prnu2 -- $spinner[1] - spinner=($spinner[2,-1] $spinner[1]) - done + local pgid + while (( $#pgid < 20 )); do + [[ -t $resp_fd ]] + sysread -s $((20 - $#pgid)) -t $timeout -i $resp_fd 'pgid[$#pgid+1]' || return + done + [[ $pgid == ' '#<1-> ]] || return + typeset -gi GITSTATUS_DAEMON_PID_$name=pgid - if (( deadline == 0 )); then - if [[ -t 2 ]]; then - print -Pru2 -- $'\b[%2Fok%f]' + sysopen -w -o cloexec -u req_fd -- $file_prefix.fifo || return + [[ $req_fd == <1-> ]] || return + typeset -gi _GITSTATUS_REQ_FD_$name=req_fd + + print -nru $req_fd -- $'hello\x1f\x1e' || return + local expected=$'hello\x1f0\x1e' actual + if (( $+functions[p10k] )) && [[ ! -t 1 && ! -t 0 ]]; then + local -F deadline='EPOCHREALTIME + 4' else - print -ru2 -- ' [ok]' + local -F deadline='1' fi - if [[ $xtrace != /dev/null && -o no_xtrace ]]; then - exec {stderr_fd}>&2 || return - exec 2>>$xtrace || return - setopt xtrace + while true; do + [[ -t $resp_fd ]] + sysread -s 1 -t $timeout -i $resp_fd actual || return + [[ $actual == h ]] && break + [[ $actual == . ]] || return + (( EPOCHREALTIME < deadline )) && continue + if (( deadline > 0 )); then + deadline=0 + if (( stderr_fd )); then + unsetopt xtrace + exec 2>&$stderr_fd {stderr_fd}>&- + stderr_fd=0 + fi + if (( $+functions[p10k] )); then + p10k clear-instant-prompt || return + fi + if [[ $name == POWERLEVEL9K ]]; then + local label=powerlevel10k + else + local label=gitstatus + fi + if [[ -t 2 ]]; then + local spinner=($'\b%3F-%f' $'\b%3F\\%f' $'\b%3F|%f' $'\b%3F/%f') + print -Prnu2 -- "[%3F$label%f] fetching %2Fgitstatusd%f .. " + else + local spinner=('.') + print -rnu2 -- "[$label] fetching gitstatusd .." + fi + fi + print -Prnu2 -- $spinner[1] + spinner=($spinner[2,-1] $spinner[1]) + done + + if (( deadline == 0 )); then + if [[ -t 2 ]]; then + print -Pru2 -- $'\b[%2Fok%f]' + else + print -ru2 -- ' [ok]' + fi + if [[ $xtrace != /dev/null && -o no_xtrace ]]; then + exec {stderr_fd}>&2 || return + exec 2>>$xtrace || return + setopt xtrace + fi fi + + while (( $#actual < $#expected )); do + [[ -t $resp_fd ]] + sysread -s $(($#expected - $#actual)) -t $timeout -i $resp_fd 'actual[$#actual+1]' || return + done + [[ $actual == $expected ]] || return + + function _gitstatus_process_response_$name-$fsuf() { + emulate -L zsh -o no_aliases -o extended_glob -o typeset_silent + local pair=${${(%):-%N}#_gitstatus_process_response_} + local name=${pair%%-*} + local fsuf=${pair#*-} + [[ $name == POWERLEVEL9K && $fsuf == _p9k_ ]] && eval $__p9k_intro_base + if (( ARGC == 1 )); then + _gitstatus_process_response$fsuf $name 0 '' + else + gitstatus_stop$fsuf $name + fi + } + if ! zle -F $resp_fd _gitstatus_process_response_$name-$fsuf; then + unfunction _gitstatus_process_response_$name-$fsuf + return 1 + fi + + function _gitstatus_cleanup_$name-$fsuf() { + emulate -L zsh -o no_aliases -o extended_glob -o typeset_silent + local pair=${${(%):-%N}#_gitstatus_cleanup_} + local name=${pair%%-*} + local fsuf=${pair#*-} + (( _GITSTATUS_CLIENT_PID_$name == sysparams[pid] )) || return + gitstatus_stop$fsuf $name + } + if ! add-zsh-hook zshexit _gitstatus_cleanup_$name-$fsuf; then + unfunction _gitstatus_cleanup_$name-$fsuf + return 1 + fi + + if (( lock_fd != -1 )); then + zf_rm -- $file_prefix.lock || return + zsystem flock -u $lock_fd || return + fi + unset _GITSTATUS_LOCK_FD_$name + + typeset -gi _GITSTATUS_STATE_$name=2 fi + } + } always { + local -i err=$? + (( stderr_fd )) && exec 2>&$stderr_fd {stderr_fd}>&- + (( err == 0 )) && return - while (( $#actual < $#expected )); do - [[ -t $resp_fd ]] - sysread -s $(($#expected - $#actual)) -t $timeout -i $resp_fd 'actual[$#actual+1]' || return - done - [[ $actual == $expected ]] || return + gitstatus_stop$fsuf $name - if (( lock_fd != -1 )); then - zf_rm -- $file_prefix.lock || return - zsystem flock -u $lock_fd || return + setopt prompt_percent no_prompt_subst no_prompt_bang + print -ru2 -- '' + print -Pru2 -- '[%F{red}ERROR%f]: gitstatus failed to initialize.' + print -ru2 -- '' + print -ru2 -- ' Your Git prompt may disappear or become slow.' + if [[ -s $xtrace ]]; then + print -ru2 -- '' + print -ru2 -- " The content of ${(q-)xtrace} (gitstatus_start xtrace):" + print -Pru2 -- '%F{yellow}' + >&2 awk '{print " " $0}' <$xtrace + print -Pru2 -- "%F{red} ^ this command failed ($err)%f" + fi + if [[ -s $daemon_log ]]; then + print -ru2 -- '' + print -ru2 -- " The content of ${(q-)daemon_log} (gitstatus daemon log):" + print -Pru2 -- '%F{yellow}' + >&2 awk '{print " " $0}' <$daemon_log + print -Pnru2 -- '%f' + fi + if [[ $GITSTATUS_LOG_LEVEL == DEBUG ]]; then + print -ru2 -- '' + print -ru2 -- ' Your system information:' + print -Pru2 -- '%F{yellow}' + print -ru2 -- " zsh: $ZSH_VERSION" + print -ru2 -- " uname -a: $(uname -a)" + print -Pru2 -- '%f' + print -ru2 -- ' If you need help, open an issue and attach this whole error message to it:' + print -ru2 -- '' + print -Pru2 -- ' %F{green}https://github.com/romkatv/gitstatus/issues/new%f' + else + print -ru2 -- '' + print -ru2 -- ' Run the following command to retry with extra diagnostics:' + print -Pru2 -- '%F{green}' + local env="GITSTATUS_LOG_LEVEL=DEBUG" + if [[ -n $GITSTATUS_NUM_THREADS ]]; then + env+=" GITSTATUS_NUM_THREADS=${(q)GITSTATUS_NUM_THREADS}" fi - unset _GITSTATUS_LOCK_FD_$name - - typeset -gi _GITSTATUS_STATE_$name=2 + if [[ -n $GITSTATUS_DAEMON ]]; then + env+=" GITSTATUS_DAEMON=${(q)GITSTATUS_DAEMON}" + fi + if [[ -n $GITSTATUS_AUTO_INSTALL ]]; then + env+=" GITSTATUS_AUTO_INSTALL=${(q)GITSTATUS_AUTO_INSTALL}" + fi + if [[ -n $GITSTATUS_CACHE_DIR ]]; then + env+=" GITSTATUS_CACHE_DIR=${(q)GITSTATUS_CACHE_DIR}" + fi + print -nru2 -- " ${env} gitstatus_start ${(@q-)*}" + print -Pru2 -- '%f' + print -ru2 -- '' + local zshrc=${(D)ZDOTDIR:-~}/.zshrc + print -ru2 -- " If this command produces no output, add the following parameter to $zshrc:" + print -ru2 -- '' + print -Pru2 -- '%F{green} GITSTATUS_LOG_LEVEL=DEBUG%f' + print -ru2 -- '' + print -ru2 -- ' With this parameter gitstatus will print additional information on error.' fi } - - local -i err=$? - (( stderr_fd )) && exec 2>&$stderr_fd {stderr_fd}>&- - (( err == 0 )) && return - - gitstatus_stop$fsuf $name - - setopt prompt_percent no_prompt_subst no_prompt_bang - print -Pru2 -- '[%F{red}ERROR%f]: gitstatus failed to initialize.' - print -ru2 -- '' - print -ru2 -- ' Your Git prompt may disappear or become slow.' - if [[ -s $xtrace ]]; then - print -ru2 -- '' - print -ru2 -- " The content of ${(q-)xtrace} (gitstatus_start xtrace):" - print -Pru2 -- '%F{yellow}' - >&2 awk '{print " " $0}' <$xtrace - print -Pru2 -- "%F{red} ^ this command failed ($err)%f" - fi - if [[ -s $daemon_log ]]; then - print -ru2 -- '' - print -ru2 -- " The content of ${(q-)daemon_log} (gitstatus daemon log):" - print -Pru2 -- '%F{yellow}' - >&2 awk '{print " " $0}' <$daemon_log - print -Pnru2 -- '%f' - fi - if [[ $GITSTATUS_LOG_LEVEL == DEBUG ]]; then - print -ru2 -- '' - print -ru2 -- ' Your system information:' - print -Pru2 -- '%F{yellow}' - print -ru2 -- " zsh: $ZSH_VERSION" - print -ru2 -- " uname -a: $(uname -a)" - print -Pru2 -- '%f' - print -ru2 -- ' If you need help, open an issue and attach this whole error message to it:' - print -ru2 -- '' - print -Pru2 -- ' %F{green}https://github.com/romkatv/gitstatus/issues/new%f' - else - print -ru2 -- '' - print -ru2 -- ' Run the following command to retry with extra diagnostics:' - print -Pru2 -- '%F{green}' - local env="GITSTATUS_LOG_LEVEL=DEBUG" - if [[ -n $GITSTATUS_NUM_THREADS ]]; then - env+=" GITSTATUS_NUM_THREADS=${(q)GITSTATUS_NUM_THREADS}" - fi - if [[ -n $GITSTATUS_DAEMON ]]; then - env+=" GITSTATUS_DAEMON=${(q)GITSTATUS_DAEMON}" - fi - if [[ -n $GITSTATUS_AUTO_INSTALL ]]; then - env+=" GITSTATUS_AUTO_INSTALL=${(q)GITSTATUS_AUTO_INSTALL}" - fi - if [[ -n $GITSTATUS_CACHE_DIR ]]; then - env+=" GITSTATUS_CACHE_DIR=${(q)GITSTATUS_CACHE_DIR}" - fi - print -nru2 -- " ${env} gitstatus_start ${(@q-)*}" - print -Pru2 -- '%f' - print -ru2 -- '' - local zshrc=${(D)ZDOTDIR:-~}/.zshrc - print -ru2 -- " If this command produces no output, add the following parameter to $zshrc:" - print -ru2 -- '' - print -Pru2 -- '%F{green} GITSTATUS_LOG_LEVEL=DEBUG%f' - print -ru2 -- '' - print -ru2 -- ' With this parameter gitstatus will print additional information on error.' - fi - - return err } # Stops gitstatusd if it's running. From 646a826440235307ba358fd83ff2eb2eadd71b80 Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 19 May 2020 20:20:21 +0200 Subject: [PATCH 037/659] close instant prompt descriptors in worker --- internal/worker.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/worker.zsh b/internal/worker.zsh index 9e78bc15..aa82e9f5 100644 --- a/internal/worker.zsh +++ b/internal/worker.zsh @@ -182,6 +182,9 @@ function _p9k_worker_start() { sysopen -r -o cloexec -u _p9k__worker_resp_fd <( exec 0&- + (( __p9k_fd_1 )) && exec {__p9k_fd_1}>&- + (( __p9k_fd_2 )) && exec {__p9k_fd_2}>&- if [[ -n $_POWERLEVEL9K_WORKER_LOG_LEVEL ]]; then exec 2>$_p9k__worker_file_prefix.log setopt xtrace From 00cfdb48a8c74150814792e4deccff2a1ce91ad0 Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 19 May 2020 20:20:39 +0200 Subject: [PATCH 038/659] Squashed 'gitstatus/' changes from c99d28aa..78a2ec25 78a2ec25 close p10k instant prompt descriptors in daemon git-subtree-dir: gitstatus git-subtree-split: 78a2ec251e99ffa48ea10bbb48ab54ba6401701c --- gitstatus.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index 1fe219e9..fc4ca172 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -356,6 +356,9 @@ function _gitstatus_process_response"${1:-}"() { function _gitstatus_daemon"${1:-}"() { local -i pipe_fd exec 0<&- {pipe_fd}>&1 1>>$daemon_log 2>&1 || return + (( __p9k_fd_0 )) && exec {__p9k_fd_0}>&- + (( __p9k_fd_1 )) && exec {__p9k_fd_1}>&- + (( __p9k_fd_2 )) && exec {__p9k_fd_2}>&- local pgid=$sysparams[pid] [[ $pgid == <1-> ]] || return builtin cd -q / || return From 8e86b0c8d4b13f693968a0f5b639270bc77f72de Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 19 May 2020 20:25:29 +0200 Subject: [PATCH 039/659] don't hide empty line when invoking zsh immediately after clear --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 0156f906..b27e7c9d 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5581,7 +5581,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=24 +typeset -gri __p9k_instant_prompt_version=25 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -5654,7 +5654,7 @@ _p9k_dump_instant_prompt() { local tail=${content##*$rs$key$us} [[ ${#tail} != ${#content} ]] || return local P9K_PROMPT=instant - if (( ! $+P9K_TTY )); then' + if [[ $P9K_TTY != old ]]; then' if (( _POWERLEVEL9K_NEW_TTY_MAX_AGE_SECONDS < 0 )); then >&$fd print -r -- ' typeset -gx P9K_TTY=new' else From 519de2c569a607dfb0f2b96f01e2b15f2e1d5b4e Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 20 May 2020 07:06:38 +0200 Subject: [PATCH 040/659] Revert "close instant prompt descriptors in worker" This reverts commit 646a826440235307ba358fd83ff2eb2eadd71b80. --- internal/worker.zsh | 3 --- 1 file changed, 3 deletions(-) diff --git a/internal/worker.zsh b/internal/worker.zsh index aa82e9f5..9e78bc15 100644 --- a/internal/worker.zsh +++ b/internal/worker.zsh @@ -182,9 +182,6 @@ function _p9k_worker_start() { sysopen -r -o cloexec -u _p9k__worker_resp_fd <( exec 0&- - (( __p9k_fd_1 )) && exec {__p9k_fd_1}>&- - (( __p9k_fd_2 )) && exec {__p9k_fd_2}>&- if [[ -n $_POWERLEVEL9K_WORKER_LOG_LEVEL ]]; then exec 2>$_p9k__worker_file_prefix.log setopt xtrace From 8cfe934f157a69976f55a796b65d4ed0a0344719 Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 20 May 2020 07:07:00 +0200 Subject: [PATCH 041/659] Squashed 'gitstatus/' changes from 78a2ec25..063ed450 063ed450 Revert "close p10k instant prompt descriptors in daemon" git-subtree-dir: gitstatus git-subtree-split: 063ed45083386c98ab4d10f08794bec2a0c534d1 --- gitstatus.plugin.zsh | 3 --- 1 file changed, 3 deletions(-) diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index fc4ca172..1fe219e9 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -356,9 +356,6 @@ function _gitstatus_process_response"${1:-}"() { function _gitstatus_daemon"${1:-}"() { local -i pipe_fd exec 0<&- {pipe_fd}>&1 1>>$daemon_log 2>&1 || return - (( __p9k_fd_0 )) && exec {__p9k_fd_0}>&- - (( __p9k_fd_1 )) && exec {__p9k_fd_1}>&- - (( __p9k_fd_2 )) && exec {__p9k_fd_2}>&- local pgid=$sysparams[pid] [[ $pgid == <1-> ]] || return builtin cd -q / || return From 499de79a2bc61378c50672eaf919824ba7d51ff5 Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 20 May 2020 12:04:49 +0200 Subject: [PATCH 042/659] remove instant prompt if it corresponds to a different config --- internal/p10k.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index b27e7c9d..2a2f2750 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5581,7 +5581,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=25 +typeset -gri __p9k_instant_prompt_version=26 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -5616,6 +5616,7 @@ _p9k_dump_instant_prompt() { \$TERM_PROGRAM $hyper 'Hyper' && \$+VTE_VERSION == $+VTE_VERSION && \$POWERLEVEL9K_DISABLE_INSTANT_PROMPT != 'true' && \$POWERLEVEL9K_INSTANT_PROMPT != 'off' ]] || { __p9k_instant_prompt_sourced=0; return 1; } + typeset -g __p9k_instant_prompt_param_sig=${(q+)_p9k__param_sig} local gitstatus_dir=${(q)gitstatus_dir} local gitstatus_header=${(q)gitstatus_header} local -i ZLE_RPROMPT_INDENT=${ZLE_RPROMPT_INDENT:-1} @@ -6030,6 +6031,9 @@ function _p9k_restore_state() { fi _p9k_delete_instant_prompt zf_rm -f -- $__p9k_dump_file{,.zwc} 2>/dev/null + elif [[ $__p9k_instant_prompt_param_sig != $_p9k__param_sig ]]; then + _p9k_delete_instant_prompt + _p9k_dumped_instant_prompt_sigs=() fi unset __p9k_cached_param_sig } From c713ded9e76032f90014bc6829165d0dd69d28b3 Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 20 May 2020 12:05:11 +0200 Subject: [PATCH 043/659] set P9K_TTY=old in preexec --- internal/p10k.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 2a2f2750..a3503615 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5255,6 +5255,7 @@ _p9k_preexec1() { _p9k_preexec2() { typeset -g _p9k__preexec_cmd=$2 _p9k__timer_start=EPOCHREALTIME + P9K_TTY=old } function _p9k_prompt_net_iface_init() { From ee44f9e112a71ef6fa5aacdf65a43862a5a89279 Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 22 May 2020 08:44:25 +0200 Subject: [PATCH 044/659] Squashed 'gitstatus/' changes from 063ed450..0127fd26 0127fd26 set user.name in the test git repo 00564e95 Merge pull request #135 from Aloxaf/Aloxaf-patch-1 6003278c build: no gpg sign git-subtree-dir: gitstatus git-subtree-split: 0127fd26a0d102cc5d5b2b10e511fa99138d78e3 --- build | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build b/build index b0caeff6..25dbb5e9 100755 --- a/build +++ b/build @@ -267,9 +267,10 @@ app="$outdir"/usrbin/"$appname" command strip "$app".tmp command mkdir -- "$workdir"/repo -command git -C "$workdir"/repo init -- +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 -m '' +command git -C "$workdir"/repo 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*}" ] From 6b69030bfb6fff74733f58aa493e7b2b41c8ae6b Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 22 May 2020 21:36:40 +0200 Subject: [PATCH 045/659] mention that arch linux packages for powerlevel10k are broken and should not be used --- README.md | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 314c7e25..de6ec7ba 100644 --- a/README.md +++ b/README.md @@ -426,10 +426,10 @@ echo 'source /usr/local/opt/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc ### Arch Linux -```zsh -pacman -S --noconfirm zsh-theme-powerlevel10k -echo 'source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc -``` +There is [zsh-theme-powerlevel10k]( + https://www.archlinux.org/packages/community/any/zsh-theme-powerlevel10k/) community package and +[zsh-theme-powerlevel10k-git](https://aur.archlinux.org/packages/zsh-theme-powerlevel10k-git/) AUR +package. Both are old and broken. **Do not use them.** ## Configuration @@ -1081,14 +1081,6 @@ 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). -### Is there an AUR package for Powerlevel10k? - -There is [zsh-theme-powerlevel10k-git]( - https://aur.archlinux.org/packages/zsh-theme-powerlevel10k-git/). It's owned by an unaffiliated -volunteer. - -There is also an [official Powerlevel10k package](#arch-linux) for Pacman. - ### What is the minimum supported Zsh version? Zsh 5.1 or newer should work. Fast startup requires Zsh >= 5.4. @@ -1764,7 +1756,6 @@ typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='${P9K_CONTENT}' # not bold - [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) - - [Is there an AUR package for Powerlevel10k?](#is-there-an-aur-package-for-powerlevel10k) - [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) From be83ec430cddc1b92a774f264bd287102f88e026 Mon Sep 17 00:00:00 2001 From: romkatv Date: Sat, 23 May 2020 14:20:37 +0200 Subject: [PATCH 046/659] =?UTF-8?q?replace=20=E2=85=A4=20(roman=20numeral?= =?UTF-8?q?=205)=20with=20V=20(ascii);=20see=20#754?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- config/p10k-classic.zsh | 2 +- config/p10k-lean-8colors.zsh | 2 +- config/p10k-lean.zsh | 2 +- config/p10k-rainbow.zsh | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index de6ec7ba..e6f65be6 100644 --- a/README.md +++ b/README.md @@ -266,7 +266,7 @@ enable as many segments as you like. It won't slow down your prompt or Zsh start | `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: `❯`, `❮`, `Ⅴ`, `▶` for insert, command, visual and replace mode respectively; turns red on error | +| `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 | @@ -1046,7 +1046,7 @@ Similarly, if you enable transient prompt, sparse prompt (with an empty line bef 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: `❯`, `❮`, `Ⅴ`, `▶` for insert, command, visual +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 without left frame. diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 4682db14..b409fd19 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -190,7 +190,7 @@ # Prompt symbol in command vi mode. typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' # Prompt symbol in visual vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='Ⅴ' + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' # Prompt symbol in overwrite vi mode. typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶' typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 240009a3..184a8726 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -186,7 +186,7 @@ # Prompt symbol in command vi mode. typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' # Prompt symbol in visual vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='Ⅴ' + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' # Prompt symbol in overwrite vi mode. typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶' typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index ea78f5ce..03c58e3f 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -186,7 +186,7 @@ # Prompt symbol in command vi mode. typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' # Prompt symbol in visual vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='Ⅴ' + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' # Prompt symbol in overwrite vi mode. typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶' typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 2d8c751f..61555798 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -188,7 +188,7 @@ # Prompt symbol in command vi mode. typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' # Prompt symbol in visual vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='Ⅴ' + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' # Prompt symbol in overwrite vi mode. typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶' typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true From a963533cbd8718a23f193869100c332f0bd6d6a8 Mon Sep 17 00:00:00 2001 From: romkatv Date: Sun, 24 May 2020 13:08:05 +0200 Subject: [PATCH 047/659] mention that powerlevel10k once again can be installed from AUR --- README.md | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index e6f65be6..3c0971e3 100644 --- a/README.md +++ b/README.md @@ -426,10 +426,15 @@ echo 'source /usr/local/opt/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc ### Arch Linux -There is [zsh-theme-powerlevel10k]( +```zsh +yay -Sy --noconfirm zsh-theme-powerlevel10k-bin +echo 'source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc +``` + +There is also [zsh-theme-powerlevel10k]( https://www.archlinux.org/packages/community/any/zsh-theme-powerlevel10k/) community package and [zsh-theme-powerlevel10k-git](https://aur.archlinux.org/packages/zsh-theme-powerlevel10k-git/) AUR -package. Both are old and broken. **Do not use them.** +package. Both of these are old and broken. **Do not use them.** ## Configuration @@ -588,18 +593,19 @@ 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/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` | +| Installation | Update command | +|---------------------------|------------------------------------------------| +| [Manual](#manual) | `git -C ~/powerlevel10k pull` | +| [Oh My Zsh](#oh-my-zsh) | `git -C $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 -Syu` | **IMPORTANT**: Restart Zsh after updating Powerlevel10k. [Do not use `source ~/.zshrc`]( #weird-things-happen-after-typing-source-zshrc). From 45eeb08fc39f87127cfd8b15e07718fc8c89fb75 Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 25 May 2020 07:26:52 +0200 Subject: [PATCH 048/659] add P9K_ANACONDA_PYTHON_VERSION --- internal/p10k.zsh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index a3503615..51fd9f02 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1093,11 +1093,16 @@ function _p9k_python_version() { ################################################################ # Anaconda Environment prompt_anaconda() { - local p=${CONDA_PREFIX:-$CONDA_ENV_PATH} - local msg='' - if (( _POWERLEVEL9K_ANACONDA_SHOW_PYTHON_VERSION )) && _p9k_python_version; then - msg="${_p9k__ret//\%//%%} " + local msg + if _p9k_python_version; then + P9K_ANACONDA_PYTHON_VERSION=$_p9k__ret + if (( _POWERLEVEL9K_ANACONDA_SHOW_PYTHON_VERSION )); then + msg="${P9K_ANACONDA_PYTHON_VERSION//\%/%%} " + fi + else + unset P9K_ANACONDA_PYTHON_VERSION fi + local p=${CONDA_PREFIX:-$CONDA_ENV_PATH} msg+="$_POWERLEVEL9K_ANACONDA_LEFT_DELIMITER${${p:t}//\%/%%}$_POWERLEVEL9K_ANACONDA_RIGHT_DELIMITER" _p9k_prompt_segment "$0" "blue" "$_p9k_color1" 'PYTHON_ICON' 0 '' "$msg" } @@ -7633,7 +7638,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v87\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v88\1'${ZSH_VERSION}$'\1'${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\1${ZLE_RPROMPT_INDENT:-1}\1$__p9k_ksh_arrays\1' From 644488afcc2e12657c325539015402e914abf694 Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 25 May 2020 07:31:19 +0200 Subject: [PATCH 049/659] change the default anaconda format in config templates Also document how to configure it. See #762. --- config/p10k-classic.zsh | 30 ++++++++++++++++++++++++++---- config/p10k-lean-8colors.zsh | 30 ++++++++++++++++++++++++++---- config/p10k-lean.zsh | 30 ++++++++++++++++++++++++++---- config/p10k-rainbow.zsh | 30 ++++++++++++++++++++++++++---- 4 files changed, 104 insertions(+), 16 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index b409fd19..a945416c 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -856,10 +856,32 @@ #####################[ anaconda: conda environment (https://conda.io/) ]###################### # Anaconda environment color. typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=37 - # Don't show Python version next to the anaconda environment name. - typeset -g POWERLEVEL9K_ANACONDA_SHOW_PYTHON_VERSION=false - # Separate environment name from Python version only with a space. - typeset -g POWERLEVEL9K_ANACONDA_{LEFT,RIGHT}_DELIMITER= + + # Anaconda segment format. The following parameters are available within the expansion. + # + # - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment. + # - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment. + # - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below). + # - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version). + # + # CONDA_PROMPT_MODIFIER can be configured with the following command: + # + # conda config --set env_prompt '({default_env}) ' + # + # The last argument is a Python format string that can use the following variables: + # + # - prefix The same as CONDA_PREFIX. + # - default_env The same as CONDA_DEFAULT_ENV. + # - name The last segment of CONDA_PREFIX. + # - stacked_env Comma-separated list of names in the environment stack. The first element is + # always the same as default_env. + # + # Note: '({default_env}) ' is the default value of env_prompt. + # + # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER + # without the leading '(' or the trailing ') '. + typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${CONDA_PROMPT_MODIFIER#\(}%\) }' + # Custom icon. # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 184a8726..243fb59c 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -833,10 +833,32 @@ #####################[ anaconda: conda environment (https://conda.io/) ]###################### # Anaconda environment color. typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=6 - # Don't show Python version next to the anaconda environment name. - typeset -g POWERLEVEL9K_ANACONDA_SHOW_PYTHON_VERSION=false - # Separate environment name from Python version only with a space. - typeset -g POWERLEVEL9K_ANACONDA_{LEFT,RIGHT}_DELIMITER= + + # Anaconda segment format. The following parameters are available within the expansion. + # + # - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment. + # - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment. + # - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below). + # - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version). + # + # CONDA_PROMPT_MODIFIER can be configured with the following command: + # + # conda config --set env_prompt '({default_env}) ' + # + # The last argument is a Python format string that can use the following variables: + # + # - prefix The same as CONDA_PREFIX. + # - default_env The same as CONDA_DEFAULT_ENV. + # - name The last segment of CONDA_PREFIX. + # - stacked_env Comma-separated list of names in the environment stack. The first element is + # always the same as default_env. + # + # Note: '({default_env}) ' is the default value of env_prompt. + # + # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER + # without the leading '(' or the trailing ') '. + typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${CONDA_PROMPT_MODIFIER#\(}%\) }' + # Custom icon. # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 03c58e3f..3c6aebc9 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -833,10 +833,32 @@ #####################[ anaconda: conda environment (https://conda.io/) ]###################### # Anaconda environment color. typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=37 - # Don't show Python version next to the anaconda environment name. - typeset -g POWERLEVEL9K_ANACONDA_SHOW_PYTHON_VERSION=false - # Separate environment name from Python version only with a space. - typeset -g POWERLEVEL9K_ANACONDA_{LEFT,RIGHT}_DELIMITER= + + # Anaconda segment format. The following parameters are available within the expansion. + # + # - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment. + # - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment. + # - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below). + # - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version). + # + # CONDA_PROMPT_MODIFIER can be configured with the following command: + # + # conda config --set env_prompt '({default_env}) ' + # + # The last argument is a Python format string that can use the following variables: + # + # - prefix The same as CONDA_PREFIX. + # - default_env The same as CONDA_DEFAULT_ENV. + # - name The last segment of CONDA_PREFIX. + # - stacked_env Comma-separated list of names in the environment stack. The first element is + # always the same as default_env. + # + # Note: '({default_env}) ' is the default value of env_prompt. + # + # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER + # without the leading '(' or the trailing ') '. + typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${CONDA_PROMPT_MODIFIER#\(}%\) }' + # Custom icon. # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 61555798..ce16ddae 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -892,10 +892,32 @@ # Anaconda environment color. # typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=0 # typeset -g POWERLEVEL9K_ANACONDA_BACKGROUND=4 - # Don't show Python version next to the anaconda environment name. - typeset -g POWERLEVEL9K_ANACONDA_SHOW_PYTHON_VERSION=false - # Separate environment name from Python version only with a space. - typeset -g POWERLEVEL9K_ANACONDA_{LEFT,RIGHT}_DELIMITER= + + # Anaconda segment format. The following parameters are available within the expansion. + # + # - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment. + # - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment. + # - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below). + # - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version). + # + # CONDA_PROMPT_MODIFIER can be configured with the following command: + # + # conda config --set env_prompt '({default_env}) ' + # + # The last argument is a Python format string that can use the following variables: + # + # - prefix The same as CONDA_PREFIX. + # - default_env The same as CONDA_DEFAULT_ENV. + # - name The last segment of CONDA_PREFIX. + # - stacked_env Comma-separated list of names in the environment stack. The first element is + # always the same as default_env. + # + # Note: '({default_env}) ' is the default value of env_prompt. + # + # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER + # without the leading '(' or the trailing ') '. + typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${CONDA_PROMPT_MODIFIER#\(}%\) }' + # Custom icon. # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' From 5e9a4eb072bace619b0729632bfa5c7c80dce107 Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 25 May 2020 12:18:02 +0200 Subject: [PATCH 050/659] asdf: filter multiple versions the same way as upstream; see #764 --- internal/p10k.zsh | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 51fd9f02..ad7576f5 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5010,12 +5010,14 @@ function _p9k_asdf_init_meta() { fi fi - local root=${ASDF_DATA_DIR:-~/.asdf}/plugins - files+=$root - if [[ -d $root ]]; then + local root=${ASDF_DATA_DIR:-~/.asdf} + files+=$root/plugins + if [[ -d $root/plugins ]]; then local plugin - for plugin in $root/[^[:space:]]##(N); do - _p9k_asdf_plugins+=${plugin:t} + for plugin in $root/plugins/[^[:space:]]##(/N); do + files+=$root/installs/${plugin:t} + local -aU installed=($root/installs/${plugin:t}/[^[:space:]]##(/N:t) system) + _p9k_asdf_plugins[${plugin:t}]=${(j:|:)${(@b)installed}} (( legacy_enabled )) || continue if [[ ! -e $plugin/bin ]]; then files+=$plugin/bin @@ -5045,6 +5047,8 @@ function _p9k_asdf_init_meta() { zstat -A stat +mtime -- $_p9k_asdf_meta_files 2>/dev/null || return fi _p9k_asdf_meta_sig=$ASDF_CONFIG_FILE$'\0'$ASDF_DATA_DIR$'\0'${(pj:\0:)stat} + _p9k__asdf_dir2files=() + _p9k_asdf_file2versions=() } always { if (( $? == 0 )); then _p9k__state_dump_scheduled=1 @@ -5081,10 +5085,11 @@ function _p9k_asdf_parse_version_file() { else { local v=($(<$file)) } 2>/dev/null fi + v=${v[(r)$_p9k_asdf_plugins[$plugin]]:-$v[1]} _p9k_asdf_file2versions[$plugin:$file]=$stat[1]:"$v" _p9k__state_dump_scheduled=1 fi - (( $#v )) && : ${versions[$plugin]="$v"} + [[ -n $v ]] && : ${versions[$plugin]="$v"} done else local cached=$_p9k_asdf_file2versions[:$file] @@ -5096,8 +5101,10 @@ function _p9k_asdf_parse_version_file() { local line for line in $lines; do local words=($=line) - (( $#words > 1 && $_p9k_asdf_plugins[(Ie)$words[1]] )) || continue - file_versions+=($words[1] "${words[2,-1]}") + (( $#words > 1 )) || continue + local installed=$_p9k_asdf_plugins[$words[1]] + [[ -n $installed ]] || continue + file_versions+=($words[1] ${${words:1}[(r)$installed]:-$words[2]}) done _p9k_asdf_file2versions[:$file]=$stat[1]:${(pj:\0:)file_versions} _p9k__state_dump_scheduled=1 @@ -5153,7 +5160,7 @@ function prompt_asdf() { fi local plugin - for plugin in $_p9k_asdf_plugins; do + for plugin in ${(k)_p9k_asdf_plugins}; do local upper=${(U)plugin//-/_} if (( $+parameters[_POWERLEVEL9K_ASDF_${upper}_SOURCES] )); then local sources=(${(P)${:-_POWERLEVEL9K_ASDF_${upper}_SOURCES}}) @@ -6553,8 +6560,9 @@ _p9k_init_vars() { typeset -ga _p9k_asdf_meta_non_files typeset -g _p9k_asdf_meta_sig - # example: (ruby lua chubaka) - typeset -ga _p9k_asdf_plugins + # plugin => installed_version_pattern + # example: (ruby '2.7.0|2.6.3|system' lua 'system' chubaka '1.0.0|system') + typeset -gA _p9k_asdf_plugins # example: (.ruby-version "ruby 1 chubaka 0") # @@ -7638,7 +7646,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v88\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v89\1'${ZSH_VERSION}$'\1'${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\1${ZLE_RPROMPT_INDENT:-1}\1$__p9k_ksh_arrays\1' From ed3287b737bafff6eefdf59a532caac88d2ff915 Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 25 May 2020 17:07:41 +0200 Subject: [PATCH 051/659] Revert "mention that arch linux packages for powerlevel10k are broken and should not be used" This reverts commit 6b69030bfb6fff74733f58aa493e7b2b41c8ae6b. --- README.md | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 3c0971e3..e6f65be6 100644 --- a/README.md +++ b/README.md @@ -426,15 +426,10 @@ echo 'source /usr/local/opt/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc ### Arch Linux -```zsh -yay -Sy --noconfirm zsh-theme-powerlevel10k-bin -echo 'source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc -``` - -There is also [zsh-theme-powerlevel10k]( +There is [zsh-theme-powerlevel10k]( https://www.archlinux.org/packages/community/any/zsh-theme-powerlevel10k/) community package and [zsh-theme-powerlevel10k-git](https://aur.archlinux.org/packages/zsh-theme-powerlevel10k-git/) AUR -package. Both of these are old and broken. **Do not use them.** +package. Both are old and broken. **Do not use them.** ## Configuration @@ -593,19 +588,18 @@ 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/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 -Syu` | +| Installation | Update command | +|-------------------------|------------------------------------------------| +| [Manual](#manual) | `git -C ~/powerlevel10k pull` | +| [Oh My Zsh](#oh-my-zsh) | `git -C $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` | **IMPORTANT**: Restart Zsh after updating Powerlevel10k. [Do not use `source ~/.zshrc`]( #weird-things-happen-after-typing-source-zshrc). From 2ade5d786b5b2a700964a6cd418cdaaca88fc55b Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 26 May 2020 08:36:52 +0200 Subject: [PATCH 052/659] disable instant prompt when gitstatus fails to initialize --- internal/p10k.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index ad7576f5..373ee7b3 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7910,6 +7910,7 @@ _p9k_init_vcs() { } } fi + (( $+GITSTATUS_DAEMON_PID_POWERLEVEL9K )) || _p9k__instant_prompt_disabled=1 return 0 fi (( _POWERLEVEL9K_DISABLE_GITSTATUS )) && return @@ -7952,6 +7953,7 @@ _p9k_init_vcs() { trap ':' INT } } + (( $+GITSTATUS_DAEMON_PID_POWERLEVEL9K )) || _p9k__instant_prompt_disabled=1 } _p9k_init() { From 9a4bbcd930afa54bc605e3020fb38353161e5a84 Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 26 May 2020 08:37:25 +0200 Subject: [PATCH 053/659] Squashed 'gitstatus/' changes from 0127fd26a..cc956ca78 cc956ca78 interrupt p10k instant prompt before printing "gitstatus failed to initialize" error db3603bc8 improve "gitstatus failed to initialize" error message e164594ea work around bugs in cygwin 55af96ade cleanup + todo 0e70dbc56 add an empty line before the error message git-subtree-dir: gitstatus git-subtree-split: cc956ca7878ef6d00bb1f35861864d0a40ffac75 --- build | 7 ++++-- gitstatus.plugin.sh | 1 + gitstatus.plugin.zsh | 52 ++++++++++++++++---------------------------- mbuild | 20 +++++++++-------- 4 files changed, 36 insertions(+), 44 deletions(-) diff --git a/build b/build index 25dbb5e9..2cb63f74 100755 --- a/build +++ b/build @@ -56,9 +56,12 @@ appname=gitstatusd-"$gitstatus_kernel"-"$gitstatus_arch" libgit2_tmp="$outdir"/deps/"$appname".libgit2.tmp cleanup() { - cd / - command rm -rf -- "$workdir" "$outdir"/usrbin/"$appname".tmp "$libgit2_tmp" trap - INT QUIT TERM ILL PIPE + cd / + if ! command rm -rf -- "$workdir" "$outdir"/usrbin/"$appname".tmp "$libgit2_tmp"; then + command sleep 5 + command rm -rf -- "$workdir" "$outdir"/usrbin/"$appname".tmp "$libgit2_tmp" + fi } trap cleanup INT QUIT TERM ILL PIPE diff --git a/gitstatus.plugin.sh b/gitstatus.plugin.sh index 4c9b70f0..d44d8cd7 100644 --- a/gitstatus.plugin.sh +++ b/gitstatus.plugin.sh @@ -225,6 +225,7 @@ function gitstatus_start() { } if ! gitstatus_start_impl; then + echo "" >&2 echo "gitstatus_start: failed to start gitstatusd" >&2 [[ -z "${req_fifo:-}" ]] || command rm -f "$req_fifo" [[ -z "${resp_fifo:-}" ]] || command rm -f "$resp_fifo" diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index 1fe219e9..1e5c7545 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -725,60 +725,46 @@ function gitstatus_start"${1:-}"() { gitstatus_stop$fsuf $name setopt prompt_percent no_prompt_subst no_prompt_bang + (( $+functions[p10k] )) && p10k clear-instant-prompt print -ru2 -- '' - print -Pru2 -- '[%F{red}ERROR%f]: gitstatus failed to initialize.' - print -ru2 -- '' - print -ru2 -- ' Your Git prompt may disappear or become slow.' + print -Pru2 -- '[%F{red}ERROR%f]: gitstatus failed to initialize.' + print -ru2 -- '' + print -ru2 -- ' Your Git prompt may disappear or become slow.' if [[ -s $xtrace ]]; then - print -ru2 -- '' - print -ru2 -- " The content of ${(q-)xtrace} (gitstatus_start xtrace):" - print -Pru2 -- '%F{yellow}' - >&2 awk '{print " " $0}' <$xtrace - print -Pru2 -- "%F{red} ^ this command failed ($err)%f" + print -ru2 -- '' + print -Pru2 -- " Zsh log (%U${xtrace//\%/%%}%u):" + print -Pru2 -- '%F{yellow}' + print -lru2 -- "${(@)${(@f)$(<$xtrace)}/#/ }" + print -Pru2 -- " %F{red}^ this command failed ($err)%f" fi if [[ -s $daemon_log ]]; then print -ru2 -- '' - print -ru2 -- " The content of ${(q-)daemon_log} (gitstatus daemon log):" + print -Pru2 -- " Daemon log (%U${daemon_log//\%/%%}%u):" print -Pru2 -- '%F{yellow}' - >&2 awk '{print " " $0}' <$daemon_log + print -lru2 -- "${(@)${(@f)$(<$daemon_log)}/#/ }" print -Pnru2 -- '%f' fi if [[ $GITSTATUS_LOG_LEVEL == DEBUG ]]; then print -ru2 -- '' - print -ru2 -- ' Your system information:' + print -ru2 -- ' System information:' print -Pru2 -- '%F{yellow}' print -ru2 -- " zsh: $ZSH_VERSION" print -ru2 -- " uname -a: $(uname -a)" print -Pru2 -- '%f' print -ru2 -- ' If you need help, open an issue and attach this whole error message to it:' print -ru2 -- '' - print -Pru2 -- ' %F{green}https://github.com/romkatv/gitstatus/issues/new%f' + print -Pru2 -- ' %Uhttps://github.com/romkatv/gitstatus/issues/new%u' else print -ru2 -- '' - print -ru2 -- ' Run the following command to retry with extra diagnostics:' - print -Pru2 -- '%F{green}' - local env="GITSTATUS_LOG_LEVEL=DEBUG" - if [[ -n $GITSTATUS_NUM_THREADS ]]; then - env+=" GITSTATUS_NUM_THREADS=${(q)GITSTATUS_NUM_THREADS}" - fi - if [[ -n $GITSTATUS_DAEMON ]]; then - env+=" GITSTATUS_DAEMON=${(q)GITSTATUS_DAEMON}" - fi - if [[ -n $GITSTATUS_AUTO_INSTALL ]]; then - env+=" GITSTATUS_AUTO_INSTALL=${(q)GITSTATUS_AUTO_INSTALL}" - fi - if [[ -n $GITSTATUS_CACHE_DIR ]]; then - env+=" GITSTATUS_CACHE_DIR=${(q)GITSTATUS_CACHE_DIR}" - fi - print -nru2 -- " ${env} gitstatus_start ${(@q-)*}" - print -Pru2 -- '%f' + local home=~ + local zshrc=${${${(q)${ZDOTDIR:-~}}/#${(q)home}/'~'}//\%/%%}/.zshrc + print -Pru2 -- " Add the following parameter to %U$zshrc%u for extra diagnostics on error:" print -ru2 -- '' - local zshrc=${(D)ZDOTDIR:-~}/.zshrc - print -ru2 -- " If this command produces no output, add the following parameter to $zshrc:" + print -Pru2 -- ' %BGITSTATUS_LOG_LEVEL=DEBUG%b' print -ru2 -- '' - print -Pru2 -- '%F{green} GITSTATUS_LOG_LEVEL=DEBUG%f' + print -ru2 -- ' Restart Zsh to retry gitstatus initialization:' print -ru2 -- '' - print -ru2 -- ' With this parameter gitstatus will print additional information on error.' + print -Pru2 -- ' %F{green}%Uexec%u zsh%f' fi } } diff --git a/mbuild b/mbuild index c5d5c87f..44800917 100755 --- a/mbuild +++ b/mbuild @@ -151,7 +151,7 @@ done shift $((OPTIND - 1)) -(( $# )) || set -- ${(k)assets} +(( $# )) || set -- ${(ko)assets} set -- ${(u)@} local platform @@ -200,15 +200,22 @@ function build-windows() { local tmp env bin intro flags=(-w) case $2 in - msys_nt-10.0-i686) bin='msys32/usr/bin';| - msys_nt-10.0-x86_64) bin='msys64/usr/bin';| cygwin_nt-10.0-i686) bin='cygwin32/bin' ;| cygwin_nt-10.0-x86_64) bin='cygwin64/bin' ;| + msys_nt-10.0-i686) bin='msys32/usr/bin';| + msys_nt-10.0-x86_64) bin='msys64/usr/bin';| + cygwin_nt-10.0-*) + 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; ' + 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. + break local out out="$(ssh $1 cmd.exe "$c/${bin%%/*}/autorebase.bat" 2>&1)" [[ $out == *"The following DLLs couldn't be rebased"* ]] || break @@ -243,12 +250,7 @@ function build-windows() { } done } "$@" - intro='pacman -Syu --noconfirm; pacman -S --needed --noconfirm git; ' - intro+='PATH="$PATH:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl"' - ;; - cygwin_nt-10.0-*) - tmp='/cygdrive/c/tmp' - ;; + ;| esac ssh $1 $c/$bin/env.exe $env c:/$bin/bash.exe -l <<<" From ba6c79e277299e2e033795ade9409331bc32498c Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 26 May 2020 11:14:33 +0200 Subject: [PATCH 054/659] docs: remove packaging instructions and instead discourage it --- README.md | 78 +++---------------------------------------------------- 1 file changed, 3 insertions(+), 75 deletions(-) diff --git a/README.md b/README.md index e6f65be6..30a80a41 100644 --- a/README.md +++ b/README.md @@ -1119,81 +1119,9 @@ If everything goes well, four `ttf` files will appear in `./out`. ### How to package Powerlevel10k for distribution? -If you want to package Powerlevel10k, it's best to do it based off [releases]( - https://github.com/romkatv/powerlevel10k/releases). - -The following code should work without patching anything in Powerlevel10k sources. If it doesn't, -please open an issue. - -**IMPORTANT:** *Change version to what you want to package. This example doesn't get updated when -new versions are released.* - -```zsh -# Download and extract Powerlevel10k tarball. -powerlevel10k_version=1.9.0 # IMPORTANT: CHANGE VERSION TO WHAT YOU WANT -wget https://github.com/romkatv/powerlevel10k/archive/v"$powerlevel10k_version".tar.gz -tar -xzf v"$powerlevel10k_version".tar.gz -cd powerlevel10k-"$powerlevel10k_version" - -# Download libgit2 tarball and compile gitstatusd. -./gitstatus/build -w - -# Post-process. -rm ./gitstatus/deps/libgit2-*.tar.gz -for file in *.zsh-theme internal/*.zsh gitstatus/*.zsh gitstatus/install; do - zsh -fc "emulate zsh -o no_aliases && zcompile -R -- $file.zwc $file" -done -``` - -This needs binutils, cmake, gcc, g++, git, GNU make, wget, zsh and either shasum or sha256sum. - -Once build completes, *do not delete or move any files*. Package the whole directory as is. Don't -add the directory or any of its subdirectories to `PATH`. - -You probably don't want to build in docker, so don't pass `-d` to `./gitstatus/build`. - -gitstatus depends on a [custom fork of libgit2](https://github.com/romkatv/libgit2/). When you run -`./gitstatus/build -w`, it'll automatically download the appropriate libgit2 tarball and verify its -sha256. If you want to separate the downloading of source tarballs from compilation, you can -download the libgit2 tarball manually and invoke `./gitstatus/build` without `-w`. - -```zsh -# Download and extract Powerlevel10k tarball. -powerlevel10k_version=1.9.0 # IMPORTANT: CHANGE VERSION TO WHAT YOU WANT -wget https://github.com/romkatv/powerlevel10k/archive/v"$powerlevel10k_version".tar.gz -tar -xzf v"$powerlevel10k_version".tar.gz -cd powerlevel10k-"$powerlevel10k_version" - -# Download libgit2 tarball and place it where ./gitstatus/build expects it. -. ./gitstatus/build.info -libgit2_path=./gitstatus/deps/libgit2-"$libgit2_version".tar.gz -libgit2_url=https://github.com/romkatv/libgit2/archive/"$libgit2_version".tar.gz -wget -O "$libgit2_path" "$libgit2_url" - -# Compile gitstatusd. -./gitstatus/build - -# Post-process. -rm ./gitstatus/deps/libgit2-*.tar.gz -for file in *.zsh-theme internal/*.zsh gitstatus/*.zsh gitstatus/install; do - zsh -fc "emulate zsh -o no_aliases && zcompile -R -- $file.zwc $file" -done -``` - -Note that the URL and the content of the libgit2 tarball are fully defined by the main Powerlevel10k -tarball. Thus, you can set URLs and sha256 checksums of the two tarball in the same place (package -definition) and update them at the same time when bumping package version. In other words, you don't -have to extract `libgit2_version` programmatically. You can manually copy it from [build.info]( - https://github.com/romkatv/powerlevel10k/blob/master/gitstatus/build.info) to your package -definition, if you prefer. - -Powerlevel10k has an embedded version of [gitstatus](https://github.com/romkatv/gitstatus). It must -stay that way. If you decide to package both of them, follow the respective instructions from each -project. The embedded gitstatus in Powerlevel10k won't conflict with the standalone gitstatus. They -can have different versions and can coexist within the same Zsh process. Do not attempt to -surgically remove gitstatus from Powerlevel10k, package the result and then force Powerlevel10k to -use a separately packaged gitstatus. Instead, treat Powerlevel10k and gitstatus as independent -projects that don't depend on each other. +It's currently neither easy nor recommended to package and distribute Powerlevel10k. There are no +instructions you can follow that would allow you to easily update your package when new versions of +Powerlevel10k are released. This may change in the future but not soon. ## Troubleshooting From 6696212ddecbb5ffae8d71467518cc5651c90b3f Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 26 May 2020 11:14:53 +0200 Subject: [PATCH 055/659] Squashed 'gitstatus/' changes from cc956ca78..331e9ff65 331e9ff65 docs: remove packaging instructions and instead discourage it c1fff558c install: add a link to #compiling docs if no gitstatusd is found 8632b85ab build: use extra optimization and hardening flags c0a71c757 mbuild: don't stop on first failure 52e0359ec build: don't link statically when doing a local linux build git-subtree-dir: gitstatus git-subtree-split: 331e9ff65df96e7423c0b7a01e5e98d6c6b7d428 --- README.md | 84 ++++++------------------------------------------------- build | 34 +++++++++++++++------- install | 2 ++ mbuild | 15 +++++++--- 4 files changed, 46 insertions(+), 89 deletions(-) diff --git a/README.md b/README.md index 24ebf75d..291f89bf 100644 --- a/README.md +++ b/README.md @@ -511,83 +511,17 @@ by shell bindings automatically. When you update shell bindings, they may refuse to work with the binary you've built earlier. In this case you'll need to rebuild. +If you are using gitstatus through [Powerlevel10k](https://github.com/romkatv/powerlevel10k), the +instructions are the same except that you don't need to clone gitstatus. Instead, change your +current directory to `/path/to/powerlevel10k/gitstatus` (`/path/to/powerlevel10k` is the directory +where you've installed Powerlevel10k) and run `./build -w -s -d docker` from there as described +above. + ### Compiling for distribution -If you want to package gitstatus, it's best to do it based off [releases]( - https://github.com/romkatv/gitstatus/releases). - -The following code should work without patching anything in gitstatus sources. If it doesn't, please -open an issue. - -**IMPORTANT:** *Change version to what you want to package. This example doesn't get updated when -new versions are released.* - -```zsh -# Download and extract gitstatus tarball. -gitstatus_version=1.1.0 # IMPORTANT: CHANGE VERSION TO WHAT YOU WANT -wget https://github.com/romkatv/gitstatus/archive/v"$gitstatus_version".tar.gz -tar -xzf v"$gitstatus_version".tar.gz -cd gitstatus-"$gitstatus_version" - -# Download libgit2 tarball and compile gitstatusd. -./build -w - -# Post-process. -rm ./deps/libgit2-*.tar.gz -for file in *.zsh install; do - zsh -fc "emulate zsh -o no_aliases && zcompile -R -- $file.zwc $file" -done -``` - -This needs binutils, cmake, gcc, g++, git, GNU make, wget, zsh and either shasum or sha256sum. - -Once build completes, *do not delete or move any files*. Package the whole directory as is. Don't -add the directory or any of its subdirectories to `PATH`. - -You probably don't want to build in docker, so don't pass `-d` to `./build`. - -gitstatus depends on a [custom fork of libgit2](https://github.com/romkatv/libgit2/). When you run -`./build -w`, it'll automatically download the appropriate libgit2 tarball and verify its sha256. -If you want to separate the downloading of source tarballs from compilation, you can download the -libgit2 tarball manually and invoke `./build` without `-w`. - -```zsh -# Download and extract gitstatus tarball. -gitstatus_version=1.1.0 # IMPORTANT: CHANGE VERSION TO WHAT YOU WANT -wget https://github.com/romkatv/gitstatus/archive/v"$gitstatus_version".tar.gz -tar -xzf v"$gitstatus_version".tar.gz -cd gitstatus-"$gitstatus_version" - -# Download libgit2 tarball and place it where ./build expects it. -. ./build.info -libgit2_path=./deps/libgit2-"$libgit2_version".tar.gz -libgit2_url=https://github.com/romkatv/libgit2/archive/"$libgit2_version".tar.gz -wget -O "$libgit2_path" "$libgit2_url" - -# Compile gitstatusd. -./build - -# Post-process. -rm ./deps/libgit2-*.tar.gz -for file in *.zsh install; do - zsh -fc "emulate zsh -o no_aliases && zcompile -R -- $file.zwc $file" -done -``` - -Note that the URL and the content of the libgit2 tarball are fully defined by the main gitstatus -tarball. Thus, you can set URLs and sha256 checksums of the two tarball in the same place (package -definition) and update them at the same time when bumping package version. In other words, you don't -have to extract `libgit2_version` programmatically. You can manually copy it from [build.info]( - https://github.com/romkatv/gitstatus/blob/master/build.info) to your package definition, if you -prefer. - -[Powerlevel10k](https://github.com/romkatv/powerlevel10k) has an embedded version of gitstatus. It -must stay that way. If you decide to package both of them, follow the respective instructions from -each project. The embedded gitstatus in Powerlevel10k won't conflict with the standalone gitstatus. -They can have different versions and can coexist within the same Zsh process. Do not attempt to -surgically remove gitstatus from Powerlevel10k, package the result and then force Powerlevel10k to -use a separately packaged gitstatus. Instead, treat Powerlevel10k and gitstatus as independent -projects that don't depend on each other. +It's currently neither easy nor recommended to package and distribute gitstatus. There are no +instructions you can follow that would allow you to easily update your package when new versions of +gitstatus are released. This may change in the future but not soon. ## License diff --git a/build b/build index 2cb63f74..78d57ec5 100755 --- a/build +++ b/build @@ -110,34 +110,44 @@ cpus="$(command getconf _NPROCESSORS_ONLN 2>/dev/null)" || cpus=8 case "$gitstatus_cpu" in - ppc64le) - archflag="-mcpu" - ;; - *) - archflag="-march" - ;; + ppc64le) archflag="-mcpu";; + *) archflag="-march";; esac +cflags="$archflag=$gitstatus_cpu -fno-plt" + +if [ "$gitstatus_cpu" = x86-64 ]; then + cflags="$cflags -mtune=generic" +fi + libgit2_cmake_flags= -libgit2_cflags="$archflag=$gitstatus_cpu" +libgit2_cflags="$cflags" gitstatus_cxx=g++ -gitstatus_cxxflags="-I${workdir}/libgit2/include -DGITSTATUS_ZERO_NSEC -D_GNU_SOURCE $archflag=$gitstatus_cpu" +gitstatus_cxxflags="$cflags -I${workdir}/libgit2/include -DGITSTATUS_ZERO_NSEC -D_GNU_SOURCE" gitstatus_ldflags="-L${workdir}/libgit2/build" gitstatus_ldlibs= gitstatus_make=make case "$gitstatus_kernel" in linux) - gitstatus_ldflags="$gitstatus_ldflags -static" + if [ -n "$docker_cmd" ]; then + gitstatus_ldflags="$gitstatus_ldflags -static" + fi + gitstatus_ldflags="$gitstatus_ldflags -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" + 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" + 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" + libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" ;; darwin) command mkdir -- "$workdir"/lib @@ -147,12 +157,15 @@ case "$gitstatus_kernel" in gitstatus_cxxflags="$gitstatus_cxxflags -I/usr/local/opt/libiconv/include" gitstatus_ldlibs="$gitstatus_ldlibs -liconv" gitstatus_ldflags="$gitstatus_ldflags -L${workdir}/lib" + libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=OFF" ;; msys*|mingw*) gitstatus_ldflags="$gitstatus_ldflags -static" + libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" ;; cygwin*) gitstatus_ldflags="$gitstatus_ldflags -static" + libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" ;; *) >&2 echo "[internal error] unhandled kernel: $gitstatus_kernel" @@ -252,7 +265,6 @@ CFLAGS="$libgit2_cflags" command cmake \ -DUSE_GSSAPI=OFF \ -DUSE_NTLMCLIENT=OFF \ -DBUILD_SHARED_LIBS=OFF \ - -DENABLE_REPRODUCIBLE_BUILDS=OFF \ $libgit2_cmake_flags \ .. command make -j "$cpus" VERBOSE=1 @@ -490,6 +502,8 @@ fi if [ -n "$docker_cmd" ]; then "$docker_cmd" run \ + -e docker_cmd="$docker_cmd" \ + -e docker_image="$docker_image" \ -e gitstatus_kernel="$gitstatus_kernel" \ -e gitstatus_arch="$gitstatus_arch" \ -e gitstatus_cpu="$gitstatus_cpu" \ diff --git a/install b/install index 126b8339..d243ef9c 100755 --- a/install +++ b/install @@ -367,6 +367,8 @@ END done <"$gitstatus_dir"/install.info >&2 echo "[gitstatus] error: no gitstatusd found for $uname_s $uname_m" + >&2 echo "" + >&2 echo "See: https://github.com/romkatv/gitstatus/blob/master/README.md#compiling" return 1 } diff --git a/mbuild b/mbuild index 44800917..cf4bc008 100755 --- a/mbuild +++ b/mbuild @@ -283,17 +283,24 @@ function mbuild() { print -r -- "starting build for $platform on $assets[$platform] (pid $!)" pids+=($platform $!) done + local failed=() for platform pid in $pids; do print -rn -- "$platform => " if wait $pid; then print -r -- "ok" else - print -r -- "error $?" - print -r -- "---------------------" - >&2 cat $logs/$platform - return 1 + print -r -- "error" + failed+=$platform fi done + (( $#failed )) || return 0 + print + print -r -- "Error logs:" + print + for platform in $failed; do + print -r -- " $platform => $logs/$platform" + done + return 1 } # Copied from https://github.com/romkatv/run-process-tree. From 7d35c7ebb834123bc69a8155a97bb32513c84312 Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 26 May 2020 11:31:11 +0200 Subject: [PATCH 056/659] remove execute permission from wizard.zsh --- internal/wizard.zsh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 internal/wizard.zsh diff --git a/internal/wizard.zsh b/internal/wizard.zsh old mode 100755 new mode 100644 From 4cd2700a85053047fa2cf3b6fe4eee552cf72612 Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 26 May 2020 13:45:56 +0200 Subject: [PATCH 057/659] bug fix: update taskwarrior when a pending task becomes overdue; see #763 --- internal/p10k.zsh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 373ee7b3..c587c4b7 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4812,6 +4812,7 @@ function _p9k_taskwarrior_check_data() { zstat -A stat +mtime -- $_p9k_taskwarrior_data_files 2>/dev/null || return fi [[ $_p9k_taskwarrior_data_sig == ${(pj:\0:)stat}$'\0'$TASKRC$'\0'$TASKDATA ]] || return + (( _p9k_taskwarrior_next_due == 0 || _p9k_taskwarrior_next_due > EPOCHSECONDS )) || return } function _p9k_taskwarrior_init_data() { @@ -4836,6 +4837,18 @@ function _p9k_taskwarrior_init_data() { _p9k_taskwarrior_counters[$name]=$val done + _p9k_taskwarrior_next_due=0 + + if (( _p9k_taskwarrior_counters[PENDING] > _p9k_taskwarrior_counters[OVERDUE] )); then + local -a ts + ts=($(task +PENDING -OVERDUE list \ + rc.verbose=nothing rc.report.list.labels= rc.report.list.columns=due.epoch)) || ts=() + if (( $#ts )); then + _p9k_taskwarrior_next_due=${${(on)ts}[1]} + (( _p9k_taskwarrior_next_due > EPOCHSECONDS )) || _p9k_taskwarrior_next_due=$((EPOCHSECONDS+60)) + fi + fi + _p9k__state_dump_scheduled=1 } @@ -4846,6 +4859,7 @@ function prompt_taskwarrior() { _p9k_taskwarrior_data_non_files=() _p9k_taskwarrior_data_sig= _p9k_taskwarrior_counters=() + _p9k_taskwarrior_next_due=0 _p9k_taskwarrior_check_meta || _p9k_taskwarrior_init_meta || return _p9k_taskwarrior_init_data fi @@ -6555,6 +6569,7 @@ _p9k_init_vars() { typeset -ga _p9k_taskwarrior_data_non_files typeset -g _p9k_taskwarrior_data_sig typeset -gA _p9k_taskwarrior_counters + typeset -gF _p9k_taskwarrior_next_due typeset -ga _p9k_asdf_meta_files typeset -ga _p9k_asdf_meta_non_files @@ -7646,7 +7661,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v89\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v90\1'${ZSH_VERSION}$'\1'${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\1${ZLE_RPROMPT_INDENT:-1}\1$__p9k_ksh_arrays\1' From ad18cd78dba0676a5f1fefcebce9e7283a2bcbb7 Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 26 May 2020 13:47:34 +0200 Subject: [PATCH 058/659] call taskwarrior via `command task` --- internal/p10k.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index c587c4b7..ce3f7214 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4776,7 +4776,7 @@ function _p9k_taskwarrior_init_meta() { local last_sig=$_p9k_taskwarrior_meta_sig { local cfg - cfg="$(task show data.location /dev/null)" || return + cfg="$(command task show data.location /dev/null)" || return local lines=(${(@M)${(f)cfg}:#data.location[[:space:]]##[^[:space:]]*}) (( $#lines == 1 )) || return local dir=${lines[1]##data.location[[:space:]]#} @@ -4832,7 +4832,7 @@ function _p9k_taskwarrior_init_data() { local name val for name in PENDING OVERDUE; do - val="$(task +$name count /dev/null)" || continue + val="$(command task +$name count /dev/null)" || continue [[ $val == <1-> ]] || continue _p9k_taskwarrior_counters[$name]=$val done @@ -4841,8 +4841,8 @@ function _p9k_taskwarrior_init_data() { if (( _p9k_taskwarrior_counters[PENDING] > _p9k_taskwarrior_counters[OVERDUE] )); then local -a ts - ts=($(task +PENDING -OVERDUE list \ - rc.verbose=nothing rc.report.list.labels= rc.report.list.columns=due.epoch)) || ts=() + ts=($(command task +PENDING -OVERDUE list rc.verbose=nothing \ + rc.report.list.labels= rc.report.list.columns=due.epoch /dev/null)) || ts=() if (( $#ts )); then _p9k_taskwarrior_next_due=${${(on)ts}[1]} (( _p9k_taskwarrior_next_due > EPOCHSECONDS )) || _p9k_taskwarrior_next_due=$((EPOCHSECONDS+60)) From b3875f519313319530913f7e894f3b491c81278c Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 26 May 2020 20:15:53 +0200 Subject: [PATCH 059/659] avoid spurious error (even if harmless and invisible) on worker cleanup --- internal/worker.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/worker.zsh b/internal/worker.zsh index 9e78bc15..4b3f40e4 100644 --- a/internal/worker.zsh +++ b/internal/worker.zsh @@ -89,7 +89,8 @@ function _p9k_worker_invoke() { } function _p9k_worker_cleanup() { - eval "$__p9k_intro" + # langinfo may not be available here. + eval "$__p9k_intro_no_locale" [[ $_p9k__worker_shell_pid == $sysparams[pid] ]] && _p9k_worker_stop return 0 } From 102aefadaba271a48a74f13953dd88067f9862c6 Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 26 May 2020 20:51:58 +0200 Subject: [PATCH 060/659] Squashed 'gitstatus/' changes from 331e9ff65..be42ea1be be42ea1be support split gitstatusd release binaries git-subtree-dir: gitstatus git-subtree-split: be42ea1be4a7938464aea568d719bf4c01e4b1f4 --- install | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/install b/install index d243ef9c..65f84caf 100755 --- a/install +++ b/install @@ -236,9 +236,9 @@ END local fetch if command -v curl >/dev/null 2>&1; then - fetch="command curl -fsSLo" + fetch="command curl -fsSL --" elif command -v wget >/dev/null 2>&1; then - fetch="command wget -O" + fetch="command wget -O- --" else >&2 echo "[gitstatus] error: please install curl or wget" exit 1 @@ -276,15 +276,29 @@ END if [ "$1" != 1 ] && command -v sleep >/dev/null 2>/dev/null; then sleep "$1" fi - $fetch "$1".tar.gz -- "$2" 2>/dev/null & - local pid=$! - local die="trap - $sig; kill -- $pid 2>/dev/null; exit 1" - trap "$die" $sig - [ -z "$trapped" ] || eval "$die" - wait -- "$pid" 2>/dev/null && check_sha256 "$1" - local ret="$?" + local part=0 url ret pid die + while true; do + if [ "$part" = 3 ]; then + ret=1 + break + elif [ "$part" = 0 ]; then + url="$2" + else + url="$2"."$part" + fi + $fetch "$url" >>"$1".tar.gz 2>/dev/null & + pid=$! + die="trap - $sig; kill -- $pid 2>/dev/null; exit 1" + trap "$die" $sig + [ -z "$trapped" ] || eval "$die" + wait -- "$pid" 2>/dev/null + ret="$?" + trap - $sig + [ "$ret" = 0 ] || break + check_sha256 "$1" && break + part=$((part+1)) + done echo -n >"$1".status - trap - $sig return "$ret" } From 86d980cdb5d8eed683322f61db7c22c02640dd67 Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 26 May 2020 21:50:05 +0200 Subject: [PATCH 061/659] Squashed 'gitstatus/' changes from be42ea1be..45489634e 45489634e check for cygwin via OSTYPE git-subtree-dir: gitstatus git-subtree-split: 45489634e1b9a2a11fc8dc94482516142d61a9c8 --- gitstatus.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index 1e5c7545..1e806a3c 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -573,7 +573,7 @@ function gitstatus_start"${1:-}"() { typeset -gi _GITSTATUS_LOCK_FD_$name=lock_fd - if [[ -n $USERPROFILE && -d /cygdrive && -d /proc/self/fd ]]; then + if [[ $OSTYPE == cygwin* && -d /proc/self/fd ]]; then # Work around bugs in Cygwin 32-bit. # # This hangs: From 937204640a2588a66124a6c50abae1f6b308d690 Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 27 May 2020 07:35:31 +0200 Subject: [PATCH 062/659] add uninistall instructions --- README.md | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 30a80a41..42b0bd87 100644 --- a/README.md +++ b/README.md @@ -591,7 +591,7 @@ 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/themes/powerlevel10k pull` | +| [Oh My Zsh](#oh-my-zsh) | `git -C ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k pull` | | [Prezto](#prezto) | `zprezto-update` | | [Zim](#zim) | `zimfw update` | | [Antigen](#antigen) | `antigen update` | @@ -604,6 +604,47 @@ The command to update Powerlevel10k depends on how it was installed. **IMPORTANT**: Restart Zsh after updating Powerlevel10k. [Do not use `source ~/.zshrc`]( #weird-things-happen-after-typing-source-zshrc). +### How do I uninstall Powerlevel10k? + +1. Remove all references to "p10k" from `~/.zshrc`. You might have this snippet at the top: + ```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 + ``` + And this at the bottom: + ```zsh + [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh + ``` + These are added by the [configuration wizard](#configuration-wizard). Remove them. +2. Remove all references to "powerlevel10k" from `~/.zshrc`, `~/.zpreztorc` and `~/.zimrc` (some + of these files may be missing -- this is normal). These references have been added manually by + yourself when installing Powerlevel10k. Refer to the [installation instructions](#installation) + if you need a reminder. +3. Verify that all references to "p10k" and "powerlevel10k" are gone from `~/.zshrc`, `~/.zpreztorc` + and `~/.zimrc`. + ```zsh + grep -E 'p10k|powerlevel10k' ~/.zshrc ~/.zpreztorc ~/.zimrc 2>/dev/null + ``` + If this command produces output, there are still references to "p10k" or "powerlevel10k". You + need to remove them. +4. Delete Powerlevel10k source files. The command to do so depends on how you've installed + Powerlevel10k. 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:-~/.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` | +5. Restart Zsh. [Do not use `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc). + ### 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]( @@ -1106,7 +1147,6 @@ 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). - MesloLGS NF font can be recreated with the following command (requires `git` and `docker`): ```zsh @@ -1664,6 +1704,7 @@ typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='${P9K_CONTENT}' # not bold - [License](#license) - [FAQ](#faq) - [How do I update Powerlevel10k?](#how-do-i-update-powerlevel10k) + - [How do I uninstall Powerlevel10k?](#how-do-i-uninstall-powerlevel10k) - [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) From c9e3cfe5db69840db054f3cad9d0798dbbc5728c Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 27 May 2020 07:37:19 +0200 Subject: [PATCH 063/659] add `rm -f ~/.p10k.zsh` to uninistall instructions --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 42b0bd87..476d71d1 100644 --- a/README.md +++ b/README.md @@ -628,7 +628,11 @@ The command to update Powerlevel10k depends on how it was installed. ``` If this command produces output, there are still references to "p10k" or "powerlevel10k". You need to remove them. -4. Delete Powerlevel10k source files. The command to do so depends on how you've installed +4. Delete Powerlevel10k configuration file. + ```zsh + rm -f ~/.p10k.zsh + ``` +5. Delete Powerlevel10k source files. The command to do so depends on how you've installed Powerlevel10k. Refer to the [installation instructions](#installation) if you need a reminder. | Installation | Uninstall command | From d8d6efc4ec8e368d4eb6c6dcb797f2b9755cead4 Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 27 May 2020 07:41:54 +0200 Subject: [PATCH 064/659] add more details to uninstall instructions --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 476d71d1..556f8b3e 100644 --- a/README.md +++ b/README.md @@ -628,12 +628,14 @@ The command to update Powerlevel10k depends on how it was installed. ``` If this command produces output, there are still references to "p10k" or "powerlevel10k". You need to remove them. -4. Delete Powerlevel10k configuration file. +4. Delete Powerlevel10k configuration file. This file is created by the + [configuration wizard](#configuration-wizard) and may contain manual edits by yourself. ```zsh rm -f ~/.p10k.zsh ``` -5. Delete Powerlevel10k source files. The command to do so depends on how you've installed - Powerlevel10k. Refer to the [installation instructions](#installation) if you need a reminder. +5. Delete Powerlevel10k source files. These files have been downloaded when you've 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 | |-------------------------|---------------------------------------------------------------------| From f3fb34dd99dbbb3b5974326311117bf6a7e1d229 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 28 May 2020 08:58:53 +0200 Subject: [PATCH 065/659] more conservative instant prompt activation and cleanup on premature shell exit; see #770 --- internal/p10k.zsh | 54 ++++++++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index ce3f7214..5ea8f529 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5608,7 +5608,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=26 +typeset -gri __p9k_instant_prompt_version=27 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -5639,7 +5639,7 @@ _p9k_dump_instant_prompt() { $__p9k_intro_no_locale (( ! \$+__p9k_instant_prompt_disabled )) || return typeset -gi __p9k_instant_prompt_disabled=1 __p9k_instant_prompt_sourced=$__p9k_instant_prompt_version - [[ -t 0 && -t 1 && -t 2 && \$ZSH_VERSION == ${(q)ZSH_VERSION} && \$ZSH_PATCHLEVEL == ${(q)ZSH_PATCHLEVEL} && + [[ \$ZSH_VERSION == ${(q)ZSH_VERSION} && \$ZSH_PATCHLEVEL == ${(q)ZSH_PATCHLEVEL} && \$TERM_PROGRAM $hyper 'Hyper' && \$+VTE_VERSION == $+VTE_VERSION && \$POWERLEVEL9K_DISABLE_INSTANT_PROMPT != 'true' && \$POWERLEVEL9K_INSTANT_PROMPT != 'off' ]] || { __p9k_instant_prompt_sourced=0; return 1; } @@ -5661,6 +5661,8 @@ _p9k_dump_instant_prompt() { __p9k_instant_prompt_sourced=0 return 1 fi + [[ $ZSH_SUBSHELL == 0 && -z $ZSH_SCRIPT && -z $ZSH_EXECUTION_STRING && + -t 0 && -t 1 && -t 2 && -o interactive && -o zle && -o no_xtrace ]] || return zmodload zsh/langinfo zsh/terminfo zsh/system || return if [[ $langinfo[CODESET] != (utf|UTF)(-|)8 ]]; then local loc_cmd=$commands[locale] @@ -5893,34 +5895,41 @@ _p9k_dump_instant_prompt() { if source $__p9k_instant_prompt_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then _p9k_preinit fi + function _p9k_instant_prompt_cleanup() { + (( ZSH_SUBSHELL == 0 && ${+__p9k_instant_prompt_active} )) || return 0 + '$__p9k_intro_no_locale' + unset __p9k_instant_prompt_active + 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 + print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed] + if [[ -s $__p9k_instant_prompt_output ]]; then + command cat $__p9k_instant_prompt_output 2>/dev/null + if (( $1 )); then + local _p9k__ret mark="${(e)${PROMPT_EOL_MARK-%B%S%#%s%b}}" + _p9k_prompt_length $mark + local -i fill=$((COLUMNS > _p9k__ret ? COLUMNS - _p9k__ret : 0)) + echo -nE - "${(%):-%b%k%f%s%u$mark${(pl.$fill.. .)}$cr%b%k%f%s%u%E}" + fi + fi + zshexit_functions=(${zshexit_functions:#_p9k_instant_prompt_cleanup}) + zmodload -F zsh/files b:zf_rm || return + local user=${(%):-%n} + local root_dir=${__p9k_instant_prompt_dump_file:h} + zf_rm -f -- $__p9k_instant_prompt_output $__p9k_instant_prompt_dump_file{,.zwc} $root_dir/p10k-instant-prompt-$user.zsh{,.zwc} $root_dir/p10k-$user/prompt-*(N) 2>/dev/null + } function _p9k_instant_prompt_precmd_first() { '$__p9k_intro' function _p9k_instant_prompt_sched_last() { - (( $+__p9k_instant_prompt_active )) || return 0 - () { - '$__p9k_intro' - 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 __p9k_instant_prompt_active - typeset -gi __p9k_instant_prompt_erased=1 - print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed] - if [[ -s $__p9k_instant_prompt_output ]]; then - cat $__p9k_instant_prompt_output 2>/dev/null - local _p9k__ret mark="${(e)${PROMPT_EOL_MARK-%B%S%#%s%b}}" - _p9k_prompt_length $mark - local -i fill=$((COLUMNS > _p9k__ret ? COLUMNS - _p9k__ret : 0)) - echo -nE - "${(%):-%b%k%f%s%u$mark${(pl.$fill.. .)}$cr%b%k%f%s%u%E}" - fi - zmodload -F zsh/files b:zf_rm || return - local user=${(%):-%n} - local root_dir=${__p9k_instant_prompt_dump_file:h} - zf_rm -f -- $__p9k_instant_prompt_output $__p9k_instant_prompt_dump_file{,.zwc} $root_dir/p10k-instant-prompt-$user.zsh{,.zwc} $root_dir/p10k-$user/prompt-*(N) 2>/dev/null - } + (( ${+__p9k_instant_prompt_active} )) || return 0 + _p9k_instant_prompt_cleanup 1 setopt no_local_options prompt_cr prompt_sp } zmodload zsh/sched sched +0 _p9k_instant_prompt_sched_last precmd_functions=(${(@)precmd_functions:#_p9k_instant_prompt_precmd_first}) } + 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 || true' @@ -6073,6 +6082,7 @@ function _p9k_clear_instant_prompt() { fi exec 1>&$__p9k_fd_1 2>&$__p9k_fd_2 {__p9k_fd_1}>&- {__p9k_fd_2}>&- unset __p9k_fd_1 __p9k_fd_2 + zshexit_functions=(${zshexit_functions:#_p9k_instant_prompt_cleanup}) if (( _p9k__can_hide_cursor )); then echoti civis _p9k__cursor_hidden=1 @@ -6140,7 +6150,7 @@ function _p9k_clear_instant_prompt() { echo -E - "" fi fi - cat -- $__p9k_instant_prompt_output + command cat -- $__p9k_instant_prompt_output echo -nE - $sp zf_rm -f -- $__p9k_instant_prompt_output } 2>/dev/null From a3d887cd43b21e8c86a972b4e74f92c534321dd6 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 29 May 2020 09:25:40 +0200 Subject: [PATCH 066/659] add __p9k_root_dir and GITSTATUS_AUTO_INSTALL to param_pat --- internal/p10k.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 5ea8f529..edba4be2 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7671,14 +7671,14 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v90\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v91\1'${ZSH_VERSION}$'\1'${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\1${ZLE_RPROMPT_INDENT:-1}\1$__p9k_ksh_arrays\1' - _p9k__param_pat+=$'$__p9k_sh_glob\1$ITERM_SHELL_INTEGRATION_INSTALLED\1$commands[uname]\1' + _p9k__param_pat+=$'$GITSTATUS_CACHE_DIR\1$GITSTATUS_AUTO_INSTALL\1${ZLE_RPROMPT_INDENT:-1}\1' + _p9k__param_pat+=$'$__p9k_sh_glob\1$__p9k_ksh_arrays\1$ITERM_SHELL_INTEGRATION_INSTALLED\1' _p9k__param_pat+=$'${PROMPT_EOL_MARK-%B%S%#%s%b}\1$commands[locale]\1$langinfo[CODESET]\1' - _p9k__param_pat+=$'$VTE_VERSION\1$TERM_PROGRAM\1$DEFAULT_USER\1$P9K_SSH\1' - _p9k__param_pat+=$'$functions[p10k-on-init]$functions[p10k-on-pre-prompt]\1' + _p9k__param_pat+=$'$VTE_VERSION\1$TERM_PROGRAM\1$DEFAULT_USER\1$P9K_SSH\1$commands[uname]\1' + _p9k__param_pat+=$'$__p9k_root_dir\1$functions[p10k-on-init]$functions[p10k-on-pre-prompt]\1' _p9k__param_pat+=$'$functions[p10k-on-post-widget]$functions[p10k-on-post-prompt]\1' local MATCH IFS=$'\1' _p9k__param_pat+="${(@)${(@o)parameters[(I)POWERLEVEL9K_*]}:/(#m)*/\${${(q)MATCH}-$IFS\}}" From a4a71cff9e99d7b1a1f9670e0c3934d4270e6a1e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 29 May 2020 14:43:43 +0200 Subject: [PATCH 067/659] speed up pasting in terminals without bracketed paste; see #568 --- internal/p10k.zsh | 61 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index edba4be2..3158379c 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6496,6 +6496,7 @@ _p9k_precmd_impl() { _p9k_trapint() { if (( __p9k_enabled )); then eval "$__p9k_intro" + _p9k_deschedule_redraw zle && _p9k_on_widget_zle-line-finish int fi return 0 @@ -6652,6 +6653,7 @@ _p9k_init_vars() { typeset -gi _p9k__fully_initialized typeset -gi _p9k__must_restore_prompt typeset -gi _p9k__restore_prompt_fd + typeset -gi _p9k__redraw_fd typeset -gi _p9k__can_hide_cursor=$(( $+terminfo[civis] && $+terminfo[cnorm] )) typeset -gi _p9k__cursor_hidden typeset -gi _p9k__non_hermetic_expansion @@ -7216,12 +7218,56 @@ function _p9k_display_segment() { __p9k_reset_state=2 } +function _p9k_redraw() { + zle -F $1 + exec {1}>&- + _p9k__redraw_fd=0 + + local -a P9K_COMMANDS + _p9k__last_buffer="$PREBUFFER$BUFFER" + # this must run with user options + _p9k_parse_buffer "$_p9k__last_buffer" $_POWERLEVEL9K_COMMANDS_MAX_TOKEN_COUNT + _p9k__last_commands=(${P9K_COMMANDS[@]}) + + () { + eval "$__p9k_intro" + local -h WIDGET=zle-line-pre-redraw + (( _p9k__restore_prompt_fd )) && _p9k_restore_prompt $_p9k__restore_prompt_fd + local pat idx var + for pat idx var in $_p9k_show_on_command; do + if (( $P9K_COMMANDS[(I)$pat] )); then + _p9k_display_segment $idx $var show + else + _p9k_display_segment $idx $var hide + fi + done + (( $+functions[p10k-on-post-widget] )) && p10k-on-post-widget + (( __p9k_reset_state == 2 )) && _p9k_reset_prompt + __p9k_reset_state=0 + } +} + +function _p9k_deschedule_redraw() { + (( _p9k__redraw_fd )) || return + zle -F $_p9k__redraw_fd + exec {_p9k__redraw_fd}>&- + _p9k__redraw_fd=0 +} + function _p9k_widget_hook() { if (( $+functions[p10k-on-post-widget] || $#_p9k_show_on_command )); then local -a P9K_COMMANDS if [[ "$_p9k__last_buffer" == "$PREBUFFER$BUFFER" ]]; then P9K_COMMANDS=(${_p9k__last_commands[@]}) + _p9k_deschedule_redraw + elif [[ $1 == zle-line-pre-redraw ]] && (( PENDING || KEYS_QUEUED_COUNT )); then + P9K_COMMANDS=(${_p9k__last_commands[@]}) + if (( ! _p9k__redraw_fd )); then + sysopen -o cloexec -ru _p9k__redraw_fd /dev/null + zle -F $_p9k__redraw_fd _p9k_redraw + fi else + _p9k_deschedule_redraw _p9k__last_buffer="$PREBUFFER$BUFFER" if [[ -n "$_p9k__last_buffer" ]]; then # this must run with user options @@ -7671,7 +7717,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v91\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v92\1'${ZSH_VERSION}$'\1'${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' @@ -8115,7 +8161,18 @@ _p9k_deinit() { (( $+functions[_p9k_preinit] )) && unfunction _p9k_preinit (( $+functions[gitstatus_stop_p9k_] )) && gitstatus_stop_p9k_ POWERLEVEL9K _p9k_worker_stop - (( _p9k__state_dump_fd )) && exec {_p9k__state_dump_fd}>&- + if (( _p9k__state_dump_fd )); then + zle -F $_p9k__state_dump_fd + exec {_p9k__state_dump_fd}>&- + fi + if (( _p9k__restore_prompt_fd )); then + zle -F $_p9k__restore_prompt_fd + exec {_p9k__restore_prompt_fd}>&- + fi + if (( _p9k__redraw_fd )); then + zle -F $_p9k__redraw_fd + exec {_p9k__redraw_fd}>&- + 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_TTY)' From 094d1b3a47cf40746807820cababab3a829ac334 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 30 May 2020 12:58:18 +0200 Subject: [PATCH 068/659] Squashed 'gitstatus/' changes from 45489634e..ab1aea155 ab1aea155 remove "this command failed" message; it makes users to post truncated messages that are useless for debugging git-subtree-dir: gitstatus git-subtree-split: ab1aea155f051ecab8b70154f136eef81976dd25 --- gitstatus.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index 1e806a3c..b4690727 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -735,7 +735,7 @@ function gitstatus_start"${1:-}"() { print -Pru2 -- " Zsh log (%U${xtrace//\%/%%}%u):" print -Pru2 -- '%F{yellow}' print -lru2 -- "${(@)${(@f)$(<$xtrace)}/#/ }" - print -Pru2 -- " %F{red}^ this command failed ($err)%f" + print -Pnru2 -- '%f' fi if [[ -s $daemon_log ]]; then print -ru2 -- '' From 189ecf8e1643e883b939f9880e71719f5e5f9480 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 30 May 2020 18:48:03 +0200 Subject: [PATCH 069/659] remove traling ")" from conda even if it is not followed by space --- 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 a945416c..67a5650d 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -880,7 +880,7 @@ # # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER # without the leading '(' or the trailing ') '. - typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${CONDA_PROMPT_MODIFIER#\(}%\) }' + typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}' # Custom icon. # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 243fb59c..33e20c4b 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -857,7 +857,7 @@ # # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER # without the leading '(' or the trailing ') '. - typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${CONDA_PROMPT_MODIFIER#\(}%\) }' + typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}' # Custom icon. # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 3c6aebc9..1281f7e3 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -857,7 +857,7 @@ # # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER # without the leading '(' or the trailing ') '. - typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${CONDA_PROMPT_MODIFIER#\(}%\) }' + typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}' # Custom icon. # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index ce16ddae..ead5f819 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -916,7 +916,7 @@ # # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER # without the leading '(' or the trailing ') '. - typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${CONDA_PROMPT_MODIFIER#\(}%\) }' + typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}' # Custom icon. # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' From 285bf7ba60d187c5d76e46670f12138068523b76 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 31 May 2020 11:45:21 +0200 Subject: [PATCH 070/659] ignore POWERLEVEL9K_GITSTATUS_DIR when deciding whether to auto-trigger the wizard --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 3158379c..6cf8e161 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6378,7 +6378,7 @@ _p9k_precmd_impl() { local -i instant_prompt_disabled if (( !__p9k_configured )); then __p9k_configured=1 - if [[ -z "${parameters[(I)POWERLEVEL9K_*~(POWERLEVEL9K_MODE|POWERLEVEL9K_CONFIG_FILE)]}" ]]; then + if [[ -z "${parameters[(I)POWERLEVEL9K_*~POWERLEVEL9K_(MODE|CONFIG_FILE|GITSTATUS_DIR)]}" ]]; then _p9k_can_configure -q local -i ret=$? if (( ret == 2 && $+__p9k_instant_prompt_active )); then From 801bfbb2946b10527e75e77838a3657d78cb92e5 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 31 May 2020 11:49:03 +0200 Subject: [PATCH 071/659] jump straight to ascii if TERM is "dump" or "linux" --- internal/wizard.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index b72212d5..767b787a 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1940,7 +1940,7 @@ while true; do unset pure_use_rprompt - if [[ $langinfo[CODESET] == (utf|UTF)(-|)8 ]]; then + if [[ $TERM != (dumb|linux) && $langinfo[CODESET] == (utf|UTF)(-|)8 ]]; then ask_font || continue ask_diamond || continue if [[ $AWESOME_GLYPHS_LOADED == 1 ]]; then From 55a9f366a8b720be7edd7d3b5b39a0580e530ff0 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 1 Jun 2020 07:32:48 +0200 Subject: [PATCH 072/659] typo in docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 556f8b3e..6cc39208 100644 --- a/README.md +++ b/README.md @@ -1590,7 +1590,7 @@ to the same position when prompt needs to be refreshed. *Note*: The patch doesn't work on Alacritty. On the plus side, it doesn't make things worse. -There are two alternative approaches to fixing the bug that may seem to work at fight glance but in +There are two alternative approaches to fixing the bug 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` From 62c0a12a10518607814fa661905b3c8ec0f16590 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 1 Jun 2020 16:30:50 +0200 Subject: [PATCH 073/659] Squashed 'gitstatus/' changes from ab1aea155..a827370d7 a827370d7 suppress error message from redirect git-subtree-dir: gitstatus git-subtree-split: a827370d7f11f6e6aac4a044efaef6a99ab1f1f4 --- install | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install b/install index 65f84caf..af0f0561 100755 --- a/install +++ b/install @@ -286,7 +286,9 @@ END else url="$2"."$part" fi - $fetch "$url" >>"$1".tar.gz 2>/dev/null & + { $fetch "$url" >>"$1".tar.gz 2>/dev/null & } 2>/dev/null + ret=$? + [ "$ret" = 0 ] || break pid=$! die="trap - $sig; kill -- $pid 2>/dev/null; exit 1" trap "$die" $sig From 2b1d0e599cbf3769c97ce63797dbc6d6de31467c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 2 Jun 2020 10:30:35 +0200 Subject: [PATCH 074/659] make todo segment work if todo-cli is installed from apt; see #785 --- internal/p10k.zsh | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 6cf8e161..fc4a3dae 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3294,10 +3294,9 @@ instant_prompt_date() { # todo.sh: shows the number of tasks in your todo.sh file prompt_todo() { unset P9K_TODO_TOTAL_TASK_COUNT P9K_TODO_FILTERED_TASK_COUNT - [[ -r $_p9k__todo_file ]] || return - local todo=$commands[todo.sh] + [[ -r $_p9k__todo_file && -x $_p9k__todo_command ]] || return if ! _p9k_cache_stat_get $0 $_p9k__todo_file; then - local count="$($todo -p ls | tail -1)" + local count="$($_p9k__todo_command -p ls | command tail -1)" if [[ $count == (#b)'TODO: '([[:digit:]]##)' of '([[:digit:]]##)' '* ]]; then _p9k_cache_stat_set 1 $match[1] $match[2] else @@ -3319,7 +3318,7 @@ prompt_todo() { } _p9k_prompt_todo_init() { - typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$commands[todo.sh]' + typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$_p9k__todo_file' } ################################################################ @@ -6684,6 +6683,7 @@ _p9k_init_vars() { typeset -ga _p9k_left_join typeset -ga _p9k_right_join typeset -g _p9k__public_ip + typeset -g _p9k__todo_command typeset -g _p9k__todo_file typeset -g _p9k__git_dir # git workdir => 1 if gitstatus is slow on it, 0 if it's fast. @@ -7717,7 +7717,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v92\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v93\1'${ZSH_VERSION}$'\1'${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' @@ -8091,19 +8091,22 @@ _p9k_init() { fi if _p9k_segment_in_use todo; then - local todo=$commands[todo.sh] - if [[ -n $todo ]]; then - local bash=${commands[bash]:-:} - _p9k__todo_file="$(exec -a $todo $bash 2>/dev/null -c " + if [[ -n ${_p9k__todo_command::=${commands[todo.sh]}} ]]; then + local todo_global=/etc/todo/config + elif [[ -n ${_p9k__todo_command::=${commands[todo-txt]}} ]]; then + local todo_global=/etc/todo-txt/config + fi + if [[ -n $_p9k__todo_command ]]; then + _p9k__todo_file="$(exec -a $_p9k__todo_command ${commands[bash]:-:} 3>&1 &>/dev/null -c " [ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\$HOME/.todo/config [ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\$HOME/todo.cfg [ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\$HOME/.todo.cfg [ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\${XDG_CONFIG_HOME:-\$HOME/.config}/todo/config - [ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=${(qqq)todo:h}/todo.cfg - [ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\${TODOTXT_GLOBAL_CFG_FILE:-/etc/todo/config} + [ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=${(qqq)_p9k__todo_command:h}/todo.cfg + [ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\${TODOTXT_GLOBAL_CFG_FILE:-${(qqq)todo_global}} [ -r \"\$TODOTXT_CFG_FILE\" ] || exit - source \"\$TODOTXT_CFG_FILE\" &>/dev/null - echo \"\$TODO_FILE\"")" + source \"\$TODOTXT_CFG_FILE\" + printf "%s" \"\$TODO_FILE\" >&3")" fi fi From f82d0de0d30916ee7cd1b1d948890407467418c1 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 3 Jun 2020 09:22:15 +0200 Subject: [PATCH 075/659] remove spurious error messages from _p9k_worker_stop --- internal/worker.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/worker.zsh b/internal/worker.zsh index 4b3f40e4..8eb21af3 100644 --- a/internal/worker.zsh +++ b/internal/worker.zsh @@ -89,13 +89,15 @@ function _p9k_worker_invoke() { } function _p9k_worker_cleanup() { - # langinfo may not be available here. - eval "$__p9k_intro_no_locale" + # __p9k_intro bugs out here in some cases for some reason. + emulate -L zsh [[ $_p9k__worker_shell_pid == $sysparams[pid] ]] && _p9k_worker_stop return 0 } function _p9k_worker_stop() { + # See comments in _p9k_worker_cleanup. + emulate -L zsh add-zsh-hook -D zshexit _p9k_worker_cleanup [[ -n $_p9k__worker_resp_fd ]] && zle -F $_p9k__worker_resp_fd [[ -n $_p9k__worker_resp_fd ]] && exec {_p9k__worker_resp_fd}>&- From 9fd719c834910c9734b0def927cc079654943a8d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 3 Jun 2020 09:56:40 +0200 Subject: [PATCH 076/659] Squashed 'gitstatus/' changes from a827370d7..643091154 643091154 suppress rc files for curl and wget; see #146 git-subtree-dir: gitstatus git-subtree-split: 6430911548516bd9bb0e4a5088993302d45cc499 --- install | 160 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 94 insertions(+), 66 deletions(-) diff --git a/install b/install index af0f0561..42428f74 100755 --- a/install +++ b/install @@ -9,7 +9,7 @@ _gitstatus_install_main() { set -u fi - local argv1=$1 + local argv1="$1" shift local no_check= no_install= uname_s= uname_m= gitstatus_dir= dl_status= @@ -227,91 +227,107 @@ END mkdir -p -- "$tmpdir" || return fi + if ! command -v curl >/dev/null 2>&1 && ! command -v wget >/dev/null 2>&1; then + >&2 echo "[gitstatus] error: please install curl or wget" + return 1 + fi + ( - if [ -n "${ZSH_VERSION:-}" ]; then - builtin cd -q -- "$tmpdir" || exit - else - cd -- "$tmpdir" || exit - fi - - local fetch - if command -v curl >/dev/null 2>&1; then - fetch="command curl -fsSL --" - elif command -v wget >/dev/null 2>&1; then - fetch="command wget -O- --" - else - >&2 echo "[gitstatus] error: please install curl or wget" - exit 1 - fi - - local url1="https://github.com/romkatv/gitstatus/releases/download/$version/$file.tar.gz" - local url2="https://gitee.com/romkatv/gitstatus/raw/release-$version/release/$file.tar.gz" + run_cmd() { + command -v "$1" >/dev/null 2>/dev/null || return 127 + local trapped= pid die ret + trap 'trapped=1' $sig + # The only reason for suppressing stderr is that `curl -f` cannot be silenced: + # `-s` doesn't work despite what the docs say. + command "$@" 2>/dev/null & + ret="$?" + if [ "$ret" = 0 ]; then + pid="$!" + die="trap - $sig; kill -- $pid 2>/dev/null; wait -- $pid 2>/dev/null; exit 1" + trap "$die" $sig + [ -z "$trapped" ] || eval "$die" + wait -- "$pid" 2>/dev/null + ret="$?" + fi + trap - $sig + [ -z "$trapped" ] || exit + return "$ret" + } check_sha256() { - local file="$1".tar.gz + 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 - hash="$(command shasum -b -a 256 -- "$file")" || hash= - hash="${hash%% *}" + 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 - hash="$(command sha256sum -b -- "$file")" || hash= - hash="${hash%% *}" + 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 - hash="$(command sha256 -- "$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 [ "$1" = 1 -a -z "$hash" -o "$hash" = "$sha256" ] } + local url1="https://github.com/romkatv/gitstatus/releases/download/$version/$file.tar.gz" + local url2="https://gitee.com/romkatv/gitstatus/raw/release-$version/release/$file.tar.gz" local sig='INT QUIT TERM ILL PIPE' fetch() { - local trapped= - trap 'trapped=1' $sig if [ "$1" != 1 ] && command -v sleep >/dev/null 2>/dev/null; then - sleep "$1" - fi - local part=0 url ret pid die - while true; do - if [ "$part" = 3 ]; then - ret=1 - break - elif [ "$part" = 0 ]; then - url="$2" - else - url="$2"."$part" + if ! run_cmd sleep "$1"; then + echo -n >"$tmpdir"/"$1".status + return 1 fi - { $fetch "$url" >>"$1".tar.gz 2>/dev/null & } 2>/dev/null - ret=$? - [ "$ret" = 0 ] || break - pid=$! - die="trap - $sig; kill -- $pid 2>/dev/null; exit 1" - trap "$die" $sig - [ -z "$trapped" ] || eval "$die" - wait -- "$pid" 2>/dev/null + fi + local cmd part url ret + for cmd in 'curl -q -fsSL' 'wget --no-config -qO-'; do + part=0 + while true; do + if [ "$part" = 2 ]; then + ret=1 + break + elif [ "$part" = 0 ]; then + url="$2" + else + url="$2"."$part" + fi + run_cmd $cmd -- "$url" >>"$tmpdir"/"$1".tar.gz + ret="$?" + [ "$ret" = 0 ] || break + check_sha256 "$1" && break + part=$((part+1)) + done + [ "$ret" = 0 ] && break + run_cmd rm -f -- "$tmpdir"/"$1".tar.gz && continue ret="$?" - trap - $sig - [ "$ret" = 0 ] || break - check_sha256 "$1" && break - part=$((part+1)) + break done - echo -n >"$1".status + echo -n >"$tmpdir"/"$1".status return "$ret" } local trapped= trap 'trapped=1' $sig fetch 1 "$url1" & - local pid1=$! + local pid1="$!" fetch 2 "$url2" & - local pid2=$! + local pid2="$!" - local die="trap - $sig; kill -- $pid1 $pid2 2>/dev/null; exit 1" + local die="trap - $sig; kill -- $pid1 $pid2 2>/dev/null; wait -- $pid1 $pid2 2>/dev/null; exit 1" trap "$die" $sig [ -z "$trapped" ] || eval "$die" @@ -323,27 +339,39 @@ END elif command -v true >/dev/null 2>/dev/null; then command true fi - if [ -n "$pid1" -a -e 1.status ]; then + if [ -n "$pid1" -a -e "$tmpdir"/1.status ]; then wait -- "$pid1" 2>/dev/null local ret="$?" pid1= if [ "$ret" = 0 ]; then - [ -z "$pid2" ] || kill -- "$pid2" 2>/dev/null + if [ -n "$pid2" ]; then + kill -- "$pid2" 2>/dev/null + wait -- "$pid2" 2>/dev/null + fi n=1 break elif [ -z "$pid2" ]; then break + else + die="trap - $sig; kill -- $pid2 2>/dev/null; wait -- $pid2 2>/dev/null; exit 1" + trap "$die" $sig fi - elif [ -n "$pid2" -a -e 2.status ]; then + elif [ -n "$pid2" -a -e "$tmpdir"/2.status ]; then wait -- "$pid2" 2>/dev/null local ret="$?" pid2= if [ "$ret" = 0 ]; then - [ -z "$pid1" ] || kill -- "$pid1" 2>/dev/null + if [ -n "$pid1" ]; then + kill -- "$pid1" 2>/dev/null + wait -- "$pid1" 2>/dev/null + fi n=2 break elif [ -z "$pid1" ]; then break + else + die="trap - $sig; kill -- $pid1 2>/dev/null; wait -- $pid1 2>/dev/null; exit 1" + trap "$die" $sig fi fi done @@ -358,7 +386,7 @@ END exit 1 fi - command tar -xzf "$n".tar.gz || exit + command tar -C "$tmpdir" -xzf "$tmpdir"/"$n".tar.gz || exit local tmpfile if ! command -v mktemp >/dev/null 2>&1 || @@ -366,7 +394,7 @@ END tmpfile="$cache_dir"/gitstatusd.tmp.$$ fi - command mv -f -- gitstatusd-* "$tmpfile" || exit + command mv -f -- "$tmpdir"/gitstatusd-* "$tmpfile" || exit command mv -f -- "$tmpfile" "$cache_dir"/"$file" && exit command rm -f -- "$cache_dir"/"$file" command mv -f -- "$tmpfile" "$cache_dir"/"$file" && exit @@ -374,7 +402,7 @@ END exit 1 ) - local ret=$? + local ret="$?" command rm -rf -- "$tmpdir" [ "$ret" = 0 ] || return From 7760aa66d75581c221cfbfe6f94cc6d15547cdaf Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 3 Jun 2020 18:30:40 +0200 Subject: [PATCH 077/659] don't unset POWERLEVEL9K_GITSTATUS_DIR in config templates --- 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 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 67a5650d..31bb2439 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -17,7 +17,7 @@ # Unset all configuration options. This allows you to apply configuration changes without # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. - unset -m 'POWERLEVEL9K_*|DEFAULT_USER' + unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' # Zsh >= 5.1 is required. autoload -Uz is-at-least && is-at-least 5.1 || return diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 33e20c4b..e83d46e0 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -17,7 +17,7 @@ # Unset all configuration options. This allows you to apply configuration changes without # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. - unset -m 'POWERLEVEL9K_*|DEFAULT_USER' + unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' # Zsh >= 5.1 is required. autoload -Uz is-at-least && is-at-least 5.1 || return diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 1281f7e3..db562f0c 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -17,7 +17,7 @@ # Unset all configuration options. This allows you to apply configuration changes without # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. - unset -m 'POWERLEVEL9K_*|DEFAULT_USER' + unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' # Zsh >= 5.1 is required. autoload -Uz is-at-least && is-at-least 5.1 || return diff --git a/config/p10k-pure.zsh b/config/p10k-pure.zsh index 2ab4369f..88b8d604 100644 --- a/config/p10k-pure.zsh +++ b/config/p10k-pure.zsh @@ -26,7 +26,7 @@ emulate -L zsh # Unset all configuration options. - unset -m 'POWERLEVEL9K_*|DEFAULT_USER' + unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' # Zsh >= 5.1 is required. autoload -Uz is-at-least && is-at-least 5.1 || return diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index ead5f819..7508aae0 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -17,7 +17,7 @@ # Unset all configuration options. This allows you to apply configuration changes without # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. - unset -m 'POWERLEVEL9K_*|DEFAULT_USER' + unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' # Zsh >= 5.1 is required. autoload -Uz is-at-least && is-at-least 5.1 || return diff --git a/config/p10k-robbyrussell.zsh b/config/p10k-robbyrussell.zsh index 7703350e..fe797215 100644 --- a/config/p10k-robbyrussell.zsh +++ b/config/p10k-robbyrussell.zsh @@ -21,7 +21,7 @@ emulate -L zsh # Unset all configuration options. - unset -m 'POWERLEVEL9K_*|DEFAULT_USER' + unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' # Zsh >= 5.1 is required. autoload -Uz is-at-least && is-at-least 5.1 || return From 50dec9f9f5026f098ca25289d815dd63763e17e9 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 6 Jun 2020 09:16:26 +0200 Subject: [PATCH 078/659] default to POWERLEVEL9K_MODE=ascii if there is no UTF-8 locale --- internal/icons.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/icons.zsh b/internal/icons.zsh index 403beea6..bf8f31fe 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -1,6 +1,7 @@ typeset -gA icons function _p9k_init_icons() { + [[ -n ${POWERLEVEL9K_MODE-} || ${langinfo[CODESET]} == (utf|UTF)(-|)8 ]] || local POWERLEVEL9K_MODE=ascii [[ $_p9k__icon_mode == $POWERLEVEL9K_MODE/$POWERLEVEL9K_LEGACY_ICON_SPACING/$POWERLEVEL9K_ICON_PADDING ]] && return typeset -g _p9k__icon_mode=$POWERLEVEL9K_MODE/$POWERLEVEL9K_LEGACY_ICON_SPACING/$POWERLEVEL9K_ICON_PADDING From 04656da7c1c64864ccbcebb345e2f673e6f854c2 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 6 Jun 2020 18:31:48 +0200 Subject: [PATCH 079/659] add install and update instructions for arch linux --- README.md | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 6cc39208..98d5c43f 100644 --- a/README.md +++ b/README.md @@ -426,10 +426,10 @@ echo 'source /usr/local/opt/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc ### Arch Linux -There is [zsh-theme-powerlevel10k]( - https://www.archlinux.org/packages/community/any/zsh-theme-powerlevel10k/) community package and -[zsh-theme-powerlevel10k-git](https://aur.archlinux.org/packages/zsh-theme-powerlevel10k-git/) AUR -package. Both are old and broken. **Do not use them.** +```zsh +yay -Sy --noconfirm zsh-theme-powerlevel10k-git +echo 'source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc +``` ## Configuration @@ -588,18 +588,19 @@ 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:-~/.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` | +| Installation | Update command | +|---------------------------|-------------------------------------------------------------| +| [Manual](#manual) | `git -C ~/powerlevel10k pull` | +| [Oh My Zsh](#oh-my-zsh) | `git -C ${ZSH_CUSTOM:-~/.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 -Syu --noconfirm --needed zsh-theme-powerlevel10k-git` | **IMPORTANT**: Restart Zsh after updating Powerlevel10k. [Do not use `source ~/.zshrc`]( #weird-things-happen-after-typing-source-zshrc). From b2be33d556bdd2f32e3c72020c75121f5bdce053 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 6 Jun 2020 18:36:52 +0200 Subject: [PATCH 080/659] fix formatting --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 98d5c43f..094288d7 100644 --- a/README.md +++ b/README.md @@ -600,7 +600,7 @@ The command to update Powerlevel10k depends on how it was installed. | [Zplugin](#zplugin) | `zplugin update` | | [Zinit](#zinit) | `zinit update` | | [Homebrew](#homebrew) | `brew update && brew upgrade` | -| [Arch Linux(#arch-linux)] | `yay -Syu --noconfirm --needed zsh-theme-powerlevel10k-git` | +| [Arch Linux](#arch-linux) | `yay -Syu --noconfirm --needed zsh-theme-powerlevel10k-git` | **IMPORTANT**: Restart Zsh after updating Powerlevel10k. [Do not use `source ~/.zshrc`]( #weird-things-happen-after-typing-source-zshrc). From 05dad31f3f2fa83fb9f60c08d045c85347fbf545 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 6 Jun 2020 18:39:43 +0200 Subject: [PATCH 081/659] add uninstall instructions for arch linux --- README.md | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 094288d7..2e22d5aa 100644 --- a/README.md +++ b/README.md @@ -588,19 +588,19 @@ 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:-~/.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 -Syu --noconfirm --needed 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 -Syu --noconfirm --needed zsh-theme-powerlevel10k-git` | **IMPORTANT**: Restart Zsh after updating Powerlevel10k. [Do not use `source ~/.zshrc`]( #weird-things-happen-after-typing-source-zshrc). @@ -638,18 +638,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` | - | [Oh My Zsh](#oh-my-zsh) | `rm -rf -- ${ZSH_CUSTOM:-~/.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` | + | Installation | Uninstall command | + |---------------------------|---------------------------------------------------------------------| + | [Manual](#manual) | `rm -rf ~/powerlevel10k` | + | [Oh My Zsh](#oh-my-zsh) | `rm -rf -- ${ZSH_CUSTOM:-~/.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` | 5. Restart Zsh. [Do not use `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc). ### Where can I ask for help and report bugs? From 54c98228342043612ea83eaaf13ac13659c26295 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 8 Jun 2020 09:41:59 +0200 Subject: [PATCH 082/659] Squashed 'gitstatus/' changes from 643091154..ec9c39499 ec9c39499 don't download gitstatusd if there is a bad version in usrbin git-subtree-dir: gitstatus git-subtree-split: ec9c39499a96ea8b181db15c76df5089959d3111 --- gitstatus.plugin.sh | 3 +++ gitstatus.plugin.zsh | 3 +++ 2 files changed, 6 insertions(+) diff --git a/gitstatus.plugin.sh b/gitstatus.plugin.sh index d44d8cd7..685e81a2 100644 --- a/gitstatus.plugin.sh +++ b/gitstatus.plugin.sh @@ -164,6 +164,9 @@ function gitstatus_start() { (( ! _gitstatus_bash_downloaded )) || return [[ "${GITSTATUS_AUTO_INSTALL:-1}" -ne 0 ]] || return + [[ "$_gitstatus_bash_daemon" == \ + "${GITSTATUS_CACHE_DIR:-${XDG_CACHE_HOME:-$HOME/.cache}/gitstatus}"/* ]] || return + set -- -f "$@" _gitstatus_bash_daemon= _gitstatus_bash_version= diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index b4690727..66d128c2 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -414,6 +414,9 @@ function _gitstatus_daemon"${1:-}"() { (( ! _gitstatus_zsh_downloaded )) || return [[ ${GITSTATUS_AUTO_INSTALL:-1} == (|-|+)<1-> ]] || return + [[ $_gitstatus_zsh_daemon == + ${GITSTATUS_CACHE_DIR:-${XDG_CACHE_HOME:-$HOME/.cache}/gitstatus}/* ]] || return + set -- -f "$@" _gitstatus_zsh_daemon= _gitstatus_zsh_version= From b93f9663c5e4e9d914c4389fc405bc7ec7382b57 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 8 Jun 2020 10:52:47 +0200 Subject: [PATCH 083/659] Squashed 'gitstatus/' changes from ec9c39499..830aaa999 830aaa999 try wget without --no-config if it fails with git-subtree-dir: gitstatus git-subtree-split: 830aaa99976c0f5addedf336414f9bf82e2699d6 --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index 42428f74..c5b15d22 100755 --- a/install +++ b/install @@ -294,7 +294,7 @@ END fi fi local cmd part url ret - for cmd in 'curl -q -fsSL' 'wget --no-config -qO-'; do + for cmd in 'curl -q -fsSL' 'wget --no-config -qO-' 'wget -qO-' 'curl -fsSL'; do part=0 while true; do if [ "$part" = 2 ]; then From 6e120b9eecaf995c9d7d69e13c3389be549240a7 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 9 Jun 2020 12:58:48 +0200 Subject: [PATCH 084/659] don't initialize vcs if there is no git command --- internal/p10k.zsh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index fc4a3dae..f191bb64 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7717,7 +7717,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v93\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v94\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' @@ -7726,6 +7726,7 @@ _p9k_must_init() { _p9k__param_pat+=$'$VTE_VERSION\1$TERM_PROGRAM\1$DEFAULT_USER\1$P9K_SSH\1$commands[uname]\1' _p9k__param_pat+=$'$__p9k_root_dir\1$functions[p10k-on-init]$functions[p10k-on-pre-prompt]\1' _p9k__param_pat+=$'$functions[p10k-on-post-widget]$functions[p10k-on-post-prompt]\1' + _p9k__param_pat+=$'$+commands[git]' local MATCH IFS=$'\1' _p9k__param_pat+="${(@)${(@o)parameters[(I)POWERLEVEL9K_*]}:/(#m)*/\${${(q)MATCH}-$IFS\}}" IFS=$'\2' _p9k__param_sig="${(e)_p9k__param_pat}" @@ -7969,6 +7970,13 @@ function _p9k_init_cacheable() { _p9k_init_vcs() { _p9k_segment_in_use vcs || return + if [[ $#_POWERLEVEL9K_VCS_BACKENDS -le 1 && $_POWERLEVEL9K_VCS_BACKENDS == git && + $+commands[git] == 0 ]]; then + (( $+functions[gitstatus_stop_p9k_] )) && gitstatus_stop_p9k_ POWERLEVEL9K + unset _p9k_preinit + return + fi + _p9k_vcs_info_init if (( $+functions[_p9k_preinit] )); then if (( $+GITSTATUS_DAEMON_PID_POWERLEVEL9K )); then From d75147503ef3163e32e3279a39bd07bc9942a9de Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 9 Jun 2020 13:08:12 +0200 Subject: [PATCH 085/659] remove git from POWERLEVEL9K_VCS_BACKENDS if there is no git command --- internal/p10k.zsh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index f191bb64..a30ef982 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7044,6 +7044,7 @@ _p9k_init_params() { _p9k_declare -F POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS 0.02 (( POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS >= 0 )) || (( POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS = 0 )) _p9k_declare -a POWERLEVEL9K_VCS_BACKENDS -- git + (( $+commands[git] )) || _POWERLEVEL9K_VCS_BACKENDS=(${_POWERLEVEL9K_VCS_BACKENDS:#git}) _p9k_declare -b POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING 0 _p9k_declare -i POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY -1 _p9k_declare -i POWERLEVEL9K_VCS_STAGED_MAX_NUM 1 @@ -7717,7 +7718,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v94\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v95\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' @@ -7969,9 +7970,7 @@ function _p9k_init_cacheable() { } _p9k_init_vcs() { - _p9k_segment_in_use vcs || return - if [[ $#_POWERLEVEL9K_VCS_BACKENDS -le 1 && $_POWERLEVEL9K_VCS_BACKENDS == git && - $+commands[git] == 0 ]]; then + if ! _p9k_segment_in_use vcs || (( ! $#_POWERLEVEL9K_VCS_BACKENDS )); then (( $+functions[gitstatus_stop_p9k_] )) && gitstatus_stop_p9k_ POWERLEVEL9K unset _p9k_preinit return From a3c1b7164be115f097682088c6feac283c40a1f2 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 9 Jun 2020 13:26:38 +0200 Subject: [PATCH 086/659] Squashed 'gitstatus/' changes from 830aaa999..3050dfca8 3050dfca8 add `command` in front of commands git-subtree-dir: gitstatus git-subtree-split: 3050dfca875a8070aaa0dc890afcc756574078c6 --- gitstatus.plugin.sh | 10 +++++----- gitstatus.plugin.zsh | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gitstatus.plugin.sh b/gitstatus.plugin.sh index 685e81a2..1ecccb85 100644 --- a/gitstatus.plugin.sh +++ b/gitstatus.plugin.sh @@ -76,7 +76,7 @@ function gitstatus_start() { [[ -n "$log_level" || "${GITSTATUS_ENABLE_LOGGING:-0}" != 1 ]] || log_level=INFO local uname_sm - uname_sm="$(uname -sm)" || return + uname_sm="$(command uname -sm)" || return uname_sm="${uname_sm,,}" local uname_s="${uname_sm% *}" local uname_m="${uname_sm#* }" @@ -86,8 +86,8 @@ function gitstatus_start() { else local cpus if ! command -v sysctl &>/dev/null || [[ "$uname_s" == linux ]] || - ! cpus="$(sysctl -n hw.ncpu)"; then - if ! command -v getconf &>/dev/null || ! cpus="$(getconf _NPROCESSORS_ONLN)"; then + ! cpus="$(command sysctl -n hw.ncpu)"; then + if ! command -v getconf &>/dev/null || ! cpus="$(command getconf _NPROCESSORS_ONLN)"; then cpus=8 fi fi @@ -104,7 +104,7 @@ function gitstatus_start() { --dirty-max-index-size="$max_dirty" $extra_flags) - tmpdir="$(mktemp -d "${TMPDIR:-/tmp}"/gitstatus.bash.$$.XXXXXXXXXX)" || return + tmpdir="$(command mktemp -d "${TMPDIR:-/tmp}"/gitstatus.bash.$$.XXXXXXXXXX)" || return if [[ -n "$log_level" ]]; then GITSTATUS_DAEMON_LOG="$tmpdir"/daemon.log @@ -115,7 +115,7 @@ function gitstatus_start() { req_fifo="$tmpdir"/req.fifo resp_fifo="$tmpdir"/resp.fifo - mkfifo -- "$req_fifo" "$resp_fifo" || return + command mkfifo -- "$req_fifo" "$resp_fifo" || return { ( diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index 66d128c2..a19f93f2 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -365,7 +365,7 @@ function _gitstatus_daemon"${1:-}"() { trap '' PIPE local uname_sm - uname_sm="${(L)$(uname -sm)}" || return + uname_sm="${(L)$(command uname -sm)}" || return [[ $uname_sm == [^' ']##' '[^' ']## ]] || return local uname_s=${uname_sm% *} local uname_m=${uname_sm#* } @@ -375,15 +375,15 @@ function _gitstatus_daemon"${1:-}"() { else local cpus if (( ! $+commands[sysctl] )) || [[ $uname_s == linux ]] || - ! cpus="$(sysctl -n hw.ncpu)"; then - if (( ! $+commands[getconf] )) || ! cpus="$(getconf _NPROCESSORS_ONLN)"; then + ! cpus="$(command sysctl -n hw.ncpu)"; then + if (( ! $+commands[getconf] )) || ! cpus="$(command getconf _NPROCESSORS_ONLN)"; then cpus=8 fi fi args+=(-t $((cpus > 16 ? 32 : cpus > 0 ? 2 * cpus : 16))) fi - mkfifo -- $file_prefix.fifo || return + command mkfifo -- $file_prefix.fifo || return print -rnu $pipe_fd -- ${(l:20:)pgid} || return exec <$file_prefix.fifo || return zf_rm -- $file_prefix.fifo || return @@ -752,7 +752,7 @@ function gitstatus_start"${1:-}"() { print -ru2 -- ' System information:' print -Pru2 -- '%F{yellow}' print -ru2 -- " zsh: $ZSH_VERSION" - print -ru2 -- " uname -a: $(uname -a)" + print -ru2 -- " uname -a: $(command uname -a)" print -Pru2 -- '%f' print -ru2 -- ' If you need help, open an issue and attach this whole error message to it:' print -ru2 -- '' From a700031279b0fa5efdd67e99181a2a959bd7f2c2 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 9 Jun 2020 13:49:03 +0200 Subject: [PATCH 087/659] don't start gitstatusd from instant prompt if there is no git command --- internal/p10k.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index a30ef982..cd74822c 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7718,7 +7718,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v95\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v96\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' @@ -7997,6 +7997,7 @@ _p9k_init_vcs() { local gitstatus_dir=${_POWERLEVEL9K_GITSTATUS_DIR:-${__p9k_root_dir}/gitstatus} typeset -g _p9k_preinit="function _p9k_preinit() { + (( $+commands[git] )) || { unfunction _p9k_preinit; return 1 } [[ \$ZSH_VERSION == ${(q)ZSH_VERSION} ]] || return [[ -r ${(q)gitstatus_dir}/gitstatus.plugin.zsh ]] || return source ${(q)gitstatus_dir}/gitstatus.plugin.zsh _p9k_ || return From c6e599ddd50607342ad79b21e8387e8ca6afaa30 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 9 Jun 2020 20:25:55 +0200 Subject: [PATCH 088/659] fix a typo in remote-git-url => icon conversion (bitbucket was shows as github); see #808 --- internal/p10k.zsh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index cd74822c..303df733 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3605,7 +3605,7 @@ 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_GITHUB_ICON;; + *stash*) _p9k__ret=VCS_GIT_BITBUCKET_ICON;; *gitlab*) _p9k__ret=VCS_GIT_GITLAB_ICON;; *) _p9k__ret=VCS_GIT_ICON;; esac @@ -3692,13 +3692,8 @@ 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 compatiblity. - case "$VCS_STATUS_REMOTE_URL" in - *github*) icon=VCS_GIT_GITHUB_ICON;; - *bitbucket*) icon=VCS_GIT_BITBUCKET_ICON;; - *stash*) icon=VCS_GIT_GITHUB_ICON;; - *gitlab*) icon=VCS_GIT_GITLAB_ICON;; - *) icon=VCS_GIT_ICON;; - esac + _p9k_vcs_icon + icon=$_p9k__ret fi : ${state:=CLEAN} From e3f582f246840279abf6a75b78cb9b2316e96a71 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 9 Jun 2020 21:33:10 +0200 Subject: [PATCH 089/659] survive people explicitly disabling conda prompt and then expecting to see it --- config/p10k-classic.zsh | 5 +++-- config/p10k-lean-8colors.zsh | 5 +++-- config/p10k-lean.zsh | 5 +++-- config/p10k-rainbow.zsh | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 31bb2439..c7aace21 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -879,8 +879,9 @@ # Note: '({default_env}) ' is the default value of env_prompt. # # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER - # without the leading '(' or the trailing ') '. - typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}' + # without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former + # is empty. + typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' # Custom icon. # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index e83d46e0..aa976451 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -856,8 +856,9 @@ # Note: '({default_env}) ' is the default value of env_prompt. # # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER - # without the leading '(' or the trailing ') '. - typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}' + # without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former + # is empty. + typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' # Custom icon. # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index db562f0c..ba4f4727 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -856,8 +856,9 @@ # Note: '({default_env}) ' is the default value of env_prompt. # # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER - # without the leading '(' or the trailing ') '. - typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}' + # without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former + # is empty. + typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' # Custom icon. # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 7508aae0..9c77f52b 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -915,8 +915,9 @@ # Note: '({default_env}) ' is the default value of env_prompt. # # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER - # without the leading '(' or the trailing ') '. - typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}' + # without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former + # is empty. + typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' # Custom icon. # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' From fa2e337cbdd88ccd297d25fa9847225211801d3e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 10 Jun 2020 07:57:51 +0200 Subject: [PATCH 090/659] Squashed 'gitstatus/' changes from 3050dfca8..38d62a475 38d62a475 fix gitstatus on older zsh versions git-subtree-dir: gitstatus git-subtree-split: 38d62a475fadf5f8d418fc772d680ba234ba8609 --- gitstatus.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index a19f93f2..cc6662a7 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -414,7 +414,7 @@ function _gitstatus_daemon"${1:-}"() { (( ! _gitstatus_zsh_downloaded )) || return [[ ${GITSTATUS_AUTO_INSTALL:-1} == (|-|+)<1-> ]] || return - [[ $_gitstatus_zsh_daemon == + [[ $_gitstatus_zsh_daemon == \ ${GITSTATUS_CACHE_DIR:-${XDG_CACHE_HOME:-$HOME/.cache}/gitstatus}/* ]] || return set -- -f "$@" From fb5a0a6cca8b628be8bb99d9394875b3c59eb233 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 11 Jun 2020 11:06:02 +0200 Subject: [PATCH 091/659] make error message about incorrect powerlevel10k loading visible in more cases --- internal/p10k.zsh | 73 ++++++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 32 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 303df733..f3c37a4d 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8122,44 +8122,53 @@ _p9k_init() { _p9k_init_vcs if (( _p9k__instant_prompt_disabled )); then - unset __p9k_instant_prompt_erased + (( _POWERLEVEL9K_DISABLE_INSTANT_PROMPT )) && unset __p9k_instant_prompt_erased _p9k_delete_instant_prompt _p9k_dumped_instant_prompt_sigs=() fi if (( $+__p9k_instant_prompt_erased )); then unset __p9k_instant_prompt_erased - >&2 echo -E - "" - >&2 echo -E - "${(%):-[%1FERROR%f]: When using instant prompt, Powerlevel10k must be loaded before the first prompt.}" - >&2 echo -E - "" - >&2 echo -E - "${(%):-You can:}" - >&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.}" - else - >&2 echo - "${(%):- See https://github.com/romkatv/powerlevel10k/blob/master/README.md#installation.}" - fi - if (( $+functins[zplugin] )); then - >&2 echo -E - "${(%):- NOTE: If using %2Fzplugin%f to load %3F'romkatv/powerlevel10k'%f, %Bdo not apply%b %1Fice wait%f.}" - fi - >&2 echo -E - "" - >&2 echo -E - "${(%):- * You %Bwill not%b see this error message again.}" - >&2 echo -E - "${(%):- * Zsh will start %Bquickly%b.}" - >&2 echo -E - "" - >&2 echo -E - "${(%):- - Disable instant prompt either by running %Bp10k configure%b or by manually}" - >&2 echo -E - "${(%):- defining the following parameter:}" - >&2 echo -E - "" - >&2 echo -E - "${(%):- %3Ftypeset%f -g POWERLEVEL9K_INSTANT_PROMPT=off}" - >&2 echo -E - "" - >&2 echo -E - "${(%):- * You %Bwill not%b see this error message again.}" - >&2 echo -E - "${(%):- * Zsh will start %Bslowly%b.}" - >&2 echo -E - "" - >&2 echo -E - "${(%):- - Do nothing.}" - >&2 echo -E - "" - >&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 echo -E - "" + >&2 echo -E - "${(%):-[%1FERROR%f]: When using instant prompt, Powerlevel10k must be loaded before the first prompt.}" + >&2 echo -E - "" + >&2 echo -E - "${(%):-You can:}" + >&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.}" + else + >&2 echo - "${(%):- See https://github.com/romkatv/powerlevel10k/blob/master/README.md#installation.}" + fi + if (( $+zsh_defer_options )); then + >&2 echo -E - "" + >&2 echo -E - "${(%):- NOTE: Do not use %1Fzsh-defer%f to load %Upowerlevel10k.zsh-theme%u.}" + elif (( $+functins[zinit] )); then + >&2 echo -E - "" + >&2 echo -E - "${(%):- NOTE: If using %2Fzinit%f to load %3F'romkatv/powerlevel10k'%f, %Bdo not apply%b %1Fice wait%f.}" + elif (( $+functins[zplugin] )); then + >&2 echo -E - "" + >&2 echo -E - "${(%):- NOTE: If using %2Fzplugin%f to load %3F'romkatv/powerlevel10k'%f, %Bdo not apply%b %1Fice wait%f.}" + fi + >&2 echo -E - "" + >&2 echo -E - "${(%):- * You %Bwill not%b see this error message again.}" + >&2 echo -E - "${(%):- * Zsh will start %Bquickly%b.}" + >&2 echo -E - "" + >&2 echo -E - "${(%):- - Disable instant prompt either by running %Bp10k configure%b or by manually}" + >&2 echo -E - "${(%):- defining the following parameter:}" + >&2 echo -E - "" + >&2 echo -E - "${(%):- %3Ftypeset%f -g POWERLEVEL9K_INSTANT_PROMPT=off}" + >&2 echo -E - "" + >&2 echo -E - "${(%):- * You %Bwill not%b see this error message again.}" + >&2 echo -E - "${(%):- * Zsh will start %Bslowly%b.}" + >&2 echo -E - "" + >&2 echo -E - "${(%):- - Do nothing.}" + >&2 echo -E - "" + >&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 fi } From 05eaf8162c0a83c38bb210e888358d5bdc3aef90 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 11 Jun 2020 15:29:47 +0200 Subject: [PATCH 092/659] tweak omz update pattern; maybe it'll help with #729 --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index f3c37a4d..aebd6a49 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6091,13 +6091,13 @@ function _p9k_clear_instant_prompt() { local cr=$'\r' local sp="${(%):-%b%k%f%s%u$mark${(pl.$fill.. .)}$cr%b%k%f%s%u%E}" print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed] - local unexpected=${${${(S)content//$'\e'*($'\a'|$'\e\\')}//$'\e[?'<->'c'}//$'\e['<->' q'} + local unexpected=${${${(S)content//$'\e]0;'[^$'\a\e']#($'\a'|$'\e\\')}//$'\e[?'<->'c'}//$'\e['<->' q'} if [[ -n $unexpected ]]; then local omz1='[Oh My Zsh] Would you like to update? [Y/n]: ' local omz2='Updating Oh My Zsh' local omz3='https://shop.planetargon.com/collections/oh-my-zsh' local omz4='There was an error updating. Try again later?' - if [[ -n ${${unexpected/$omz1}/$omz2*($omz3|$omz4)[^$'\n']#($'\n'|)} ]]; then + if [[ $unexpected != ($omz1|)$omz2*($omz3|$omz4)[^$'\n']#($'\n'|) ]]; then echo -E - "" echo -E - "${(%):-[%3FWARNING%f]: Console output during zsh initialization detected.}" echo -E - "" From e2196ce32e28d1860441eaa5a9490e768adcd969 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 12 Jun 2020 08:30:03 +0200 Subject: [PATCH 093/659] match terminal escape sequences in instant prompt output more aggressively --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index aebd6a49..7b5b4acd 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6091,7 +6091,7 @@ function _p9k_clear_instant_prompt() { local cr=$'\r' local sp="${(%):-%b%k%f%s%u$mark${(pl.$fill.. .)}$cr%b%k%f%s%u%E}" print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed] - local unexpected=${${${(S)content//$'\e]0;'[^$'\a\e']#($'\a'|$'\e\\')}//$'\e[?'<->'c'}//$'\e['<->' q'} + 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 a43b1b34d80c83c0f77427030662951ff845a29d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 12 Jun 2020 12:55:02 +0200 Subject: [PATCH 094/659] add an icon and asdf colors for julia; see #817 --- config/p10k-classic.zsh | 5 +++++ config/p10k-lean-8colors.zsh | 5 +++++ config/p10k-lean.zsh | 5 +++++ config/p10k-rainbow.zsh | 6 ++++++ internal/icons.zsh | 6 ++++++ internal/p10k.zsh | 2 +- 6 files changed, 28 insertions(+), 1 deletion(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index c7aace21..d31a3f45 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -664,6 +664,11 @@ # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐' # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar' + # Julia version from asdf. + typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=70 + # typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar' + ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### # NordVPN connection indicator color. typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=39 diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index aa976451..bae1e36c 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -658,6 +658,11 @@ # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐' # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar' + # Julia version from asdf. + typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=2 + # typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar' + ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### # NordVPN connection indicator color. typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=6 diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index ba4f4727..3b1c1311 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -658,6 +658,11 @@ # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐' # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar' + # Julia version from asdf. + typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=70 + # typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar' + ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### # NordVPN connection indicator color. typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=39 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 9c77f52b..b32a06bc 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -678,6 +678,12 @@ # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐' # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar' + # Julia version from asdf. + typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_JULIA_BACKGROUND=2 + # typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar' + ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### # NordVPN connection indicator color. # typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=7 diff --git a/internal/icons.zsh b/internal/icons.zsh index bf8f31fe..f9331df1 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -141,6 +141,7 @@ function _p9k_init_icons() { PHP_ICON 'php' HASKELL_ICON 'hs' PACKAGE_ICON 'pkg' + JULIA_ICON 'jl' ) ;; 'awesome-fontconfig') @@ -266,6 +267,7 @@ function _p9k_init_icons() { PHP_ICON 'php' HASKELL_ICON 'hs' PACKAGE_ICON 'pkg' + JULIA_ICON 'jl' ) ;; 'awesome-mapped-fontconfig') @@ -394,6 +396,7 @@ function _p9k_init_icons() { PHP_ICON 'php' HASKELL_ICON 'hs' PACKAGE_ICON 'pkg' + JULIA_ICON 'jl' ) ;; 'nerdfont-complete'|'nerdfont-fontconfig') @@ -520,6 +523,7 @@ function _p9k_init_icons() { PHP_ICON '\uE608' #  HASKELL_ICON '\uE61F' #  PACKAGE_ICON '\uF8D6' #  + JULIA_ICON '\uE624' #  ) ;; ascii) @@ -643,6 +647,7 @@ function _p9k_init_icons() { PHP_ICON 'php' HASKELL_ICON 'hs' PACKAGE_ICON 'pkg' + JULIA_ICON 'jl' ) ;; *) @@ -768,6 +773,7 @@ function _p9k_init_icons() { PHP_ICON 'php' HASKELL_ICON 'hs' PACKAGE_ICON 'pkg' + JULIA_ICON 'jl' ) ;; esac diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 7b5b4acd..8d57052e 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7713,7 +7713,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v96\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v97\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 faa510d54c30b9384ee7f4a95b9d04f5c6a8cf62 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 12 Jun 2020 13:00:03 +0200 Subject: [PATCH 095/659] explicitly mention that POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND overrides POWERLEVEL9K_ASDF_FOREGROUND; see #817 --- config/p10k-classic.zsh | 1 + config/p10k-lean-8colors.zsh | 1 + config/p10k-lean.zsh | 1 + config/p10k-rainbow.zsh | 2 ++ 4 files changed, 5 insertions(+) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index d31a3f45..9f87d300 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -532,6 +532,7 @@ ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### # Default asdf color. Only used to display tools for which there is no color override (see below). + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND. typeset -g POWERLEVEL9K_ASDF_FOREGROUND=66 # There are four parameters that can be used to hide asdf tools. Each parameter describes diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index bae1e36c..39408377 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -526,6 +526,7 @@ ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### # Default asdf color. Only used to display tools for which there is no color override (see below). + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND. typeset -g POWERLEVEL9K_ASDF_FOREGROUND=6 # There are four parameters that can be used to hide asdf tools. Each parameter describes diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 3b1c1311..f0eeb333 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -526,6 +526,7 @@ ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### # Default asdf color. Only used to display tools for which there is no color override (see below). + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND. typeset -g POWERLEVEL9K_ASDF_FOREGROUND=66 # There are four parameters that can be used to hide asdf tools. Each parameter describes diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index b32a06bc..9e91db6c 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -530,6 +530,8 @@ ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### # Default asdf color. Only used to display tools for which there is no color override (see below). + # Tip: Override these parameters for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND and + # POWERLEVEL9K_ASDF_${TOOL}_BACKGROUND. typeset -g POWERLEVEL9K_ASDF_FOREGROUND=0 typeset -g POWERLEVEL9K_ASDF_BACKGROUND=7 From b0158178925484c058e6175e174b639237532c63 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 13 Jun 2020 11:15:44 +0200 Subject: [PATCH 096/659] Squashed 'gitstatus/' changes from 38d62a47..1c74c8db 1c74c8db add linux-ppc64le 968779b5 fix tar invocation 300f657c create anonymous tar archives a5581d18 force C locale during build (perl complains) 2616cd47 support downloads to usrbin 1e6075dd enable static linking on linux 2975d25f update libgit2 ref bea6f868 add ppc64le target git-subtree-dir: gitstatus git-subtree-split: 1c74c8db0f422aa6f95ced878351e0c6944a9bd6 --- build | 27 ++++++++++++++++----------- build.info | 8 ++++---- gitstatus.plugin.sh | 14 ++++++++++++-- gitstatus.plugin.zsh | 13 +++++++++++-- install | 30 +++++++----------------------- install.info | 1 + mbuild | 12 +++++++----- 7 files changed, 58 insertions(+), 47 deletions(-) diff --git a/build b/build index 78d57ec5..6023c210 100755 --- a/build +++ b/build @@ -9,6 +9,8 @@ if [ -n "${ZSH_VERSION:-}" ]; then emulate sh -o err_exit -o no_unset fi +export LC_ALL=C + usage="$(command cat <<\END Usage: build [-m ARCH] [-c CPU] [-d CMD] [-i IMAGE] [-s] [-w] @@ -52,7 +54,7 @@ if [ "$(narg $workdir)" != 1 -o -z "${workdir##*:*}" ]; then exit 1 fi -appname=gitstatusd-"$gitstatus_kernel"-"$gitstatus_arch" +appname=gitstatusd libgit2_tmp="$outdir"/deps/"$appname".libgit2.tmp cleanup() { @@ -68,8 +70,16 @@ trap cleanup INT QUIT TERM ILL PIPE if [ -n "$gitstatus_install_tools" ]; then case "$gitstatus_kernel" in linux) - command apk update - command apk add binutils cmake gcc g++ git make musl-dev perl-utils + if command -v apk >/dev/null 2>&1; then + command apk update + command apk add binutils cmake gcc g++ git make musl-dev perl-utils + elif command -v apt-get >/dev/null 2>&1; then + apt-get update + apt-get install -y binutils cmake gcc g++ make wget + else + >&2 echo "[error] -s is not supported on this system" + exit 1 + fi ;; freebsd) command pkg install -y cmake gmake binutils gcc git perl5 @@ -110,8 +120,8 @@ cpus="$(command getconf _NPROCESSORS_ONLN 2>/dev/null)" || cpus=8 case "$gitstatus_cpu" in - ppc64le) archflag="-mcpu";; - *) archflag="-march";; + powerpc64le) archflag="-mcpu";; + *) archflag="-march";; esac cflags="$archflag=$gitstatus_cpu -fno-plt" @@ -131,9 +141,7 @@ gitstatus_make=make case "$gitstatus_kernel" in linux) - if [ -n "$docker_cmd" ]; then - gitstatus_ldflags="$gitstatus_ldflags -static" - fi + 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" ;; @@ -446,9 +454,6 @@ case "$gitstatus_kernel" in ;; esac fi - elif [ -n "$gitstatus_install_tools" ]; then - >&2 echo '[error] -s without -d is not supported on linux' - exit 1 fi ;; freebsd|netbsd|darwin) diff --git a/build.info b/build.info index 80dbc452..cf180b0c 100644 --- a/build.info +++ b/build.info @@ -2,8 +2,8 @@ # read by ./Makefile. `gitstatusd --version` reports it back. # # This value is also read by shell bindings (indirectly, through -# ./install) when gitstatusd is from ./usrbin. -gitstatus_version="v1.0.0" +# ./install) when using GITSTATUS_DAEMON or usrbin/gitstatusd. +gitstatus_version="v1.2.0" # 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.0.0" # # If sha256 of ./deps/libgit2-${libgit2_version}.tar.gz doesn't match, # build gets aborted. -libgit2_version="tag-005f77dca6dbe8788e55139fa1199fc94cc04f9a" -libgit2_sha256="6af7c839640ed5474fef9761a80b5c24bcdd87abc771406e31d5c2bf27f48be5" +libgit2_version="tag-d6c37a38587c9af2a9e63449fc8bf951dca0e854" +libgit2_sha256="e3df79da60963f8711580dce53b1a7ed583bb534be9ebb95589e76346fa986be" diff --git a/gitstatus.plugin.sh b/gitstatus.plugin.sh index 1ecccb85..2fe322ef 100644 --- a/gitstatus.plugin.sh +++ b/gitstatus.plugin.sh @@ -146,8 +146,18 @@ function gitstatus_start() { local sig=(TERM ILL PIPE) + if (( UID == EUID )); then + local home=~ + else + local user + user="$(command id -un)" || return + [[ "$user" =~ ^[a-zA-Z0-9_,.-]+$ ]] || return + eval "local home=~$user" + [[ -n "$home" ]] || return + fi + if [[ -x "$_gitstatus_bash_daemon" ]]; then - "$_gitstatus_bash_daemon" \ + HOME="$home" "$_gitstatus_bash_daemon" \ -G "$_gitstatus_bash_version" "${daemon_args[@]}" <&"$fd_in" >&"$fd_out" & local pid=$! trap "trap - ${sig[*]}; kill $pid &>/dev/null" ${sig[@]} @@ -176,7 +186,7 @@ function gitstatus_start() { [[ -n "$_gitstatus_bash_version" ]] || return [[ "$_gitstatus_bash_downloaded" == 1 ]] || return - "$_gitstatus_bash_daemon" \ + HOME="$home" "$_gitstatus_bash_daemon" \ -G "$_gitstatus_bash_version" "${daemon_args[@]}" <&"$fd_in" >&"$fd_out" & local pid=$! trap "trap - ${sig[*]}; kill $pid &>/dev/null" ${sig[@]} diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index cc6662a7..0df36724 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -406,8 +406,17 @@ function _gitstatus_daemon"${1:-}"() { [[ -n $_gitstatus_zsh_version ]] || return [[ $_gitstatus_zsh_downloaded == [01] ]] || return + if (( UID == EUID )); then + local home=~ + else + local user + user="$(command id -un)" || return + local home=${userdirs[$user]} + [[ -n $home ]] || return + fi + if [[ -x $_gitstatus_zsh_daemon ]]; then - $_gitstatus_zsh_daemon -G $_gitstatus_zsh_version "${(@)args}" >&$pipe_fd + HOME=$home $_gitstatus_zsh_daemon -G $_gitstatus_zsh_version "${(@)args}" >&$pipe_fd local -i ret=$? [[ $ret == (0|129|130|131|137|141|143) ]] && return ret fi @@ -426,7 +435,7 @@ function _gitstatus_daemon"${1:-}"() { [[ -n $_gitstatus_zsh_version ]] || return [[ $_gitstatus_zsh_downloaded == 1 ]] || return - $_gitstatus_zsh_daemon -G $_gitstatus_zsh_version "${(@)args}" >&$pipe_fd + HOME=$home $_gitstatus_zsh_daemon -G $_gitstatus_zsh_version "${(@)args}" >&$pipe_fd } always { local -i ret=$? zf_rm -f -- $file_prefix.lock $file_prefix.fifo diff --git a/install b/install index c5b15d22..4303129b 100755 --- a/install +++ b/install @@ -131,14 +131,8 @@ END >&2 echo "[gitstatus] error: GITSTATUS_DAEMON is not absolute path: $daemon" return 1 fi - if [ -z "$daemon" ]; then + if [ -z "$daemon" && -e "$gitstatus_dir"/usrbin/gitstatusd ]; then daemon="$gitstatus_dir"/usrbin/gitstatusd - if [ ! -e "$daemon" ]; then - daemon="$daemon"-"$uname_s"-"$uname_m" - if [ ! -e "$daemon" ]; then - daemon= - fi - fi fi if [ -n "$daemon" ]; then local gitstatus_version= libgit2_version= @@ -184,23 +178,13 @@ END if [ -z "$no_check" ]; then # Check if a suitable gitstatusd already exists. - local daemon="$cache_dir"/"$file" - if [ -e "$daemon" ]; then - [ $# = 0 ] || "$@" "$daemon" "$version" 0 - return + local daemon="$gitstatus_dir"/usrbin/"$file" + if [ ! -e "$daemon" ]; then + daemon="$cache_dir"/"$file" + [ -e "$daemon" ] || daemon= fi - daemon="$daemon"-"$uname_s"-"$uname_m" - if [ -e "$daemon" ]; then - local gitstatus_version= libgit2_version= - if ! . "$gitstatus_dir"/build.info; then - >&2 echo "[gitstatus] internal error: failed to source build.info" - return 1 - fi - if [ -z "$gitstatus_version" ]; then - >&2 echo "[gitstatus] internal error: empty gitstatus_version in build.info" - return 1 - fi - [ $# = 0 ] || "$@" "$daemon" "$gitstatus_version" 0 + if [ -n "$daemon" ]; then + [ $# = 0 ] || "$@" "$daemon" "$version" 0 return fi fi diff --git a/install.info b/install.info index 35260b7f..668f3e48 100644 --- a/install.info +++ b/install.info @@ -14,6 +14,7 @@ uname_s_glob="linux"; uname_m_glob="aarch64"; file="gitstatusd-${uname_ uname_s_glob="linux"; uname_m_glob="armv6l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="051a9448d9cb4bb1d95e93cff51a6ab48a085465ec30eec40046977d4213feff"; uname_s_glob="linux"; uname_m_glob="armv7l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="adaa47c8e8dec1e1e8686c3044ee0f45afda15deaa8388efcb4952747b66246e"; uname_s_glob="linux"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="c80355664e7361e11215e64b523ed75a3d39f72393fa2204fefa85eae0342a67"; +uname_s_glob="linux"; uname_m_glob="ppc64le"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.2.0"; sha256="38a60b64f619d9db83747f1653b0b740380b1b2b9b414a0ff94815305cdd76bc"; uname_s_glob="linux"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="e33867063f091d3c31ede9916fef079ff8cd6fdcc70d051914f962ab3b8f36fd"; uname_s_glob="msys_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="2cf6ff92a5c50e4181ceb402217162bebd5e52144eb52eacfef2f6d47d5c20d4"; uname_s_glob="msys_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="960c3d9d90d7b96257a9746f7168faffdf9b5fbda464e354e7b14c42cc473f15"; diff --git a/mbuild b/mbuild index cf4bc008..7d98b1fb 100755 --- a/mbuild +++ b/mbuild @@ -117,6 +117,7 @@ local -rA assets=( linux-armv6l build-linux-armv7l linux-armv7l build-linux-armv7l linux-i686 build-linux-x86_64 + linux-ppc64le build-linux-ppc64le linux-x86_64 build-linux-x86_64 ) @@ -180,14 +181,15 @@ local build=' function build-unix() { local intro flags=(-sw) case $2 in - darwin-*) intro='PATH="/usr/local/bin:$PATH"';; + linux-ppc64le);; linux-*) flags+=(-d docker);; + darwin-*) intro='PATH="/usr/local/bin:$PATH"';; esac ssh $1 -- /bin/sh -uex <<<" $intro cd /tmp $build ${2##*-} ${(j: :)${(@q)flags}}" - scp $1:/tmp/gitstatus/usrbin/gitstatusd-$2 $binaries/ + scp $1:/tmp/gitstatus/usrbin/gitstatusd $binaries/gitstatusd-$2 } function build-windows() { @@ -236,7 +238,7 @@ function build-windows() { while true; do IFS= read -u $fd -r line || return 0 if [[ $line == *"warning: terminate MSYS2"* ]]; then - # At this point the machine is hosed. Rogue process with corrupted name + # At this point the machine is hosed. A rogue process with a corrupted name # is eating all CPU. The top SSH connection won't terminate on its own. ssh $1 powershell.exe <<<'Restart-Computer -Force' || true sleep 30 @@ -260,7 +262,7 @@ function build-windows() { cd -- $tmp $build ${2##*-} ${(j: :)${(@q)flags}} exit" - scp $1:$c/tmp/gitstatus/usrbin/gitstatusd-$2 $binaries/ + scp $1:$c/tmp/gitstatus/usrbin/gitstatusd $binaries/gitstatusd-$2 chmod +x $binaries/gitstatusd-$2 } @@ -272,7 +274,7 @@ function build() ( zsystem flock $locks/$machine build-${protocol[(k)$platform]} $machine $platform local tmp=gitstatusd-$platform.tmp.$$.tar.gz - ( cd -q -- $binaries; GZIP=-9 tar -czf $tmp gitstatusd-$platform ) + ( cd -q -- $binaries; tar --owner=0 --group=0 -I 'gzip -9' -cf $tmp gitstatusd-$platform ) mv -f -- $binaries/$tmp $binaries/gitstatusd-$platform.tar.gz ) From 3e17260622dc9d40f55fa7d73fc346ef3185e4a5 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 13 Jun 2020 17:04:31 +0200 Subject: [PATCH 097/659] no need to call `zle -R` when using z4h --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 8d57052e..d62a559d 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6522,10 +6522,10 @@ function _p9k_reset_prompt() { setopt prompt_subst (( __p9k_ksh_arrays )) && setopt ksh_arrays (( __p9k_sh_glob )) && setopt sh_glob - (( _p9k__can_hide_cursor )) && echoti civis { + (( _p9k__can_hide_cursor )) && echoti civis zle .reset-prompt - zle -R + (( ${+functions[z4h]} )) || zle -R } always { (( _p9k__can_hide_cursor )) && echoti cnorm _p9k__cursor_hidden=0 From 4c15d633ddf311d07c45f94c326ef27e19c9e7b7 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 14 Jun 2020 09:21:28 +0200 Subject: [PATCH 098/659] respect POWERLEVEL9K_PROMPT_CHAR_ERROR_VIINS_CONTENT_EXPANSION in simple transient prompt; see #820 --- internal/p10k.zsh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index d62a559d..b7f477d8 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7713,7 +7713,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v97\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v98\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' @@ -7769,13 +7769,22 @@ function _p9k_init_cacheable() { done if [[ $_POWERLEVEL9K_TRANSIENT_PROMPT != off ]]; then - _p9k_transient_prompt='%b%k%s%u%F{%(?.' + local sep=$'\1' + _p9k_transient_prompt='%b%k%s%u%(?'$sep _p9k_color prompt_prompt_char_OK_VIINS FOREGROUND 76 - _p9k_transient_prompt+=$_p9k__ret'.' - _p9k_color prompt_prompt_char_ERROR_VIINS FOREGROUND 196 - _p9k_transient_prompt+=$_p9k__ret')}${${P9K_CONTENT::="❯"}+}' + _p9k_foreground $_p9k__ret + _p9k_transient_prompt+=$_p9k__ret + _p9k_transient_prompt+='${${P9K_CONTENT::="❯"}+}' _p9k_param prompt_prompt_char_OK_VIINS CONTENT_EXPANSION '${P9K_CONTENT}' - _p9k_transient_prompt+='${:-"'$_p9k__ret'"}%b%k%f%s%u ' + _p9k_transient_prompt+='${:-"'$_p9k__ret'"}' + _p9k_transient_prompt+=$sep + _p9k_color prompt_prompt_char_ERROR_VIINS FOREGROUND 196 + _p9k_foreground $_p9k__ret + _p9k_transient_prompt+=$_p9k__ret + _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 ' if [[ $ITERM_SHELL_INTEGRATION_INSTALLED == Yes ]]; then _p9k_transient_prompt=$'%{\e]133;A\a%}'$_p9k_transient_prompt$'%{\e]133;B\a%}' fi From 0717e57ff46201ff04e7d62cda8677e174a83be6 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 14 Jun 2020 10:29:29 +0200 Subject: [PATCH 099/659] Squashed 'gitstatus/' changes from 1c74c8db..0d23fbd1 0d23fbd1 comments 9c19c9c4 fix a typo in install that prevents the locally built gitstatusd from being used 92fd143f doc cleanup git-subtree-dir: gitstatus git-subtree-split: 0d23fbd117ad6afe52fdbd96d08cf38f941be4d3 --- README.md | 12 ++++++------ gitstatus.prompt.sh | 2 +- install | 2 +- src/dir.cc | 12 +++++++----- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 291f89bf..cbf29c3a 100644 --- a/README.md +++ b/README.md @@ -103,9 +103,9 @@ function my_set_prompt() { if gitstatus_query MY && [[ $VCS_STATUS_RESULT == ok-sync ]]; then RPROMPT=${${VCS_STATUS_LOCAL_BRANCH:-@${VCS_STATUS_COMMIT}}//\%/%%} # escape % - (( $VCS_STATUS_NUM_STAGED )) && RPROMPT+='+' - (( $VCS_STATUS_NUM_UNSTAGED )) && RPROMPT+='!' - (( $VCS_STATUS_NUM_UNTRACKED )) && RPROMPT+='?' + (( VCS_STATUS_NUM_STAGED )) && RPROMPT+='+' + (( VCS_STATUS_NUM_UNSTAGED )) && RPROMPT+='!' + (( VCS_STATUS_NUM_UNTRACKED )) && RPROMPT+='?' fi setopt no_prompt_{bang,subst} prompt_percent # enable/disable correct prompt expansions @@ -204,9 +204,9 @@ function my_set_prompt() { else PS1+=" @${VCS_STATUS_COMMIT//\\/\\\\}" # escape backslash fi - [[ "$VCS_STATUS_HAS_STAGED" == 1 ]] && PS1+='+' - [[ "$VCS_STATUS_HAS_UNSTAGED" == 1 ]] && PS1+='!' - [[ "$VCS_STATUS_HAS_UNTRACKED" == 1 ]] && PS1+='?' + (( VCS_STATUS_HAS_STAGED" )) && PS1+='+' + (( VCS_STATUS_HAS_UNSTAGED" )) && PS1+='!' + (( VCS_STATUS_HAS_UNTRACKED" )) && PS1+='?' fi PS1+='\n\$ ' diff --git a/gitstatus.prompt.sh b/gitstatus.prompt.sh index b2c67c8d..9c1a2138 100644 --- a/gitstatus.prompt.sh +++ b/gitstatus.prompt.sh @@ -94,7 +94,7 @@ shopt -s promptvars # # Example: # -# user@host ~/projects/skynet master+! +# user@host ~/projects/skynet master ⇡42 # $ █ PS1='\[\033[01;32m\]\u@\h\[\033[00m\] ' # green user@host PS1+='\[\033[01;34m\]\w\[\033[00m\]' # blue current working directory diff --git a/install b/install index 4303129b..ec442ed9 100755 --- a/install +++ b/install @@ -131,7 +131,7 @@ END >&2 echo "[gitstatus] error: GITSTATUS_DAEMON is not absolute path: $daemon" return 1 fi - if [ -z "$daemon" && -e "$gitstatus_dir"/usrbin/gitstatusd ]; then + if [ -z "$daemon" -a -e "$gitstatus_dir"/usrbin/gitstatusd ]; then daemon="$gitstatus_dir"/usrbin/gitstatusd fi if [ -n "$daemon" ]; then diff --git a/src/dir.cc b/src/dir.cc index 14bc6ac4..1817e1d3 100644 --- a/src/dir.cc +++ b/src/dir.cc @@ -116,16 +116,18 @@ bool ListDir(int dir_fd, Arena& arena, std::vector& entries, bool precomp entries.clear(); return false; } - if (n == 0) break; for (int pos = 0; pos < n;) { auto* ent = reinterpret_cast(buf + pos); if (!Dots(ent->d_name)) entries.push_back(ent->d_name); pos += ent->d_reclen; - // It's tempting to bail here if n + sizeof(linux_dirent64) + 512 <= n. After all, there - // was enough space for another entry but SYS_getdents64 didn't write it, so this must be - // the end of the directory listing, right? Unfortuatenly, no. SYS_getdents64 is finicky. - // It sometimes writes a partial list of entries even if the full list would fit. } + if (n == 0) break; + // The following optimization relies on SYS_getdents64 always returning as many + // entries as would fit. This is not guaranteed by the specification and I don't + // know if this is true in practice. The optimization has no measurable effect on + // gitstatus performance, so it's turned off. + // + // if (n + sizeof(linux_dirent64) + 512 <= kBufSize) break; } if (case_sensitive) { From 54bbe0a0a3efcea69a35b09a817cf5836b89e055 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 15 Jun 2020 17:33:35 +0200 Subject: [PATCH 100/659] speed up pasting in terminals without bracketed paste --- internal/p10k.zsh | 54 +++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index b7f477d8..92cc4aa2 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7219,27 +7219,9 @@ function _p9k_redraw() { exec {1}>&- _p9k__redraw_fd=0 - local -a P9K_COMMANDS - _p9k__last_buffer="$PREBUFFER$BUFFER" - # this must run with user options - _p9k_parse_buffer "$_p9k__last_buffer" $_POWERLEVEL9K_COMMANDS_MAX_TOKEN_COUNT - _p9k__last_commands=(${P9K_COMMANDS[@]}) - () { - eval "$__p9k_intro" local -h WIDGET=zle-line-pre-redraw - (( _p9k__restore_prompt_fd )) && _p9k_restore_prompt $_p9k__restore_prompt_fd - local pat idx var - for pat idx var in $_p9k_show_on_command; do - if (( $P9K_COMMANDS[(I)$pat] )); then - _p9k_display_segment $idx $var show - else - _p9k_display_segment $idx $var hide - fi - done - (( $+functions[p10k-on-post-widget] )) && p10k-on-post-widget - (( __p9k_reset_state == 2 )) && _p9k_reset_prompt - __p9k_reset_state=0 + _p9k_widget_hook '' } } @@ -7251,19 +7233,13 @@ function _p9k_deschedule_redraw() { } function _p9k_widget_hook() { + _p9k_deschedule_redraw + if (( $+functions[p10k-on-post-widget] || $#_p9k_show_on_command )); then local -a P9K_COMMANDS if [[ "$_p9k__last_buffer" == "$PREBUFFER$BUFFER" ]]; then P9K_COMMANDS=(${_p9k__last_commands[@]}) - _p9k_deschedule_redraw - elif [[ $1 == zle-line-pre-redraw ]] && (( PENDING || KEYS_QUEUED_COUNT )); then - P9K_COMMANDS=(${_p9k__last_commands[@]}) - if (( ! _p9k__redraw_fd )); then - sysopen -o cloexec -ru _p9k__redraw_fd /dev/null - zle -F $_p9k__redraw_fd _p9k_redraw - fi else - _p9k_deschedule_redraw _p9k__last_buffer="$PREBUFFER$BUFFER" if [[ -n "$_p9k__last_buffer" ]]; then # this must run with user options @@ -7297,9 +7273,27 @@ function _p9k_widget_hook() { } function _p9k_widget() { - (( ! ${+widgets[._p9k_orig_$1]} )) || zle ._p9k_orig_$1 "${@:2}" - local res=$? - (( ! __p9k_enabled )) || [[ $CONTEXT != start ]] || _p9k_widget_hook "$@" + local f=${widgets[._p9k_orig_$1]:-} + local -i res + [[ -z $f ]] || { + [[ $f == user:-z4h-* ]] && { + "${f#user:}" "${@:2}" + res=$? + } || { + zle ._p9k_orig_$1 -- "${@:2}" + 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 "$@" + } return res } From eda706c8ff978e925572c9111bc556b768ea4995 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 15 Jun 2020 17:56:32 +0200 Subject: [PATCH 101/659] notes --- internal/notes.md | 53 +++++++---------------------------------------- 1 file changed, 7 insertions(+), 46 deletions(-) diff --git a/internal/notes.md b/internal/notes.md index 3ef3a828..dea28d30 100644 --- a/internal/notes.md +++ b/internal/notes.md @@ -76,16 +76,6 @@ emulate zsh -o prompt_percent -c 'print -P "%F{#ff0000}red%F{green}%B bold green --- -bug: open a new tab and hit ctrl-p. an empty line will appear before prompt. - ---- - -take a look at https://github.com/skywind3000/z.lua. it claims to have fzf support. would be nice -if alt-down showed two groups -- one for subdirs and another for directory history (sorted by -frequency of use? by last use? three sections? more key bindings?). - ---- - add `p10k explain` that prints something like this: ```text @@ -163,7 +153,8 @@ Prompt connection should have matching options. Add `POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_MIRROR_SEPARATOR`. If set, left segments get separated with `POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR` followed by `POWERLEVEL9K_LEFT_SEGMENT_MIRROR_SEPARATOR`. Each is drawn without background. The first with the foreground of left segment, the second with -the background of right segment. To insert space in between, embed it in one of these parameters. +the background of right segment. To insert space in between, embed it in +`POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_MIRROR_SEPARATOR`. `POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR` is unused. --- @@ -177,41 +168,6 @@ two filled separators similar to heads and tail. Figure out how to present this --- -Get rid of `saved_columns` in the wizard and always present all options as if horizontal space was -unlimited. `print_prompt` should print something like this if prompt is too wide: - - Terminal window too narrow to display prompt. - Make it wider and press ENTER to refresh. - -Terminal dimensions will need to be checked more often. - -Try getting rid of the "press ENTER" requirement by trapping `SIGWINCH`. Might need to run `read -k` -with timeout in a loop. - -Print all text with a helper function that keeps track of the number of lines remaining on screen. -`print_prompt` will then be able to show a similar message for Terminal window being too short. This -makes sense only for two-line prompts. This is probably OK. - -If `print_prompt` can be told in advance how many prompts we are going to display, it might be able -to insert or avoid inserting `\n` in between, depending on terminal height. There is one screen -where one prompt is a one-liner while another is a two-liner. This is fine because there are only -two options. `print_prompt` can assume that all options will use the current prompt height. - -Don't use `print_prompt` directly. Create `ask_prompt` and use it like this: - -```zsh -ask_prompt \ - 1 "No frame" "left_frame=0 right_frame=0" \ - 2 "Left frame" "left_frame=1 right_frame=0" \ - ... -``` - -There are two prompt questions that don't fit this pattern: `ask_empty_line` and -`ask_transient_prompt`. The first is easy to adapt (`print_prompt` can print prompt twice if -`empty_line=1`) but the second will probably have to be hand-coded. - ---- - Optimize auto-wizard check. ```text @@ -234,3 +190,8 @@ Respect `POWERLEVEL9K_VCS_STASH_ICON` overrides but not anything with segment na Define `POWERLEVEL9K_VCS_*` parameters in config templates for all symbols used in `my_git_formatter`. Add missing entries to `icons`. Use `$P9K_ICON[...]` within `my_git_formatter`. Add a screen to the wizard to choose between clear and circled icons. + +--- + +Add a screen to the wizard asking whether to set `POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~'`. +Show it only if there is `$HOME/.git`. By default this parameter should be commented out. From 8854cb6000d7eccd9b95ca4eec9fb16ea8d283eb Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 16 Jun 2020 19:51:53 +0200 Subject: [PATCH 102/659] survive files with windows EOL (on linux, yes; people do that); see #827 --- internal/p10k.zsh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 92cc4aa2..4d09e801 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -193,6 +193,7 @@ function _p9k_read_word() { local rest _p9k__ret= { read _p9k__ret rest <$1 } 2>/dev/null + _p9k__ret=${_p9k__ret%$'\r'} _p9k__read_word_cache[$1]=$stat[1]:$_p9k__ret fi [[ -n $_p9k__ret ]] @@ -2078,7 +2079,7 @@ prompt_package() { # Redneck json parsing. Yields correct results for any well-formed json document. # Produces random garbage for invalid json. { data="$(<$file)" || return } 2>/dev/null - data=${data##[[:space:]]#} + data=${${data//$'\r'}##[[:space:]]#} [[ $data == '{'* ]] || return data[1]= local -i depth=1 @@ -2301,6 +2302,7 @@ function _p9k_nvm_ls_default() { while [[ -r $NVM_DIR/alias/$v ]]; do local target= IFS='' read -r target <$NVM_DIR/alias/$v + target=${target%$'\r'} [[ -z $target ]] && break (( $seen[(I)$target] )) && return seen+=$target @@ -5012,7 +5014,7 @@ function _p9k_asdf_init_meta() { # legacy_version_file = yes # # We do the same. - local lines=(${(@M)${(f)"$(<$cfg)"}:#[[:space:]]#legacy_version_file[[:space:]]#=*}) + local lines=(${(@M)${(@)${(f)"$(<$cfg)"}%$'\r'}:#[[:space:]]#legacy_version_file[[:space:]]#=*}) if [[ $#lines == 1 && ${${(s:=:)lines[1]}[2]} == [[:space:]]#yes[[:space:]]# ]]; then legacy_enabled=1 fi @@ -5092,6 +5094,7 @@ 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)$_p9k_asdf_plugins[$plugin]]:-$v[1]} _p9k_asdf_file2versions[$plugin:$file]=$stat[1]:"$v" @@ -5105,7 +5108,7 @@ function _p9k_asdf_parse_version_file() { local file_versions=(${(0)${cached#*:}}) else local file_versions=() - { local lines=(${(@)${(f)"$(<$file)"}/\#*}) } 2>/dev/null + { local lines=(${(@)${(@)${(f)"$(<$file)"}%$'\r'}/\#*}) } 2>/dev/null local line for line in $lines; do local words=($=line) From 178c3bccf0f0b26372a35162044e94df23eea2d6 Mon Sep 17 00:00:00 2001 From: mundry <1453314+mundry@users.noreply.github.com> Date: Sun, 21 Jun 2020 11:03:36 +0200 Subject: [PATCH 103/659] Add font configuration instructions for Terminator. (#835) Co-authored-by: mundry --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 2e22d5aa..754c3d1a 100644 --- a/README.md +++ b/README.md @@ -550,6 +550,9 @@ applications on your system. Configure your terminal to use this 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*. **IMPORTANT:** Run `p10k configure` after changing terminal font. The old `~/.p10k.zsh` may work incorrectly with the new font. From d394a4e038e494354cbdb68aeaebc05e7d0788fa Mon Sep 17 00:00:00 2001 From: mundry <1453314+mundry@users.noreply.github.com> Date: Sun, 21 Jun 2020 11:04:23 +0200 Subject: [PATCH 104/659] Fix typo in config comment. (#836) Co-authored-by: mundry --- config/p10k-classic.zsh | 2 +- config/p10k-lean-8colors.zsh | 2 +- config/p10k-lean.zsh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 9f87d300..9e85288b 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -460,7 +460,7 @@ # isn't in an svn or hg reposotiry. typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) - # These settings are used for respositories other than Git or when gitstatusd fails and + # These settings are used for repositories other than Git or when gitstatusd fails and # Powerlevel10k has to fall back to using vcs_info. typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=76 typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=76 diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 39408377..cac63a9a 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -454,7 +454,7 @@ # isn't in an svn or hg reposotiry. typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) - # These settings are used for respositories other than Git or when gitstatusd fails and + # These settings are used for repositories other than Git or when gitstatusd fails and # Powerlevel10k has to fall back to using vcs_info. typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=2 typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=2 diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index f0eeb333..747bd863 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -454,7 +454,7 @@ # isn't in an svn or hg reposotiry. typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) - # These settings are used for respositories other than Git or when gitstatusd fails and + # These settings are used for repositories other than Git or when gitstatusd fails and # Powerlevel10k has to fall back to using vcs_info. typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=76 typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=76 From eadfdba7073e625562ae02841608ea37a46e0120 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 22 Jun 2020 19:18:34 +0200 Subject: [PATCH 105/659] Squashed 'gitstatus/' changes from 0d23fbd1..0f5402c8 0f5402c8 bug fix: properly propagate switches to gitstatusd git-subtree-dir: gitstatus git-subtree-split: 0f5402c8686a593cd21b95ade28a154dd51749bb --- gitstatus.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index 0df36724..32c20f32 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -516,7 +516,7 @@ function gitstatus_start"${1:-}"() { args+=(-$opt $OPTARG) [[ $opt == m ]] && dirty_max_index_size=OPTARG ;; - e|U|W|D) args+=$opt;; + e|U|W|D) args+=-$opt;; +(e|U|W|D)) args=(${(@)args:#-$opt});; \?) print -ru2 -- "gitstatus_start: invalid option: $OPTARG" ; return 1;; :) print -ru2 -- "gitstatus_start: missing required argument: $OPTARG"; return 1;; From 6a1e993a05439e7829ad91c1699f84c46c82a862 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 25 Jun 2020 09:03:59 +0200 Subject: [PATCH 106/659] make `fvm` segment work with fvm >= 1.0.0; see #842 --- internal/p10k.zsh | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 4d09e801..38fbd9ae 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1224,14 +1224,32 @@ function _p9k_read_file() { [[ -n $_p9k__ret ]] } -prompt_fvm() { - _p9k_upglob fvm && return - local link=$_p9k__parent_dirs[$?]/fvm - if [[ -L $link ]]; then - if [[ ${link:A} == (#b)*/versions/([^/]##)/bin/flutter ]]; then +function _p9k_fvm_old() { + _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 $0 blue $_p9k_color1 FLUTTER_ICON 0 '' ${match[1]//\%/%%} + return 0 fi fi + return 1 +} + +function _p9k_fvm_new() { + _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 $0 blue $_p9k_color1 FLUTTER_ICON 0 '' ${match[1]//\%/%%} + return 0 + fi + fi + return 1 +} + +prompt_fvm() { + _p9k_fvm_new || _p9k_fvm_old } _p9k_prompt_fvm_init() { From ae32fd58b3623b52005c72fb1edcb09ab753ad45 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 25 Jun 2020 11:09:19 +0200 Subject: [PATCH 107/659] fix `fvm` styling that has been broken by the last commit; fixes #645 --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 38fbd9ae..7a37056b 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1229,7 +1229,7 @@ function _p9k_fvm_old() { local fvm=$_p9k__parent_dirs[$?]/fvm if [[ -L $fvm ]]; then if [[ ${fvm:A} == (#b)*/versions/([^/]##)/bin/flutter ]]; then - _p9k_prompt_segment $0 blue $_p9k_color1 FLUTTER_ICON 0 '' ${match[1]//\%/%%} + _p9k_prompt_segment prompt_fvm blue $_p9k_color1 FLUTTER_ICON 0 '' ${match[1]//\%/%%} return 0 fi fi @@ -1241,7 +1241,7 @@ function _p9k_fvm_new() { local sdk=$_p9k__parent_dirs[$?]/.fvm/flutter_sdk if [[ -L $sdk ]]; then if [[ ${sdk:A} == (#b)*/versions/([^/]##) ]]; then - _p9k_prompt_segment $0 blue $_p9k_color1 FLUTTER_ICON 0 '' ${match[1]//\%/%%} + _p9k_prompt_segment prompt_fvm blue $_p9k_color1 FLUTTER_ICON 0 '' ${match[1]//\%/%%} return 0 fi fi From db6f909958bdc452f45f62df58c123c50fed1c5f Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 28 Jun 2020 10:45:46 +0200 Subject: [PATCH 108/659] suppress the expected error message from PlistBuddy --- internal/wizard.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 767b787a..eb27e2c1 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -535,7 +535,7 @@ function install_font() { ) for k t v in $settings; do /usr/libexec/PlistBuddy -c "Set :\"New Bookmarks\":0:$k $v" \ - ~/Library/Preferences/com.googlecode.iterm2.plist && continue + ~/Library/Preferences/com.googlecode.iterm2.plist 2>/dev/null && continue run_command "" /usr/libexec/PlistBuddy -c \ "Add :\"New Bookmarks\":0:$k $t $v" ~/Library/Preferences/com.googlecode.iterm2.plist done From a88e11f54b567f1d30a4e699c3b53966375bc4bf Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 28 Jun 2020 11:11:27 +0200 Subject: [PATCH 109/659] disable background transparency in iTerm2 --- internal/wizard.zsh | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index eb27e2c1..b078a9e2 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -519,19 +519,20 @@ function install_font() { local size=$iterm2_font_size [[ $size == 12 ]] && size=13 local k t v settings=( - '"Normal Font"' string '"MesloLGS-NF-Regular '$size'"' - '"Terminal Type"' string '"xterm-256color"' - '"Horizontal Spacing"' real 1 - '"Vertical Spacing"' real 1 - '"Minimum Contrast"' real 0 - '"Use Bold Font"' bool 1 - '"Use Bright Bold"' bool 1 - '"Use Italic Font"' bool 1 - '"ASCII Anti Aliased"' bool 1 - '"Non-ASCII Anti Aliased"' bool 1 - '"Use Non-ASCII Font"' bool 0 - '"Ambiguous Double Width"' bool 0 - '"Draw Powerline Glyphs"' bool 1 + '"Normal Font"' string '"MesloLGS-NF-Regular '$size'"' + '"Terminal Type"' string '"xterm-256color"' + '"Horizontal Spacing"' real 1 + '"Vertical Spacing"' real 1 + '"Minimum Contrast"' real 0 + '"Use Bold Font"' bool 1 + '"Use Bright Bold"' bool 1 + '"Use Italic Font"' bool 1 + '"ASCII Anti Aliased"' bool 1 + '"Non-ASCII Anti Aliased"' bool 1 + '"Use Non-ASCII Font"' bool 0 + '"Ambiguous Double Width"' bool 0 + '"Draw Powerline Glyphs"' bool 1 + '"Only The Default BG Color Uses Transparency"' bool 1 ) for k t v in $settings; do /usr/libexec/PlistBuddy -c "Set :\"New Bookmarks\":0:$k $v" \ From be66f21f5338ae9243403ce37a7a03931617648f Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 2 Jul 2020 06:33:12 +0200 Subject: [PATCH 110/659] replace NETWORK_ICON The original icon (U+FBF1) is in fact a ligature. Some terminals do funky things when displaying it. For example: print '\uFBF1 42 abc' When executed in a VTE-based terminal with Nerd Fonts, it'll print this: 42 X abc Here X stands for the glyph that Nerd Fonts uses for U+FBF1. --- 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 f9331df1..5181d45e 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -459,7 +459,7 @@ function _p9k_init_icons() { HOME_SUB_ICON '\uF07C'$s #  FOLDER_ICON '\uF115'$s #  ETC_ICON '\uF013'$s #  - NETWORK_ICON '\uFBF1'$s # ﯱ + NETWORK_ICON '\uF877'$s #  LOAD_ICON '\uF080 ' #  SWAP_ICON '\uF464'$s #  RAM_ICON '\uF0E4'$s #  diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 7a37056b..b59f86d2 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7728,7 +7728,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v98\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v99\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 e0ed693e6dcf01a1e0d104ca10d23d1a76b89153 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 2 Jul 2020 10:39:35 +0200 Subject: [PATCH 111/659] add `CMB*` to battery directory patterns; see #858 --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index b59f86d2..962ebd4f 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1270,7 +1270,7 @@ _p9k_prompt_battery_init() { return fi if [[ $_p9k_os != (Linux|Android) || - -z /sys/class/power_supply/(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 } @@ -1328,7 +1328,7 @@ _p9k_prompt_battery_set_args() { Linux|Android) # See https://sourceforge.net/projects/acpiclient. - local -a bats=( /sys/class/power_supply/(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 882cede0aec99f58ccaf8d0765688bfee7b198fb Mon Sep 17 00:00:00 2001 From: Andrea Carpani Date: Fri, 3 Jul 2020 19:05:48 +0200 Subject: [PATCH 112/659] Add option to show terraform workspace even if it's default --- 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, 11 insertions(+), 1 deletion(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 9e85288b..b6a72f66 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1153,6 +1153,8 @@ '*' DEFAULT) typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_FOREGROUND=38 # typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Show terraform workspace even if it's default + typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT_WS=false #############[ 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 cac63a9a..6c27bca8 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1217,6 +1217,8 @@ '*' DEFAULT) typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_FOREGROUND=4 # typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Show terraform workspace even if it's default + typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT_WS=false #[ 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. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 747bd863..cdca774e 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1217,6 +1217,8 @@ '*' DEFAULT) typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_FOREGROUND=38 # typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Show terraform workspace even if it's default + typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT_WS=false #[ 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. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 9e91db6c..2a7fd630 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1216,6 +1216,8 @@ typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_FOREGROUND=4 typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_BACKGROUND=0 # typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Show terraform workspace even if it's default + typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT_WS=false #############[ 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/internal/p10k.zsh b/internal/p10k.zsh index 962ebd4f..095ad31c 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4666,7 +4666,8 @@ function prompt_terraform() { if [[ -z $TF_WORKSPACE ]]; then _p9k_read_word ${${TF_DATA_DIR:-.terraform}:A}/environment && ws=$_p9k__ret fi - [[ $ws == (|default) ]] && return + [[ $ws == '' ]] && return + [[ ($ws == 'default') && ( ! ${_POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT_WS} ) ]] && return local pat class for pat class in "${_POWERLEVEL9K_TERRAFORM_CLASSES[@]}"; do if [[ $ws == ${~pat} ]]; then @@ -7114,6 +7115,7 @@ _p9k_init_params() { _p9k_declare -a POWERLEVEL9K_KUBECONTEXT_CLASSES -- _p9k_declare -a POWERLEVEL9K_AWS_CLASSES -- _p9k_declare -a POWERLEVEL9K_TERRAFORM_CLASSES -- + _p9k_declare -b POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT_WS 0 _p9k_declare -a POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES -- 'service_account:*' SERVICE_ACCOUNT # Specifies the format of java version. # From ff8654ccd5b4f22710a235e7f715913277612451 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 4 Jul 2020 07:00:17 +0200 Subject: [PATCH 113/659] Squashed 'gitstatus/' changes from 0f5402c8..89e9ebfd 89e9ebfd survive zsh environments where `source` is a broken function git-subtree-dir: gitstatus git-subtree-split: 89e9ebfd59f5ddfea4d97ae1e510273415a57a51 --- gitstatus.plugin.zsh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index 32c20f32..46861e32 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -398,13 +398,13 @@ function _gitstatus_daemon"${1:-}"() { local gitstatus_plugin_dir_var=_gitstatus_plugin_dir$fsuf local gitstatus_plugin_dir=${(P)gitstatus_plugin_dir_var} - set -- -d $gitstatus_plugin_dir -s $uname_s -m $uname_m -p "printf . >&$pipe_fd" -- \ + builtin set -- -d $gitstatus_plugin_dir -s $uname_s -m $uname_m -p "printf . >&$pipe_fd" -- \ _gitstatus_set_daemon$fsuf - [[ ${GITSTATUS_AUTO_INSTALL:-1} == (|-|+)<1-> ]] || set -- -n "$@" - source $gitstatus_plugin_dir/install || return - [[ -n $_gitstatus_zsh_daemon ]] || return - [[ -n $_gitstatus_zsh_version ]] || return - [[ $_gitstatus_zsh_downloaded == [01] ]] || return + [[ ${GITSTATUS_AUTO_INSTALL:-1} == (|-|+)<1-> ]] || builtin set -- -n "$@" + builtin source $gitstatus_plugin_dir/install || return + [[ -n $_gitstatus_zsh_daemon ]] || return + [[ -n $_gitstatus_zsh_version ]] || return + [[ $_gitstatus_zsh_downloaded == [01] ]] || return if (( UID == EUID )); then local home=~ @@ -426,14 +426,14 @@ function _gitstatus_daemon"${1:-}"() { [[ $_gitstatus_zsh_daemon == \ ${GITSTATUS_CACHE_DIR:-${XDG_CACHE_HOME:-$HOME/.cache}/gitstatus}/* ]] || return - set -- -f "$@" + builtin set -- -f "$@" _gitstatus_zsh_daemon= _gitstatus_zsh_version= _gitstatus_zsh_downloaded= - source $gitstatus_plugin_dir/install || return - [[ -n $_gitstatus_zsh_daemon ]] || return - [[ -n $_gitstatus_zsh_version ]] || return - [[ $_gitstatus_zsh_downloaded == 1 ]] || return + builtin source $gitstatus_plugin_dir/install || return + [[ -n $_gitstatus_zsh_daemon ]] || return + [[ -n $_gitstatus_zsh_version ]] || return + [[ $_gitstatus_zsh_downloaded == 1 ]] || return HOME=$home $_gitstatus_zsh_daemon -G $_gitstatus_zsh_version "${(@)args}" >&$pipe_fd } always { From 2d74ac9d069ff58b984f4818a2fb743b0059b3ed Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 4 Jul 2020 07:03:46 +0200 Subject: [PATCH 114/659] prefix all `source` calls with `builtin` --- internal/configure.zsh | 4 ++-- internal/p10k.zsh | 24 ++++++++++++------------ powerlevel10k.zsh-theme | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/internal/configure.zsh b/internal/configure.zsh index 5b3df9ad..9c92c233 100644 --- a/internal/configure.zsh +++ b/internal/configure.zsh @@ -59,11 +59,11 @@ function p9k_configure() { _p9k_can_configure || return ( set -- -f - source $__p9k_root_dir/internal/wizard.zsh + builtin source $__p9k_root_dir/internal/wizard.zsh ) local ret=$? case $ret in - 0) source $__p9k_cfg_path; _p9k__force_must_init=1;; + 0) builtin source $__p9k_cfg_path; _p9k__force_must_init=1;; 69) return 0;; *) return $ret;; esac diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 962ebd4f..a7e3f77e 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -49,10 +49,10 @@ if ! autoload -Uz is-at-least || ! is-at-least 5.1; then return 1 fi -source "${__p9k_root_dir}/internal/configure.zsh" -source "${__p9k_root_dir}/internal/worker.zsh" -source "${__p9k_root_dir}/internal/parser.zsh" -source "${__p9k_root_dir}/internal/icons.zsh" +builtin source "${__p9k_root_dir}/internal/configure.zsh" +builtin source "${__p9k_root_dir}/internal/worker.zsh" +builtin source "${__p9k_root_dir}/internal/parser.zsh" +builtin source "${__p9k_root_dir}/internal/icons.zsh" # For compatibility with Powerlevel9k. It's not recommended to use mnemonic color # names in the configuration except for colors 0-7 as these are standard. @@ -5623,7 +5623,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=27 +typeset -gri __p9k_instant_prompt_version=28 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -5907,7 +5907,7 @@ _p9k_dump_instant_prompt() { exec 2>&1 {fd_null}>&- typeset -gi __p9k_instant_prompt_active=1 typeset -g __p9k_instant_prompt_dump_file=${XDG_CACHE_HOME:-~/.cache}/p10k-dump-${(%):-%n}.zsh - if source $__p9k_instant_prompt_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then + if builtin source $__p9k_instant_prompt_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then _p9k_preinit fi function _p9k_instant_prompt_cleanup() { @@ -6413,12 +6413,12 @@ _p9k_precmd_impl() { fi if (( ret == 0 )); then ( - source "$__p9k_root_dir"/internal/wizard.zsh + builtin source "$__p9k_root_dir"/internal/wizard.zsh ) if (( $? )); then instant_prompt_disabled=1 else - source "$__p9k_cfg_path" + builtin source "$__p9k_cfg_path" _p9k__force_must_init=1 _p9k_must_init fi @@ -8017,9 +8017,9 @@ _p9k_init_vcs() { typeset -g _p9k_preinit="function _p9k_preinit() { (( $+commands[git] )) || { unfunction _p9k_preinit; return 1 } - [[ \$ZSH_VERSION == ${(q)ZSH_VERSION} ]] || return - [[ -r ${(q)gitstatus_dir}/gitstatus.plugin.zsh ]] || return - source ${(q)gitstatus_dir}/gitstatus.plugin.zsh _p9k_ || return + [[ \$ZSH_VERSION == ${(q)ZSH_VERSION} ]] || return + [[ -r ${(q)gitstatus_dir}/gitstatus.plugin.zsh ]] || return + builtin source ${(q)gitstatus_dir}/gitstatus.plugin.zsh _p9k_ || return GITSTATUS_AUTO_INSTALL=${(q)GITSTATUS_AUTO_INSTALL} \ GITSTATUS_DAEMON=${(q)GITSTATUS_DAEMON} \ GITSTATUS_CACHE_DIR=${(q)GITSTATUS_CACHE_DIR} \ @@ -8035,7 +8035,7 @@ _p9k_init_vcs() { ${${_POWERLEVEL9K_VCS_RECURSE_UNTRACKED_DIRS:#0}:+-e} \ -a POWERLEVEL9K }" - source $gitstatus_dir/gitstatus.plugin.zsh _p9k_ || return + builtin source $gitstatus_dir/gitstatus.plugin.zsh _p9k_ || return () { trap 'return 130' INT { diff --git a/powerlevel10k.zsh-theme b/powerlevel10k.zsh-theme index cd49dd4c..d17862af 100644 --- a/powerlevel10k.zsh-theme +++ b/powerlevel10k.zsh-theme @@ -74,7 +74,7 @@ function _p9k_init_locale() { done fi fi - source $__p9k_root_dir/internal/p10k.zsh || true + builtin source $__p9k_root_dir/internal/p10k.zsh || true } (( $+__p9k_instant_prompt_active )) && unsetopt prompt_cr prompt_sp || setopt prompt_cr prompt_sp From 6c9d0977a6378239f4153f5d3700bc5f70b36c3d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 11 Jul 2020 10:07:34 +0200 Subject: [PATCH 115/659] make omz installation command work when executed from weird shells (no quoting though; that would be too much) --- README.md | 56 +++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 754c3d1a..90d8a2cd 100644 --- a/README.md +++ b/README.md @@ -366,14 +366,14 @@ 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:-~/.oh-my-zsh/custom}/themes/powerlevel10k +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:-~/.oh-my-zsh/custom}/themes/powerlevel10k +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`. @@ -591,19 +591,19 @@ 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:-~/.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 -Syu --noconfirm --needed 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 -Syu --noconfirm --needed zsh-theme-powerlevel10k-git` | **IMPORTANT**: Restart Zsh after updating Powerlevel10k. [Do not use `source ~/.zshrc`]( #weird-things-happen-after-typing-source-zshrc). @@ -641,19 +641,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` | - | [Oh My Zsh](#oh-my-zsh) | `rm -rf -- ${ZSH_CUSTOM:-~/.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` | 5. Restart Zsh. [Do not use `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc). ### Where can I ask for help and report bugs? From 34952e4a850bceef2e17af9b24741b4db7003357 Mon Sep 17 00:00:00 2001 From: Henry Bley-Vroman Date: Sat, 11 Jul 2020 16:53:38 -0400 Subject: [PATCH 116/659] Fix POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD comments (#880) --- 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 83eb89ac..6379158b 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -503,7 +503,7 @@ typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘' ###################[ command_execution_time: duration of the last command ]################### - # Show duration of the last command if takes longer than this many seconds. + # Show duration of the last command if takes at least this many seconds. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 # Show this many fractional digits. Zero means round to seconds. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index c70ca45e..c9a09bde 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -497,7 +497,7 @@ typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘' ###################[ command_execution_time: duration of the last command ]################### - # Show duration of the last command if takes longer than this many seconds. + # Show duration of the last command if takes at least this many seconds. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 # Show this many fractional digits. Zero means round to seconds. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 643cf469..f874a584 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -497,7 +497,7 @@ typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘' ###################[ command_execution_time: duration of the last command ]################### - # Show duration of the last command if takes longer than this many seconds. + # Show duration of the last command if takes at least this many seconds. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 # Show this many fractional digits. Zero means round to seconds. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 3377b8b9..74db332c 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -501,7 +501,7 @@ # Execution time color. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=0 typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND=3 - # Show duration of the last command if takes longer than this many seconds. + # Show duration of the last command if takes at least this many seconds. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 # Show this many fractional digits. Zero means round to seconds. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 From d0edcbc9662f20a16f16bc5c70df2c97fdc2a093 Mon Sep 17 00:00:00 2001 From: Kamlesh Date: Sun, 12 Jul 2020 02:19:01 -0400 Subject: [PATCH 117/659] Add Instructions to make powerlevel10 work for Guake (#882) Update instructions for the `Guake` terminal --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 90d8a2cd..c6ccb846 100644 --- a/README.md +++ b/README.md @@ -553,6 +553,9 @@ applications on your system. Configure your terminal to use this font: - **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*. **IMPORTANT:** Run `p10k configure` after changing terminal font. The old `~/.p10k.zsh` may work incorrectly with the new font. From cfc35853dfd4ff8a1bbcbe43f11c6d71c5233148 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 13 Jul 2020 14:24:38 +0200 Subject: [PATCH 118/659] start downloading gitstatusd while wizard is running --- internal/p10k.zsh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 22249727..94c5532c 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6413,7 +6413,16 @@ _p9k_precmd_impl() { fi if (( ret == 0 )); then ( - builtin source "$__p9k_root_dir"/internal/wizard.zsh + local -i pid + { + { /bin/sh "$__p9k_root_dir"/gitstatus/install /dev/null & } && pid=$! + ( builtin source "$__p9k_root_dir"/internal/wizard.zsh ) + } always { + if (( pid )); then + kill -- $pid 2>/dev/null + wait -- $pid 2>/dev/null + fi + } ) if (( $? )); then instant_prompt_disabled=1 From 4635fcaceec0f16bbeba9da8e3512fbedf709b8e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 14 Jul 2020 06:46:05 +0200 Subject: [PATCH 119/659] don't fetch gitstatusd if there is no git --- internal/p10k.zsh | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 94c5532c..52d85d5e 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6412,18 +6412,22 @@ _p9k_precmd_impl() { ret=$? fi if (( ret == 0 )); then - ( - local -i pid - { - { /bin/sh "$__p9k_root_dir"/gitstatus/install /dev/null & } && pid=$! - ( builtin source "$__p9k_root_dir"/internal/wizard.zsh ) - } always { - if (( pid )); then - kill -- $pid 2>/dev/null - wait -- $pid 2>/dev/null - fi - } - ) + if (( $+commands[git] )); then + ( + local -i pid + { + { /bin/sh "$__p9k_root_dir"/gitstatus/install /dev/null & } && pid=$! + ( builtin source "$__p9k_root_dir"/internal/wizard.zsh ) + } always { + if (( pid )); then + kill -- $pid 2>/dev/null + wait -- $pid 2>/dev/null + fi + } + ) + else + ( builtin source "$__p9k_root_dir"/internal/wizard.zsh ) + fi if (( $? )); then instant_prompt_disabled=1 else From 620e69fef1f1197998810d373f41b6e2a8fa651d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 16 Jul 2020 15:58:19 +0200 Subject: [PATCH 120/659] replace NETWORK_ICON; the original (U+F877) triggers a bug on macOS; see #895 --- 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 5181d45e..0c3bd86a 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -459,7 +459,7 @@ function _p9k_init_icons() { HOME_SUB_ICON '\uF07C'$s #  FOLDER_ICON '\uF115'$s #  ETC_ICON '\uF013'$s #  - NETWORK_ICON '\uF877'$s #  + NETWORK_ICON '\uF50D'$s #  LOAD_ICON '\uF080 ' #  SWAP_ICON '\uF464'$s #  RAM_ICON '\uF0E4'$s #  diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 52d85d5e..ab8b1c61 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7742,7 +7742,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v99\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v100\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 6dfd92f8c1d60892ea9b2a57e93cd22a8cb75c2a Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 18 Jul 2020 10:43:49 +0200 Subject: [PATCH 121/659] allow optional offset in POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER; see #896 --- config/p10k-classic.zsh | 5 +++++ config/p10k-lean-8colors.zsh | 5 +++++ config/p10k-lean.zsh | 5 +++++ config/p10k-rainbow.zsh | 5 +++++ internal/p10k.zsh | 13 ++++++------- 5 files changed, 26 insertions(+), 7 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 6379158b..76638267 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -247,6 +247,11 @@ # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first) # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers # and other directories don't. + # + # Optionally, "first" and "last" can be followed by ":" where is an integer. + # This moves the truncation point to the right (positive offset) or to the left (negative offset) + # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0" + # respectively. typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false # Don't shorten this many last directory segments. They are anchors. typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index c9a09bde..d5e97604 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -241,6 +241,11 @@ # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first) # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers # and other directories don't. + # + # Optionally, "first" and "last" can be followed by ":" where is an integer. + # This moves the truncation point to the right (positive offset) or to the left (negative offset) + # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0" + # respectively. typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false # Don't shorten this many last directory segments. They are anchors. typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index f874a584..68fb3ec3 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -241,6 +241,11 @@ # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first) # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers # and other directories don't. + # + # Optionally, "first" and "last" can be followed by ":" where is an integer. + # This moves the truncation point to the right (positive offset) or to the left (negative offset) + # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0" + # respectively. typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false # Don't shorten this many last directory segments. They are anchors. typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 74db332c..7deeb594 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -247,6 +247,11 @@ # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first) # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers # and other directories don't. + # + # Optionally, "first" and "last" can be followed by ":" where is an integer. + # This moves the truncation point to the right (positive offset) or to the left (negative offset) + # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0" + # respectively. typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false # Don't shorten this many last directory segments. They are anchors. typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 diff --git a/internal/p10k.zsh b/internal/p10k.zsh index ab8b1c61..b11f3ffe 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1847,10 +1847,10 @@ prompt_dir() { done if [[ -n $_POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER ]]; then local _2=$'\2' - if [[ $_POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER == last ]]; then - (( e = ${parts[(I)*$_2]} )) + if [[ $_POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER == last* ]]; then + (( e = ${parts[(I)*$_2]} + ${_POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER#*:} )) else - (( e = ${parts[(ib:2:)*$_2]} )) + (( e = ${parts[(ib:2:)*$_2]} + ${_POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER#*:} )) fi if (( e > 1 && e <= $#parts )); then parts[1,e-1]=() @@ -6980,9 +6980,8 @@ _p9k_init_params() { _p9k_declare -e POWERLEVEL9K_SHORTEN_DELIMITER _p9k_declare -s POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER '' case $_POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER in - first) ;; - last) ;; - true) _POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=last;; + first|last) _POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER+=:0;; + (first|last):(|-)<->);; *) _POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=;; esac [[ -z $_POWERLEVEL9K_SHORTEN_FOLDER_MARKER ]] && _POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER= @@ -7742,7 +7741,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v100\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v101\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 bf2aa14becccd2b55180bc2aeff44d3a6015a580 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 19 Jul 2020 11:09:39 +0200 Subject: [PATCH 122/659] Squashed 'gitstatus/' changes from 89e9ebfd..7546f4de 7546f4de return norepo-sync when cwd does not exist 8ccd4d34 comments git-subtree-dir: gitstatus git-subtree-split: 7546f4def34558e44ee660a9970da80f760e99c8 --- gitstatus.plugin.zsh | 10 ++++++++-- install.info | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index 46861e32..55301ab1 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -168,13 +168,13 @@ function gitstatus_query"${1:-}"() { done if (( OPTIND != ARGC )); then - print -ru2 -- "gitstatus_start: exactly one positional argument is required" + print -ru2 -- "gitstatus_query: exactly one positional argument is required" return 1 fi local name=$*[OPTIND] if [[ $name != [[:IDENT:]]## ]]; then - print -ru2 -- "gitstatus_start: invalid positional argument: $name" + print -ru2 -- "gitstatus_query: invalid positional argument: $name" return 1 fi @@ -186,6 +186,12 @@ function gitstatus_query"${1:-}"() { [[ $GIT_DIR == /* ]] && dir=:$GIT_DIR || dir=:${(%):-%/}/$GIT_DIR fi + if [[ $dir != (|:)/* ]]; then + typeset -g VCS_STATUS_RESULT=norepo-sync + _gitstatus_clear$fsuf + return 0 + fi + local -i req_fd=${(P)${:-_GITSTATUS_REQ_FD_$name}} local req_id=$EPOCHREALTIME print -rnu $req_fd -- $req_id' '$callback$'\x1f'$dir$'\x1f'$no_diff$'\x1e' || return diff --git a/install.info b/install.info index 668f3e48..475d9457 100644 --- a/install.info +++ b/install.info @@ -3,7 +3,9 @@ # This file is used by ./install and indirectly by shell bindings. # # The first line is read by powerlevel10k instant prompt. It must -# be updated whenever the content of this file changes. +# be updated whenever the content of this file changes. The actual +# value doesn't matter as long as it's unique. You can use the output +# of `git rev-parse HEAD`. # Official gitstatusd binaries. uname_s_glob="cygwin_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="c38342c7a70842067074710250fd8cebea87ae111f032277c2c70a77179b5355"; From 86b747f4342c383eb63ad4be266cbf535c72c4d4 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 19 Jul 2020 11:10:50 +0200 Subject: [PATCH 123/659] bug fix: infinite loop when cwd doesn't exist; see #900 --- internal/p10k.zsh | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index b11f3ffe..97f11059 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -201,10 +201,10 @@ function _p9k_read_word() { function _p9k_fetch_cwd() { _p9k__cwd=${(%):-%/} - _p9k__cwd_a=${_p9k__cwd:A} + _p9k__cwd_a=${${_p9k__cwd:A}:-.} case $_p9k__cwd in - ~|/) + ~|/|.) _p9k__parent_dirs=() _p9k__parent_mtimes=() _p9k__parent_mtimes_i=() @@ -2011,7 +2011,7 @@ prompt_dir() { [[ $sep == *%* ]] && sep+=$style local content="${(pj.$sep.)parts}" - if (( _POWERLEVEL9K_DIR_HYPERLINK && _p9k_term_has_href )); then + if (( _POWERLEVEL9K_DIR_HYPERLINK && _p9k_term_has_href )) && [[ $_p9k__cwd == /* ]]; then local header=$'%{\e]8;;file://'${${_p9k__cwd//\%/%%25}//'#'/%%23}$'\a%}' local footer=$'%{\e]8;;\a%}' if (( expand )); then @@ -2470,7 +2470,7 @@ prompt_nodenv() { (( ${_POWERLEVEL9K_NODENV_SOURCES[(I)local]} )) || return break fi - [[ $dir == / ]] && break + [[ $dir == (/|.) ]] && break dir=${dir:h} done fi @@ -2631,7 +2631,7 @@ prompt_rbenv() { (( ${_POWERLEVEL9K_RBENV_SOURCES[(I)local]} )) || return break fi - [[ $dir == / ]] && break + [[ $dir == (/|.) ]] && break dir=${dir:h} done fi @@ -2689,7 +2689,7 @@ prompt_phpenv() { (( ${_POWERLEVEL9K_PHPENV_SOURCES[(I)local]} )) || return break fi - [[ $dir == / ]] && break + [[ $dir == (/|.) ]] && break dir=${dir:h} done fi @@ -2750,7 +2750,7 @@ prompt_luaenv() { (( ${_POWERLEVEL9K_LUAENV_SOURCES[(I)local]} )) || return break fi - [[ $dir == / ]] && break + [[ $dir == (/|.) ]] && break dir=${dir:h} done fi @@ -2811,7 +2811,7 @@ prompt_jenv() { (( ${_POWERLEVEL9K_JENV_SOURCES[(I)local]} )) || return break fi - [[ $dir == / ]] && break + [[ $dir == (/|.) ]] && break dir=${dir:h} done fi @@ -2872,7 +2872,7 @@ prompt_plenv() { (( ${_POWERLEVEL9K_PLENV_SOURCES[(I)local]} )) || return break fi - [[ $dir == / ]] && break + [[ $dir == (/|.) ]] && break dir=${dir:h} done fi @@ -3600,7 +3600,7 @@ function _p9k_vcs_status_for_dir() { while true; do _p9k__ret=$_p9k__gitstatus_last[$dir] [[ -n $_p9k__ret ]] && return 0 - [[ $dir == / ]] && return 1 + [[ $dir == (/|.) ]] && return 1 dir=${dir:h} done fi @@ -3615,7 +3615,7 @@ function _p9k_vcs_status_purge() { # unset doesn't work if $dir contains weird shit _p9k__gitstatus_last[$dir]="" _p9k_git_slow[$dir]="" - [[ $dir == / ]] && break + [[ $dir == (/|.) ]] && break dir=${dir:h} done fi @@ -3885,7 +3885,7 @@ function _p9k_vcs_gitstatus() { local dir=$_p9k__cwd_a while true; do case $_p9k_git_slow[$dir] in - "") [[ $dir == / ]] && break; dir=${dir:h};; + "") [[ $dir == (/|.) ]] && break; dir=${dir:h};; 0) break;; 1) timeout=0; break;; esac @@ -4078,7 +4078,7 @@ prompt_pyenv() { (( ${_POWERLEVEL9K_PYENV_SOURCES[(I)local]} )) || return break fi - [[ $dir == / ]] && break + [[ $dir == (/|.) ]] && break dir=${dir:h} done fi @@ -4146,7 +4146,7 @@ prompt_goenv() { (( ${_POWERLEVEL9K_GOENV_SOURCES[(I)local]} )) || return break fi - [[ $dir == / ]] && break + [[ $dir == (/|.) ]] && break dir=${dir:h} done fi @@ -5623,7 +5623,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=28 +typeset -gri __p9k_instant_prompt_version=29 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -5692,6 +5692,7 @@ _p9k_dump_instant_prompt() { fi (( $+terminfo[cuu] && $+terminfo[cuf] && $+terminfo[ed] && $+terminfo[sc] && $+terminfo[rc] )) || return local pwd=${(%):-%/} + [[ $pwd == /* ]] || return local prompt_file=$prompt_dir/prompt-${#pwd} local key=$pwd:$ssh:${(%):-%#} local content From 7a114ad6fb0182ddf5515cd8e54dcdf75f3aa7d6 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 19 Jul 2020 11:26:19 +0200 Subject: [PATCH 124/659] detect artix linux for the sake of displaying os logo; see #898 --- internal/icons.zsh | 6 ++++++ internal/p10k.zsh | 5 ++++- internal/wizard.zsh | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/internal/icons.zsh b/internal/icons.zsh index 0c3bd86a..9c989885 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -68,6 +68,7 @@ function _p9k_init_icons() { LINUX_SABAYON_ICON '\uE271'$s #  LINUX_SLACKWARE_ICON '\uE271'$s #  LINUX_VOID_ICON '\uE271'$s #  + LINUX_ARTIX_ICON '\uE271'$s #  SUNOS_ICON '\U1F31E'$q # 🌞 HOME_ICON '\uE12C'$s #  HOME_SUB_ICON '\uE18D'$s #  @@ -198,6 +199,7 @@ function _p9k_init_icons() { LINUX_SABAYON_ICON '\uF17C'$s #  LINUX_SLACKWARE_ICON '\uF17C'$s #  LINUX_VOID_ICON '\uF17C'$s #  + LINUX_ARTIX_ICON '\uF17C'$s #  SUNOS_ICON '\uF185 ' #  HOME_ICON '\uF015'$s #  HOME_SUB_ICON '\uF07C'$s #  @@ -329,6 +331,7 @@ function _p9k_init_icons() { LINUX_SABAYON_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" 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}" 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}" @@ -452,6 +455,7 @@ function _p9k_init_icons() { LINUX_SABAYON_ICON '\uF317'$s #  LINUX_SLACKWARE_ICON '\uF319'$s #  LINUX_VOID_ICON '\uF17C' #  + LINUX_ARTIX_ICON '\uF17C' #  LINUX_UBUNTU_ICON '\uF31b'$s #  LINUX_ICON '\uF17C' #  SUNOS_ICON '\uF185 ' #  @@ -578,6 +582,7 @@ function _p9k_init_icons() { LINUX_SABAYON_ICON 'sabayon' LINUX_SLACKWARE_ICON 'slack' LINUX_VOID_ICON 'void' + LINUX_ARTIX_ICON 'artix' SUNOS_ICON 'sunos' HOME_ICON '' HOME_SUB_ICON '' @@ -704,6 +709,7 @@ function _p9k_init_icons() { LINUX_SABAYON_ICON 'Sab' LINUX_SLACKWARE_ICON 'Sla' LINUX_VOID_ICON 'Vo' + LINUX_ARTIX_ICON 'Art' SUNOS_ICON 'Sun' HOME_ICON '' HOME_SUB_ICON '' diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 97f11059..6e2fc053 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7742,7 +7742,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v101\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v102\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' @@ -7838,6 +7838,8 @@ function _p9k_init_cacheable() { local lines=(${(f)"$( Date: Mon, 20 Jul 2020 15:06:02 +0200 Subject: [PATCH 125/659] Squashed 'gitstatus/' changes from 7546f4de..b157d02a b157d02a treat exit code 159 (SIGSYS) from gistatusd as terminal git-subtree-dir: gitstatus git-subtree-split: b157d02a9a89892f228064e06b5a817a24eea9ed --- gitstatus.plugin.sh | 2 +- gitstatus.plugin.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gitstatus.plugin.sh b/gitstatus.plugin.sh index 2fe322ef..9f5b9a6e 100644 --- a/gitstatus.plugin.sh +++ b/gitstatus.plugin.sh @@ -165,7 +165,7 @@ function gitstatus_start() { local ret=$? trap - ${sig[@]} case "$ret" in - 0|129|130|131|137|141|143) + 0|129|130|131|137|141|143|159) echo -nE $'bye\x1f0\x1e' >&"$fd_out" exit "$ret" ;; diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index 55301ab1..a93f2c36 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -424,7 +424,7 @@ function _gitstatus_daemon"${1:-}"() { if [[ -x $_gitstatus_zsh_daemon ]]; then HOME=$home $_gitstatus_zsh_daemon -G $_gitstatus_zsh_version "${(@)args}" >&$pipe_fd local -i ret=$? - [[ $ret == (0|129|130|131|137|141|143) ]] && return ret + [[ $ret == (0|129|130|131|137|141|143|159) ]] && return ret fi (( ! _gitstatus_zsh_downloaded )) || return From 2ba87f4d1f47e182a37557e2430e69fac1bec1b4 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 23 Jul 2020 08:17:34 +0200 Subject: [PATCH 126/659] ksh_arrays compatibility --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 6e2fc053..0fd05790 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7270,7 +7270,7 @@ function _p9k_deschedule_redraw() { function _p9k_widget_hook() { _p9k_deschedule_redraw - if (( $+functions[p10k-on-post-widget] || $#_p9k_show_on_command )); then + if (( ${+functions[p10k-on-post-widget]} || ${#_p9k_show_on_command} )); then local -a P9K_COMMANDS if [[ "$_p9k__last_buffer" == "$PREBUFFER$BUFFER" ]]; then P9K_COMMANDS=(${_p9k__last_commands[@]}) From 598ff99f1b4e9e5ae4d1f94b14e8779b70a2a9bf Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 29 Jul 2020 08:37:51 +0200 Subject: [PATCH 127/659] reduce the default value of POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS to 10ms --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 0fd05790..b3e61c11 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7070,7 +7070,7 @@ _p9k_init_params() { _p9k_declare -a POWERLEVEL9K_VCS_SVN_HOOKS -- vcs-detect-changes svn-detect-changes # If it takes longer than this to fetch git repo status, display the prompt with a greyed out # vcs segment and fix it asynchronously when the results come it. - _p9k_declare -F POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS 0.02 + _p9k_declare -F POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS 0.01 (( POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS >= 0 )) || (( POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS = 0 )) _p9k_declare -a POWERLEVEL9K_VCS_BACKENDS -- git (( $+commands[git] )) || _POWERLEVEL9K_VCS_BACKENDS=(${_POWERLEVEL9K_VCS_BACKENDS:#git}) @@ -7742,7 +7742,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v102\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v103\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 05ff6625680d1fa4298bda18eb9156a0b50456a1 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 29 Jul 2020 09:45:02 +0200 Subject: [PATCH 128/659] add more info about the resizing bug and patch --- README.md | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index c6ccb846..923db49f 100644 --- a/README.md +++ b/README.md @@ -1591,12 +1591,17 @@ upon terminal shrinking due to the command line wrapping around. #### Zsh patch -The bug described above has been fixed in [this branch]( +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 same position when prompt needs to be refreshed. +to the original position when prompt needs to be refreshed. -*Note*: The patch doesn't work on Alacritty. On the plus side, it doesn't make things worse. +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 +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 fact don't: @@ -1618,19 +1623,21 @@ There is no ETA for the patch making its way into upstream Zsh. See [discussion] There are a few mitigation options for this issue. - 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. + 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 setting, try a different terminal. - Avoid long lines between the start of prompt and cursor. 1. Disable ruler with `POWERLEVEL9K_SHOW_RULER=false`. - 1. Disable prompt connection with `POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' '`. - 1. Disable right frame with `POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX=` and - `POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX=` and - `POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX=`. - 1. Remove all elements from `POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS`. Right prompt on the last prompt - line will cause resizing issues only when the cursor is below it. This isn't very common, so - you might want to keep some elements in `POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS` provided that - none of them are succeeded by `newline`. + 2. Disable prompt connection with `POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' '`. + 3. Disable right frame with `POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX=''`, + `POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX=''` and + `POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX=''`. + 4. Set `POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=()`. Right prompt on the last prompt line will cause + resizing issues only when the cursor is below it. This isn't very common, so you might want to + keep some elements in `POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS` provided that none of them are + succeeded by `newline`. ### Icons cut off in Konsole From cb59280c407e60d6e993c24eaddb0feb5dd373a5 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 29 Jul 2020 23:05:36 +0200 Subject: [PATCH 129/659] Squashed 'gitstatus/' changes from b157d02a..fcebf0b0 fcebf0b0 support armv8l; see #165; thanks, @ppoffice! c2e03bc5 use fully-qualified remote ref name; see powerlevel10k/issues/915 dc827169 Merge branch 'master' of github.com:romkatv/gitstatus 4ad671ca build: set -march=armv8 when compiling for Apple's arm64 architecture git-subtree-dir: gitstatus git-subtree-split: fcebf0b0f7aff181f2ecc441458d8fc443125ad0 --- build | 1 + install.info | 1 + src/gitstatus.cc | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build b/build index 6023c210..8db1cd14 100755 --- a/build +++ b/build @@ -409,6 +409,7 @@ if [ -z "$gitstatus_cpu" ]; then case "$gitstatus_arch" in armv6l) gitstatus_cpu=armv6;; armv7l) gitstatus_cpu=armv7;; + arm64) gitstatus_cpu=armv8;; aarch64) gitstatus_cpu=armv8-a;; ppc64le) gitstatus_cpu=powerpc64le;; riscv64) gitstatus_cpu=rv64imafdc;; diff --git a/install.info b/install.info index 475d9457..fedfd9b4 100644 --- a/install.info +++ b/install.info @@ -15,6 +15,7 @@ uname_s_glob="freebsd"; uname_m_glob="amd64"; file="gitstatusd-${uname_ uname_s_glob="linux"; uname_m_glob="aarch64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="eb7f125d43c29f955239ef4014ab652b9162bbbb6c81c40f1d5ead46a209866e"; uname_s_glob="linux"; uname_m_glob="armv6l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="051a9448d9cb4bb1d95e93cff51a6ab48a085465ec30eec40046977d4213feff"; uname_s_glob="linux"; uname_m_glob="armv7l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="adaa47c8e8dec1e1e8686c3044ee0f45afda15deaa8388efcb4952747b66246e"; +uname_s_glob="linux"; uname_m_glob="armv8l"; file="gitstatusd-${uname_s}-aarch64"; version="v1.0.0"; sha256="eb7f125d43c29f955239ef4014ab652b9162bbbb6c81c40f1d5ead46a209866e"; uname_s_glob="linux"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="c80355664e7361e11215e64b523ed75a3d39f72393fa2204fefa85eae0342a67"; uname_s_glob="linux"; uname_m_glob="ppc64le"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.2.0"; sha256="38a60b64f619d9db83747f1653b0b740380b1b2b9b414a0ff94815305cdd76bc"; uname_s_glob="linux"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="e33867063f091d3c31ede9916fef079ff8cd6fdcc70d051914f962ab3b8f36fd"; diff --git a/src/gitstatus.cc b/src/gitstatus.cc index 35351b85..5560ca8d 100644 --- a/src/gitstatus.cc +++ b/src/gitstatus.cc @@ -118,7 +118,7 @@ void ProcessRequest(const Options& opts, RepoCache& cache, Request req) { resp.Print(stats.num_untracked); if (remote && remote->ref) { - const char* ref = git_reference_shorthand(remote->ref); + const char* ref = git_reference_name(remote->ref); // Number of commits we are ahead of upstream. Non-negative integer. resp.Print(CountRange(repo->repo(), ref + "..HEAD"s)); // Number of commits we are behind upstream. Non-negative integer. @@ -152,7 +152,7 @@ void ProcessRequest(const Options& opts, RepoCache& cache, Request req) { resp.Print(push_remote ? push_remote->url : ""); if (push_remote && push_remote->ref) { - const char* ref = git_reference_shorthand(push_remote->ref); + const char* ref = git_reference_name(push_remote->ref); // Number of commits we are ahead of push remote. Non-negative integer. resp.Print(CountRange(repo->repo(), ref + "..HEAD"s)); // Number of commits we are behind upstream. Non-negative integer. From 03e61879b51e4a46a6d8ec9789a407fcb0ae289a Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 3 Aug 2020 10:58:14 +0200 Subject: [PATCH 130/659] add `p10k display -r` --- internal/p10k.zsh | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index b3e61c11..5a1ecdaa 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8379,13 +8379,17 @@ Perform the final stage of initialization. Must be called at the very end of zsh typeset -gr __p9k_p10k_display_usage="Usage: %2Fp10k%f %Bdisplay%b part-pattern=state-list... -Show, hide or toggle prompt parts. If called from zle, the current -prompt is refreshed. + Show, hide or toggle prompt parts. If called from zle, the current + prompt is refreshed. Usage: %2Fp10k%f %Bdisplay%b -a [part-pattern]... -Populate array \`reply\` with states of prompt parts matching the patterns. -If no patterns are supplied, assume \`*\`. + Populate array \`reply\` with states of prompt parts matching the patterns. + If no patterns are supplied, assume \`*\`. + +Usage: %2Fp10k%f %Bdisplay%b -r + + Redisplay prompt. Parts: empty_line empty line (duh) @@ -8498,8 +8502,15 @@ function p10k() { shift local -i k dump local opt prev new pair list name var - while getopts ':ha' opt; do + while getopts ':har' opt; do case $opt in + r) + if (( __p9k_reset_state > 0 )); then + __p9k_reset_state=2 + else + __p9k_reset_state=-1 + fi + ;; a) dump=1;; h) print -rP -- $__p9k_p10k_display_usage; return 0;; ?) print -rP -- $__p9k_p10k_display_usage >&2; return 1;; @@ -8514,6 +8525,9 @@ function p10k() { reply+=($_p9k__display_v[k,k+1]) done done + if (( __p9k_reset_state == -1 )); then + _p9k_reset_prompt + fi return 0 fi local REPLY From c48b81ecb7ebcfe87b40e8da2cae939b6795fc77 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 6 Aug 2020 16:03:04 +0200 Subject: [PATCH 131/659] remove minimum screen size requirement for the wizard --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index 923db49f..ce86c7f7 100644 --- a/README.md +++ b/README.md @@ -1368,11 +1368,6 @@ configuration wizard won't offer prompt styles that use them. *Fix*: Restart you install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). Verify by running `p10k configure` and checking that all glyphs render correctly. -The minimum screen size at which configuration wizard can function is 55 columns by 21 lines. -However, not all prompt styles are offered at such small screen size as there is simply not enough -space to present them. *Fix*: Resize your terminal to at least 84 columns by 25 lines prior to -running `p10k configure`. Verify with `print ${COLUMNS}x${LINES}`. - ### Cannot install the recommended font Once you download [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k), From d5d6ee11ff66a1126e74bab961bad07ba7d469f7 Mon Sep 17 00:00:00 2001 From: Stephen <927583+scribbles@users.noreply.github.com> Date: Sat, 8 Aug 2020 15:50:04 -0600 Subject: [PATCH 132/659] Add MesloLGS font config steps for Alacritty (#929) * Add MesloLGS font config steps for Alacritty * Adding Alacritty font config changes Shortened steps and included official doc. * Simplified and updated Alacritty font config steps Required YAML included in full. Quotes added to font family due to space in family name. Unnecessary detail has been removed. * Reduced the required Alacritty font config YAML Removed additional styles from the "MesloLGS NF" family, they are implied and not necessary to include. --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index ce86c7f7..ea6dbc85 100644 --- a/README.md +++ b/README.md @@ -556,6 +556,13 @@ 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*. +- **Alacritty**: Edit or create `~/.config/alacritty/alacritty.yml`. Append the `font` section below: + ```yaml + font: + normal: + family: "MesloLGS NF" + ``` + **IMPORTANT:** Run `p10k configure` after changing terminal font. The old `~/.p10k.zsh` may work incorrectly with the new font. From b53b43533ab15efdeeb3c33b9eedd572162a97e4 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 8 Aug 2020 23:52:12 +0200 Subject: [PATCH 133/659] fix wording in docs --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ea6dbc85..6066b0c1 100644 --- a/README.md +++ b/README.md @@ -556,13 +556,13 @@ 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*. -- **Alacritty**: Edit or create `~/.config/alacritty/alacritty.yml`. Append the `font` section below: - ```yaml - font: - normal: - family: "MesloLGS NF" - ``` - +- **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and and the following section + to it: +```yaml +font: + normal: + family: "MesloLGS NF" +``` **IMPORTANT:** Run `p10k configure` after changing terminal font. The old `~/.p10k.zsh` may work incorrectly with the new font. From 7a0bf995c7bccd6a2ab40eeef3004db8d6976e00 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 8 Aug 2020 23:52:52 +0200 Subject: [PATCH 134/659] formatting --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6066b0c1..bb617755 100644 --- a/README.md +++ b/README.md @@ -558,11 +558,11 @@ applications on your system. Configure your terminal to use this font: Exit the Preferences dialog by clicking *Close*. - **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and and the following section to it: -```yaml -font: - normal: - family: "MesloLGS NF" -``` + ```yaml + font: + normal: + family: "MesloLGS NF" + ``` **IMPORTANT:** Run `p10k configure` after changing terminal font. The old `~/.p10k.zsh` may work incorrectly with the new font. From f63d6a31c1348e304e40e4e0dcca750128ad2cfd Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 15 Aug 2020 08:59:44 +0200 Subject: [PATCH 135/659] Squashed 'gitstatus/' changes from fcebf0b0..3f874d9c 3f874d9c fix bash bindings when noclobber is set; see #171 git-subtree-dir: gitstatus git-subtree-split: 3f874d9c5933d184b9b06472dcf25e8debb326a8 --- gitstatus.plugin.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gitstatus.plugin.sh b/gitstatus.plugin.sh index 9f5b9a6e..e0cd206d 100644 --- a/gitstatus.plugin.sh +++ b/gitstatus.plugin.sh @@ -125,7 +125,7 @@ function gitstatus_start() { ( local fd_in fd_out - exec {fd_in}<"$req_fifo" {fd_out}>"$resp_fifo" || exit + exec {fd_in}<"$req_fifo" {fd_out}>>"$resp_fifo" || exit echo "$BASHPID" >&"$fd_out" local _gitstatus_bash_daemon _gitstatus_bash_version _gitstatus_bash_downloaded @@ -197,8 +197,8 @@ function gitstatus_start() { ) & disown } 0"$GITSTATUS_DAEMON_LOG" - exec {_GITSTATUS_REQ_FD}>"$req_fifo" {_GITSTATUS_RESP_FD}<"$resp_fifo" || return - command rm -f -- "$req_fifo" "$resp_fifo" || return + exec {_GITSTATUS_REQ_FD}>>"$req_fifo" {_GITSTATUS_RESP_FD}<"$resp_fifo" || return + command rm -f -- "$req_fifo" "$resp_fifo" || return [[ "$GITSTATUS_DAEMON_LOG" != /dev/null ]] || command rmdir -- "$tmpdir" 2>/dev/null IFS='' read -r -u $_GITSTATUS_RESP_FD GITSTATUS_DAEMON_PID || return From 03ab8e9c7ed3de37d13706bc931524fefe763c32 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 18 Aug 2020 11:25:43 +0200 Subject: [PATCH 136/659] don't expand _p9k_dir when dir is hidden via 'p10k display'; see #952 --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 5a1ecdaa..07ec912c 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5589,7 +5589,7 @@ function _p9k_set_prompt() { fi fi _p9k__prompt+='${${_p9k__d::=$((_p9k__m-_p9k__h))}+}' - _p9k__prompt+='${_p9k__lprompt/\%\{d\%\}*\%\{d\%\}/'$_p9k__dir'}' + _p9k__prompt+='${_p9k__lprompt/\%\{d\%\}*\%\{d\%\}/${_p9k__'$_p9k__line_index'ldir-'$_p9k__dir'}}' _p9k__prompt+='${${_p9k__m::=$((_p9k__d+_p9k__h))}+}' else _p9k__prompt+='${_p9k__lprompt}' From c425a5e635d66523cc679ebf45f42fa1b20e975e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 19 Aug 2020 22:12:14 +0200 Subject: [PATCH 137/659] bump version --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 07ec912c..390d7884 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7742,7 +7742,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v103\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v104\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 525e2545db9470bad88b6365b97df80fcfa9aff4 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 20 Aug 2020 14:59:07 +0200 Subject: [PATCH 138/659] wizard: when using z4h, automatically enable instant prompt in quiet mode --- internal/wizard.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index c668afde..4ef373a7 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1424,8 +1424,14 @@ function print_instant_prompt_link() { function ask_instant_prompt() { if ! is-at-least 5.4; then instant_prompt=off + options+=instant_prompt=auto-off return 0 fi + if (( $+functions[z4h] )); then + instant_prompt=quiet + options+=instant_prompt=auto-quiet + return + fi add_widget 0 flowing -c "%BInstant Prompt Mode%b" add_widget 0 print_instant_prompt_link add_widget 1 From 711490252e1ba7aafb3a8d83171ca0344f6f6760 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 21 Aug 2020 11:08:14 +0200 Subject: [PATCH 139/659] enable extended_glob in p10k-{pure,robbyrussell}.zsh to fix `unset -m` --- config/p10k-pure.zsh | 2 +- config/p10k-robbyrussell.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/p10k-pure.zsh b/config/p10k-pure.zsh index 88b8d604..566c030d 100644 --- a/config/p10k-pure.zsh +++ b/config/p10k-pure.zsh @@ -23,7 +23,7 @@ 'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' () { - emulate -L zsh + emulate -L zsh -o extended_glob # Unset all configuration options. unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' diff --git a/config/p10k-robbyrussell.zsh b/config/p10k-robbyrussell.zsh index fe797215..a4cb8b2d 100644 --- a/config/p10k-robbyrussell.zsh +++ b/config/p10k-robbyrussell.zsh @@ -18,7 +18,7 @@ 'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' () { - emulate -L zsh + emulate -L zsh -o extended_glob # Unset all configuration options. unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' From dca8774f1b79a31d3da6f07a841a754eccb2752b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 22 Aug 2020 09:35:48 +0200 Subject: [PATCH 140/659] add an empty line after the branch/tag truncation logic --- config/p10k-classic.zsh | 1 + config/p10k-lean-8colors.zsh | 1 + config/p10k-lean.zsh | 1 + config/p10k-rainbow.zsh | 1 + 4 files changed, 4 insertions(+) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 76638267..a6398782 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -384,6 +384,7 @@ # Otherwise show the first 12 … the last 12. # Tip: To always show local branch name in full without truncation, delete the next line. (( $#where > 32 )) && where[13,-13]="…" + res+="${clean}${where//\%/%%}" # escape % # Display the current Git commit if there is no branch or tag. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index d5e97604..88d6ee8b 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -378,6 +378,7 @@ # Otherwise show the first 12 … the last 12. # Tip: To always show local branch name in full without truncation, delete the next line. (( $#where > 32 )) && where[13,-13]="…" + res+="${clean}${where//\%/%%}" # escape % # Display the current Git commit if there is no branch or tag. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 68fb3ec3..41396029 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -378,6 +378,7 @@ # Otherwise show the first 12 … the last 12. # Tip: To always show local branch name in full without truncation, delete the next line. (( $#where > 32 )) && where[13,-13]="…" + res+="${clean}${where//\%/%%}" # escape % # Display the current Git commit if there is no branch or tag. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 7deeb594..e50d09a0 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -384,6 +384,7 @@ # Otherwise show the first 12 … the last 12. # Tip: To always show local branch name in full without truncation, delete the next line. (( $#where > 32 )) && where[13,-13]="…" + res+="${clean}${where//\%/%%}" # escape % # Display the current Git commit if there is no branch or tag. From 8f90ed6d4992f51bb445555d6e826442d36be4f2 Mon Sep 17 00:00:00 2001 From: hal9000 Date: Sun, 23 Aug 2020 17:29:03 -0400 Subject: [PATCH 141/659] linux wifi widget --- internal/p10k.zsh | 93 +++++++++++++++++++++++++++++++++-------------- log.txt | 1 + 2 files changed, 66 insertions(+), 28 deletions(-) create mode 100644 log.txt diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 390d7884..59a10758 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4903,12 +4903,19 @@ prompt_wifi() { (( _p9k__has_upglob )) || typeset -g "_p9k__segment_val_${_p9k__prompt_side}[_p9k__segment_index]"=$_p9k__prompt[len+1,-1] } + _p9k_prompt_wifi_init() { - if [[ -x /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport ]]; then + if [[ -x /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport || -f /proc/net/wireless ]]; then typeset -g _p9k__wifi_on= typeset -g P9K_WIFI_LAST_TX_RATE= typeset -g P9K_WIFI_SSID= - typeset -g P9K_WIFI_LINK_AUTH= + + # possible refactor to set link_auth only on darwin + # or also possible to simply set linux link_auth to empty string and leave this scope as-is + if [[ $_p9k_os == OSX ]]; then + typeset -g P9K_WIFI_LINK_AUTH= + fi + typeset -g P9K_WIFI_RSSI= typeset -g P9K_WIFI_NOISE= typeset -g P9K_WIFI_BARS= @@ -4918,27 +4925,64 @@ _p9k_prompt_wifi_init() { fi } -_p9k_prompt_wifi_compute() { - _p9k_worker_async _p9k_prompt_wifi_async _p9k_prompt_wifi_sync -} - _p9k_prompt_wifi_async() { - local airport=/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport local last_tx_rate ssid link_auth rssi noise bars on out line v state - { - [[ -x $airport ]] || return 0 - out="$($airport -I)" || return 0 - for line in ${${${(f)out}##[[:space:]]#}%%[[:space:]]#}; do - v=${line#*: } - case $line[1,-$#v-3] in - agrCtlRSSI) rssi=$v;; - agrCtlNoise) noise=$v;; - state) state=$v;; - lastTxRate) last_tx_rate=$v;; - link\ auth) link_auth=$v;; - SSID) ssid=$v;; - esac - done + + { + if [[ $_p9k_os == OSX ]]; then + local airport=/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport + [[ -x $airport ]] || return 0 + out="$($airport -I)" || return 0 + for line in ${${${(f)out}##[[:space:]]#}%%[[:space:]]#}; do + v=${line#*: } + case $line[1,-$#v-3] in + agrCtlRSSI) rssi=$v;; + agrCtlNoise) noise=$v;; + state) state=$v;; + lastTxRate) last_tx_rate=$v;; + link\ auth) link_auth=$v;; + SSID) ssid=$v;; + esac + done + + elif [[ $_p9k_os == (Linux|Android)]]; then + # iw tools only output 'noise' from a dump that requires superuser and a background service to be running, which probably isn't, so a separate process is needed + # /proc/net/wireless displays noise level up to date, w/o requiring superuser + local proc_less=/proc/net/wireless + [[ -f $proc_less ]] || return 0 + + # this method using iw is over 10x faster than the network manager method in benchmarking + # it's possible some systems are still using 'wireless_tools' (iw's ancestor) but they are long deprecated anyway + local device="$(iw dev | grep 'Interface ' | cut -d\ -f2)" || return 0 + out="$(iw dev $device link)" || return 0 + + # 'running' state guaranteed by 'device' and 'proc_less' var assignment + state='running' + + local proc_out="$(grep $device $proc_less | tr -s ' ')" || return 0 + # using cut is more performant than awk,sed,perl, but I haven't timed against zsh expansion pattern + rssi="${$($proc_out | cut -d\ -f4)%.*}" + noise="$($proc_out | cut -d\ -f5)" + + # it's possible to get boolean from iw to check authorization status from a dump, but getting the method (if any) requires superuser + link_auth="" + + for line in ${${${(f)out}##[[:space:]]#}%%[[:space:]]#}; do + v=${line#*: } + case ${line[1,-$#v-3]} in + SSID) ssid=$v;; + + # formatting here to remove ' dBm' from tail + # note 'rssi' is also assigned up above, but this replacement pattern might be faster than using cut - needs benchmarking + signal) rssi=${v//[^0-9-]/};; + + # formatting here to transform from 'xxx.x MBit/s MCS xx short GI' to 'xxx.x' where x's are integers + # benchmarking shows grep here is extremely fast (under .1 msc even on older hw), but you can change to native zsh pattern if you want + tx\ bitrate) last_tx_rate=$(echo $v | grep -o "^[0-9]+.[0-9]");; + esac + done + fi + if [[ $state != running || $rssi != (0|-<->) || $noise != (0|-<->) ]]; then rssi= noise= @@ -4991,13 +5035,6 @@ _p9k_prompt_wifi_async() { } } -_p9k_prompt_wifi_sync() { - if [[ -n $REPLY ]]; then - eval $REPLY - _p9k_worker_reply $REPLY - fi -} - function _p9k_asdf_check_meta() { [[ -n $_p9k_asdf_meta_sig ]] || return [[ -z $^_p9k_asdf_meta_non_files(#qN) ]] || return diff --git a/log.txt b/log.txt new file mode 100644 index 00000000..e050bad0 --- /dev/null +++ b/log.txt @@ -0,0 +1 @@ +2020/08/23 17:20:27 Micro started From d62961131c57de97bb766d8df41ba83f9cb0ee85 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 23 Aug 2020 17:36:08 -0400 Subject: [PATCH 142/659] Delete log.txt --- log.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 log.txt diff --git a/log.txt b/log.txt deleted file mode 100644 index e050bad0..00000000 --- a/log.txt +++ /dev/null @@ -1 +0,0 @@ -2020/08/23 17:20:27 Micro started From 2f4c3c4cece4443153d742e439d470f1f43bcd60 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 24 Aug 2020 08:22:03 +0200 Subject: [PATCH 143/659] use portable sed syntax --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bb617755..1a37a306 100644 --- a/README.md +++ b/README.md @@ -708,7 +708,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 ``` From 6279aa57d77e26430173430adf84c06acc7b6de6 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 24 Aug 2020 09:02:52 +0200 Subject: [PATCH 144/659] add k9s, helmfile and terragrunt to some SHOW_ON_COMMAND params; #904 --- README.md | 10 +++++----- config/p10k-classic.zsh | 8 ++++---- config/p10k-lean-8colors.zsh | 8 ++++---- config/p10k-lean.zsh | 8 ++++---- config/p10k-rainbow.zsh | 8 ++++---- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 1a37a306..fe3fa046 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 @@ -927,8 +927,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 +944,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..c0dd9719 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. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 88d6ee8b..33dfadb6 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. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 41396029..42e80f2e 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. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index e50d09a0..21a7307a 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. From 16cb58d15f5bb602bf7a0d09dcf6011544a8fc0e Mon Sep 17 00:00:00 2001 From: sys-lectern Date: Tue, 25 Aug 2020 16:04:47 -0400 Subject: [PATCH 145/659] minor fixes and syntax improvements --- internal/p10k.zsh | 14 +++++++------- log.txt | 1 - 2 files changed, 7 insertions(+), 8 deletions(-) delete mode 100644 log.txt diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 59a10758..985d417a 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4945,15 +4945,15 @@ _p9k_prompt_wifi_async() { esac done - elif [[ $_p9k_os == (Linux|Android)]]; then + elif [[ $_p9k_os == Linux]]; then # iw tools only output 'noise' from a dump that requires superuser and a background service to be running, which probably isn't, so a separate process is needed # /proc/net/wireless displays noise level up to date, w/o requiring superuser local proc_less=/proc/net/wireless [[ -f $proc_less ]] || return 0 - # this method using iw is over 10x faster than the network manager method in benchmarking - # it's possible some systems are still using 'wireless_tools' (iw's ancestor) but they are long deprecated anyway - local device="$(iw dev | grep 'Interface ' | cut -d\ -f2)" || return 0 + # this method using iw is over 10x faster than the network manager method in benchmarking + # it's possible some systems are still using 'wireless_tools' (iw's ancestor) but they are long deprecated anyway + local device="$(cut -d\ -f2 <<< $(iw dev | grep Interface))" || return 0 out="$(iw dev $device link)" || return 0 # 'running' state guaranteed by 'device' and 'proc_less' var assignment @@ -4961,8 +4961,8 @@ _p9k_prompt_wifi_async() { local proc_out="$(grep $device $proc_less | tr -s ' ')" || return 0 # using cut is more performant than awk,sed,perl, but I haven't timed against zsh expansion pattern - rssi="${$($proc_out | cut -d\ -f4)%.*}" - noise="$($proc_out | cut -d\ -f5)" + rssi="${$(cut -d\ -f4 <<< $proc_out)%.*}" + noise="$(cut -d\ -f5 <<< $proc_out)" # it's possible to get boolean from iw to check authorization status from a dump, but getting the method (if any) requires superuser link_auth="" @@ -4978,7 +4978,7 @@ _p9k_prompt_wifi_async() { # formatting here to transform from 'xxx.x MBit/s MCS xx short GI' to 'xxx.x' where x's are integers # benchmarking shows grep here is extremely fast (under .1 msc even on older hw), but you can change to native zsh pattern if you want - tx\ bitrate) last_tx_rate=$(echo $v | grep -o "^[0-9]+.[0-9]");; + tx\ bitrate) last_tx_rate=$(cut -d\ -f1 <<< $v);; esac done fi diff --git a/log.txt b/log.txt deleted file mode 100644 index e050bad0..00000000 --- a/log.txt +++ /dev/null @@ -1 +0,0 @@ -2020/08/23 17:20:27 Micro started From 6853fcd8e5d1e082ebce26942847743367a7c2a1 Mon Sep 17 00:00:00 2001 From: sys-lectern Date: Tue, 25 Aug 2020 16:13:41 -0400 Subject: [PATCH 146/659] minor fixes and syntax improvements --- internal/p10k.zsh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 985d417a..24d756ac 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5035,6 +5035,13 @@ _p9k_prompt_wifi_async() { } } +function _p9k_prompt_wifi_sync() { + if [[ -n $REPLY ]]; then + eval $REPLY + _p9k_worker_reply $REPLY + fi +} + function _p9k_asdf_check_meta() { [[ -n $_p9k_asdf_meta_sig ]] || return [[ -z $^_p9k_asdf_meta_non_files(#qN) ]] || return From 7eb501c0f533d33ec42a6b460f1778ddf3ae08f1 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 26 Aug 2020 10:48:53 +0200 Subject: [PATCH 147/659] suport hex flags in the output of ifconfig; see #979 --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 390d7884..2fc3f7b4 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5337,8 +5337,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= From 2a4c962c210785e0ee222c6145b8b10d3f057bc4 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 27 Aug 2020 08:14:43 +0200 Subject: [PATCH 148/659] add "gpd" to the list of default VPN network interfaces; see #979 --- 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, 6 insertions(+), 6 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index c0dd9719..d17791c4 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -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 33dfadb6..3302276a 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -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 42e80f2e..e86d68ed 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -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 21a7307a..c538f7ac 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.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='(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/p10k.zsh b/internal/p10k.zsh index 2fc3f7b4..3b4b3460 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6990,7 +6990,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 @@ -7742,7 +7742,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=$'v105\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 f2bf0197581abb8bde529e6b492710948549ba7f Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 27 Aug 2020 09:57:12 +0200 Subject: [PATCH 149/659] wizard: simplify instant prompt screen; make sure all screens work with 47x14 terminal size --- internal/configure.zsh | 8 ++++--- internal/wizard.zsh | 52 +++++++++++++++++++++++++++--------------- 2 files changed, 39 insertions(+), 21 deletions(-) diff --git a/internal/configure.zsh b/internal/configure.zsh index 9c92c233..63a73978 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} @@ -44,7 +46,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/wizard.zsh b/internal/wizard.zsh index 4ef373a7..93ec62d0 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 @@ -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 } From b673e6a7dde2a91a00a72614fbbce8e1e9f28f2c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 28 Aug 2020 09:38:16 +0200 Subject: [PATCH 150/659] bug fix: trigger transient prompt on send-break --- internal/p10k.zsh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 3b4b3460..c0757332 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7241,6 +7241,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 @@ -7332,6 +7336,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() { @@ -7350,6 +7362,7 @@ function _p9k_wrap_widgets() { visual-line-mode deactivate-region clear-screen + send-break $_POWERLEVEL9K_HOOK_WIDGETS ) else @@ -7366,6 +7379,7 @@ function _p9k_wrap_widgets() { zle-line-finish zle-history-line-set zle-keymap-select + send-break $_POWERLEVEL9K_HOOK_WIDGETS ${${${(f)"$(<$tmp)"}##* }:#(*\"|.*)} ) @@ -7375,7 +7389,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 From c1db3926feaf03bf36f205b2e31a4498641795ba Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 28 Aug 2020 10:25:23 +0200 Subject: [PATCH 151/659] docs: explicitly mention that powerlevel10k doesn't affect key bindings --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index fe3fa046..2baa3509 100644 --- a/README.md +++ b/README.md @@ -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). From a3727dcaefbfba04484ba0f979c62d070850eeed Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 30 Aug 2020 13:40:12 +0200 Subject: [PATCH 152/659] wizard: don't refuse to start if ZDOTDIR is not writable; see #987 --- internal/configure.zsh | 12 +++++++++++- internal/wizard.zsh | 16 +++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/internal/configure.zsh b/internal/configure.zsh index 63a73978..4fb7cb6e 100644 --- a/internal/configure.zsh +++ b/internal/configure.zsh @@ -21,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 diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 93ec62d0..cd62a384 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -505,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 @@ -1590,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 @@ -1875,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 @@ -1914,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 } From 536d90a335a49794e5cf4d218cd8959812f9d7ad Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 31 Aug 2020 12:55:00 +0200 Subject: [PATCH 153/659] support per-state POWERLEVEL9K_BATTERY_HIDE_ABOVE_THRESHOLD; see #988 --- internal/p10k.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index c0757332..edef258e 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)" @@ -6869,6 +6869,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}}}})";; @@ -7758,7 +7759,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v105\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' From cababbeee2f28c0c557522ef82fad44ac1952ba8 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 1 Sep 2020 11:01:24 +0200 Subject: [PATCH 154/659] wifi on linux: fix bugs and speed things up --- config/p10k-classic.zsh | 6 +- config/p10k-lean-8colors.zsh | 6 +- config/p10k-lean.zsh | 6 +- config/p10k-rainbow.zsh | 6 +- internal/p10k.zsh | 160 +++++++++++++++++++---------------- 5 files changed, 89 insertions(+), 95 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index d17791c4..354db384 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1475,15 +1475,11 @@ # Parameter | Meaning # ----------------------+--------------- # P9K_WIFI_SSID | service set identifier, a.k.a. network name - # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none" + # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 # 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) - # - # All parameters except P9K_WIFI_BARS are extracted from the output of the following command: - # - # /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I ####################################[ time: current time ]#################################### # Current time color. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 3302276a..0bc1920e 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1452,15 +1452,11 @@ # Parameter | Meaning # ----------------------+--------------- # P9K_WIFI_SSID | service set identifier, a.k.a. network name - # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none" + # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 # 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) - # - # All parameters except P9K_WIFI_BARS are extracted from the output of the following command: - # - # /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I ####################################[ time: current time ]#################################### # Current time color. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index e86d68ed..ee71a364 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1452,15 +1452,11 @@ # Parameter | Meaning # ----------------------+--------------- # P9K_WIFI_SSID | service set identifier, a.k.a. network name - # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none" + # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 # 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) - # - # All parameters except P9K_WIFI_BARS are extracted from the output of the following command: - # - # /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I ####################################[ time: current time ]#################################### # Current time color. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index c538f7ac..991815d4 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1552,15 +1552,11 @@ # Parameter | Meaning # ----------------------+--------------- # P9K_WIFI_SSID | service set identifier, a.k.a. network name - # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none" + # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 # 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) - # - # All parameters except P9K_WIFI_BARS are extracted from the output of the following command: - # - # /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I ####################################[ time: current time ]#################################### # Current time color. diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 0820a5f4..ea7054bc 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4903,19 +4903,13 @@ prompt_wifi() { (( _p9k__has_upglob )) || typeset -g "_p9k__segment_val_${_p9k__prompt_side}[_p9k__segment_index]"=$_p9k__prompt[len+1,-1] } - _p9k_prompt_wifi_init() { - if [[ -x /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport || -f /proc/net/wireless ]]; then + if [[ -x /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport || + -r /proc/net/wireless && -n $commands[iw] ]]; then typeset -g _p9k__wifi_on= typeset -g P9K_WIFI_LAST_TX_RATE= typeset -g P9K_WIFI_SSID= - - # possible refactor to set link_auth only on darwin - # or also possible to simply set linux link_auth to empty string and leave this scope as-is - if [[ $_p9k_os == OSX ]]; then - typeset -g P9K_WIFI_LINK_AUTH= - fi - + typeset -g P9K_WIFI_LINK_AUTH= typeset -g P9K_WIFI_RSSI= typeset -g P9K_WIFI_NOISE= typeset -g P9K_WIFI_BARS= @@ -4925,71 +4919,88 @@ _p9k_prompt_wifi_init() { fi } +_p9k_prompt_wifi_compute() { + _p9k_worker_async _p9k_prompt_wifi_async _p9k_prompt_wifi_sync +} + _p9k_prompt_wifi_async() { - local last_tx_rate ssid link_auth rssi noise bars on out line v state - - { - if [[ $_p9k_os == OSX ]]; then - local airport=/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport - [[ -x $airport ]] || return 0 - out="$($airport -I)" || return 0 - for line in ${${${(f)out}##[[:space:]]#}%%[[:space:]]#}; do - v=${line#*: } - case $line[1,-$#v-3] in - agrCtlRSSI) rssi=$v;; - agrCtlNoise) noise=$v;; - state) state=$v;; - lastTxRate) last_tx_rate=$v;; - link\ auth) link_auth=$v;; - SSID) ssid=$v;; - esac - done - - elif [[ $_p9k_os == Linux]]; then - # iw tools only output 'noise' from a dump that requires superuser and a background service to be running, which probably isn't, so a separate process is needed - # /proc/net/wireless displays noise level up to date, w/o requiring superuser - local proc_less=/proc/net/wireless - [[ -f $proc_less ]] || return 0 - - # this method using iw is over 10x faster than the network manager method in benchmarking - # it's possible some systems are still using 'wireless_tools' (iw's ancestor) but they are long deprecated anyway - local device="$(cut -d\ -f2 <<< $(iw dev | grep Interface))" || return 0 - out="$(iw dev $device link)" || return 0 - - # 'running' state guaranteed by 'device' and 'proc_less' var assignment - state='running' - - local proc_out="$(grep $device $proc_less | tr -s ' ')" || return 0 - # using cut is more performant than awk,sed,perl, but I haven't timed against zsh expansion pattern - rssi="${$(cut -d\ -f4 <<< $proc_out)%.*}" - noise="$(cut -d\ -f5 <<< $proc_out)" - - # it's possible to get boolean from iw to check authorization status from a dump, but getting the method (if any) requires superuser - link_auth="" - - for line in ${${${(f)out}##[[:space:]]#}%%[[:space:]]#}; do - v=${line#*: } - case ${line[1,-$#v-3]} in - SSID) ssid=$v;; - - # formatting here to remove ' dBm' from tail - # note 'rssi' is also assigned up above, but this replacement pattern might be faster than using cut - needs benchmarking - signal) rssi=${v//[^0-9-]/};; - - # formatting here to transform from 'xxx.x MBit/s MCS xx short GI' to 'xxx.x' where x's are integers - # benchmarking shows grep here is extremely fast (under .1 msc even on older hw), but you can change to native zsh pattern if you want - tx\ bitrate) last_tx_rate=$(cut -d\ -f1 <<< $v);; - esac - done - fi - - if [[ $state != running || $rssi != (0|-<->) || $noise != (0|-<->) ]]; then - rssi= - noise= - last_tx_rate= - link_auth= - ssid= - bars= + local airport=/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport + local last_tx_rate ssid link_auth rssi noise bars on out line v state iface + { + if [[ -x $airport ]]; then + out="$($airport -I)" || return 0 + for line in ${${${(f)out}##[[:space:]]#}%%[[:space:]]#}; do + v=${line#*: } + case $line[1,-$#v-3] in + agrCtlRSSI) rssi=$v;; + agrCtlNoise) noise=$v;; + state) state=$v;; + lastTxRate) last_tx_rate=$v;; + link\ auth) link_auth=$v;; + SSID) ssid=$v;; + esac + done + if [[ $state != running || $rssi != (0|-<->) || $noise != (0|-<->) ]]; then + rssi= + noise= + last_tx_rate= + link_auth= + ssid= + return 0 + fi + on=1 + elif [[ -r /proc/net/wireless && -n $commands[iw] ]]; then + # Content example (https://github.com/romkatv/powerlevel10k/pull/973#issuecomment-680251804): + # + # Inter-| sta-| Quality | Discarded packets | Missed | WE + # face | tus | link level noise | nwid crypt frag retry misc | beacon | 22 + # wlp3s0: 0000 58. -52. -256 0 0 0 0 76 0 + local -a lines + lines=(${${(f)"$() || $noise != (0|-<->) ]]; then + rssi= + noise= + return 0 + fi + # Output example (https://github.com/romkatv/powerlevel10k/pull/973#issuecomment-680251804): + # + # Connected to 74:83:c2:be:76:da (on wlp3s0) + # SSID: DailyGrindGuest1 + # freq: 5745 + # RX: 35192066 bytes (27041 packets) + # TX: 4090471 bytes (24287 packets) + # signal: -52 dBm + # rx bitrate: 243.0 MBit/s VHT-MCS 6 40MHz VHT-NSS 2 + # tx bitrate: 240.0 MBit/s VHT-MCS 5 40MHz short GI VHT-NSS 2 + # + # bss flags: short-slot-time + # dtim period: 1 + # beacon int: 100 + lines=(${(f)"$(command iw dev $iface link)"}) || return 0 + local -a match mbegin mend + for line in $lines; do + if [[ $line == (#b)[[:space:]]#SSID:[[:space:]]##([^[:space:]]##) ]]; then + ssid=$match[1] + elif [[ $line == (#b)[[:space:]]#'tx bitrate:'[[:space:]]##([^[:space:]]##)' MBit/s'* ]]; then + last_tx_rate=$match[1] + [[ $last_tx_rate == <->.<-> ]] && last_tx_rate=${${last_tx_rate%%0#}%.} + fi + done + if [[ -z $ssid || -z $last_tx_rate ]]; then + rssi= + noise= + ssid= + last_tx_rate= + return 0 + fi + on=1 + else return 0 fi # https://www.speedguide.net/faq/how-to-read-rssisignal-and-snrnoise-ratings-440 @@ -5006,7 +5017,6 @@ _p9k_prompt_wifi_async() { else bars=0 fi - on=1 } always { if [[ $_p9k__wifi_on != $on || $P9K_WIFI_LAST_TX_RATE != $last_tx_rate || @@ -5035,7 +5045,7 @@ _p9k_prompt_wifi_async() { } } -function _p9k_prompt_wifi_sync() { +_p9k_prompt_wifi_sync() { if [[ -n $REPLY ]]; then eval $REPLY _p9k_worker_reply $REPLY From 47c842fe8e666e718c8ea805586fe30d0038c262 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 1 Sep 2020 11:07:49 +0200 Subject: [PATCH 155/659] wifi: further cleanup --- internal/p10k.zsh | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index ea7054bc..2cba7c60 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4940,15 +4940,7 @@ _p9k_prompt_wifi_async() { SSID) ssid=$v;; esac done - if [[ $state != running || $rssi != (0|-<->) || $noise != (0|-<->) ]]; then - rssi= - noise= - last_tx_rate= - link_auth= - ssid= - return 0 - fi - on=1 + [[ $state == running && $rssi == (0|-<->) && $noise == (0|-<->) ]] || return 0 elif [[ -r /proc/net/wireless && -n $commands[iw] ]]; then # Content example (https://github.com/romkatv/powerlevel10k/pull/973#issuecomment-680251804): # @@ -4963,11 +4955,7 @@ _p9k_prompt_wifi_async() { state=${parts[2]} rssi=${parts[4]%.*} noise=${parts[5]%.*} - if [[ -z $iface || $state != 0## || $rssi != (0|-<->) || $noise != (0|-<->) ]]; then - rssi= - noise= - return 0 - fi + [[ -n $iface && $state == 0## && $rssi == (0|-<->) && $noise == (0|-<->) ]] || return 0 # Output example (https://github.com/romkatv/powerlevel10k/pull/973#issuecomment-680251804): # # Connected to 74:83:c2:be:76:da (on wlp3s0) @@ -4992,14 +4980,7 @@ _p9k_prompt_wifi_async() { [[ $last_tx_rate == <->.<-> ]] && last_tx_rate=${${last_tx_rate%%0#}%.} fi done - if [[ -z $ssid || -z $last_tx_rate ]]; then - rssi= - noise= - ssid= - last_tx_rate= - return 0 - fi - on=1 + [[ -n $ssid && -n $last_tx_rate ]] || return 0 else return 0 fi @@ -5017,7 +4998,16 @@ _p9k_prompt_wifi_async() { else bars=0 fi + on=1 } always { + if (( ! on )); then + rssi= + noise= + ssid= + last_tx_rate= + bars= + link_auth= + fi if [[ $_p9k__wifi_on != $on || $P9K_WIFI_LAST_TX_RATE != $last_tx_rate || $P9K_WIFI_SSID != $ssid || From 3b2f474c9f1e087ed1a2d967d3875a2e1df7bb2e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 1 Sep 2020 13:31:05 +0200 Subject: [PATCH 156/659] support generic POWERLEVEL9K_* parameters for segments with dashes in their names --- internal/p10k.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 2cba7c60..c91656d0 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -467,7 +467,7 @@ _p9k_param() { if [[ -n $_p9k__ret ]]; then _p9k__ret[-1,-1]='' else - if [[ $1 == (#b)prompt_([a-z0-9_]#)(*) ]]; then + if [[ ${1//-/_} == (#b)prompt_([a-z0-9_]#)(*) ]]; then local var=_POWERLEVEL9K_${(U)match[1]}$match[2]_$2 if (( $+parameters[$var] )); then _p9k__ret=${(P)var} @@ -7839,7 +7839,7 @@ function _p9k_init_cacheable() { local -i i=0 for i in {1..$#_p9k_line_segments_left}; do - for elem in ${${(@0)_p9k_line_segments_left[i]}%_joined}; do + for elem in ${${${(@0)_p9k_line_segments_left[i]}%_joined}//-/_}; do local var=POWERLEVEL9K_${(U)elem}_SHOW_ON_COMMAND (( $+parameters[$var] )) || continue _p9k_show_on_command+=( @@ -7847,7 +7847,7 @@ function _p9k_init_cacheable() { $((1+_p9k_display_k[$i/left/$elem])) _p9k__${i}l$elem) done - for elem in ${${(@0)_p9k_line_segments_right[i]}%_joined}; do + for elem in ${${${(@0)_p9k_line_segments_right[i]}%_joined}//-/_}; do local var=POWERLEVEL9K_${(U)elem}_SHOW_ON_COMMAND (( $+parameters[$var] )) || continue local cmds=(${(P)var}) From 6c8c6eea1baa2cb0d27be30f06b4781a7f421507 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 2 Sep 2020 09:24:58 +0200 Subject: [PATCH 157/659] typo in 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 354db384..76c55969 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -304,7 +304,7 @@ # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with class # WORK or WORK_NOT_WRITABLE. # - # Simply assigning classes to directories don't have any visible effects. It merely gives you an + # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an # option to define custom colors and icons for different directory classes. # # # Styling for WORK. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 0bc1920e..718e1aee 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -298,7 +298,7 @@ # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with class # WORK or WORK_NOT_WRITABLE. # - # Simply assigning classes to directories don't have any visible effects. It merely gives you an + # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an # option to define custom colors and icons for different directory classes. # # # Styling for WORK. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index ee71a364..71ead77f 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -298,7 +298,7 @@ # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with class # WORK or WORK_NOT_WRITABLE. # - # Simply assigning classes to directories don't have any visible effects. It merely gives you an + # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an # option to define custom colors and icons for different directory classes. # # # Styling for WORK. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 991815d4..dab4fbf3 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -304,7 +304,7 @@ # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with class # WORK or WORK_NOT_WRITABLE. # - # Simply assigning classes to directories don't have any visible effects. It merely gives you an + # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an # option to define custom colors and icons for different directory classes. # # # Styling for WORK. From 622130980c0785df8f76b53074c6743456eebe53 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 3 Sep 2020 10:53:19 +0200 Subject: [PATCH 158/659] add scalaenv prompt segment; see #991 --- config/p10k-classic.zsh | 14 ++++++++ config/p10k-lean-8colors.zsh | 14 ++++++++ config/p10k-lean.zsh | 14 ++++++++ config/p10k-rainbow.zsh | 15 ++++++++ internal/icons.zsh | 6 ++++ internal/p10k.zsh | 66 ++++++++++++++++++++++++++++++++++++ 6 files changed, 129 insertions(+) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 76c55969..1c6b5b7b 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -66,6 +66,7 @@ jenv # java version from jenv (https://github.com/jenv/jenv) plenv # perl version from plenv (https://github.com/tokuhirom/plenv) 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/) kubecontext # current kubernetes context (https://kubernetes.io/) terraform # terraform workspace (https://www.terraform.io) @@ -1115,6 +1116,19 @@ # Custom icon. # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### + # Scala color. + typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=160 + # Hide scala version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) + # If set to false, hide scala version if it's the same as global: + # $(scalaenv version-name) == $(scalaenv global). + typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide scala version if it's equal to "system". + typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]########### # Haskell color. typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=172 diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 718e1aee..6c8cf2e5 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -66,6 +66,7 @@ jenv # java version from jenv (https://github.com/jenv/jenv) plenv # perl version from plenv (https://github.com/tokuhirom/plenv) 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/) kubecontext # current kubernetes context (https://kubernetes.io/) terraform # terraform workspace (https://www.terraform.io) @@ -1092,6 +1093,19 @@ # Custom icon. # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### + # Scala color. + typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=1 + # Hide scala version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) + # If set to false, hide scala version if it's the same as global: + # $(scalaenv version-name) == $(scalaenv global). + typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide scala version if it's equal to "system". + typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]########### # Haskell color. typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=3 diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 71ead77f..19cea6e6 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -66,6 +66,7 @@ jenv # java version from jenv (https://github.com/jenv/jenv) plenv # perl version from plenv (https://github.com/tokuhirom/plenv) 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/) kubecontext # current kubernetes context (https://kubernetes.io/) terraform # terraform workspace (https://www.terraform.io) @@ -1092,6 +1093,19 @@ # Custom icon. # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### + # Scala color. + typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=160 + # Hide scala version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) + # If set to false, hide scala version if it's the same as global: + # $(scalaenv version-name) == $(scalaenv global). + typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide scala version if it's equal to "system". + typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]########### # Haskell color. typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=172 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index dab4fbf3..39b4f50b 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -66,6 +66,7 @@ jenv # java version from jenv (https://github.com/jenv/jenv) plenv # perl version from plenv (https://github.com/tokuhirom/plenv) 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/) kubecontext # current kubernetes context (https://kubernetes.io/) terraform # terraform workspace (https://www.terraform.io) @@ -1175,6 +1176,20 @@ # Custom icon. # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### + # Scala color. + # typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=0 + # typeset -g POWERLEVEL9K_SCALAENV_BACKGROUND=1 + # Hide scala version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) + # If set to false, hide scala version if it's the same as global: + # $(scalaenv version-name) == $(scalaenv global). + typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide scala version if it's equal to "system". + typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]########### # Haskell color. # typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=0 diff --git a/internal/icons.zsh b/internal/icons.zsh index 9c989885..719c03c4 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -143,6 +143,7 @@ function _p9k_init_icons() { HASKELL_ICON 'hs' PACKAGE_ICON 'pkg' JULIA_ICON 'jl' + SCALA_ICON 'scala' ) ;; 'awesome-fontconfig') @@ -270,6 +271,7 @@ function _p9k_init_icons() { HASKELL_ICON 'hs' PACKAGE_ICON 'pkg' JULIA_ICON 'jl' + SCALA_ICON 'scala' ) ;; 'awesome-mapped-fontconfig') @@ -400,6 +402,7 @@ function _p9k_init_icons() { HASKELL_ICON 'hs' PACKAGE_ICON 'pkg' JULIA_ICON 'jl' + SCALA_ICON 'scala' ) ;; 'nerdfont-complete'|'nerdfont-fontconfig') @@ -528,6 +531,7 @@ function _p9k_init_icons() { HASKELL_ICON '\uE61F' #  PACKAGE_ICON '\uF8D6' #  JULIA_ICON '\uE624' #  + SCALA_ICON '\uE737' #  ) ;; ascii) @@ -653,6 +657,7 @@ function _p9k_init_icons() { HASKELL_ICON 'hs' PACKAGE_ICON 'pkg' JULIA_ICON 'jl' + SCALA_ICON 'scala' ) ;; *) @@ -780,6 +785,7 @@ function _p9k_init_icons() { HASKELL_ICON 'hs' PACKAGE_ICON 'pkg' JULIA_ICON 'jl' + SCALA_ICON 'scala' ) ;; esac diff --git a/internal/p10k.zsh b/internal/p10k.zsh index c91656d0..fc8f3f8b 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -2673,6 +2673,69 @@ function _p9k_phpenv_global_version() { _p9k_read_word ${PHPENV_ROOT:-$HOME/.phpenv}/version || _p9k__ret=system } +function _p9k_scalaenv_global_version() { + _p9k_read_word ${SCALAENV_ROOT:-$HOME/.scalaenv}/version || _p9k__ret=system +} + +# https://github.com/scalaenv/scalaenv +prompt_scalaenv() { + if [[ -n $SCALAENV_VERSION ]]; then + (( ${_POWERLEVEL9K_SCALAENV_SOURCES[(I)shell]} )) || return + local v=$SCALAENV_VERSION + else + (( ${_POWERLEVEL9K_SCALAENV_SOURCES[(I)local|global]} )) || return + _p9k__ret= + if [[ $SCALAENV_DIR != (|.) ]]; then + [[ $SCALAENV_DIR == /* ]] && local dir=$SCALAENV_DIR || local dir="$_p9k__cwd_a/$SCALAENV_DIR" + dir=${dir:A} + if [[ $dir != $_p9k__cwd_a ]]; then + while true; do + if _p9k_read_word $dir/.scala-version; then + (( ${_POWERLEVEL9K_SCALAENV_SOURCES[(I)local]} )) || return + break + fi + [[ $dir == (/|.) ]] && break + dir=${dir:h} + done + fi + fi + if [[ -z $_p9k__ret ]]; then + _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 + else + _p9k__ret= + fi + fi + if [[ -z $_p9k__ret ]]; then + (( _POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW )) || return + (( ${_POWERLEVEL9K_SCALAENV_SOURCES[(I)global]} )) || return + _p9k_scalaenv_global_version + fi + local v=$_p9k__ret + fi + + if (( !_POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW )); then + _p9k_scalaenv_global_version + [[ $v == $_p9k__ret ]] && return + fi + + if (( !_POWERLEVEL9K_SCALAENV_SHOW_SYSTEM )); then + [[ $v == system ]] && return + fi + + _p9k_prompt_segment "$0" "red" "$_p9k_color1" 'SCALA_ICON' 0 '' "${v//\%/%%}" +} + +_p9k_prompt_scalaenv_init() { + typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${commands[scalaenv]:-${${+functions[scalaenv]}:#0}}' +} + +function _p9k_phpenv_global_version() { + _p9k_read_word ${PHPENV_ROOT:-$HOME/.phpenv}/version || _p9k__ret=system +} + prompt_phpenv() { if [[ -n $PHPENV_VERSION ]]; then (( ${_POWERLEVEL9K_PHPENV_SOURCES[(I)shell]} )) || return @@ -7057,6 +7120,9 @@ _p9k_init_params() { _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 + _p9k_declare -b POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW 0 + _p9k_declare -a POWERLEVEL9K_SCALAENV_SOURCES -- shell local global + _p9k_declare -b POWERLEVEL9K_SCALAENV_SHOW_SYSTEM 1 _p9k_declare -b POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW 0 _p9k_declare -a POWERLEVEL9K_PHPENV_SOURCES -- shell local global _p9k_declare -b POWERLEVEL9K_PHPENV_SHOW_SYSTEM 1 From 12cef820770a5067b16bb31dfe2f5078e1f88266 Mon Sep 17 00:00:00 2001 From: Lucas Larson <91468+LucasLarson@users.noreply.github.com> Date: Mon, 7 Sep 2020 16:30:55 -0400 Subject: [PATCH 159/659] repair spelling of "occurrences" (#998) --- 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 1c6b5b7b..e34f172a 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1332,7 +1332,7 @@ # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)' # - # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurences of '%' replaced with '%%'. + # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'. # # Obtaining project name requires sending a request to Google servers. This can take a long time # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud @@ -1405,7 +1405,7 @@ # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email # - # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurences of '%' replaced by '%%'. + # 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//\%/%%}' ###############################[ public_ip: public IP address ]############################### diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 6c8cf2e5..79056ebd 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1309,7 +1309,7 @@ # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)' # - # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurences of '%' replaced with '%%'. + # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'. # # Obtaining project name requires sending a request to Google servers. This can take a long time # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud @@ -1382,7 +1382,7 @@ # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email # - # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurences of '%' replaced by '%%'. + # 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//\%/%%}' ###############################[ public_ip: public IP address ]############################### diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 19cea6e6..e82f1a81 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1309,7 +1309,7 @@ # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)' # - # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurences of '%' replaced with '%%'. + # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'. # # Obtaining project name requires sending a request to Google servers. This can take a long time # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud @@ -1382,7 +1382,7 @@ # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email # - # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurences of '%' replaced by '%%'. + # 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//\%/%%}' ###############################[ public_ip: public IP address ]############################### diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 39b4f50b..9e1dedd0 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1403,7 +1403,7 @@ # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)' # - # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurences of '%' replaced with '%%'. + # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'. # # Obtaining project name requires sending a request to Google servers. This can take a long time # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud @@ -1477,7 +1477,7 @@ # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email # - # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurences of '%' replaced by '%%'. + # 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//\%/%%}' ###############################[ public_ip: public IP address ]############################### From 54d40b924c491a6510c44391dccac05fe78a7310 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 9 Sep 2020 12:10:26 +0200 Subject: [PATCH 160/659] support POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=if-different; see #730 --- config/p10k-classic.zsh | 3 ++- config/p10k-lean-8colors.zsh | 3 ++- config/p10k-lean.zsh | 3 ++- config/p10k-rainbow.zsh | 3 ++- internal/p10k.zsh | 25 +++++++++++++++++-------- 5 files changed, 25 insertions(+), 12 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index e34f172a..b7abae53 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -859,7 +859,8 @@ typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=37 # Don't show Python version next to the virtual environment name. typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false - # Don't show virtualenv if pyenv is already shown. + # If set to "false", won't show virtualenv if pyenv is already shown. + # If set to "if-different", won't show virtualenv if it's the same as pyenv. typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false # Separate environment name from Python version only with a space. typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 79056ebd..8a4df8d1 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -836,7 +836,8 @@ typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=6 # Don't show Python version next to the virtual environment name. typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false - # Don't show virtualenv if pyenv is already shown. + # If set to "false", won't show virtualenv if pyenv is already shown. + # If set to "if-different", won't show virtualenv if it's the same as pyenv. typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false # Separate environment name from Python version only with a space. typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index e82f1a81..ed6ce824 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -836,7 +836,8 @@ typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=37 # Don't show Python version next to the virtual environment name. typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false - # Don't show virtualenv if pyenv is already shown. + # If set to "false", won't show virtualenv if pyenv is already shown. + # If set to "if-different", won't show virtualenv if it's the same as pyenv. typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false # Separate environment name from Python version only with a space. typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 9e1dedd0..39e1261e 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -896,7 +896,8 @@ # typeset -g POWERLEVEL9K_VIRTUALENV_BACKGROUND=4 # Don't show Python version next to the virtual environment name. typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false - # Don't show virtualenv if pyenv is already shown. + # If set to "false", won't show virtualenv if pyenv is already shown. + # If set to "if-different", won't show virtualenv if it's the same as pyenv. typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false # Separate environment name from Python version only with a space. typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= diff --git a/internal/p10k.zsh b/internal/p10k.zsh index fc8f3f8b..cf4d471e 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4083,11 +4083,18 @@ prompt_virtualenv() { local v=${VIRTUAL_ENV:t} [[ $v == $~_POWERLEVEL9K_VIRTUALENV_GENERIC_NAMES ]] && v=${VIRTUAL_ENV:h:t} msg+="$_POWERLEVEL9K_VIRTUALENV_LEFT_DELIMITER${v//\%/%%}$_POWERLEVEL9K_VIRTUALENV_RIGHT_DELIMITER" - if (( _POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV )); then - _p9k_prompt_segment "$0" "blue" "$_p9k_color1" 'PYTHON_ICON' 0 '' "$msg" - else - _p9k_prompt_segment "$0" "blue" "$_p9k_color1" 'PYTHON_ICON' 0 '${(M)${#P9K_PYENV_PYTHON_VERSION}:#0}' "$msg" - fi + case $_POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV in + false) + _p9k_prompt_segment "$0" "blue" "$_p9k_color1" 'PYTHON_ICON' 0 '${(M)${#P9K_PYENV_PYTHON_VERSION}:#0}' "$msg" + ;; + if-different) + _p9k_escape $v + _p9k_prompt_segment "$0" "blue" "$_p9k_color1" 'PYTHON_ICON' 0 '${${:-'$_p9k__ret'}:#$_p9k__pyenv_version}' "$msg" + ;; + *) + _p9k_prompt_segment "$0" "blue" "$_p9k_color1" 'PYTHON_ICON' 0 '' "$msg" + ;; + esac } _p9k_prompt_virtualenv_init() { @@ -4124,7 +4131,7 @@ function _p9k_pyenv_global_version() { # Segment to display pyenv information # https://github.com/pyenv/pyenv#choosing-the-python-version prompt_pyenv() { - unset P9K_PYENV_PYTHON_VERSION + unset P9K_PYENV_PYTHON_VERSION _p9k__pyenv_version local v=${(j.:.)${(@)${(s.:.)PYENV_VERSION}#python-}} if [[ -n $v ]]; then @@ -4180,6 +4187,8 @@ prompt_pyenv() { typeset -g P9K_PYENV_PYTHON_VERSION=$match[1] fi + typeset -g _p9k__pyenv_version=$v + _p9k_prompt_segment "$0" "blue" "$_p9k_color1" 'PYTHON_ICON' 0 '' "${v//\%/%%}" } @@ -7201,7 +7210,7 @@ _p9k_init_params() { _p9k_declare -e POWERLEVEL9K_VI_VISUAL_MODE_STRING # OVERWRITE mode is shown as INSERT unless POWERLEVEL9K_VI_OVERWRITE_MODE_STRING is explicitly set. _p9k_declare -e POWERLEVEL9K_VI_OVERWRITE_MODE_STRING - _p9k_declare -b POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV 1 + _p9k_declare -s POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV true _p9k_declare -b POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION 1 _p9k_declare -e POWERLEVEL9K_VIRTUALENV_LEFT_DELIMITER "(" _p9k_declare -e POWERLEVEL9K_VIRTUALENV_RIGHT_DELIMITER ")" @@ -7869,7 +7878,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v106\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v107\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 760f7cb7a55203be03ddf789dd3c06e75377423f Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 11 Sep 2020 09:16:24 +0200 Subject: [PATCH 161/659] Squashed 'gitstatus/' changes from 3f874d9c..a760bda8 a760bda8 disable certificate checks in curl; we are checking sha256 anyway git-subtree-dir: gitstatus git-subtree-split: a760bda882be6e79a5ff0ab0ccc0e576781dca7a --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index ec442ed9..91a47205 100755 --- a/install +++ b/install @@ -278,7 +278,7 @@ END fi fi local cmd part url ret - for cmd in 'curl -q -fsSL' 'wget --no-config -qO-' 'wget -qO-' 'curl -fsSL'; do + for cmd in 'curl -q -kfsSL' 'wget --no-config -qO-' 'wget -qO-' 'curl -kfsSL'; do part=0 while true; do if [ "$part" = 2 ]; then From 4d1fba340f4c3a224fbf7d57205b4d4f584d6245 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 15 Sep 2020 10:45:04 +0200 Subject: [PATCH 162/659] bug fix: superfluous dash in P9K_KUBECONTEXT_CLOUD_ZONE (#1013) --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index cf4d471e..d98905e9 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4328,7 +4328,7 @@ prompt_kubecontext() { if [[ $cluster == (#b)gke_(?*)_(asia|australia|europe|northamerica|southamerica|us)-([a-z]##<->)(-[a-z]|)_(?*) ]]; then cloud_name=gke cloud_account=$match[1] - cloud_zone=$match[2]-$match[3]-$match[4] + cloud_zone=$match[2]-$match[3]$match[4] cloud_cluster=$match[5] if (( ${_POWERLEVEL9K_KUBECONTEXT_SHORTEN[(I)gke]} )); then text=$cloud_cluster @@ -7878,7 +7878,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v107\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v108\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 f14b58e44f486758aa78920701f9e4a600ae0c75 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 15 Sep 2020 19:50:00 +0200 Subject: [PATCH 163/659] wizard: recognize `source $POWERLEVEL9K_CONFIG_FILE` in .zshrc --- internal/wizard.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index cd62a384..81c967ce 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1576,7 +1576,9 @@ function ask_zshrc_edit() { local h7='$ZDOTDIR/.p10k.zsh' local h8='"$ZDOTDIR/.p10k.zsh"' local h9='"$ZDOTDIR"/.p10k.zsh' - if [[ -n ${(@M)lines:#(#b)[^#]#([^[:IDENT:]]|)source[[:space:]]##($f1|$f2|$f3|$f4|$g1|$h0|$h1|$h2|$h3|$h4|$h5|$h6|$h7|$h8|$h9)(|[[:space:]]*|'#'*)} ]]; then + 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' From 3b772824c08c8af95626c4e001e6b2199684be7c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 16 Sep 2020 15:01:49 +0200 Subject: [PATCH 164/659] don't print instant prompt if it was generated with the different value of terminfo[colors] --- internal/p10k.zsh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index d98905e9..aeb997c9 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5739,7 +5739,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=29 +typeset -gri __p9k_instant_prompt_version=30 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -5806,6 +5806,7 @@ _p9k_dump_instant_prompt() { fi fi fi + (( terminfo[colors] == '${terminfo[colors]:-0}' )) || return (( $+terminfo[cuu] && $+terminfo[cuf] && $+terminfo[ed] && $+terminfo[sc] && $+terminfo[rc] )) || return local pwd=${(%):-%/} [[ $pwd == /* ]] || return @@ -7885,9 +7886,9 @@ _p9k_must_init() { _p9k__param_pat+=$'$__p9k_sh_glob\1$__p9k_ksh_arrays\1$ITERM_SHELL_INTEGRATION_INSTALLED\1' _p9k__param_pat+=$'${PROMPT_EOL_MARK-%B%S%#%s%b}\1$commands[locale]\1$langinfo[CODESET]\1' _p9k__param_pat+=$'$VTE_VERSION\1$TERM_PROGRAM\1$DEFAULT_USER\1$P9K_SSH\1$commands[uname]\1' - _p9k__param_pat+=$'$__p9k_root_dir\1$functions[p10k-on-init]$functions[p10k-on-pre-prompt]\1' - _p9k__param_pat+=$'$functions[p10k-on-post-widget]$functions[p10k-on-post-prompt]\1' - _p9k__param_pat+=$'$+commands[git]' + _p9k__param_pat+=$'$__p9k_root_dir\1$functions[p10k-on-init]\1$functions[p10k-on-pre-prompt]\1' + _p9k__param_pat+=$'$functions[p10k-on-post-widget]\1$functions[p10k-on-post-prompt]\1' + _p9k__param_pat+=$'$+commands[git]\1$terminfo[colors]' local MATCH IFS=$'\1' _p9k__param_pat+="${(@)${(@o)parameters[(I)POWERLEVEL9K_*]}:/(#m)*/\${${(q)MATCH}-$IFS\}}" IFS=$'\2' _p9k__param_sig="${(e)_p9k__param_pat}" From 80d9e573887791c88e2401750d94abfe99aad19e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 19 Sep 2020 12:28:43 +0200 Subject: [PATCH 165/659] docs: remove -u from yay commands (#1018) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2baa3509..c5673317 100644 --- a/README.md +++ b/README.md @@ -427,7 +427,7 @@ echo 'source /usr/local/opt/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc ### Arch Linux ```zsh -yay -Sy --noconfirm zsh-theme-powerlevel10k-git +yay -S --noconfirm zsh-theme-powerlevel10k-git echo 'source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc ``` @@ -613,7 +613,7 @@ The command to update Powerlevel10k depends on how it was installed. | [Zplugin](#zplugin) | `zplugin update` | | [Zinit](#zinit) | `zinit update` | | [Homebrew](#homebrew) | `brew update && brew upgrade` | -| [Arch Linux](#arch-linux) | `yay -Syu --noconfirm --needed zsh-theme-powerlevel10k-git` | +| [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). From 71b39f0da9236acb1323f2833e7cec3ef3eda365 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 21 Sep 2020 07:31:02 +0200 Subject: [PATCH 166/659] mention that zsh-theme-powerlevel10k community package is to be avoided (#1018) --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index c5673317..e64e4ee3 100644 --- a/README.md +++ b/README.md @@ -431,6 +431,14 @@ yay -S --noconfirm zsh-theme-powerlevel10k-git echo 'source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc ``` +[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. +Historicaly, [it has been breaking often and for extended periods of time]( + https://github.com/romkatv/powerlevel10k/pull/786). **Do not use it.** + ## Configuration ### For new users From 3586cc8d7e0ec66015052dadf36414615e950e18 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 29 Sep 2020 13:26:21 +0200 Subject: [PATCH 167/659] expand c-escapes in POWERLEVEL9K_DIR_PATH_SEPARATOR --- internal/p10k.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index aeb997c9..7911ad2f 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -2006,6 +2006,7 @@ prompt_dir() { sep=$_p9k__ret fi _p9k_param $state PATH_SEPARATOR / + _p9k__ret=${(g::)_p9k__ret} (( expand )) && _p9k_escape $_p9k__ret sep+=$_p9k__ret [[ $sep == *%* ]] && sep+=$style From 42aa719e48ab23ce009bb978a300eef1c85cf552 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 29 Sep 2020 13:40:06 +0200 Subject: [PATCH 168/659] dir: ignore separator overrides if cwd is / and POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER is true --- internal/p10k.zsh | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 7911ad2f..e322a95a 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1997,19 +1997,23 @@ prompt_dir() { parts=("${(@)parts//$'\3'}") fi - local sep='' - if (( $+parameters[_POWERLEVEL9K_DIR_PATH_SEPARATOR_FOREGROUND] || - $+parameters[_POWERLEVEL9K_${(U)state}_PATH_SEPARATOR_FOREGROUND] )); then - _p9k_color $state PATH_SEPARATOR_FOREGROUND '' - _p9k_foreground $_p9k__ret - (( expand )) && _p9k_escape_style $_p9k__ret - sep=$_p9k__ret + if [[ $_p9k__cwd == / && $_POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER == 1 ]]; then + local sep='/' + else + local sep='' + if (( $+parameters[_POWERLEVEL9K_DIR_PATH_SEPARATOR_FOREGROUND] || + $+parameters[_POWERLEVEL9K_${(U)state}_PATH_SEPARATOR_FOREGROUND] )); then + _p9k_color $state PATH_SEPARATOR_FOREGROUND '' + _p9k_foreground $_p9k__ret + (( expand )) && _p9k_escape_style $_p9k__ret + sep=$_p9k__ret + fi + _p9k_param $state PATH_SEPARATOR / + _p9k__ret=${(g::)_p9k__ret} + (( expand )) && _p9k_escape $_p9k__ret + sep+=$_p9k__ret + [[ $sep == *%* ]] && sep+=$style fi - _p9k_param $state PATH_SEPARATOR / - _p9k__ret=${(g::)_p9k__ret} - (( expand )) && _p9k_escape $_p9k__ret - sep+=$_p9k__ret - [[ $sep == *%* ]] && sep+=$style local content="${(pj.$sep.)parts}" if (( _POWERLEVEL9K_DIR_HYPERLINK && _p9k_term_has_href )) && [[ $_p9k__cwd == /* ]]; then From 2875595647f06b460aa90eebeb6521642736c349 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 2 Oct 2020 10:08:44 +0200 Subject: [PATCH 169/659] add offline installation instructions (#1033) --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index e64e4ee3..cf5e0087 100644 --- a/README.md +++ b/README.md @@ -674,6 +674,29 @@ The command to update Powerlevel10k depends on how it was installed. | [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). +### How do I install Powerlevel10k on a machine without Internet access? + +1. Run this command on the machine without Internet access: + ```sh + uname -sm | tr '[A-Z]' '[a-z]' + ``` +2. Run these commands on a machine connected to the Internet after replacing the value of + `target_uname` with the output of the previous command: + ```sh + target_uname="replace this with the output of the previous command" + git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k + GITSTATUS_CACHE_DIR="$HOME"/powerlevel10k/gitstatus/usrbin ~/powerlevel10k/gitstatus/install -f -s "${target_uname% *}" -m "${target_uname#* }" + ``` +3. Copy `~/powerlevel10k` from the machine connected to the Internet to the one without Internet + access. +4. Append the following lines to the bottom of `~/.zshrc` on the machine without Internet access: + ```zsh + source ~/powerlevel10k/powerlevel10k.zsh-theme + unset ZSH_THEME + ``` + +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]( @@ -1737,6 +1760,7 @@ typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='${P9K_CONTENT}' # not bold - [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) From 060af91a80359d23f20257bf957734f6f6d76089 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 2 Oct 2020 10:10:38 +0200 Subject: [PATCH 170/659] fix a TOC link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cf5e0087..3063db8c 100644 --- a/README.md +++ b/README.md @@ -1760,7 +1760,7 @@ typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='${P9K_CONTENT}' # not bold - [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) + - [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) From 3aec0c6b363829c30fed5f74b099d4685f64ad59 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 5 Oct 2020 14:46:48 +0200 Subject: [PATCH 171/659] make configuration options work when using Turkish locale (#1036) --- gitstatus/gitstatus.plugin.zsh | 4 +- internal/p10k.zsh | 70 ++++++++++++++++++---------------- internal/wizard.zsh | 4 +- 3 files changed, 42 insertions(+), 36 deletions(-) diff --git a/gitstatus/gitstatus.plugin.zsh b/gitstatus/gitstatus.plugin.zsh index a93f2c36..603e04d0 100644 --- a/gitstatus/gitstatus.plugin.zsh +++ b/gitstatus/gitstatus.plugin.zsh @@ -371,8 +371,8 @@ function _gitstatus_daemon"${1:-}"() { trap '' PIPE local uname_sm - uname_sm="${(L)$(command uname -sm)}" || return - [[ $uname_sm == [^' ']##' '[^' ']## ]] || return + uname_sm="${${(L)$(command uname -sm)}//ı/i}" || return + [[ $uname_sm == [^' ']##' '[^' ']## ]] || return local uname_s=${uname_sm% *} local uname_m=${uname_sm#* } diff --git a/internal/p10k.zsh b/internal/p10k.zsh index e322a95a..aba8429e 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -468,11 +468,11 @@ _p9k_param() { _p9k__ret[-1,-1]='' else if [[ ${1//-/_} == (#b)prompt_([a-z0-9_]#)(*) ]]; then - local var=_POWERLEVEL9K_${(U)match[1]}$match[2]_$2 + local var=_POWERLEVEL9K_${${(U)match[1]}//İ/I}$match[2]_$2 if (( $+parameters[$var] )); then _p9k__ret=${(P)var} else - var=_POWERLEVEL9K_${(U)match[1]%_}_$2 + var=_POWERLEVEL9K_${${(U)match[1]%_}//İ/I}_$2 if (( $+parameters[$var] )); then _p9k__ret=${(P)var} else @@ -522,7 +522,7 @@ _p9k_translate_color() { if [[ $1 == <-> ]]; then # decimal color code: 255 _p9k__ret=${(l.3..0.)1} elif [[ $1 == '#'[[:xdigit:]]## ]]; then # hexademical color code: #ffffff - _p9k__ret=${(L)1} + _p9k__ret=${${(L)1}//ı/i} else # named color: red # Strip prifixes if there are any. _p9k__ret=$__p9k_colors[${${${1#bg-}#fg-}#br}] @@ -1119,7 +1119,7 @@ prompt_aws() { local pat class for pat class in "${_POWERLEVEL9K_AWS_CLASSES[@]}"; do if [[ $aws_profile == ${~pat} ]]; then - [[ -n $class ]] && state=_${(U)class} + [[ -n $class ]] && state=_${${(U)class}//İ/I} break fi done @@ -1910,7 +1910,7 @@ prompt_dir() { local a='' b='' c='' for a b c in "${_POWERLEVEL9K_DIR_CLASSES[@]}"; do if [[ $_p9k__cwd == ${~a} ]]; then - [[ -n $b ]] && state+=_${(U)b} + [[ -n $b ]] && state+=_${${(U)b}//İ/I} icon=$'\1'$c break fi @@ -1924,6 +1924,8 @@ prompt_dir() { icon=LOCK_ICON fi + local state_u=${${(U)state}//İ/I} + local style=%b _p9k_color $state BACKGROUND blue _p9k_background $_p9k__ret @@ -1949,7 +1951,7 @@ prompt_dir() { _p9k_param $state PATH_HIGHLIGHT_BOLD '' [[ $_p9k__ret == true ]] && last_style+=%B if (( $+parameters[_POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND] || - $+parameters[_POWERLEVEL9K_${(U)state}_PATH_HIGHLIGHT_FOREGROUND] )); then + $+parameters[_POWERLEVEL9K_${state_u}_PATH_HIGHLIGHT_FOREGROUND] )); then _p9k_color $state PATH_HIGHLIGHT_FOREGROUND '' _p9k_foreground $_p9k__ret last_style+=$_p9k__ret @@ -1963,7 +1965,7 @@ prompt_dir() { _p9k_param $state ANCHOR_BOLD '' [[ $_p9k__ret == true ]] && anchor_style+=%B if (( $+parameters[_POWERLEVEL9K_DIR_ANCHOR_FOREGROUND] || - $+parameters[_POWERLEVEL9K_${(U)state}_ANCHOR_FOREGROUND] )); then + $+parameters[_POWERLEVEL9K_${state_u}_ANCHOR_FOREGROUND] )); then _p9k_color $state ANCHOR_FOREGROUND '' _p9k_foreground $_p9k__ret anchor_style+=$_p9k__ret @@ -1981,7 +1983,7 @@ prompt_dir() { fi if (( $+parameters[_POWERLEVEL9K_DIR_SHORTENED_FOREGROUND] || - $+parameters[_POWERLEVEL9K_${(U)state}_SHORTENED_FOREGROUND] )); then + $+parameters[_POWERLEVEL9K_${state_u}_SHORTENED_FOREGROUND] )); then _p9k_color $state SHORTENED_FOREGROUND '' _p9k_foreground $_p9k__ret (( expand )) && _p9k_escape_style $_p9k__ret @@ -2002,7 +2004,7 @@ prompt_dir() { else local sep='' if (( $+parameters[_POWERLEVEL9K_DIR_PATH_SEPARATOR_FOREGROUND] || - $+parameters[_POWERLEVEL9K_${(U)state}_PATH_SEPARATOR_FOREGROUND] )); then + $+parameters[_POWERLEVEL9K_${state_u}_PATH_SEPARATOR_FOREGROUND] )); then _p9k_color $state PATH_SEPARATOR_FOREGROUND '' _p9k_foreground $_p9k__ret (( expand )) && _p9k_escape_style $_p9k__ret @@ -4021,7 +4023,7 @@ prompt_vcs() { current_state='CLEAN' fi fi - _p9k_prompt_segment "${0}_${(U)current_state}" "${__p9k_vcs_states[$current_state]}" "$_p9k_color1" "$vcs_visual_identifier" 0 '' "$vcs_prompt" + _p9k_prompt_segment "${0}_${${(U)current_state}//İ/I}" "${__p9k_vcs_states[$current_state]}" "$_p9k_color1" "$vcs_visual_identifier" 0 '' "$vcs_prompt" fi fi } @@ -4357,7 +4359,7 @@ prompt_kubecontext() { local pat class for pat class in "${_POWERLEVEL9K_KUBECONTEXT_CLASSES[@]}"; do if [[ $text == ${~pat} ]]; then - [[ -n $class ]] && state=_${(U)class} + [[ -n $class ]] && state=_${${(U)class}//İ/I} break fi done @@ -4542,7 +4544,7 @@ prompt_google_app_cred() { local pat class state for pat class in "${_POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES[@]}"; do if [[ $text == ${~pat} ]]; then - [[ -n $class ]] && state=_${(U)class} + [[ -n $class ]] && state=_${${(U)class}//İ/I} break fi done @@ -4655,14 +4657,14 @@ function prompt_nordvpn() { if [[ -e /run/nordvpnd.sock ]]; then _p9k_fetch_nordvpn_status 2>/dev/null if [[ $P9K_NORDVPN_SERVER == (#b)([[:alpha:]]##)[[:digit:]]##.nordvpn.com ]]; then - typeset -g P9K_NORDVPN_COUNTRY_CODE=${(U)match[1]} + typeset -g P9K_NORDVPN_COUNTRY_CODE=${${(U)match[1]}//İ/I} fi fi case $P9K_NORDVPN_STATUS in Connected) _p9k_prompt_segment $0_CONNECTED blue white NORDVPN_ICON 0 '' "$P9K_NORDVPN_COUNTRY_CODE";; Disconnected|Connecting|Disconnecting) - local state=${(U)P9K_NORDVPN_STATUS} + local state=${${(U)P9K_NORDVPN_STATUS}//İ/I} _p9k_get_icon $0_$state FAIL_ICON _p9k_prompt_segment $0_$state yellow white NORDVPN_ICON 0 '' "$_p9k__ret";; *) @@ -4747,7 +4749,7 @@ function prompt_terraform() { local pat class for pat class in "${_POWERLEVEL9K_TERRAFORM_CLASSES[@]}"; do if [[ $ws == ${~pat} ]]; then - [[ -n $class ]] && state=_${(U)class} + [[ -n $class ]] && state=_${${(U)class}//İ/I} break fi done @@ -5311,7 +5313,7 @@ function prompt_asdf() { local plugin for plugin in ${(k)_p9k_asdf_plugins}; do - local upper=${(U)plugin//-/_} + local upper=${${(U)plugin//-/_}//İ/I} if (( $+parameters[_POWERLEVEL9K_ASDF_${upper}_SOURCES] )); then local sources=(${(P)${:-_POWERLEVEL9K_ASDF_${upper}_SOURCES}}) else @@ -5604,7 +5606,7 @@ function _p9k_set_prompt() { if [[ $1 == instant_ ]]; then for _p9k__segment_name in ${${(0)_p9k_line_segments_right[_p9k__line_index]}%_joined}; do if (( $+functions[instant_prompt_$_p9k__segment_name] )); then - local disabled=_POWERLEVEL9K_${(U)_p9k__segment_name}_DISABLED_DIR_PATTERN + local disabled=_POWERLEVEL9K_${${(U)_p9k__segment_name}//İ/I}_DISABLED_DIR_PATTERN if [[ $_p9k__cwd != ${(P)~disabled} ]]; then local -i len=$#_p9k__prompt _p9k__non_hermetic_expansion=0 @@ -5620,7 +5622,7 @@ function _p9k_set_prompt() { for _p9k__segment_name in ${${(0)_p9k_line_segments_right[_p9k__line_index]}%_joined}; do local cond=$_p9k__segment_cond_right[_p9k__segment_index] if [[ -z $cond || -n ${(e)cond} ]]; then - local disabled=_POWERLEVEL9K_${(U)_p9k__segment_name}_DISABLED_DIR_PATTERN + local disabled=_POWERLEVEL9K_${${(U)_p9k__segment_name}//İ/I}_DISABLED_DIR_PATTERN if [[ $_p9k__cwd != ${(P)~disabled} ]]; then local val=$_p9k__segment_val_right[_p9k__segment_index] if [[ -n $val ]]; then @@ -5650,7 +5652,7 @@ function _p9k_set_prompt() { if [[ $1 == instant_ ]]; then for _p9k__segment_name in ${${(0)_p9k_line_segments_left[_p9k__line_index]}%_joined}; do if (( $+functions[instant_prompt_$_p9k__segment_name] )); then - local disabled=_POWERLEVEL9K_${(U)_p9k__segment_name}_DISABLED_DIR_PATTERN + local disabled=_POWERLEVEL9K_${${(U)_p9k__segment_name}//İ/I}_DISABLED_DIR_PATTERN if [[ $_p9k__cwd != ${(P)~disabled} ]]; then local -i len=$#_p9k__prompt _p9k__non_hermetic_expansion=0 @@ -5666,7 +5668,7 @@ function _p9k_set_prompt() { for _p9k__segment_name in ${${(0)_p9k_line_segments_left[_p9k__line_index]}%_joined}; do local cond=$_p9k__segment_cond_left[_p9k__segment_index] if [[ -z $cond || -n ${(e)cond} ]]; then - local disabled=_POWERLEVEL9K_${(U)_p9k__segment_name}_DISABLED_DIR_PATTERN + local disabled=_POWERLEVEL9K_${${(U)_p9k__segment_name}//İ/I}_DISABLED_DIR_PATTERN if [[ $_p9k__cwd != ${(P)~disabled} ]]; then local val=$_p9k__segment_val_left[_p9k__segment_index] if [[ -n $val ]]; then @@ -7275,7 +7277,7 @@ _p9k_init_params() { local -i i=1 while (( i <= $#_POWERLEVEL9K_LEFT_PROMPT_ELEMENTS )); do - local segment=${(U)_POWERLEVEL9K_LEFT_PROMPT_ELEMENTS[i]} + local segment=${${(U)_POWERLEVEL9K_LEFT_PROMPT_ELEMENTS[i]}//İ/I} local var=POWERLEVEL9K_${segment}_LEFT_DISABLED (( $+parameters[$var] )) || var=POWERLEVEL9K_${segment}_DISABLED if [[ ${(P)var} == true ]]; then @@ -7287,7 +7289,7 @@ _p9k_init_params() { local -i i=1 while (( i <= $#_POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS )); do - local segment=${(U)_POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS[i]} + local segment=${${(U)_POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS[i]}//İ/I} local var=POWERLEVEL9K_${segment}_RIGHT_DISABLED (( $+parameters[$var] )) || var=POWERLEVEL9K_${segment}_DISABLED if [[ ${(P)var} == true ]]; then @@ -7547,25 +7549,29 @@ instant_prompt__p9k_internal_nothing() { prompt__p9k_internal_nothing; } # _p9k_build_gap_post line_number _p9k_build_gap_post() { - [[ $1 == 1 ]] && local kind=first || local kind=newline - _p9k_get_icon '' MULTILINE_${(U)kind}_PROMPT_GAP_CHAR + if [[ $1 == 1 ]]; then + local kind_l=first kind_u=FIRST + else + local kind_l=newline kind_u=NEWLINE + fi + _p9k_get_icon '' MULTILINE_${kind_u}_PROMPT_GAP_CHAR local char=${_p9k__ret:- } _p9k_prompt_length $char if (( _p9k__ret != 1 || $#char != 1 )); then - >&2 print -rP -- "%F{red}WARNING!%f %BMULTILINE_${(U)kind}_PROMPT_GAP_CHAR%b is not one character long. Will use ' '." - >&2 print -rP -- "Either change the value of %BPOWERLEVEL9K_MULTILINE_${(U)kind}_PROMPT_GAP_CHAR%b or remove it." + >&2 print -rP -- "%F{red}WARNING!%f %BMULTILINE_${kind_u}_PROMPT_GAP_CHAR%b is not one character long. Will use ' '." + >&2 print -rP -- "Either change the value of %BPOWERLEVEL9K_MULTILINE_${kind_u}_PROMPT_GAP_CHAR%b or remove it." char=' ' fi local style - _p9k_color prompt_multiline_${kind}_prompt_gap BACKGROUND "" + _p9k_color prompt_multiline_${kind_l}_prompt_gap BACKGROUND "" [[ -n $_p9k__ret ]] && _p9k_background $_p9k__ret style+=$_p9k__ret - _p9k_color prompt_multiline_${kind}_prompt_gap FOREGROUND "" + _p9k_color prompt_multiline_${kind_l}_prompt_gap FOREGROUND "" [[ -n $_p9k__ret ]] && _p9k_foreground $_p9k__ret style+=$_p9k__ret _p9k_escape_style $style style=$_p9k__ret - local exp=_POWERLEVEL9K_MULTILINE_${(U)kind}_PROMPT_GAP_EXPANSION + local exp=_POWERLEVEL9K_MULTILINE_${kind_u}_PROMPT_GAP_EXPANSION (( $+parameters[$exp] )) && exp=${(P)exp} || exp='${P9K_GAP}' [[ $char == '.' ]] && local s=',' || local s='.' _p9k__ret=$'${${_p9k__g+\n}:-'$style'${${${_p9k__m:#-*}:+' @@ -7921,7 +7927,7 @@ function _p9k_init_cacheable() { for i in {1..$#_p9k_line_segments_left}; do for elem in ${${${(@0)_p9k_line_segments_left[i]}%_joined}//-/_}; do - local var=POWERLEVEL9K_${(U)elem}_SHOW_ON_COMMAND + local var=POWERLEVEL9K_${${(U)elem}//İ/I}_SHOW_ON_COMMAND (( $+parameters[$var] )) || continue _p9k_show_on_command+=( $'(|*[/\0])('${(j.|.)${(P)var}}')' @@ -7929,7 +7935,7 @@ function _p9k_init_cacheable() { _p9k__${i}l$elem) done for elem in ${${${(@0)_p9k_line_segments_right[i]}%_joined}//-/_}; do - local var=POWERLEVEL9K_${(U)elem}_SHOW_ON_COMMAND + local var=POWERLEVEL9K_${${(U)elem}//İ/I}_SHOW_ON_COMMAND (( $+parameters[$var] )) || continue local cmds=(${(P)var}) _p9k_show_on_command+=( @@ -8632,7 +8638,7 @@ function p10k() { fi (( ref )) || icon=$'\1'$icon typeset -i _p9k__has_upglob - "_p9k_${_p9k__prompt_side}_prompt_segment" "prompt_${_p9k__segment_name}${state:+_${(U)state}}" \ + "_p9k_${_p9k__prompt_side}_prompt_segment" "prompt_${_p9k__segment_name}${state:+_${${(U)state}//İ/I}}" \ "$bg" "${fg:-$_p9k_color1}" "$icon" "$expand" "$cond" "$text" return 0 ;; diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 81c967ce..c5bee3d7 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -978,7 +978,7 @@ function ask_color() { r) return 1;; [1-4]) color=$choice;; esac - options+=${(L)color_name[color]} + options+=${${(L)color_name[color]}//ı/i} return 0 } @@ -1005,7 +1005,7 @@ function ask_ornaments_color() { r) return 1;; [1-4]) color=$choice;; esac - options+=${(L)color_name[color]}-ornaments + options+=${${(L)color_name[color]}//ı/i}-ornaments return 0 } From 0da94e8ef1b84581ce8b4eb397c9e465640711ea Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 5 Oct 2020 15:05:41 +0200 Subject: [PATCH 172/659] Squashed 'gitstatus/' changes from a760bda8..6ba954a4 6ba954a4 make lowercasing work with Turkish locale git-subtree-dir: gitstatus git-subtree-split: 6ba954a4a6fb2b86e7d10b4b19db7757b4876525 --- gitstatus.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index a93f2c36..603e04d0 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -371,8 +371,8 @@ function _gitstatus_daemon"${1:-}"() { trap '' PIPE local uname_sm - uname_sm="${(L)$(command uname -sm)}" || return - [[ $uname_sm == [^' ']##' '[^' ']## ]] || return + uname_sm="${${(L)$(command uname -sm)}//ı/i}" || return + [[ $uname_sm == [^' ']##' '[^' ']## ]] || return local uname_s=${uname_sm% *} local uname_m=${uname_sm#* } From b770e6a3e58f5c2238363fe63839fc808c160456 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 9 Oct 2020 10:52:43 +0200 Subject: [PATCH 173/659] fix a typo that was preventing zinit-specific diagnostic from being printed as part of an error message --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index aba8429e..1626c59f 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8333,10 +8333,10 @@ _p9k_init() { if (( $+zsh_defer_options )); then >&2 echo -E - "" >&2 echo -E - "${(%):- NOTE: Do not use %1Fzsh-defer%f to load %Upowerlevel10k.zsh-theme%u.}" - elif (( $+functins[zinit] )); then + elif (( $+functions[zinit] )); then >&2 echo -E - "" >&2 echo -E - "${(%):- NOTE: If using %2Fzinit%f to load %3F'romkatv/powerlevel10k'%f, %Bdo not apply%b %1Fice wait%f.}" - elif (( $+functins[zplugin] )); then + elif (( $+functions[zplugin] )); then >&2 echo -E - "" >&2 echo -E - "${(%):- NOTE: If using %2Fzplugin%f to load %3F'romkatv/powerlevel10k'%f, %Bdo not apply%b %1Fice wait%f.}" fi From 967e845819cc2bbb14eb19620fcad1bf00c533af Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 19 Oct 2020 14:39:01 +0200 Subject: [PATCH 174/659] wizard: suppress the outro message if z4h would print its welcome --- internal/wizard.zsh | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index c5bee3d7..ac0e2654 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -2074,22 +2074,30 @@ while true; do done restore_screen -print -flowing +c New config: "%B${__p9k_cfg_path_u//\\/\\\\}%b." -if [[ -n $config_backup ]]; then - flowing +c Backup of the old config: "%B${config_backup_u//\\/\\\\}%b." -fi -if [[ -n $zshrc_backup ]]; then - flowing +c Backup of "%B${__p9k_zshrc_u//\\/\\\\}%b:" "%B${zshrc_backup_u//\\/\\\\}%b." +local -i print_outro=0 +[[ $force == 1 || -z $Z4H || ! -e $Z4H/welcome || $functions[z4h] == 0 ]] && print_outro=1 + +if (( print_outro )); then + print + + flowing +c New config: "%B${__p9k_cfg_path_u//\\/\\\\}%b." + if [[ -n $config_backup ]]; then + flowing +c Backup of the old config: "%B${config_backup_u//\\/\\\\}%b." + fi + if [[ -n $zshrc_backup ]]; then + flowing +c Backup of "%B${__p9k_zshrc_u//\\/\\\\}%b:" "%B${zshrc_backup_u//\\/\\\\}%b." + fi fi generate_config || return change_zshrc || return -print -rP "" -flowing +c File feature requests and bug reports at "$(href https://github.com/romkatv/powerlevel10k/issues)" -print -rP "" +if (( print_outro )); then + print -rP "" + flowing +c File feature requests and bug reports at "$(href https://github.com/romkatv/powerlevel10k/issues)" + print -rP "" +fi success=1 From fb2805e5abf02c397fddfa35c16e31d05521c6ca Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 19 Oct 2020 14:46:22 +0200 Subject: [PATCH 175/659] wizard: suppress the into message if z4h would print its welcome --- internal/wizard.zsh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index ac0e2654..86a551e5 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -23,6 +23,9 @@ 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 @@ -418,6 +421,7 @@ function ask() { local -i greeting_printed=0 function print_greeting() { + (( in_z4h_wizard )) && return (( greeting_printed )) && return if (( force )); then flowing -c This is %4FPowerlevel10k configuration wizard%f. \ @@ -2075,10 +2079,7 @@ done restore_screen -local -i print_outro=0 -[[ $force == 1 || -z $Z4H || ! -e $Z4H/welcome || $functions[z4h] == 0 ]] && print_outro=1 - -if (( print_outro )); then +if (( !in_z4h_wizard )); then print flowing +c New config: "%B${__p9k_cfg_path_u//\\/\\\\}%b." @@ -2093,7 +2094,7 @@ fi generate_config || return change_zshrc || return -if (( print_outro )); then +if (( !in_z4h_wizard )); then print -rP "" flowing +c File feature requests and bug reports at "$(href https://github.com/romkatv/powerlevel10k/issues)" print -rP "" From a124a7103236124c95128f71da632f50d426ba7c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 19 Oct 2020 14:51:01 +0200 Subject: [PATCH 176/659] typo --- internal/wizard.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 86a551e5..a1b87220 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -24,7 +24,7 @@ else fi local -i in_z4h_wizard=0 -[[ $force == 0 && $functions[z4h] == 1 && -n $Z4H && -e $Z4H/welcome ]] && in_z4h_wizard=1 +[[ $force == 0 && $+functions[z4h] == 1 && -n $Z4H && -e $Z4H/welcome ]] && in_z4h_wizard=1 local -i success=0 From b1aeeda6a80974f419bc598d42a993cfc8b2c3fa Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 19 Oct 2020 16:36:25 +0200 Subject: [PATCH 177/659] make it more difficult to incorrectly restart iTerm2 after installing Meslo --- internal/wizard.zsh | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index a1b87220..5999724d 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -280,6 +280,8 @@ function quit() { print -P "" fi function quit() {} + stty echo 2>/dev/null + show_cursor exit 1 } @@ -554,28 +556,20 @@ function install_font() { sleep 3 print -P " %2FOK%f" sleep 1 - restore_screen + clear + hide_cursor print flowing +c "%2FMeslo Nerd Font%f" successfully installed. print -P "" flowing +c Please "%Brestart iTerm2%b" for the changes to take effect. print -P "" - while true; do - flowing +c -i 5 " 1. Click" "%BiTerm2 → Quit iTerm2%b" or press "%B⌘ Q%b." - flowing +c -i 5 " 2. Open %BiTerm2%b." - print -P "" - local key= - read -k key${(%):-"?%BWill you restart iTerm2 before proceeding? [yN]: %b"} || quit -c - if [[ $key = (y|Y) ]]; then - print -P "" - print -P "" - exit 69 - fi - print -P "" - print -P "" - flowing +c "It's" important to "%Brestart iTerm2%b" for the changes to take effect. - print -P "" - done + flowing +c -i 5 " 1. Click" "%BiTerm2 → Quit iTerm2%b" or press "%B⌘ Q%b." + flowing +c -i 5 " 2. Open %BiTerm2%b." + print -P "" + flowing +c "It's" important to "%Brestart iTerm2%b" by following the instructions above. \ + "It's" "%Bnot enough%b" to close iTerm2 by clicking on the red circle. You must \ + click "%BiTerm2 → Quit iTerm2%b" or press "%B⌘ Q%b." + while true; do sleep 60 2>/dev/null; done ;; esac From e43209409b585c3b26e1c9a3fa1d90b19c9fe484 Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Wed, 21 Oct 2020 18:28:59 +0800 Subject: [PATCH 178/659] Correct Python version in README (#1065) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3063db8c..5f11c110 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ Note how the effect of every command is instantly reflected by the very next pro | `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 2.7.3 >.python-version` | `🐍 2.7.3` | the current python version in [pyenv](https://github.com/pyenv/pyenv) | +| `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 From 47713ea2df0c467f950a065b27182ac685c33dae Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 21 Oct 2020 13:39:56 +0200 Subject: [PATCH 179/659] recognize double-quoted strings when parsing kube configs; other types of quotes are still not supported; see #1061 --- internal/p10k.zsh | 45 +++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 1626c59f..f67574af 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4306,27 +4306,36 @@ prompt_kubecontext() { local name namespace cluster user cloud_name cloud_account cloud_zone cloud_cluster text state () { local cfg && cfg=(${(f)"$(kubectl config view -o=yaml 2>/dev/null)"}) || return - local ctx=(${(@M)cfg:#current-context: [^\"\'\|\>]*}) + local qstr='"*"' + local str='([^"'\''|>]*|'$qstr')' + local ctx=(${(@M)cfg:#current-context: $~str}) (( $#ctx == 1 )) || return name=${ctx[1]#current-context: } local -i pos=${cfg[(i)contexts:]} - (( pos <= $#cfg )) || return - shift $pos cfg - pos=${cfg[(i) name: $name]} - (( pos <= $#cfg )) || return - (( --pos )) - for ((; pos > 0; --pos)); do - local line=$cfg[pos] - if [[ $line == '- context:' ]]; then - return 0 - elif [[ $line == (#b)' cluster: '([^\"\'\|\>]*) ]]; then - cluster=$match[1] - elif [[ $line == (#b)' namespace: '([^\"\'\|\>]*) ]]; then - namespace=$match[1] - elif [[ $line == (#b)' user: '([^\"\'\|\>]*) ]]; then - user=$match[1] - fi - done + { + (( pos <= $#cfg )) || return + shift $pos cfg + pos=${cfg[(i) name: $name]} + (( pos <= $#cfg )) || return + (( --pos )) + for ((; pos > 0; --pos)); do + local line=$cfg[pos] + if [[ $line == '- context:' ]]; then + return 0 + elif [[ $line == (#b)' cluster: '($~str) ]]; then + cluster=$match[1] + [[ $cluster == $~qstr ]] && cluster=$cluster[2,-2] + elif [[ $line == (#b)' namespace: '($~str) ]]; then + namespace=$match[1] + [[ $namespace == $~qstr ]] && namespace=$namespace[2,-2] + elif [[ $line == (#b)' user: '($~str) ]]; then + user=$match[1] + [[ $user == $~qstr ]] && user=$user[2,-2] + fi + done + } always { + [[ $name == $~qstr ]] && name=$name[2,-2] + } } if [[ -n $name ]]; then : ${namespace:=default} From 2bcf38f55495f9bdeed676526315cef5367fe4c1 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 21 Oct 2020 15:53:29 +0200 Subject: [PATCH 180/659] add #font anchor to the readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5f11c110..8a4a5f9e 100644 --- a/README.md +++ b/README.md @@ -500,7 +500,7 @@ the default system fonts. The full choice of style options is available only whe 👇 **Recommended font**: Meslo Nerd Font patched for Powerlevel10k. 👇 -### Meslo Nerd Font patched for Powerlevel10k +### Meslo Nerd Font patched for Powerlevel10k Gorgeous monospace font designed by Jim Lyles for Bitstream, customized by the same for Apple, further customized by André Berg, and finally patched by yours truly with customized scripts From fdc0ee3708342553ef5ac6d6b0dbdd0d2e3e427d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 21 Oct 2020 16:05:26 +0200 Subject: [PATCH 181/659] add font.md --- font.md | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 font.md diff --git a/font.md b/font.md new file mode 100644 index 00000000..794b81ff --- /dev/null +++ b/font.md @@ -0,0 +1,77 @@ +# Recommended font: Meslo Nerd Font patched for Powerlevel10k + +Gorgeous monospace font designed by Jim Lyles for Bitstream, customized by the same for Apple, +further customized by André Berg, and finally patched by yours truly with customized scripts +originally developed by Ryan L McIntyre of Nerd Fonts. Contains all glyphs and symbols that +Powerlevel10k may need. Battle-tested in dozens of different terminals on all major operating +systems. + +*FAQ*: [How was the recommended font created?](README.md#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*. + +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**: Open *iTerm2 → Preferences → Profiles → Text* and set *Font* to `MesloLGS NF`. + Alternatively, type `p10k configure` and answer `Yes` when asked whether to install + *Meslo Nerd 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 + `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`. +- **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** (the new thing): Open *Settings* (`Ctrl+,`), search for `fontFace` and set + value to `MesloLGS NF` for every profile. +- **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*. +- **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and and the following section + to it: + ```yaml + font: + normal: + family: "MesloLGS NF" + ``` + +**IMPORTANT:** Run `p10k configure` after changing terminal font. The old `~/.p10k.zsh` 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 f0159ca6425b1c021a3b17d5ce59e867cbd608da Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 21 Oct 2020 16:23:15 +0200 Subject: [PATCH 182/659] better wizard intro when installing z4h --- internal/wizard.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 5999724d..527f6cef 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -423,9 +423,12 @@ function ask() { local -i greeting_printed=0 function print_greeting() { - (( in_z4h_wizard )) && return (( greeting_printed )) && return - if (( force )); then + if (( in_z4h_wizard )); then + flowing -c %3FZsh for Humans%f uses %4FPowerlevel10k%f to print command \ + line prompt. This wizard will ask you a few questions and configure \ + prompt for you. + else (( force )); then flowing -c This is %4FPowerlevel10k configuration wizard%f. \ It will ask you a few questions and configure your prompt. else From de0e0221771b227909566e2b0d4ec13310a8a514 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 21 Oct 2020 16:24:38 +0200 Subject: [PATCH 183/659] typo --- internal/wizard.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 527f6cef..7562c2bc 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -428,7 +428,7 @@ function print_greeting() { flowing -c %3FZsh for Humans%f uses %4FPowerlevel10k%f to print command \ line prompt. This wizard will ask you a few questions and configure \ prompt for you. - else (( force )); then + elif (( force )); then flowing -c This is %4FPowerlevel10k configuration wizard%f. \ It will ask you a few questions and configure your prompt. else From d86bbe75dece6c4276bfa99246880b92f9e053aa Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 22 Oct 2020 14:54:18 +0200 Subject: [PATCH 184/659] Squashed 'gitstatus/' changes from 6ba954a4..4f9746fb 4f9746fb rebuild all binaries 6a3d54a5 upgrade libgit2 git-subtree-dir: gitstatus git-subtree-split: 4f9746fb6e949475ff37986883796adf937055da --- build.info | 6 +++--- install.info | 44 ++++++++++++++++++++++---------------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/build.info b/build.info index cf180b0c..aa52263b 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.2.0" +gitstatus_version="v1.3.1" # 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.2.0" # # If sha256 of ./deps/libgit2-${libgit2_version}.tar.gz doesn't match, # build gets aborted. -libgit2_version="tag-d6c37a38587c9af2a9e63449fc8bf951dca0e854" -libgit2_sha256="e3df79da60963f8711580dce53b1a7ed583bb534be9ebb95589e76346fa986be" +libgit2_version="tag-82cefe2b42300224ad3c148f8b1a569757cc617a" +libgit2_sha256="dc701c4e2080f7901f5d599d642b629569e5581086b9838d481d09f284dc7621" diff --git a/install.info b/install.info index fedfd9b4..770fb44e 100644 --- a/install.info +++ b/install.info @@ -1,4 +1,4 @@ -# ae988158e1044abb1626a15d6a27751cd80c13be +# 6a3d54a5a44abb4ee46ce72a8097389364746c6a # # This file is used by ./install and indirectly by shell bindings. # @@ -8,26 +8,26 @@ # of `git rev-parse HEAD`. # Official gitstatusd binaries. -uname_s_glob="cygwin_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="c38342c7a70842067074710250fd8cebea87ae111f032277c2c70a77179b5355"; -uname_s_glob="cygwin_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="d30b455e371cd0895c9bd1ff87b8a27e6c3f3c2970b4e993e93fe1a6943962ad"; -uname_s_glob="darwin"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="c71b30027b3c763faa3ff7ad09d66c84403851fafcf798bf5e629b98c2b8384a"; -uname_s_glob="freebsd"; uname_m_glob="amd64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="a72d4c5da2f9594bf1c4153d841bf61a35cbcbb8b74818649b1375902e9d9534"; -uname_s_glob="linux"; uname_m_glob="aarch64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="eb7f125d43c29f955239ef4014ab652b9162bbbb6c81c40f1d5ead46a209866e"; -uname_s_glob="linux"; uname_m_glob="armv6l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="051a9448d9cb4bb1d95e93cff51a6ab48a085465ec30eec40046977d4213feff"; -uname_s_glob="linux"; uname_m_glob="armv7l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="adaa47c8e8dec1e1e8686c3044ee0f45afda15deaa8388efcb4952747b66246e"; -uname_s_glob="linux"; uname_m_glob="armv8l"; file="gitstatusd-${uname_s}-aarch64"; version="v1.0.0"; sha256="eb7f125d43c29f955239ef4014ab652b9162bbbb6c81c40f1d5ead46a209866e"; -uname_s_glob="linux"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="c80355664e7361e11215e64b523ed75a3d39f72393fa2204fefa85eae0342a67"; -uname_s_glob="linux"; uname_m_glob="ppc64le"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.2.0"; sha256="38a60b64f619d9db83747f1653b0b740380b1b2b9b414a0ff94815305cdd76bc"; -uname_s_glob="linux"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="e33867063f091d3c31ede9916fef079ff8cd6fdcc70d051914f962ab3b8f36fd"; -uname_s_glob="msys_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="2cf6ff92a5c50e4181ceb402217162bebd5e52144eb52eacfef2f6d47d5c20d4"; -uname_s_glob="msys_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.0.0"; sha256="960c3d9d90d7b96257a9746f7168faffdf9b5fbda464e354e7b14c42cc473f15"; +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="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.3.1"; sha256="91bcc1efafff8c896e8f172ff624d9407494f7a26b4ad1bf573f52623be2ca91"; +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"; # Fallbacks to official gitstatusd binaries. -uname_s_glob="cygwin_nt-*"; uname_m_glob="i686"; file="gitstatusd-cygwin_nt-10.0-${uname_m}"; version="v1.0.0"; sha256="c38342c7a70842067074710250fd8cebea87ae111f032277c2c70a77179b5355"; -uname_s_glob="cygwin_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-cygwin_nt-10.0-${uname_m}"; version="v1.0.0"; sha256="d30b455e371cd0895c9bd1ff87b8a27e6c3f3c2970b4e993e93fe1a6943962ad"; -uname_s_glob="mingw32_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0"; sha256="2cf6ff92a5c50e4181ceb402217162bebd5e52144eb52eacfef2f6d47d5c20d4"; -uname_s_glob="mingw32_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0"; sha256="960c3d9d90d7b96257a9746f7168faffdf9b5fbda464e354e7b14c42cc473f15"; -uname_s_glob="mingw64_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0"; sha256="2cf6ff92a5c50e4181ceb402217162bebd5e52144eb52eacfef2f6d47d5c20d4"; -uname_s_glob="mingw64_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0"; sha256="960c3d9d90d7b96257a9746f7168faffdf9b5fbda464e354e7b14c42cc473f15"; -uname_s_glob="msys_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0"; sha256="2cf6ff92a5c50e4181ceb402217162bebd5e52144eb52eacfef2f6d47d5c20d4"; -uname_s_glob="msys_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.0.0"; sha256="960c3d9d90d7b96257a9746f7168faffdf9b5fbda464e354e7b14c42cc473f15"; +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"; From 98494aaf7b2d90c9565a6b4eb49cb877e57d793e Mon Sep 17 00:00:00 2001 From: Subhaditya Nath <56714626+subnut@users.noreply.github.com> Date: Sun, 25 Oct 2020 10:40:26 +0530 Subject: [PATCH 185/659] Added font instructions for kitty (#1070) --- font.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/font.md b/font.md index 794b81ff..c9c0185c 100644 --- a/font.md +++ b/font.md @@ -69,6 +69,11 @@ applications on your system. Configure your terminal to use this font: normal: family: "MesloLGS NF" ``` + - **kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following sentence and then + restart kitty by closing all sessions and opening a new session. + ``` + font_family MesloLGS NF + ``` **IMPORTANT:** Run `p10k configure` after changing terminal font. The old `~/.p10k.zsh` may work incorrectly with the new font. From 78301e82c7a86ceb597bb925f33cccf37d6da4a1 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 25 Oct 2020 06:14:12 +0100 Subject: [PATCH 186/659] clean up kitty font instructions and duplicate them in readme.md --- README.md | 5 +++++ font.md | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8a4a5f9e..ef8c7d79 100644 --- a/README.md +++ b/README.md @@ -571,6 +571,11 @@ applications on your system. Configure your terminal to use this font: normal: family: "MesloLGS NF" ``` + - **Kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following line to it: + ``` + 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. diff --git a/font.md b/font.md index c9c0185c..51c08567 100644 --- a/font.md +++ b/font.md @@ -69,11 +69,11 @@ applications on your system. Configure your terminal to use this font: normal: family: "MesloLGS NF" ``` - - **kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following sentence and then - restart kitty by closing all sessions and opening a new session. - ``` - font_family MesloLGS NF - ``` + - **Kitty**: Create or open `~/.config/kitty/kitty.conf` and add the following line to it: + ``` + 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. From 49d5617989fcbf9a853742bfbc1ee8d02adcfe9f Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 25 Oct 2020 06:14:39 +0100 Subject: [PATCH 187/659] doc cleanup --- README.md | 2 +- font.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ef8c7d79..ae5d2676 100644 --- a/README.md +++ b/README.md @@ -572,7 +572,7 @@ applications on your system. Configure your terminal to use this font: 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. diff --git a/font.md b/font.md index 51c08567..10a0985f 100644 --- a/font.md +++ b/font.md @@ -70,7 +70,7 @@ applications on your system. Configure your terminal to use this font: 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. From 74c6e18363003015e705a8803f475b0452420373 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 26 Oct 2020 12:26:45 +0100 Subject: [PATCH 188/659] check mtime of $TTY on startup if it points to a different tty than in the parent; see #930 --- internal/p10k.zsh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index f67574af..8d7c26d5 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5755,7 +5755,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=30 +typeset -gri __p9k_instant_prompt_version=31 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -5833,7 +5833,8 @@ _p9k_dump_instant_prompt() { local tail=${content##*$rs$key$us} [[ ${#tail} != ${#content} ]] || return local P9K_PROMPT=instant - if [[ $P9K_TTY != old ]]; then' + if [[ $P9K_TTY != old || $_P9K_TTY != $TTY ]]; then + typeset -gx _P9K_TTY=$TTY' if (( _POWERLEVEL9K_NEW_TTY_MAX_AGE_SECONDS < 0 )); then >&$fd print -r -- ' typeset -gx P9K_TTY=new' else @@ -6412,8 +6413,8 @@ function _p9k_on_expand() { zle -F $_p9k__state_dump_fd _p9k_do_dump fi - if (( ! $+P9K_TTY )); then - typeset -gx P9K_TTY=old + if (( ! $+P9K_TTY )) || [[ $_P9K_TTY != $TTY ]]; then + typeset -gx P9K_TTY=old _P9K_TTY=$TTY if (( _POWERLEVEL9K_NEW_TTY_MAX_AGE_SECONDS < 0 )); then P9K_TTY=new else @@ -8388,7 +8389,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_TTY)' + unset -m '(_POWERLEVEL9K_|P9K_|_p9k_)*~(P9K_SSH|P9K_TTY|_P9K_TTY)' [[ -n $__p9k_locale ]] || unset __p9k_locale } From 8f0db0c95a01b6284f38c106c2351cc570a0b281 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 27 Oct 2020 08:01:42 +0100 Subject: [PATCH 189/659] expand the list of things powerlevel10k does not affect --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ae5d2676..0a0bb202 100644 --- a/README.md +++ b/README.md @@ -731,9 +731,11 @@ Powerlevel10k does not affect: - Terminal window title. - Colors used by `ls`. -- Content and style of command completions. +- The behavior of `git` command. +- The content and style of command completions. - Command line colors (syntax highlighting, autosuggestions, etc.). - 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). From 2ea3356d6695f1ed6d78c7c76f50415b0091e303 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 27 Oct 2020 12:49:39 +0100 Subject: [PATCH 190/659] add __p9k_initial_screen_empty for z4h integration --- internal/p10k.zsh | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 8d7c26d5..66429ea1 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5755,7 +5755,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=31 +typeset -gri __p9k_instant_prompt_version=32 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -5800,6 +5800,7 @@ _p9k_dump_instant_prompt() { local -i height=$_POWERLEVEL9K_INSTANT_PROMPT_COMMAND_LINES local prompt_dir=${(q)prompt_dir}" >&$fd print -r -- ' + (( __p9k_initial_screen_empty )) && 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 @@ -6052,7 +6053,11 @@ _p9k_dump_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 - print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed] + if (( __p9k_initial_screen_empty )); then + print -rn -- $'\''\033[2J'\''$terminfo[rc]${(%):-%b%k%f%s%u} + else + print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed] + fi if [[ -s $__p9k_instant_prompt_output ]]; then command cat $__p9k_instant_prompt_output 2>/dev/null if (( $1 )); then @@ -6246,7 +6251,11 @@ function _p9k_clear_instant_prompt() { local -i fill=$((COLUMNS > _p9k__ret ? COLUMNS - _p9k__ret : 0)) local cr=$'\r' local sp="${(%):-%b%k%f%s%u$mark${(pl.$fill.. .)}$cr%b%k%f%s%u%E}" - print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed] + if (( __p9k_initial_screen_empty )); then + print -rn -- $'\e[2J'$terminfo[rc]${(%):-%b%k%f%s%u} + else + print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed] + fi 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]: ' @@ -6306,7 +6315,11 @@ function _p9k_clear_instant_prompt() { } 2>/dev/null else zf_rm -f -- $__p9k_instant_prompt_output 2>/dev/null - print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed] + if (( __p9k_initial_screen_empty )); then + print -rn -- $'\e[2J'$terminfo[rc]${(%):-%b%k%f%s%u} + else + print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed] + fi fi prompt_opts=(percent subst sp cr) if [[ $_POWERLEVEL9K_DISABLE_INSTANT_PROMPT == 0 && $__p9k_instant_prompt_active == 2 ]]; then From b9be4f968b21c75c2ef27cb45f6826032e186587 Mon Sep 17 00:00:00 2001 From: Stephen <927583+scribbles@users.noreply.github.com> Date: Wed, 28 Oct 2020 02:20:36 -0600 Subject: [PATCH 191/659] Updating README.md typo (#1077) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0a0bb202..44dc2f67 100644 --- a/README.md +++ b/README.md @@ -564,7 +564,7 @@ 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*. -- **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and and the following section +- **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and add the following section to it: ```yaml font: From aa6d40b733280f154d9a55383f5efb6cf01a7a2a Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 28 Oct 2020 09:21:22 +0100 Subject: [PATCH 192/659] fix a typo in docs --- font.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/font.md b/font.md index 10a0985f..cc69df80 100644 --- a/font.md +++ b/font.md @@ -62,7 +62,7 @@ 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*. -- **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and and the following section +- **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and add the following section to it: ```yaml font: From 85f9e75918ced299bca87332b4c84f6788e753f4 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 30 Oct 2020 13:52:17 +0100 Subject: [PATCH 193/659] drop __p9k_initial_screen_empty; rely on _Z4H_TMUX_CMD instead --- internal/p10k.zsh | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 66429ea1..e4287d57 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5755,7 +5755,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=32 +typeset -gri __p9k_instant_prompt_version=33 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -5800,7 +5800,7 @@ _p9k_dump_instant_prompt() { local -i height=$_POWERLEVEL9K_INSTANT_PROMPT_COMMAND_LINES local prompt_dir=${(q)prompt_dir}" >&$fd print -r -- ' - (( __p9k_initial_screen_empty )) && height=0 + [[ -n $_Z4H_TMUX_CMD ]] && 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 @@ -6042,6 +6042,13 @@ _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 + typeset -g __p9k_instant_prompt_clear=$terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed] + if [[ -n $_Z4H_TMUX ]]; then + local pane + if pane="$(TMUX=$_Z4H_TMUX TMUX_PANE= $_Z4H_TMUX_CMD capture-pane -p -e 2>/dev/null && print -n x)"; then + __p9k_instant_prompt_clear=${esc}0m${esc}H${${pane//$lf/${esc}K$lf}%${lf}x}$__p9k_instant_prompt_clear + fi + fi typeset -g __p9k_instant_prompt_dump_file=${XDG_CACHE_HOME:-~/.cache}/p10k-dump-${(%):-%n}.zsh if builtin source $__p9k_instant_prompt_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then _p9k_preinit @@ -6053,11 +6060,7 @@ _p9k_dump_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 - if (( __p9k_initial_screen_empty )); then - print -rn -- $'\''\033[2J'\''$terminfo[rc]${(%):-%b%k%f%s%u} - else - print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed] - fi + print -rn -- $__p9k_instant_prompt_clear if [[ -s $__p9k_instant_prompt_output ]]; then command cat $__p9k_instant_prompt_output 2>/dev/null if (( $1 )); then @@ -6251,11 +6254,7 @@ function _p9k_clear_instant_prompt() { local -i fill=$((COLUMNS > _p9k__ret ? COLUMNS - _p9k__ret : 0)) local cr=$'\r' local sp="${(%):-%b%k%f%s%u$mark${(pl.$fill.. .)}$cr%b%k%f%s%u%E}" - if (( __p9k_initial_screen_empty )); then - print -rn -- $'\e[2J'$terminfo[rc]${(%):-%b%k%f%s%u} - else - print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed] - fi + print -rn -- ${__p9k_instant_prompt_clear-$terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed]} 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]: ' @@ -6315,11 +6314,7 @@ function _p9k_clear_instant_prompt() { } 2>/dev/null else zf_rm -f -- $__p9k_instant_prompt_output 2>/dev/null - if (( __p9k_initial_screen_empty )); then - print -rn -- $'\e[2J'$terminfo[rc]${(%):-%b%k%f%s%u} - else - print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed] - fi + print -rn -- ${__p9k_instant_prompt_clear-$terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed]} fi prompt_opts=(percent subst sp cr) if [[ $_POWERLEVEL9K_DISABLE_INSTANT_PROMPT == 0 && $__p9k_instant_prompt_active == 2 ]]; then From 76e5a692622d79900031be642f074d7e1d0b8412 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 30 Oct 2020 16:27:35 +0100 Subject: [PATCH 194/659] save/restore screen through z4h to make it work over ssh --- internal/p10k.zsh | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index e4287d57..59948730 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5755,7 +5755,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=33 +typeset -gri __p9k_instant_prompt_version=35 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -5800,7 +5800,7 @@ _p9k_dump_instant_prompt() { local -i height=$_POWERLEVEL9K_INSTANT_PROMPT_COMMAND_LINES local prompt_dir=${(q)prompt_dir}" >&$fd print -r -- ' - [[ -n $_Z4H_TMUX_CMD ]] && height=0 + (( _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 @@ -6042,12 +6042,9 @@ _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 - typeset -g __p9k_instant_prompt_clear=$terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed] - if [[ -n $_Z4H_TMUX ]]; then - local pane - if pane="$(TMUX=$_Z4H_TMUX TMUX_PANE= $_Z4H_TMUX_CMD capture-pane -p -e 2>/dev/null && print -n x)"; then - __p9k_instant_prompt_clear=${esc}0m${esc}H${${pane//$lf/${esc}K$lf}%${lf}x}$__p9k_instant_prompt_clear - fi + if (( _z4h_can_save_restore_screen == 1 )); then + typeset -g _z4h_saved_screen + -z4h-save-screen fi typeset -g __p9k_instant_prompt_dump_file=${XDG_CACHE_HOME:-~/.cache}/p10k-dump-${(%):-%n}.zsh if builtin source $__p9k_instant_prompt_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then @@ -6060,7 +6057,11 @@ _p9k_dump_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 - print -rn -- $__p9k_instant_prompt_clear + if (( _z4h_can_save_restore_screen == 1 && __p9k_instant_prompt_sourced >= 35 )); then + -z4h-restore-screen + unset _z4h_saved_screen + fi + print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed] if [[ -s $__p9k_instant_prompt_output ]]; then command cat $__p9k_instant_prompt_output 2>/dev/null if (( $1 )); then @@ -6254,7 +6255,11 @@ function _p9k_clear_instant_prompt() { local -i fill=$((COLUMNS > _p9k__ret ? COLUMNS - _p9k__ret : 0)) local cr=$'\r' local sp="${(%):-%b%k%f%s%u$mark${(pl.$fill.. .)}$cr%b%k%f%s%u%E}" - print -rn -- ${__p9k_instant_prompt_clear-$terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed]} + if (( _z4h_can_save_restore_screen == 1 && __p9k_instant_prompt_sourced >= 35 )); then + -z4h-restore-screen + 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\\')} if [[ -n $unexpected ]]; then local omz1='[Oh My Zsh] Would you like to update? [Y/n]: ' @@ -6314,7 +6319,11 @@ function _p9k_clear_instant_prompt() { } 2>/dev/null else zf_rm -f -- $__p9k_instant_prompt_output 2>/dev/null - print -rn -- ${__p9k_instant_prompt_clear-$terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed]} + if (( _z4h_can_save_restore_screen == 1 && __p9k_instant_prompt_sourced >= 35 )); then + -z4h-restore-screen + unset _z4h_saved_screen + fi + print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed] fi prompt_opts=(percent subst sp cr) if [[ $_POWERLEVEL9K_DISABLE_INSTANT_PROMPT == 0 && $__p9k_instant_prompt_active == 2 ]]; then From 5e2422df50e196d545f5b36ac6533a18326358b5 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 31 Oct 2020 07:10:11 +0100 Subject: [PATCH 195/659] fix old/new TTY detection --- internal/p10k.zsh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 59948730..629d3881 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5755,7 +5755,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=35 +typeset -gri __p9k_instant_prompt_version=36 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -5834,8 +5834,7 @@ _p9k_dump_instant_prompt() { local tail=${content##*$rs$key$us} [[ ${#tail} != ${#content} ]] || return local P9K_PROMPT=instant - if [[ $P9K_TTY != old || $_P9K_TTY != $TTY ]]; then - typeset -gx _P9K_TTY=$TTY' + if [[ -z $P9K_TTY || $P9K_TTY == old && -n ${_P9K_TTY:#$TTY} ]]; then' if (( _POWERLEVEL9K_NEW_TTY_MAX_AGE_SECONDS < 0 )); then >&$fd print -r -- ' typeset -gx P9K_TTY=new' else @@ -5850,6 +5849,7 @@ _p9k_dump_instant_prompt() { fi' fi >&$fd print -r -- ' fi + typeset -gx _P9K_TTY=$TTY local -i _p9k__empty_line_i=3 _p9k__ruler_i=3 local -A _p9k_display_k=('${(j: :)${(@q)${(kv)_p9k_display_k}}}') local -a _p9k__display_v=('${(j: :)${(@q)display_v}}') @@ -6430,8 +6430,8 @@ function _p9k_on_expand() { zle -F $_p9k__state_dump_fd _p9k_do_dump fi - if (( ! $+P9K_TTY )) || [[ $_P9K_TTY != $TTY ]]; then - typeset -gx P9K_TTY=old _P9K_TTY=$TTY + if [[ -z $P9K_TTY || $P9K_TTY == old && -n ${_P9K_TTY:#$TTY} ]]; then + typeset -gx P9K_TTY=old if (( _POWERLEVEL9K_NEW_TTY_MAX_AGE_SECONDS < 0 )); then P9K_TTY=new else @@ -6443,6 +6443,8 @@ function _p9k_on_expand() { fi fi + typeset -gx _P9K_TTY=$TTY + __p9k_reset_state=1 if (( _POWERLEVEL9K_PROMPT_ADD_NEWLINE )); then From d7861fcfa0fa489ecff59e7966c372d5ed9720c4 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 1 Nov 2020 18:23:10 +0100 Subject: [PATCH 196/659] wrap z4h-clear-screen-{soft,hard}-top --- internal/p10k.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 629d3881..dfa4126b 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7447,7 +7447,7 @@ function _p9k_widget_hook() { eval "$__p9k_intro" (( _p9k__restore_prompt_fd )) && _p9k_restore_prompt $_p9k__restore_prompt_fd - if [[ $1 == clear-screen ]]; then + if [[ $1 == (clear-screen|z4h-clear-screen-*-top) ]]; then P9K_TTY=new _p9k__expanded=0 _p9k_reset_prompt @@ -7519,6 +7519,8 @@ function _p9k_wrap_widgets() { visual-line-mode deactivate-region clear-screen + z4h-clear-screen-soft-top + z4h-clear-screen-hard-top send-break $_POWERLEVEL9K_HOOK_WIDGETS ) From 2fc725748643a00baad6c0ef3645d71ddbb3c1f0 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 6 Nov 2020 09:13:04 +0100 Subject: [PATCH 197/659] docs --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 44dc2f67..f9d17cb4 100644 --- a/README.md +++ b/README.md @@ -725,14 +725,14 @@ Powerlevel10k defines prompt and nothing else. It sets [prompt-related options]( 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 color outside these areas. +Powerlevel10k has no control over the terminal content or colors outside these areas. Powerlevel10k does not affect: -- Terminal window title. +- Terminal window/tab title. - Colors used by `ls`. - The behavior of `git` command. -- The content and style of command completions. +- The content and style of Tab completions. - Command line colors (syntax highlighting, autosuggestions, etc.). - Key bindings. - Aliases. From f6c24d2053fe7746a33791b3f366e039caa3058a Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 8 Nov 2020 13:33:59 +0100 Subject: [PATCH 198/659] reset text attributes at the end of precmd --- internal/p10k.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index dfa4126b..f4a5dbf0 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6702,6 +6702,8 @@ _p9k_precmd() { # See https://www.zsh.org/mla/workers/2020/msg00612.html for the reason behind __p9k_trapint. typeset -g __p9k_trapint='_p9k_trapint; return 130' trap "$__p9k_trapint" INT + + : ${(%):-%b%k%s%u} } function _p9k_reset_prompt() { From e2db8607456eb04186b84fc6edaaf567350e3dc0 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 10 Nov 2020 07:41:14 +0100 Subject: [PATCH 199/659] print instant prompt only if TERM is the same --- internal/p10k.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index f4a5dbf0..4e4a5068 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5755,7 +5755,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=36 +typeset -gri __p9k_instant_prompt_version=37 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -5787,7 +5787,7 @@ _p9k_dump_instant_prompt() { (( ! \$+__p9k_instant_prompt_disabled )) || return typeset -gi __p9k_instant_prompt_disabled=1 __p9k_instant_prompt_sourced=$__p9k_instant_prompt_version [[ \$ZSH_VERSION == ${(q)ZSH_VERSION} && \$ZSH_PATCHLEVEL == ${(q)ZSH_PATCHLEVEL} && - \$TERM_PROGRAM $hyper 'Hyper' && \$+VTE_VERSION == $+VTE_VERSION && + \$TERM_PROGRAM $hyper 'Hyper' && \$+VTE_VERSION == $+VTE_VERSION && \$TERM == ${(q)TERM} && \$POWERLEVEL9K_DISABLE_INSTANT_PROMPT != 'true' && \$POWERLEVEL9K_INSTANT_PROMPT != 'off' ]] || { __p9k_instant_prompt_sourced=0; return 1; } typeset -g __p9k_instant_prompt_param_sig=${(q+)_p9k__param_sig} @@ -7923,7 +7923,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v108\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v109\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' @@ -7932,7 +7932,7 @@ _p9k_must_init() { _p9k__param_pat+=$'$VTE_VERSION\1$TERM_PROGRAM\1$DEFAULT_USER\1$P9K_SSH\1$commands[uname]\1' _p9k__param_pat+=$'$__p9k_root_dir\1$functions[p10k-on-init]\1$functions[p10k-on-pre-prompt]\1' _p9k__param_pat+=$'$functions[p10k-on-post-widget]\1$functions[p10k-on-post-prompt]\1' - _p9k__param_pat+=$'$+commands[git]\1$terminfo[colors]' + _p9k__param_pat+=$'$+commands[git]\1$terminfo[colors]\1$TERM' local MATCH IFS=$'\1' _p9k__param_pat+="${(@)${(@o)parameters[(I)POWERLEVEL9K_*]}:/(#m)*/\${${(q)MATCH}-$IFS\}}" IFS=$'\2' _p9k__param_sig="${(e)_p9k__param_pat}" From 271836403d61b92019b877f37d094c4d235b818d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 10 Nov 2020 09:59:41 +0100 Subject: [PATCH 200/659] remove artificial term scrolling before instant prompt --- internal/p10k.zsh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 4e4a5068..845bd970 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7372,10 +7372,11 @@ function _p9k_on_widget_zle-line-finish() { (( _p9k_reset_on_line_finish )) && __p9k_reset_state=2 (( $+functions[p10k-on-post-prompt] )) && p10k-on-post-prompt + local -i optimized + if [[ -n $_p9k_transient_prompt ]]; then if [[ $_POWERLEVEL9K_TRANSIENT_PROMPT == always || $_p9k__cwd == $_p9k__last_prompt_pwd ]]; then - RPROMPT= - PROMPT=$_p9k_transient_prompt + optimized=1 __p9k_reset_state=2 else _p9k__last_prompt_pwd=$_p9k__cwd @@ -7390,11 +7391,11 @@ function _p9k_on_widget_zle-line-finish() { zle -F $_p9k__restore_prompt_fd _p9k_restore_prompt fi fi - if (( $+termcap[up] )); then - (( _p9k__can_hide_cursor )) && local hide=$terminfo[civis] || local hide= - echo -nE - $hide$'\n'$termcap[up] + if (( optimized )); then + RPROMPT= PROMPT=$_p9k_transient_prompt _p9k_reset_prompt + else + _p9k_reset_prompt fi - _p9k_reset_prompt fi _p9k__line_finished='%{%}' From 8840fe550e2b61d684e0ca594d2ef33fc9152d46 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 11 Nov 2020 07:02:38 +0100 Subject: [PATCH 201/659] correct install-without-internet instructions w.r.t. ZSH_THEME --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f9d17cb4..c58a4a87 100644 --- a/README.md +++ b/README.md @@ -694,10 +694,14 @@ The command to update Powerlevel10k depends on how it was installed. ``` 3. Copy `~/powerlevel10k` from the machine connected to the Internet to the one without Internet access. -4. Append the following lines to the bottom of `~/.zshrc` on the machine without Internet access: +4. Add `source ~/powerlevel10k/powerlevel10k.zsh-theme` to `~/.zshrc` on the machine without + Internet access: ```zsh - source ~/powerlevel10k/powerlevel10k.zsh-theme - unset ZSH_THEME + echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc + ``` +5. If `~/.zshrc` on the machine without Internet access sets `ZSH_THEME`, remove that line. + ```zsh + sed -i.bak '/^ZSH_THEME=/d' ~/.zshrc ``` To update, remove `~/powerlevel10k` on both machines and repeat steps 1-3. From feaf120ddc25279d6efa52ef4aecb7d14504064f Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 11 Nov 2020 07:04:02 +0100 Subject: [PATCH 202/659] replace `>>!` with `>>`; the former does not work in non-zsh shells; users who set noclobber presumably know how to deal with errors from this option --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c58a4a87..a89a94c5 100644 --- a/README.md +++ b/README.md @@ -348,7 +348,7 @@ Powerlevel10k. ```zsh git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k -echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc +echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc ``` Users in mainland China can use the official mirror on gitee.com for faster download.
@@ -356,7 +356,7 @@ Users in mainland China can use the official mirror on gitee.com for faster down ```zsh git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ~/powerlevel10k -echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc +echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc ``` This is the simplest kind of installation and it works even if you are using a plugin manager. Just @@ -421,14 +421,14 @@ supported by Powerlevel10k. ```zsh brew install romkatv/powerlevel10k/powerlevel10k -echo 'source /usr/local/opt/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc +echo 'source /usr/local/opt/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc ``` ### Arch Linux ```zsh yay -S --noconfirm zsh-theme-powerlevel10k-git -echo 'source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc +echo 'source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc ``` [zsh-theme-powerlevel10k-git](https://aur.archlinux.org/packages/zsh-theme-powerlevel10k-git/) @@ -1519,7 +1519,7 @@ theme (so that you end up with no theme) and then installing Powerlevel10k manua ```zsh git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k -echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc +echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc ``` This method of installation won't make anything slower or otherwise sub-par. From 8488f7c75c34b7cd1d0f2868dc674197b74aede3 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 15 Nov 2020 09:19:25 +0100 Subject: [PATCH 203/659] set P9K_PROMPT=transient for the duration of zle-line-finish (#1105) --- internal/p10k.zsh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 845bd970..d91519e3 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3934,7 +3934,8 @@ function _p9k_vcs_resume() { } function _p9k_vcs_gitstatus() { - if [[ $_p9k__refresh_reason == precmd ]]; then + if [[ $_p9k__refresh_reason == precmd ]] && (( !_p9k__vcs_called )); then + typeset -gi _p9k__vcs_called=1 if (( $+_p9k__gitstatus_next_dir )); then _p9k__gitstatus_next_dir=$_p9k__cwd_a else @@ -5597,6 +5598,8 @@ _p9k_prompt_net_iface_sync() { } function _p9k_set_prompt() { + local -i _p9k__vcs_called + PROMPT= RPROMPT= [[ $1 == instant_ ]] || PROMPT+='${$((_p9k_on_expand()))+}' @@ -7368,6 +7371,8 @@ function _p9k_on_widget_zle-line-init() { function _p9k_on_widget_zle-line-finish() { (( $+_p9k__line_finished )) && return + local P9K_PROMPT=transient + _p9k__line_finished= (( _p9k_reset_on_line_finish )) && __p9k_reset_state=2 (( $+functions[p10k-on-post-prompt] )) && p10k-on-post-prompt From f8ae544e6eca57177e471a08d076558e46060084 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 15 Nov 2020 09:41:55 +0100 Subject: [PATCH 204/659] properly restore prompt after SIGINT when transient prompt is disabled --- internal/p10k.zsh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index d91519e3..78b3b3fb 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7388,14 +7388,15 @@ function _p9k_on_widget_zle-line-finish() { fi fi - if (( __p9k_reset_state == 2 )); then - if [[ $1 == int ]]; then - _p9k__must_restore_prompt=1 - if (( !_p9k__restore_prompt_fd )); then - sysopen -o cloexec -ru _p9k__restore_prompt_fd /dev/null - zle -F $_p9k__restore_prompt_fd _p9k_restore_prompt - fi + if [[ $1 == int ]]; then + _p9k__must_restore_prompt=1 + if (( !_p9k__restore_prompt_fd )); then + sysopen -o cloexec -ru _p9k__restore_prompt_fd /dev/null + zle -F $_p9k__restore_prompt_fd _p9k_restore_prompt fi + fi + + if (( __p9k_reset_state == 2 )); then if (( optimized )); then RPROMPT= PROMPT=$_p9k_transient_prompt _p9k_reset_prompt else From 09be56bb532d61420c6eb2292874fcd00246a15f Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 15 Nov 2020 11:05:31 +0100 Subject: [PATCH 205/659] fix a bug introduced in 8488f7c (#1107) --- internal/p10k.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 78b3b3fb..f1534e7f 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6634,6 +6634,7 @@ _p9k_precmd_impl() { local -F start_time=EPOCHREALTIME unset _p9k__vcs unset _p9k__vcs_timeout + local -i _p9k__vcs_called _p9k_vcs_gitstatus local -i fast_vcs=1 fi From 7969eb3f1881c06cf1749f5eab5dedae122bc5eb Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 16 Nov 2020 09:02:31 +0100 Subject: [PATCH 206/659] retain instant prompt and state dumps when TERM or TERM_PROGRAM change (#1098) --- internal/p10k.zsh | 122 +++++++++++++++++++++++----------------------- 1 file changed, 62 insertions(+), 60 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index f1534e7f..acbbbfd1 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5758,7 +5758,7 @@ _p9k_set_instant_prompt() { [[ -n $RPROMPT ]] || unset RPROMPT } -typeset -gri __p9k_instant_prompt_version=37 +typeset -gri __p9k_instant_prompt_version=38 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -5774,7 +5774,7 @@ _p9k_dump_instant_prompt() { local -i fd sysopen -a -m 600 -o creat,trunc -u fd -- $tmp || return { - [[ $TERM_PROGRAM == Hyper ]] && local hyper='==' || local hyper='!=' + [[ $TERM == (screen*|tmux*) ]] && local screen='-n' || local screen='-z' local -a display_v=("${_p9k__display_v[@]}") local -i i for ((i = 6; i <= $#display_v; i+=2)); do display_v[i]=show; done @@ -5785,14 +5785,16 @@ _p9k_dump_instant_prompt() { if [[ -r $gitstatus_dir/install.info ]]; then IFS= read -r gitstatus_header <$gitstatus_dir/install.info || return fi + >&$fd print -r -- '[[ -t 0 && -t 1 && -t 2 && -o interactive && -o zle && -o no_xtrace ]] && + ! (( ${+__p9k_instant_prompt_disabled} || ZSH_SUBSHELL || ${+ZSH_SCRIPT} || ${+ZSH_EXECUTION_STRING} )) || return 0' >&$fd print -r -- "() { $__p9k_intro_no_locale - (( ! \$+__p9k_instant_prompt_disabled )) || return - typeset -gi __p9k_instant_prompt_disabled=1 __p9k_instant_prompt_sourced=$__p9k_instant_prompt_version + typeset -gi __p9k_instant_prompt_disabled=1 [[ \$ZSH_VERSION == ${(q)ZSH_VERSION} && \$ZSH_PATCHLEVEL == ${(q)ZSH_PATCHLEVEL} && - \$TERM_PROGRAM $hyper 'Hyper' && \$+VTE_VERSION == $+VTE_VERSION && \$TERM == ${(q)TERM} && + $screen \${(M)TERM:#(screen*|tmux*)} && + \${#\${(M)VTE_VERSION:#(<1-4602>|4801)}} == ${#${(M)VTE_VERSION:#(<1-4602>|4801)}} && \$POWERLEVEL9K_DISABLE_INSTANT_PROMPT != 'true' && - \$POWERLEVEL9K_INSTANT_PROMPT != 'off' ]] || { __p9k_instant_prompt_sourced=0; return 1; } + \$POWERLEVEL9K_INSTANT_PROMPT != 'off' ]] || return typeset -g __p9k_instant_prompt_param_sig=${(q+)_p9k__param_sig} local gitstatus_dir=${(q)gitstatus_dir} local gitstatus_header=${(q)gitstatus_header} @@ -5808,12 +5810,7 @@ _p9k_dump_instant_prompt() { if [[ -r $gitstatus_dir/install.info ]]; then IFS= read -r real_gitstatus_header <$gitstatus_dir/install.info || real_gitstatus_header=borked fi - if [[ $real_gitstatus_header != $gitstatus_header ]]; then - __p9k_instant_prompt_sourced=0 - return 1 - fi - [[ $ZSH_SUBSHELL == 0 && -z $ZSH_SCRIPT && -z $ZSH_EXECUTION_STRING && - -t 0 && -t 1 && -t 2 && -o interactive && -o zle && -o no_xtrace ]] || return + [[ $real_gitstatus_header == $gitstatus_header ]] || return zmodload zsh/langinfo zsh/terminfo zsh/system || return if [[ $langinfo[CODESET] != (utf|UTF)(-|)8 ]]; then local loc_cmd=$commands[locale] @@ -5833,9 +5830,16 @@ _p9k_dump_instant_prompt() { local prompt_file=$prompt_dir/prompt-${#pwd} local key=$pwd:$ssh:${(%):-%#} local content + if [[ ! -e $prompt_file ]]; then + typeset -gi __p9k_instant_prompt_sourced='$__p9k_instant_prompt_version' + return 1 + fi { content="$(<$prompt_file)" } 2>/dev/null || return local tail=${content##*$rs$key$us} - [[ ${#tail} != ${#content} ]] || return + if (( ${#tail} == ${#content} )); then + typeset -gi __p9k_instant_prompt_sourced='$__p9k_instant_prompt_version' + return 1 + fi local P9K_PROMPT=instant if [[ -z $P9K_TTY || $P9K_TTY == old && -n ${_P9K_TTY:#$TTY} ]]; then' if (( _POWERLEVEL9K_NEW_TTY_MAX_AGE_SECONDS < 0 )); then @@ -5962,37 +5966,36 @@ _p9k_dump_instant_prompt() { fi >&$fd print -r -- ' trap "unset -m _p9k__\*; unfunction p10k" EXIT - local -a _p9k_t=("${(@ps:$us:)${tail%%$rs*}}")' - if [[ $+VTE_VERSION == 1 || $TERM_PROGRAM == Hyper ]]; then - if [[ $TERM_PROGRAM == Hyper ]]; then - local bad_lines=40 bad_columns=100 - else - local bad_lines=24 bad_columns=80 - fi - >&$fd print -r -- ' - if (( LINES == '$bad_lines' && COLUMNS == '$bad_columns' )); then - zmodload -F zsh/stat b:zstat || return - zmodload zsh/datetime || return - local -a tty_ctime - if ! zstat -A tty_ctime +ctime -- $TTY 2>/dev/null || (( tty_ctime[1] + 2 > EPOCHREALTIME )); then - local -F deadline=$((EPOCHREALTIME+0.025)) - local tty_size - while true; do - if (( EPOCHREALTIME > deadline )) || ! tty_size="$(/bin/stty size 2>/dev/null)" || [[ $tty_size != <->" "<-> ]]; then - (( $+_p9k__ruler_i )) || local -i _p9k__ruler_i=1 - local _p9k__g= _p9k__'$#_p9k_line_segments_right'r= _p9k__'$#_p9k_line_segments_right'r_frame= - break - fi - if [[ $tty_size != "'$bad_lines' '$bad_columns'" ]]; then - local lines_columns=(${=tty_size}) - local LINES=$lines_columns[1] - local COLUMNS=$lines_columns[2] - break - fi - done + local -a _p9k_t=("${(@ps:$us:)${tail%%$rs*}}") + if [[ $+VTE_VERSION == 1 || $TERM_PROGRAM == Hyper ]] && (( $+commands[stty] )); then + if [[ $TERM_PROGRAM == Hyper ]]; then + local bad_lines=40 bad_columns=100 + else + local bad_lines=24 bad_columns=80 + fi + if (( LINES == bad_lines && COLUMNS == bad_columns )); then + zmodload -F zsh/stat b:zstat || return + zmodload zsh/datetime || return + local -a tty_ctime + if ! zstat -A tty_ctime +ctime -- $TTY 2>/dev/null || (( tty_ctime[1] + 2 > EPOCHREALTIME )); then + local -F deadline=$((EPOCHREALTIME+0.025)) + local tty_size + while true; do + if (( EPOCHREALTIME > deadline )) || ! tty_size="$(command stty size 2>/dev/null)" || [[ $tty_size != <->" "<-> ]]; then + (( $+_p9k__ruler_i )) || local -i _p9k__ruler_i=1 + local _p9k__g= _p9k__'$#_p9k_line_segments_right'r= _p9k__'$#_p9k_line_segments_right'r_frame= + break + fi + if [[ $tty_size != "$bad_lines $bad_columns" ]]; then + local lines_columns=(${=tty_size}) + local LINES=$lines_columns[1] + local COLUMNS=$lines_columns[2] + break + fi + done + fi fi fi' - fi (( __p9k_ksh_arrays )) && >&$fd print -r -- ' setopt ksh_arrays' (( __p9k_sh_glob )) && >&$fd print -r -- ' setopt sh_glob' >&$fd print -r -- ' typeset -ga __p9k_used_instant_prompt=("${(@e)_p9k_t[-3,-1]}")' @@ -6017,15 +6020,13 @@ _p9k_dump_instant_prompt() { fi _p9k__ret=$x } - local out' - [[ $+VTE_VERSION == 1 || $TERM_PROGRAM == Hyper ]] && >&$fd print -r -- ' if (( ! $+_p9k__g )); then' - >&$fd print -r -- ' - 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}"' - [[ $+VTE_VERSION == 1 || $TERM_PROGRAM == Hyper ]] && >&$fd print -r -- ' fi' - >&$fd print -r -- ' + local out + if [[ $+VTE_VERSION == 0 && $TERM_PROGRAM != Hyper ]] || (( ! $+_p9k__g )); 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}" + fi out+="${(pl.$height..$lf.)}$esc${height}A$terminfo[sc]" out+=${(%):-"$__p9k_used_instant_prompt[1]$__p9k_used_instant_prompt[2]"} if [[ -n $__p9k_used_instant_prompt[3] ]]; then @@ -6094,7 +6095,8 @@ _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 || 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 { exec {fd}>&- } @@ -7936,11 +7938,11 @@ _p9k_must_init() { _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' _p9k__param_pat+=$'$__p9k_sh_glob\1$__p9k_ksh_arrays\1$ITERM_SHELL_INTEGRATION_INSTALLED\1' - _p9k__param_pat+=$'${PROMPT_EOL_MARK-%B%S%#%s%b}\1$commands[locale]\1$langinfo[CODESET]\1' - _p9k__param_pat+=$'$VTE_VERSION\1$TERM_PROGRAM\1$DEFAULT_USER\1$P9K_SSH\1$commands[uname]\1' + _p9k__param_pat+=$'${PROMPT_EOL_MARK-%B%S%#%s%b}\1$+commands[locale]\1$langinfo[CODESET]\1' + _p9k__param_pat+=$'${(M)VTE_VERSION:#(<1-4602>|4801)}\1$DEFAULT_USER\1$P9K_SSH\1$+commands[uname]\1' _p9k__param_pat+=$'$__p9k_root_dir\1$functions[p10k-on-init]\1$functions[p10k-on-pre-prompt]\1' _p9k__param_pat+=$'$functions[p10k-on-post-widget]\1$functions[p10k-on-post-prompt]\1' - _p9k__param_pat+=$'$+commands[git]\1$terminfo[colors]\1$TERM' + _p9k__param_pat+=$'$+commands[git]\1$terminfo[colors]' local MATCH IFS=$'\1' _p9k__param_pat+="${(@)${(@o)parameters[(I)POWERLEVEL9K_*]}:/(#m)*/\${${(q)MATCH}-$IFS\}}" IFS=$'\2' _p9k__param_sig="${(e)_p9k__param_pat}" @@ -8357,6 +8359,11 @@ _p9k_init() { _p9k_dumped_instant_prompt_sigs=() fi + if (( $+__p9k_instant_prompt_sourced && __p9k_instant_prompt_sourced != __p9k_instant_prompt_version )); then + _p9k_delete_instant_prompt + _p9k_dumped_instant_prompt_sigs=() + fi + if (( $+__p9k_instant_prompt_erased )); then unset __p9k_instant_prompt_erased { @@ -8832,10 +8839,5 @@ 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 -if [[ $+__p9k_instant_prompt_sourced == 1 && $__p9k_instant_prompt_sourced != $__p9k_instant_prompt_version ]]; then - _p9k_delete_instant_prompt - zf_rm -f -- $__p9k_dump_file{,.zwc} 2>/dev/null -fi - _p9k_init_ssh prompt_powerlevel9k_setup From b7167a64c60401b184346147d8297f3803f56e06 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 17 Nov 2020 08:32:05 +0100 Subject: [PATCH 207/659] Squashed 'gitstatus/' changes from 4f9746fb..f9acc15a f9acc15a use gitstatusd-darwin-x86_64 binary on darwin-aarch64 (#188) git-subtree-dir: gitstatus git-subtree-split: f9acc15a3aa224206c4eba0e4a26b5d3c00325be --- install.info | 1 + 1 file changed, 1 insertion(+) diff --git a/install.info b/install.info index 770fb44e..6f598962 100644 --- a/install.info +++ b/install.info @@ -25,6 +25,7 @@ uname_s_glob="msys_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_ # 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="darwin"; uname_m_glob="aarch64"; file="gitstatusd-${uname_s}-x86_64"; version="v1.3.1"; sha256="26d582fe9a0b2090c28e84e5e32a6d42d6988cedff51e41ec5f789512c53b0fc"; 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"; From 790f4719ab3db8d62f8dec6fbb89a91d87e81df0 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 17 Nov 2020 10:02:15 +0100 Subject: [PATCH 208/659] Squashed 'gitstatus/' changes from f9acc15a..cb363c77 cb363c77 build: use zsh if possible when langued with bash < 4.0 (#188) efb0fd1b make mbuild work with darwin-aarch64 c9e6e608 do not hardcode path to homebrew, retrieve it with `brew --prefix` df4eba94 work around bugs in ancient versions of bash (#188) git-subtree-dir: gitstatus git-subtree-split: cb363c778a37575b0d5371d7e355d80ec7ae5498 --- build | 15 +++++++++++---- mbuild | 7 ++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/build b/build index 8db1cd14..cbd8ce1f 100755 --- a/build +++ b/build @@ -11,6 +11,12 @@ fi export LC_ALL=C +if [ -z "${ZSH_VERSION-}" ] && command -v zsh >/dev/null 2>&1; then + case "${BASH_VERSION-}" in + [0-3].*) exec zsh "$0" "$@";; + esac +fi + usage="$(command cat <<\END Usage: build [-m ARCH] [-c CPU] [-d CMD] [-i IMAGE] [-s] [-w] @@ -29,7 +35,7 @@ Options: succeed; on some operating systems this option is not supported; on others it can have partial effect -w automatically download tarballs for dependencies if they - don't already exist in ./deps; dependencies are described + do not already exist in ./deps; dependencies are described in ./build.info END )" @@ -159,10 +165,11 @@ case "$gitstatus_kernel" in ;; darwin) command mkdir -- "$workdir"/lib - command ln -s -- /usr/local/opt/libiconv/lib/libiconv.a "$workdir"/lib + brew_prefix="$(command brew --prefix)" + command ln -s -- "$brew_prefix"/opt/libiconv/lib/libiconv.a "$workdir"/lib libgit2_cmake_flags="$libgit2_cmake_flags -DUSE_ICONV=ON" - libgit2_cflags="$libgit2_cflags -I/usr/local/opt/libiconv/include" - gitstatus_cxxflags="$gitstatus_cxxflags -I/usr/local/opt/libiconv/include" + libgit2_cflags="$libgit2_cflags -I"$brew_prefix"/opt/libiconv/include" + gitstatus_cxxflags="$gitstatus_cxxflags -I"$brew_prefix"/opt/libiconv/include" gitstatus_ldlibs="$gitstatus_ldlibs -liconv" gitstatus_ldflags="$gitstatus_ldflags -L${workdir}/lib" libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=OFF" diff --git a/mbuild b/mbuild index 7d98b1fb..b6f220e0 100755 --- a/mbuild +++ b/mbuild @@ -181,9 +181,10 @@ local build=' function build-unix() { local intro flags=(-sw) case $2 in - linux-ppc64le);; - linux-*) flags+=(-d docker);; - darwin-*) intro='PATH="/usr/local/bin:$PATH"';; + linux-ppc64le) ;; + linux-*) flags+=(-d docker);; + darwin-aarch64) intro='PATH="/opt/homebrew/bin:$PATH"';; + darwin-*) intro='PATH="/usr/local/bin:$PATH"';; esac ssh $1 -- /bin/sh -uex <<<" $intro From 28301be914dec6da5d1bbd21cd8511cd71b419ee Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 17 Nov 2020 12:42:57 +0100 Subject: [PATCH 209/659] Squashed 'gitstatus/' changes from cb363c77..90cbb46b 90cbb46b s/darwin-aarch64/darwin-arm64/ (#188) git-subtree-dir: gitstatus git-subtree-split: 90cbb46b7b185dc95ab96301ec49754f7e801395 --- install.info | 2 +- mbuild | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/install.info b/install.info index 6f598962..2f9c2e2f 100644 --- a/install.info +++ b/install.info @@ -25,7 +25,7 @@ uname_s_glob="msys_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_ # 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="darwin"; uname_m_glob="aarch64"; file="gitstatusd-${uname_s}-x86_64"; version="v1.3.1"; sha256="26d582fe9a0b2090c28e84e5e32a6d42d6988cedff51e41ec5f789512c53b0fc"; +uname_s_glob="darwin"; uname_m_glob="arm64"; file="gitstatusd-${uname_s}-x86_64"; version="v1.3.1"; sha256="26d582fe9a0b2090c28e84e5e32a6d42d6988cedff51e41ec5f789512c53b0fc"; 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"; diff --git a/mbuild b/mbuild index b6f220e0..02408802 100755 --- a/mbuild +++ b/mbuild @@ -181,10 +181,10 @@ local build=' function build-unix() { local intro flags=(-sw) case $2 in - linux-ppc64le) ;; - linux-*) flags+=(-d docker);; - darwin-aarch64) intro='PATH="/opt/homebrew/bin:$PATH"';; - darwin-*) intro='PATH="/usr/local/bin:$PATH"';; + linux-ppc64le) ;; + linux-*) flags+=(-d docker);; + darwin-arm64) intro='PATH="/opt/homebrew/bin:$PATH"';; + darwin-*) intro='PATH="/usr/local/bin:$PATH"';; esac ssh $1 -- /bin/sh -uex <<<" $intro From 31ede3c1d348783239dbce37ae4123ae439d99a8 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Mon, 23 Nov 2020 02:02:27 +0800 Subject: [PATCH 210/659] Correct some typos in zsh conf (#1119) --- 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 b7abae53..707a20c4 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -585,7 +585,7 @@ typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true # If set to non-empty value, hide tools unless there is a file matching the specified file pattern - # in the current directory, or its parent diretory, or its grandparent directory, and so on. + # in the current directory, or its parent directory, or its grandparent directory, and so on. # # Note: If this parameter is set to empty value, it won't hide tools. # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 8a4df8d1..137c1aa7 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -579,7 +579,7 @@ typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true # If set to non-empty value, hide tools unless there is a file matching the specified file pattern - # in the current directory, or its parent diretory, or its grandparent directory, and so on. + # in the current directory, or its parent directory, or its grandparent directory, and so on. # # Note: If this parameter is set to empty value, it won't hide tools. # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index ed6ce824..60397f98 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -579,7 +579,7 @@ typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true # If set to non-empty value, hide tools unless there is a file matching the specified file pattern - # in the current directory, or its parent diretory, or its grandparent directory, and so on. + # in the current directory, or its parent directory, or its grandparent directory, and so on. # # Note: If this parameter is set to empty value, it won't hide tools. # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 39e1261e..5ec2e4be 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -585,7 +585,7 @@ typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true # If set to non-empty value, hide tools unless there is a file matching the specified file pattern - # in the current directory, or its parent diretory, or its grandparent directory, and so on. + # in the current directory, or its parent directory, or its grandparent directory, and so on. # # Note: If this parameter is set to empty value, it won't hide tools. # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments. From 39cf063480f6a378dadc802c174e96112c38c0c0 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 24 Nov 2020 12:32:19 +0100 Subject: [PATCH 211/659] Squashed 'gitstatus/' changes from 90cbb46b..ae213c54 ae213c54 add "pkg" target to makefile a208375b comments cdeb063d Give ListDir() the same semantics on BSD as on Linux git-subtree-dir: gitstatus git-subtree-split: ae213c540dd6924d3fb153a0860276897c9ba6c8 --- Makefile | 5 +++++ src/arena.h | 4 ++-- src/dir.cc | 7 ++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index d665af1f..b217d24b 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ APPNAME ?= gitstatusd OBJDIR ?= obj CXX ?= g++ +ZSH ?= $(shell command -v zsh 2> /dev/null) VERSION ?= $(shell . ./build.info && printf "%s" "$$gitstatus_version") @@ -33,4 +34,8 @@ $(OBJDIR)/%.o: src/%.cc Makefile build.info | $(OBJDIR) clean: rm -rf -- $(OBJDIR) +pkg: + GITSTATUS_DAEMON= GITSTATUS_CACHE_DIR=$(PWD)/usrbin ./install -f + $(or $(ZSH),:) -fc 'for f in *.zsh install; do zcompile -R -- $$f.zwc $$f || exit; done' + -include $(OBJS:.o=.dep) diff --git a/src/arena.h b/src/arena.h index 0bad0bfa..569833ca 100644 --- a/src/arena.h +++ b/src/arena.h @@ -37,7 +37,7 @@ namespace gitstatus { // // // Donates a block to the arena. When the time comes, it'll be freed with // // free(p, size, userdata). -// void Donate(void* p, size_t size, void* userdata, void(*free)(void*, void*)); +// void Donate(void* p, size_t size, void* userdata, void(*free)(void*, size_t, void*)); class Arena { public: struct Options { @@ -62,7 +62,7 @@ class Arena { // // void* userdata; // void (*alloc)(size_t size, size_t alignment, void* userdata); - // void (*free)(size_t size, void* userdata); + // void (*free)(void* p, size_t size, void* userdata); }; // Requires: opt.min_block_size <= opt.max_block_size. diff --git a/src/dir.cc b/src/dir.cc index 1817e1d3..e7ce7141 100644 --- a/src/dir.cc +++ b/src/dir.cc @@ -211,14 +211,15 @@ 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) { - VERIFY((dir_fd = dup(dir_fd)) >= 0); + entries.clear(); + dir_fd = dup(dir_fd); + if (dir_fd < 0) return false; DIR* dir = fdopendir(dir_fd); if (!dir) { CHECK(!close(dir_fd)) << Errno(); - return -1; + return false; } ON_SCOPE_EXIT(&) { CHECK(!closedir(dir)) << Errno(); }; - entries.clear(); while (struct dirent* ent = (errno = 0, readdir(dir))) { if (Dots(ent->d_name)) continue; entries.push_back(DirenvConvert(arena, *ent, precompose_unicode)); From 139413f535ce9a4cbf36fb9507a17dc0b81bb4e1 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 24 Nov 2020 12:46:00 +0100 Subject: [PATCH 212/659] add Makefile --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..f78c379f --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +ZSH ?= $(shell command -v zsh 2> /dev/null) + +all: + +pkg: + cd gitstatus && $(MAKE) ZSH=$(ZSH) pkg && cd .. + $(or $(ZSH),:) -fc 'for f in *.zsh-theme internal/*.zsh; do zcompile -R -- $$f.zwc $$f || exit; done' From 98b96e06cc98ef2578adbf83ac4bb35a74485e8f Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 24 Nov 2020 12:46:19 +0100 Subject: [PATCH 213/659] Squashed 'gitstatus/' changes from ae213c54..313fa4f1 313fa4f1 make target pkg work with `make -C` git-subtree-dir: gitstatus git-subtree-split: 313fa4f1bfabe99a04027d0bdf6cbecff2e963c7 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b217d24b..a6e02a02 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ clean: rm -rf -- $(OBJDIR) pkg: - GITSTATUS_DAEMON= GITSTATUS_CACHE_DIR=$(PWD)/usrbin ./install -f + 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' -include $(OBJS:.o=.dep) From fb89173a4257e0cfe3bfc772bc0cdbccd61e3be0 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 25 Nov 2020 11:14:38 +0100 Subject: [PATCH 214/659] Squashed 'gitstatus/' changes from 313fa4f1..1dcba393 1dcba393 bash bindings: provide better diagnostic for the common errors in gitstatus_start 603fb2ce move the rosetta check to `install` 3829edac provide better diagnostic for the common errors in gitstatus_start e8c9d9cd propagate error messages from install to gitstatus_start; add a special diagnostic for rosetta2 git-subtree-dir: gitstatus git-subtree-split: 1dcba3930654c54976f112b96acf2ce23006d9e5 --- gitstatus.plugin.sh | 37 ++++++++---- gitstatus.plugin.zsh | 26 ++++++--- install | 133 +++++++++++++++++++++++++++++++++++++------ 3 files changed, 160 insertions(+), 36 deletions(-) diff --git a/gitstatus.plugin.sh b/gitstatus.plugin.sh index e0cd206d..61b81e6a 100644 --- a/gitstatus.plugin.sh +++ b/gitstatus.plugin.sh @@ -36,6 +36,17 @@ # -D Unless this option is specified, report zero staged, unstaged and conflicted # changes for repositories with bash.showDirtyState = false. function gitstatus_start() { + if [[ "$BASH_VERSION" < 4 ]]; then + >&2 printf 'gitstatus_start: need bash version >= 4.0, found %s\n' "$BASH_VERSION" + >&2 printf '\n' + >&2 printf 'To see the version of the current shell, type:\n' + >&2 printf '\n' + >&2 printf ' \033[32mecho\033[0m \033[33m"$BASH_VERSION"\033[0m\n' + >&2 printf '\n' + >&2 printf 'The output of `\033[32mbash\033[0m --version` may be different and is not relevant.\n' + return 1 + fi + unset OPTIND local opt timeout=5 max_dirty=-1 extra_flags local max_num_staged=1 max_num_unstaged=1 max_num_conflicted=1 max_num_untracked=1 @@ -69,7 +80,7 @@ function gitstatus_start() { local gitstatus_plugin_dir="$PWD" fi - local tmpdir req_fifo resp_fifo + local tmpdir req_fifo resp_fifo culprit function gitstatus_start_impl() { local log_level="${GITSTATUS_LOG_LEVEL:-}" @@ -137,7 +148,7 @@ function gitstatus_start() { } set -- -d "$gitstatus_plugin_dir" -s "$uname_s" -m "$uname_m" \ - -p "printf '.\036' >&$fd_out" -- _gitstatus_set_daemon + -p "printf '.\036' >&$fd_out" -e "$fd_out" -- _gitstatus_set_daemon [[ "${GITSTATUS_AUTO_INSTALL:-1}" -ne 0 ]] || set -- -n "$@" source "$gitstatus_plugin_dir"/install || return [[ -n "$_gitstatus_bash_daemon" ]] || return @@ -166,7 +177,7 @@ function gitstatus_start() { trap - ${sig[@]} case "$ret" in 0|129|130|131|137|141|143|159) - echo -nE $'bye\x1f0\x1e' >&"$fd_out" + echo -nE $'}bye\x1f0\x1e' >&"$fd_out" exit "$ret" ;; esac @@ -192,7 +203,7 @@ function gitstatus_start() { trap "trap - ${sig[*]}; kill $pid &>/dev/null" ${sig[@]} wait "$pid" trap - ${sig[@]} - echo -nE $'bye\x1f0\x1e' >&"$fd_out" + echo -nE $'}bye\x1f0\x1e' >&"$fd_out" ) & disown ) & disown } 0"$GITSTATUS_DAEMON_LOG" @@ -205,12 +216,15 @@ function gitstatus_start() { [[ "$GITSTATUS_DAEMON_PID" == [1-9]* ]] || return local reply - echo -nE $'hello\x1f\x1e' >&$_GITSTATUS_REQ_FD || return + echo -nE $'}hello\x1f\x1e' >&$_GITSTATUS_REQ_FD || return local dl= while true; do - IFS='' read -rd $'\x1e' -u $_GITSTATUS_RESP_FD -t "$timeout" reply || return - [[ "$reply" == $'hello\x1f0' ]] && break - [[ "$reply" == . ]] || return + reply= + if ! IFS='' read -rd $'\x1e' -u $_GITSTATUS_RESP_FD -t "$timeout" reply; then + culprit="$reply" + return 1 + fi + [[ "$reply" == $'}hello\x1f0' ]] && break if [[ -z "$dl" ]]; then dl=1 if [[ -t 2 ]]; then @@ -238,8 +252,11 @@ function gitstatus_start() { } if ! gitstatus_start_impl; then - echo "" >&2 - echo "gitstatus_start: failed to start gitstatusd" >&2 + >&2 printf '\n' + >&2 printf '[\033[31mERROR\033[0m]: gitstatus failed to initialize.\n' + if [[ -n "${culprit-}" ]]; then + >&2 printf '\n%s\n' "$culprit" + fi [[ -z "${req_fifo:-}" ]] || command rm -f "$req_fifo" [[ -z "${resp_fifo:-}" ]] || command rm -f "$resp_fifo" unset -f gitstatus_start_impl diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index 603e04d0..ca0fb311 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -404,8 +404,8 @@ function _gitstatus_daemon"${1:-}"() { local gitstatus_plugin_dir_var=_gitstatus_plugin_dir$fsuf local gitstatus_plugin_dir=${(P)gitstatus_plugin_dir_var} - builtin set -- -d $gitstatus_plugin_dir -s $uname_s -m $uname_m -p "printf . >&$pipe_fd" -- \ - _gitstatus_set_daemon$fsuf + builtin set -- -d $gitstatus_plugin_dir -s $uname_s -m $uname_m \ + -p "printf '\\001' >&$pipe_fd" -e $pipe_fd -- _gitstatus_set_daemon$fsuf [[ ${GITSTATUS_AUTO_INSTALL:-1} == (|-|+)<1-> ]] || builtin set -- -n "$@" builtin source $gitstatus_plugin_dir/install || return [[ -n $_gitstatus_zsh_daemon ]] || return @@ -542,7 +542,7 @@ function gitstatus_start"${1:-}"() { fi local -i lock_fd resp_fd stderr_fd - local file_prefix xtrace=/dev/null daemon_log=/dev/null + local file_prefix xtrace=/dev/null daemon_log=/dev/null culprit { if (( _GITSTATUS_STATE_$name )); then @@ -637,8 +637,8 @@ function gitstatus_start"${1:-}"() { [[ $req_fd == <1-> ]] || return typeset -gi _GITSTATUS_REQ_FD_$name=req_fd - print -nru $req_fd -- $'hello\x1f\x1e' || return - local expected=$'hello\x1f0\x1e' actual + print -nru $req_fd -- $'}hello\x1f\x1e' || return + local expected=$'}hello\x1f0\x1e' actual if (( $+functions[p10k] )) && [[ ! -t 1 && ! -t 0 ]]; then local -F deadline='EPOCHREALTIME + 4' else @@ -647,8 +647,15 @@ function gitstatus_start"${1:-}"() { while true; do [[ -t $resp_fd ]] sysread -s 1 -t $timeout -i $resp_fd actual || return - [[ $actual == h ]] && break - [[ $actual == . ]] || return + [[ $expected == $actual* ]] && break + if [[ $actual != $'\1' ]]; then + [[ -t $resp_fd ]] + while sysread -t $timeout -i $resp_fd 'actual[$#actual+1]'; do + [[ -t $resp_fd ]] + done + culprit=$actual + return 1 + fi (( EPOCHREALTIME < deadline )) && continue if (( deadline > 0 )); then deadline=0 @@ -747,7 +754,10 @@ function gitstatus_start"${1:-}"() { print -ru2 -- '' print -Pru2 -- '[%F{red}ERROR%f]: gitstatus failed to initialize.' print -ru2 -- '' - print -ru2 -- ' Your Git prompt may disappear or become slow.' + if [[ -n $culprit ]]; then + print -ru2 -- $culprit + return err + fi if [[ -s $xtrace ]]; then print -ru2 -- '' print -Pru2 -- " Zsh log (%U${xtrace//\%/%%}%u):" diff --git a/install b/install index 91a47205..0c103b8a 100755 --- a/install +++ b/install @@ -2,6 +2,45 @@ # # This script does not have a stable API. +_gitstatus_install_daemon_found() { + local installed="$1" + shift + + case "$daemon" in + *-darwin-x86_64);; + *) + [ $# = 0 ] || "$@" "$daemon" "$version" "$installed" + return + ;; + esac + + local cpu + if [ "$uname_sm" != 'darwin arm64' ] || + [ -e /Library/Apple/System/Library/LaunchDaemons/com.apple.oahd.plist ] || + [ ! -x /usr/sbin/softwareupdate ] || + ! cpu="$(/usr/sbin/sysctl -n machdep.cpu.brand_string)"; then + [ $# = 0 ] || "$@" "$daemon" "$version" "$installed" + return + fi + + case "$cpu" in + *Intel*);; + *) + [ $# = 0 ] || "$@" "$daemon" "$version" "$installed" + return + ;; + esac + + >&"$e" printf 'Please run the following command to install Rosetta:\n' + >&"$e" printf '\n' + >&"$e" printf ' \033[32m/usr/sbin/softwareupdate\033[0m --install-rosetta\n' + >&"$e" printf '\n' + >&"$e" printf 'See for details: \033[4mhttps://support.apple.com/en-us/HT211861\033[0m\n' + >&"$e" printf '\n' + >&"$e" printf 'Once Rosetta is installed, restart your shell.\n' + return 1 +} + _gitstatus_install_main() { if [ -n "${ZSH_VERSION:-}" ]; then emulate -L sh -o no_unset @@ -12,14 +51,14 @@ _gitstatus_install_main() { local argv1="$1" shift - local no_check= no_install= uname_s= uname_m= gitstatus_dir= dl_status= + local no_check= no_install= uname_s= uname_m= gitstatus_dir= dl_status= e= local opt= OPTARG= OPTIND=1 - while getopts ':s:m:d:p:fnh' opt "$@"; do + while getopts ':s:m:d:p:e:fnh' opt "$@"; do case "$opt" in h) command cat <<\END -Usage: install [-s KERNEL] [-m ARCH] [-d DIR] [-p CMD] [-f|-n] [-- CMD [ARG]...] +Usage: install [-s KERNEL] [-m ARCH] [-d DIR] [-p CMD] [-e ERRFD] [-f|-n] [-- CMD [ARG]...] If positional arguments are specified, call this on success: @@ -36,6 +75,7 @@ Options: -m ARCH use this instead of lowercase `uname -m` -d DIR use this instead of `dirname "$0"` -p CMD eval this every second while downloading gitstatusd + -e ERRFD write error messages to this file descriptor -f download gitstatusd even if there is one locally -n do not download gitstatusd (fail instead) END @@ -77,6 +117,17 @@ END fi dl_status="$OPTARG" ;; + e) + if [ -n "$e" ]; then + >&2 echo "[gitstatus] error: duplicate option: -$opt" + return 1 + fi + if [ -z "$OPTARG" ]; then + >&2 echo "[error] incorrect value of -$opt: $OPTARG" + return 1 + fi + e="$OPTARG" + ;; m) if [ -n "$uname_m" ]; then >&2 echo "[gitstatus] error: duplicate option: -$opt" @@ -107,6 +158,7 @@ END shift "$((OPTIND - 1))" + : "${e:=2}" : "${gitstatus_dir:=$argv1}" if [ -n "$no_check" -a -n "$no_install" ]; then @@ -144,7 +196,8 @@ END >&2 echo "[gitstatus] internal error: empty gitstatus_version in build.info" return 1 fi - [ $# = 0 ] || "$@" "$daemon" "$gitstatus_version" 0 + local version="$gitstatus_version" + _gitstatus_install_daemon_found 0 "$@" return fi fi @@ -184,7 +237,7 @@ END [ -e "$daemon" ] || daemon= fi if [ -n "$daemon" ]; then - [ $# = 0 ] || "$@" "$daemon" "$version" 0 + _gitstatus_install_daemon_found 0 "$@" return fi fi @@ -202,17 +255,59 @@ END >&2 echo "[gitstatus] error: GITSTATUS_CACHE_DIR is not absolute: $cache_dir" return 1 fi - [ -d "$cache_dir" ] || mkdir -p -- "$cache_dir" || return + if [ ! -d "$cache_dir" ] && ! mkdir -p -- "$cache_dir" || [ ! -w "$cache_dir" ]; then + local dir="$cache_dir" + while true; do + if [ -e "$dir" ]; then + if [ ! -d "$dir" ]; then + >&"$e" printf 'Not a directory: \033[4;31m%s\033[0m\n' "$dir" + >&"$e" printf '\n' + >&"$e" printf 'Delete it, then restart your shell.\n' + elif [ ! -w "$dir" ]; then + >&"$e" printf 'Directory is not writable: \033[4;31m%s\033[0m\n' "$dir" + >&"$e" printf '\n' + >&"$e" printf 'Make it writable, then restart your shell.\n' + fi + break + fi + if [ "$dir" = / ] || [ "$dir" = . ]; then + break + fi + dir="$(dirname -- "$dir")" + done + return 1 + fi local tmpdir if ! command -v mktemp >/dev/null 2>&1 || - ! tmpdir="$(command mktemp -d "${TMPDIR:-/tmp}"/gitstatus-install.XXXXXXXXXX)"; then + ! tmpdir="$(command mktemp -d "${TMPDIR:-/tmp}"/gitstatus-install.XXXXXXXXXX)"; then tmpdir="${TMPDIR:-/tmp}/gitstatus-install.tmp.$$" - mkdir -p -- "$tmpdir" || return + if ! mkdir -p -- "$tmpdir"; then + local dir="${TMPDIR:-/tmp}" + if [ -z "${TMPDIR:-}" ]; 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" + >&"$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" + >&"$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" + >&"$e" printf '\n' + >&"$e" printf 'Make it writable, then restart your shell.\n' + fi + return 1 + fi fi if ! command -v curl >/dev/null 2>&1 && ! command -v wget >/dev/null 2>&1; then - >&2 echo "[gitstatus] error: please install curl or wget" + >&"$e" printf 'Please install \033[32mcurl\033[0m or \033[32mwget\033[0m, then restart your shell.\n' return 1 fi @@ -363,10 +458,12 @@ END trap - $sig if [ -z "$n" ]; then - >&2 echo "[gitstatus] error: failed to download gitstatusd from any mirror" - >&2 echo "" - >&2 echo " 1. $url1" - >&2 echo " 2. $url2" + >&"$e" printf 'Failed to download \033[32m%s\033[0m from any mirror:\n' "$file" + >&"$e" printf '\n' + >&"$e" printf ' 1. \033[4m%s\033[0m\n' "$url1" + >&"$e" printf ' 2. \033[4m%s\033[0m\n' "$url2" + >&"$e" printf '\n' + >&"$e" printf 'Check your internet connection, then restart your shell.\n' exit 1 fi @@ -378,7 +475,7 @@ END tmpfile="$cache_dir"/gitstatusd.tmp.$$ fi - command mv -f -- "$tmpdir"/gitstatusd-* "$tmpfile" || exit + command mv -f -- "$tmpdir"/"$file" "$tmpfile" || exit command mv -f -- "$tmpfile" "$cache_dir"/"$file" && exit command rm -f -- "$cache_dir"/"$file" command mv -f -- "$tmpfile" "$cache_dir"/"$file" && exit @@ -390,13 +487,13 @@ END command rm -rf -- "$tmpdir" [ "$ret" = 0 ] || return - [ $# = 0 ] || "$@" "$daemon" "$version" 1 + _gitstatus_install_daemon_found 1 "$@" return done <"$gitstatus_dir"/install.info - >&2 echo "[gitstatus] error: no gitstatusd found for $uname_s $uname_m" - >&2 echo "" - >&2 echo "See: https://github.com/romkatv/gitstatus/blob/master/README.md#compiling" + >&"$e" printf 'There is no prebuilt \033[32mgitstatusd\033[0m for \033[1m%s\033[0m.\n' "$uname_s $uname_m" + >&"$e" printf '\n' + >&"$e" printf 'See: \033[4mhttps://github.com/romkatv/gitstatus#compiling\033[0m\n' return 1 } From 507018f07918d6fdde7f093a8134400c01ddba62 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 25 Nov 2020 11:52:44 +0100 Subject: [PATCH 215/659] docs: experiment with image dimensions --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a89a94c5..fd2a4153 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,10 @@ 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) +Powerlevel10k Configuration Wizard All styles except [Pure](#pure-compatibility) are functionally equivalent. They display the same information and differ only in presentation. From 685682da908a3f29ad6b4ed41e3cef31720a59a2 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 25 Nov 2020 12:09:55 +0100 Subject: [PATCH 216/659] Revert "docs: experiment with image dimensions" This reverts commit 507018f07918d6fdde7f093a8134400c01ddba62. --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fd2a4153..a89a94c5 100644 --- a/README.md +++ b/README.md @@ -42,10 +42,8 @@ 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 +![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. From 98a8ec6f31c1ba0be1b66cb592df76934c4eb3a4 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 25 Nov 2020 16:36:03 +0100 Subject: [PATCH 217/659] prompt_length cleanup --- internal/p10k.zsh | 22 ++++++++++------------ internal/wizard.zsh | 11 +++++------ 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index acbbbfd1..2e19eec4 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -300,20 +300,19 @@ function _p9k_upglob() { # _p9k_prompt_length '%F{red}abc' => 3 # _p9k_prompt_length $'%{a\b%Gb%}' => 1 function _p9k_prompt_length() { - local COLUMNS=1024 + local -i COLUMNS=1024 local -i x y=$#1 m if (( y )); then while (( ${${(%):-$1%$y(l.1.0)}[-1]} )); do x=y - (( y *= 2 )); + (( y *= 2 )) done - local xy while (( y > x + 1 )); do - m=$(( x + (y - x) / 2 )) - typeset ${${(%):-$1%$m(l.x.y)}[-1]}=$m + (( m = x + (y - x) / 2 )) + (( ${${(%):-$1%$m(l.x.y)}[-1]} = m )) done fi - _p9k__ret=$x + typeset -g _p9k__ret=$x } typeset -gr __p9k_byte_suffix=('B' 'K' 'M' 'G' 'T' 'P' 'E' 'Z' 'Y') @@ -6005,20 +6004,19 @@ _p9k_dump_instant_prompt() { (( height += ${#${__p9k_used_instant_prompt[1]//[^$lf]}} )) local _p9k__ret function _p9k_prompt_length() { - local COLUMNS=1024 + local -i COLUMNS=1024 local -i x y=$#1 m if (( y )); then while (( ${${(%):-$1%$y(l.1.0)}[-1]} )); do x=y - (( y *= 2 )); + (( y *= 2 )) done - local xy while (( y > x + 1 )); do - m=$(( x + (y - x) / 2 )) - typeset ${${(%):-$1%$m(l.x.y)}[-1]}=$m + (( m = x + (y - x) / 2 )) + (( ${${(%):-$1%$m(l.x.y)}[-1]} = m )) done fi - _p9k__ret=$x + typeset -g _p9k__ret=$x } local out if [[ $+VTE_VERSION == 0 && $TERM_PROGRAM != Hyper ]] || (( ! $+_p9k__g )); then diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 7562c2bc..39edc089 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -110,20 +110,19 @@ local -ra rainbow_right=( ) function prompt_length() { - local COLUMNS=1024 + local -i COLUMNS=1024 local -i x y=$#1 m if (( y )); then while (( ${${(%):-$1%$y(l.1.0)}[-1]} )); do x=y - (( y *= 2 )); + (( y *= 2 )) done - local xy while (( y > x + 1 )); do - m=$(( x + (y - x) / 2 )) - typeset ${${(%):-$1%$m(l.x.y)}[-1]}=$m + (( m = x + (y - x) / 2 )) + (( ${${(%):-$1%$m(l.x.y)}[-1]} = m )) done fi - REPLY=$x + typeset -g REPLY=$x } function print_prompt() { From 8db9836617c199a8589a750ef5eb700c6e0bf4d4 Mon Sep 17 00:00:00 2001 From: Ravinder Pal Singh Date: Wed, 25 Nov 2020 16:46:34 +0000 Subject: [PATCH 218/659] Added instructions for IntelliJ --- font.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/font.md b/font.md index cc69df80..9915b752 100644 --- a/font.md +++ b/font.md @@ -38,6 +38,8 @@ 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`. +- **IntelliJ**: Open *Intellij → Edit → Preferences* then go to *Editor → Color Scheme → Console Font*. + Select `Use console font instead of the default` and change the value of font 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`. - **GNOME Terminal** (the default Ubuntu terminal): Open *Terminal → Preferences* and click on the From ade5b86226646a78b9c7610312cf09aac08d0b65 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 25 Nov 2020 17:53:00 +0100 Subject: [PATCH 219/659] docs: s/Windows Terminal/Microsoft Terminal/ --- README.md | 2 +- font.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0f6c8272..fa47085c 100644 --- a/README.md +++ b/README.md @@ -551,7 +551,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`. -- **Windows Terminal** (the new thing): Open *Settings* (`Ctrl+,`), search for `fontFace` and set +- **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`. diff --git a/font.md b/font.md index 6d34dad4..bdf94014 100644 --- a/font.md +++ b/font.md @@ -49,7 +49,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`. -- **Windows Terminal** (the new thing): Open *Settings* (`Ctrl+,`), search for `fontFace` and set +- **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`. From 7cb7ee07be1bd2912af4773643d1ebc1d2520ae6 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 25 Nov 2020 17:55:01 +0100 Subject: [PATCH 220/659] docs: add missing colons --- README.md | 4 ++-- font.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fa47085c..155e4d48 100644 --- a/README.md +++ b/README.md @@ -536,7 +536,7 @@ applications on your system. Configure your terminal to use this font: - **iTerm2**: Open *iTerm2 → Preferences → Profiles → Text* and set *Font* to `MesloLGS NF`. Alternatively, type `p10k configure` and answer `Yes` when asked whether to install *Meslo Nerd Font*. -- **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 `module.exports.config` to `MesloLGS NF`. @@ -557,7 +557,7 @@ applications on your system. Configure your terminal to use this 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 +- **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* diff --git a/font.md b/font.md index bdf94014..96bb64dc 100644 --- a/font.md +++ b/font.md @@ -34,7 +34,7 @@ applications on your system. Configure your terminal to use this font: - **iTerm2**: Open *iTerm2 → Preferences → Profiles → Text* and set *Font* to `MesloLGS NF`. Alternatively, type `p10k configure` and answer `Yes` when asked whether to install *Meslo Nerd Font*. -- **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 `module.exports.config` to `MesloLGS NF`. @@ -55,7 +55,7 @@ applications on your system. Configure your terminal to use this 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 +- **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* From 4050729e483e5346f514ea0a052716fd48d4bfbf Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 26 Nov 2020 07:16:27 +0100 Subject: [PATCH 221/659] wizard: after installing the font on iTerm2, ask for system reboot if iTerm2 session restoration is enabled --- internal/wizard.zsh | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 39edc089..364a4705 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -563,14 +563,25 @@ function install_font() { print flowing +c "%2FMeslo Nerd Font%f" successfully installed. print -P "" - flowing +c Please "%Brestart iTerm2%b" for the changes to take effect. - print -P "" - flowing +c -i 5 " 1. Click" "%BiTerm2 → Quit iTerm2%b" or press "%B⌘ Q%b." - flowing +c -i 5 " 2. Open %BiTerm2%b." - print -P "" - flowing +c "It's" important to "%Brestart iTerm2%b" by following the instructions above. \ - "It's" "%Bnot enough%b" to close iTerm2 by clicking on the red circle. You must \ - click "%BiTerm2 → Quit iTerm2%b" or press "%B⌘ Q%b." + () { + local out + out=$(/usr/bin/defaults read 'Apple Global Domain' NSQuitAlwaysKeepsWindows 2>/dev/null) || return + [[ $out == 1 ]] || return + out="$(iterm_get OpenNoWindowsAtStartup 2>/dev/null)" || return + [[ $out == false ]] + } + if (( $? )); then + flowing +c Please "%Brestart iTerm2%b" for the changes to take effect. + print -P "" + flowing +c -i 5 " 1. Click" "%BiTerm2 → Quit iTerm2%b" or press "%B⌘ Q%b." + flowing +c -i 5 " 2. Open %BiTerm2%b." + print -P "" + flowing +c "It's" important to "%Brestart iTerm2%b" by following the instructions above. \ + "It's" "%Bnot enough%b" to close iTerm2 by clicking on the red circle. You must \ + click "%BiTerm2 → Quit iTerm2%b" or press "%B⌘ Q%b." + else + flowing +c Please "%Brestart your computer%b" for the changes to take effect. + fi while true; do sleep 60 2>/dev/null; done ;; esac From 622069e60f9573c714f482dd6c76858229f4732a Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 26 Nov 2020 07:59:45 +0100 Subject: [PATCH 222/659] Squashed 'gitstatus/' changes from 1dcba393..4211e33b 4211e33b bug fix: make install work in standalone mode git-subtree-dir: gitstatus git-subtree-split: 4211e33b0b9ed9ad41898eb5a2b4f6a4a37b1db2 --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index 0c103b8a..3b92daef 100755 --- a/install +++ b/install @@ -15,7 +15,7 @@ _gitstatus_install_daemon_found() { esac local cpu - if [ "$uname_sm" != 'darwin arm64' ] || + if [ "$uname_s" != darwin ] || [ "$uname_m" != arm64 ] || [ -e /Library/Apple/System/Library/LaunchDaemons/com.apple.oahd.plist ] || [ ! -x /usr/sbin/softwareupdate ] || ! cpu="$(/usr/sbin/sysctl -n machdep.cpu.brand_string)"; then From a7f417245dc21b666f5647c4a0d55a1f51fe6cac Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 26 Nov 2020 08:53:49 +0100 Subject: [PATCH 223/659] Squashed 'gitstatus/' changes from 4211e33b..e2276e72 e2276e72 install: fix the check for rosetta on darwin-arm64 git-subtree-dir: gitstatus git-subtree-split: e2276e729e0155391126ee4aa090aa38b345b9fd --- install | 43 ++++++++++++++----------------------------- 1 file changed, 14 insertions(+), 29 deletions(-) diff --git a/install b/install index 3b92daef..23501b9c 100755 --- a/install +++ b/install @@ -7,38 +7,23 @@ _gitstatus_install_daemon_found() { shift case "$daemon" in - *-darwin-x86_64);; - *) - [ $# = 0 ] || "$@" "$daemon" "$version" "$installed" - return + *-darwin-x86_64) + if [ "$uname_m" = arm64 ] && + [ ! -e /Library/Apple/System/Library/LaunchDaemons/com.apple.oahd.plist ] && + [ -x /usr/sbin/softwareupdate ]; then + >&"$e" printf 'Please run the following command to install Rosetta:\n' + >&"$e" printf '\n' + >&"$e" printf ' \033[32m/usr/sbin/softwareupdate\033[0m --install-rosetta\n' + >&"$e" printf '\n' + >&"$e" printf 'See for details: \033[4mhttps://support.apple.com/en-us/HT211861\033[0m\n' + >&"$e" printf '\n' + >&"$e" printf 'Once Rosetta is installed, restart your shell.\n' + return 1 + fi ;; esac - local cpu - if [ "$uname_s" != darwin ] || [ "$uname_m" != arm64 ] || - [ -e /Library/Apple/System/Library/LaunchDaemons/com.apple.oahd.plist ] || - [ ! -x /usr/sbin/softwareupdate ] || - ! cpu="$(/usr/sbin/sysctl -n machdep.cpu.brand_string)"; then - [ $# = 0 ] || "$@" "$daemon" "$version" "$installed" - return - fi - - case "$cpu" in - *Intel*);; - *) - [ $# = 0 ] || "$@" "$daemon" "$version" "$installed" - return - ;; - esac - - >&"$e" printf 'Please run the following command to install Rosetta:\n' - >&"$e" printf '\n' - >&"$e" printf ' \033[32m/usr/sbin/softwareupdate\033[0m --install-rosetta\n' - >&"$e" printf '\n' - >&"$e" printf 'See for details: \033[4mhttps://support.apple.com/en-us/HT211861\033[0m\n' - >&"$e" printf '\n' - >&"$e" printf 'Once Rosetta is installed, restart your shell.\n' - return 1 + [ $# = 0 ] || "$@" "$daemon" "$version" "$installed" } _gitstatus_install_main() { From 29759b7b0a83e08ce52dd240c9463f2c8090c416 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 26 Nov 2020 11:16:16 +0100 Subject: [PATCH 224/659] Squashed 'gitstatus/' changes from e2276e72..630915cc 630915cc don't allow overriding the path to zsh git-subtree-dir: gitstatus git-subtree-split: 630915ccb1700f1f880d25cb04da23bf68fc4293 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a6e02a02..0141dd90 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ APPNAME ?= gitstatusd OBJDIR ?= obj CXX ?= g++ -ZSH ?= $(shell command -v zsh 2> /dev/null) +ZSH := $(shell command -v zsh 2> /dev/null) VERSION ?= $(shell . ./build.info && printf "%s" "$$gitstatus_version") From ff79e502adf8eeec0fa775087f42d9679b10c5eb Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 26 Nov 2020 11:17:01 +0100 Subject: [PATCH 225/659] don't allow overriding the path to zsh --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f78c379f..2ba7c76d 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ -ZSH ?= $(shell command -v zsh 2> /dev/null) +ZSH := $(shell command -v zsh 2> /dev/null) all: pkg: - cd gitstatus && $(MAKE) ZSH=$(ZSH) pkg && cd .. + cd gitstatus && $(MAKE) pkg && cd .. $(or $(ZSH),:) -fc 'for f in *.zsh-theme internal/*.zsh; do zcompile -R -- $$f.zwc $$f || exit; done' From ecf1de25a4fcd5897a20f983f94b08823a55082e Mon Sep 17 00:00:00 2001 From: ratijas Date: Thu, 26 Nov 2020 13:51:39 +0300 Subject: [PATCH 226/659] Makefile: optimize recursive invocation (#1127) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2ba7c76d..116ae41d 100644 --- a/Makefile +++ b/Makefile @@ -3,5 +3,5 @@ ZSH := $(shell command -v zsh 2> /dev/null) all: pkg: - cd gitstatus && $(MAKE) pkg && cd .. + $(MAKE) -C gitstatus pkg $(or $(ZSH),:) -fc 'for f in *.zsh-theme internal/*.zsh; do zcompile -R -- $$f.zwc $$f || exit; done' From 96646e8b9c676a9f3302d27fd96e9343826afee3 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 26 Nov 2020 12:05:00 +0100 Subject: [PATCH 227/659] enable iterm2 shell integration when running in tmux in zsh4humans --- internal/p10k.zsh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 2e19eec4..08faac75 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6025,7 +6025,7 @@ _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 - out+="${(pl.$height..$lf.)}$esc${height}A$terminfo[sc]" + (( _z4h_can_save_restore_screen == 1 )) || out+="${(pl.$height..$lf.)}$esc${height}A$terminfo[sc]" 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]" @@ -6036,6 +6036,7 @@ _p9k_dump_instant_prompt() { out+="${(pl.$gap.. .)}${(%):-${__p9k_used_instant_prompt[3]}%b%k%f%s%u}$cr$esc${left_len}C" 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 @@ -7839,8 +7840,13 @@ _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_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\e%}' + _p9k_prompt_suffix_left+=$'%{\e]133;B\a\e%}' + fi fi if (( _POWERLEVEL9K_PROMPT_ADD_NEWLINE_COUNT > 0 )); then @@ -7931,7 +7937,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v109\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v110\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' @@ -8004,7 +8010,11 @@ 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_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 c7914c051d98492185d7c4f997b4f06c18f99d54 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 26 Nov 2020 13:21:57 +0100 Subject: [PATCH 228/659] remove spurious slashes from tmux bypass sequences --- internal/p10k.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 08faac75..e55f1d21 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7841,8 +7841,8 @@ _p9k_init_prompt() { if [[ $ITERM_SHELL_INTEGRATION_INSTALLED == Yes ]]; then if (( _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\\\\%}' + _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\e%}' _p9k_prompt_suffix_left+=$'%{\e]133;B\a\e%}' @@ -7937,7 +7937,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v110\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v111\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' @@ -8011,7 +8011,7 @@ function _p9k_init_cacheable() { _p9k_transient_prompt+=')%b%k%f%s%u ' if [[ $ITERM_SHELL_INTEGRATION_INSTALLED == Yes ]]; then if (( _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\\\\%}' + _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 From 2c3bcd8b5d301f469fd8095d32ab2dc18e254a8e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 28 Nov 2020 09:55:13 +0100 Subject: [PATCH 229/659] use tmux bypass in iterm2 integration only if _z4h_iterm_cmd is defined --- internal/p10k.zsh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index e55f1d21..6304bc1c 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7840,7 +7840,7 @@ _p9k_init_prompt() { fi if [[ $ITERM_SHELL_INTEGRATION_INSTALLED == Yes ]]; then - if (( _z4h_can_save_restore_screen == 1 )); then + 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 @@ -7946,7 +7946,8 @@ _p9k_must_init() { _p9k__param_pat+=$'${(M)VTE_VERSION:#(<1-4602>|4801)}\1$DEFAULT_USER\1$P9K_SSH\1$+commands[uname]\1' _p9k__param_pat+=$'$__p9k_root_dir\1$functions[p10k-on-init]\1$functions[p10k-on-pre-prompt]\1' _p9k__param_pat+=$'$functions[p10k-on-post-widget]\1$functions[p10k-on-post-prompt]\1' - _p9k__param_pat+=$'$+commands[git]\1$terminfo[colors]' + _p9k__param_pat+=$'$+commands[git]\1$terminfo[colors]\1${+_z4h_iterm_cmd}\1' + _p9k__param_pat+=$'$_z4h_can_save_restore_screen' local MATCH IFS=$'\1' _p9k__param_pat+="${(@)${(@o)parameters[(I)POWERLEVEL9K_*]}:/(#m)*/\${${(q)MATCH}-$IFS\}}" IFS=$'\2' _p9k__param_sig="${(e)_p9k__param_pat}" @@ -8010,7 +8011,7 @@ function _p9k_init_cacheable() { _p9k_transient_prompt+='${:-"'$_p9k__ret'"}' _p9k_transient_prompt+=')%b%k%f%s%u ' if [[ $ITERM_SHELL_INTEGRATION_INSTALLED == Yes ]]; then - if (( _z4h_can_save_restore_screen == 1 )); then + 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%}' From b90b36251dcaa170f6a6553fbbaf5d4f4dd1786a Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 2 Dec 2020 08:56:34 +0100 Subject: [PATCH 230/659] fix iterm2 integration when not using zsh4humans v5 (#192 and #1138) --- internal/p10k.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 6304bc1c..cd0a2196 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7844,8 +7844,8 @@ _p9k_init_prompt() { _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\e%}' - _p9k_prompt_suffix_left+=$'%{\e]133;B\a\e%}' + _p9k_prompt_prefix_left+=$'%{\e]133;A\a%}' + _p9k_prompt_suffix_left+=$'%{\e]133;B\a%}' fi fi @@ -7937,7 +7937,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v111\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v112\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 1d99a0bac3721f6d89ac23dfd97f6d30dc04a29e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 12 Dec 2020 09:42:41 +0100 Subject: [PATCH 231/659] wifi: recognize SSID with spaces (#1152) --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index cd0a2196..83091d0f 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5061,7 +5061,7 @@ _p9k_prompt_wifi_async() { lines=(${(f)"$(command iw dev $iface link)"}) || return 0 local -a match mbegin mend for line in $lines; do - if [[ $line == (#b)[[:space:]]#SSID:[[:space:]]##([^[:space:]]##) ]]; then + if [[ $line == (#b)[[:space:]]#SSID:[[:space:]]##(*) ]]; then ssid=$match[1] elif [[ $line == (#b)[[:space:]]#'tx bitrate:'[[:space:]]##([^[:space:]]##)' MBit/s'* ]]; then last_tx_rate=$match[1] From 439ce3ed4ee21e2f4dd9c5972ede8223c0780010 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 14 Dec 2020 08:01:00 +0100 Subject: [PATCH 232/659] dir: add _NON_EXISTENT similarly to _NON_WRITABLE (requires POWERLEVEL9K_DIR_SHOW_WRITABLE=v3) See #1160. --- config/p10k-classic.zsh | 25 ++++++++++++++++--------- config/p10k-lean-8colors.zsh | 25 ++++++++++++++++++------- config/p10k-lean.zsh | 25 ++++++++++++++++--------- config/p10k-rainbow.zsh | 26 +++++++++++++++++--------- internal/p10k.zsh | 16 ++++++++++++---- 5 files changed, 79 insertions(+), 38 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 707a20c4..d48bc21d 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -274,12 +274,12 @@ # 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 - # The default icon shown next to non-writable directories when POWERLEVEL9K_DIR_SHOW_WRITABLE is - # set to v2. + # The default icon shown next to non-writable and non-existent directories when + # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3. # typeset -g POWERLEVEL9K_LOCK_ICON='⭐' # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different @@ -292,8 +292,8 @@ # # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. # - # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v2 and the current directory is not writable, - # its class gets suffix _NOT_WRITABLE. + # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories + # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively. # # For example, given these settings: # @@ -302,8 +302,9 @@ # '~(|/*)' HOME '' # '*' DEFAULT '') # - # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with class - # WORK or WORK_NOT_WRITABLE. + # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one + # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or + # WORK_NON_EXISTENT. # # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an # option to define custom colors and icons for different directory classes. @@ -320,6 +321,12 @@ # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=103 # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=39 # + # # Styling for WORK_NON_EXISTENT. + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=31 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=103 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=39 + # # If a styling parameter isn't explicitly defined for some class, it falls back to the classless # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls # back to POWERLEVEL9K_DIR_FOREGROUND. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 137c1aa7..34eac1f6 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -272,8 +272,12 @@ # POWERLEVEL9K_DIR_CLASSES below. typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v2 - # The default icon shown next to non-writable directories when POWERLEVEL9K_DIR_SHOW_WRITABLE is - # set to 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 + + # The default icon shown next to non-writable and non-existent directories when + # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3. # typeset -g POWERLEVEL9K_LOCK_ICON='⭐' # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different @@ -286,8 +290,8 @@ # # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. # - # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v2 and the current directory is not writable, - # its class gets suffix _NOT_WRITABLE. + # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories + # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively. # # For example, given these settings: # @@ -296,8 +300,9 @@ # '~(|/*)' HOME '' # '*' DEFAULT '') # - # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with class - # WORK or WORK_NOT_WRITABLE. + # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one + # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or + # WORK_NON_EXISTENT. # # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an # option to define custom colors and icons for different directory classes. @@ -312,7 +317,13 @@ # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐' # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND=4 # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=4 - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=4# + # + # Styling for WORK_NON_EXISTENT. + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=4 # # If a styling parameter isn't explicitly defined for some class, it falls back to the classless # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 60397f98..06643c5e 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -268,12 +268,12 @@ # 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 - # The default icon shown next to non-writable directories when POWERLEVEL9K_DIR_SHOW_WRITABLE is - # set to v2. + # The default icon shown next to non-writable and non-existent directories when + # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3. # typeset -g POWERLEVEL9K_LOCK_ICON='⭐' # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different @@ -286,8 +286,8 @@ # # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. # - # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v2 and the current directory is not writable, - # its class gets suffix _NOT_WRITABLE. + # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories + # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively. # # For example, given these settings: # @@ -296,8 +296,9 @@ # '~(|/*)' HOME '' # '*' DEFAULT '') # - # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with class - # WORK or WORK_NOT_WRITABLE. + # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one + # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or + # WORK_NON_EXISTENT. # # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an # option to define custom colors and icons for different directory classes. @@ -314,6 +315,12 @@ # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=103 # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=39 # + # # Styling for WORK_NON_EXISTENT. + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=31 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=103 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=39 + # # If a styling parameter isn't explicitly defined for some class, it falls back to the classless # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls # back to POWERLEVEL9K_DIR_FOREGROUND. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 5ec2e4be..74150d3f 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -274,12 +274,12 @@ # 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 - # The default icon shown next to non-writable directories when POWERLEVEL9K_DIR_SHOW_WRITABLE is - # set to v2. + # The default icon shown next to non-writable and non-existent directories when + # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3. # typeset -g POWERLEVEL9K_LOCK_ICON='⭐' # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different @@ -292,8 +292,8 @@ # # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. # - # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v2 and the current directory is not writable, - # its class gets suffix _NOT_WRITABLE. + # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories + # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively. # # For example, given these settings: # @@ -302,8 +302,9 @@ # '~(|/*)' HOME '' # '*' DEFAULT '') # - # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with class - # WORK or WORK_NOT_WRITABLE. + # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one + # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or + # WORK_NON_EXISTENT. # # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an # option to define custom colors and icons for different directory classes. @@ -322,6 +323,13 @@ # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=250 # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=255 # + # # Styling for WORK_NON_EXISTENT. + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_BACKGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=254 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=250 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=255 + # # If a styling parameter isn't explicitly defined for some class, it falls back to the classless # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls # back to POWERLEVEL9K_DIR_FOREGROUND. diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 83091d0f..800168d0 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1901,8 +1901,12 @@ prompt_dir() { ;; esac - [[ $_POWERLEVEL9K_DIR_SHOW_WRITABLE != 0 && ! -w $_p9k__cwd ]] - local w=$? + # w=0: writable + # w=1: not writable + # w=2: does not exist + (( !_POWERLEVEL9K_DIR_SHOW_WRITABLE )) || [[ -w $_p9k__cwd ]] + local -i w=$? + (( w && _POWERLEVEL9K_DIR_SHOW_WRITABLE > 2 )) && [[ ! -e $_p9k__cwd ]] && w=2 if ! _p9k_cache_ephemeral_get $0 $_p9k__cwd $p $w $fake_first "${parts[@]}"; then local state=$0 local icon='' @@ -1914,9 +1918,11 @@ prompt_dir() { break fi done - if (( ! w )); then + if (( w )); then if (( _POWERLEVEL9K_DIR_SHOW_WRITABLE == 1 )); then state=${0}_NOT_WRITABLE + elif (( w == 2 )); then + state+=_NON_EXISTENT else state+=_NOT_WRITABLE fi @@ -2031,6 +2037,7 @@ prompt_dir() { (( expand )) && _p9k_prompt_length "${(e):-"\${\${_p9k__d::=0}+}$content"}" || _p9k__ret= _p9k_cache_ephemeral_set "$state" "$icon" "$expand" "$content" $_p9k__ret + typeset -p state >>/tmp/log fi if (( _p9k__cache_val[3] )); then @@ -7068,6 +7075,7 @@ _p9k_init_params() { case $_POWERLEVEL9K_DIR_SHOW_WRITABLE in true) _POWERLEVEL9K_DIR_SHOW_WRITABLE=1;; v2) _POWERLEVEL9K_DIR_SHOW_WRITABLE=2;; + v3) _POWERLEVEL9K_DIR_SHOW_WRITABLE=3;; *) _POWERLEVEL9K_DIR_SHOW_WRITABLE=0;; esac typeset -gi _POWERLEVEL9K_DIR_SHOW_WRITABLE @@ -7937,7 +7945,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v112\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v113\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 c14fe96b7c427d62db9f13b328044ca5e1d42c89 Mon Sep 17 00:00:00 2001 From: Josh Skidmore Date: Mon, 14 Dec 2020 12:18:23 -0500 Subject: [PATCH 233/659] remove accidental logging (#1161) --- internal/p10k.zsh | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 800168d0..883204e3 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -2037,7 +2037,6 @@ prompt_dir() { (( expand )) && _p9k_prompt_length "${(e):-"\${\${_p9k__d::=0}+}$content"}" || _p9k__ret= _p9k_cache_ephemeral_set "$state" "$icon" "$expand" "$content" $_p9k__ret - typeset -p state >>/tmp/log fi if (( _p9k__cache_val[3] )); then From e8afa806ce8a9baad76793768b44cf4338f3a129 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 16 Dec 2020 16:07:00 +0100 Subject: [PATCH 234/659] wizard: allow uppercase letters in choices --- internal/wizard.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 364a4705..83fbf07e 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -406,6 +406,7 @@ function ask() { fi typeset -g choice= if read -t1 -k choice; then + choice=${(L)choice} if [[ $choice == q ]]; then quit fi From fc854fa719cc0eb6026266f06aece3383d16625f Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 18 Dec 2020 08:40:26 +0100 Subject: [PATCH 235/659] fix a comment above POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION in lean style --- config/p10k-lean.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 06643c5e..050c7fc5 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -174,8 +174,8 @@ #################################[ os_icon: os identifier ]################################## # OS identifier color. typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND= - # Make the icon bold. - typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='${P9K_CONTENT}' + # Custom icon. + # typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐' ################################[ prompt_char: prompt symbol ]################################ # Green prompt symbol if the last command succeeded. From b9b3399b354e64bac631eb700cc4570d91fdb0da Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 18 Dec 2020 16:25:33 +0100 Subject: [PATCH 236/659] nordvpn: pick up nordvpnd.sock from the new location (changed with the latest nordvpn update); remove MISSING state; (#1167) --- internal/p10k.zsh | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 883204e3..c6cccdbf 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4593,7 +4593,7 @@ typeset -gra __p9k_nordvpn_tag=( function _p9k_fetch_nordvpn_status() { setopt err_return local REPLY - zsocket /run/nordvpnd.sock + zsocket $1 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' @@ -4669,21 +4669,29 @@ function _p9k_fetch_nordvpn_status() { # POWERLEVEL9K_NORDVPN_CONNECTING_BACKGROUND=cyan function prompt_nordvpn() { unset $__p9k_nordvpn_tag P9K_NORDVPN_COUNTRY_CODE - if [[ -e /run/nordvpnd.sock ]]; then - _p9k_fetch_nordvpn_status 2>/dev/null - if [[ $P9K_NORDVPN_SERVER == (#b)([[:alpha:]]##)[[:digit:]]##.nordvpn.com ]]; then - typeset -g P9K_NORDVPN_COUNTRY_CODE=${${(U)match[1]}//İ/I} - fi + 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 + if [[ $P9K_NORDVPN_SERVER == (#b)([[:alpha:]]##)[[:digit:]]##.nordvpn.com ]]; then + typeset -g P9K_NORDVPN_COUNTRY_CODE=${${(U)match[1]}//İ/I} fi case $P9K_NORDVPN_STATUS in Connected) - _p9k_prompt_segment $0_CONNECTED blue white NORDVPN_ICON 0 '' "$P9K_NORDVPN_COUNTRY_CODE";; + _p9k_prompt_segment $0_CONNECTED blue white NORDVPN_ICON 0 '' "$P9K_NORDVPN_COUNTRY_CODE" + ;; Disconnected|Connecting|Disconnecting) local state=${${(U)P9K_NORDVPN_STATUS}//İ/I} _p9k_get_icon $0_$state FAIL_ICON - _p9k_prompt_segment $0_$state yellow white NORDVPN_ICON 0 '' "$_p9k__ret";; + _p9k_prompt_segment $0_$state yellow white NORDVPN_ICON 0 '' "$_p9k__ret" + ;; *) - _p9k_prompt_segment $0_MISSING blue white '' 0 '' '';; + return + ;; esac } From 7a6eef4918c8db70219cacfb7d2d836229991c52 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 19 Dec 2020 08:46:09 +0100 Subject: [PATCH 237/659] docs: make `p10k configure` method of installing MesloLGS NF for iTerm2 more prominent --- README.md | 6 +++--- font.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 155e4d48..fa9059cc 100644 --- a/README.md +++ b/README.md @@ -533,9 +533,9 @@ Download these four ttf files: 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**: Open *iTerm2 → Preferences → Profiles → Text* and set *Font* to `MesloLGS NF`. - Alternatively, type `p10k configure` and answer `Yes` when asked whether to install - *Meslo Nerd 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 diff --git a/font.md b/font.md index 96bb64dc..a484e7e2 100644 --- a/font.md +++ b/font.md @@ -31,9 +31,9 @@ Download these four ttf files: 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**: Open *iTerm2 → Preferences → Profiles → Text* and set *Font* to `MesloLGS NF`. - Alternatively, type `p10k configure` and answer `Yes` when asked whether to install - *Meslo Nerd 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 From 4807bd8da28eae9d12a71abdaacf4a53cae1197d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 20 Dec 2020 07:33:10 +0100 Subject: [PATCH 238/659] doc cleanup --- README.md | 2 +- font.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fa9059cc..99617936 100644 --- a/README.md +++ b/README.md @@ -535,7 +535,7 @@ 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`. + `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 diff --git a/font.md b/font.md index a484e7e2..4d4f1092 100644 --- a/font.md +++ b/font.md @@ -33,7 +33,7 @@ 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`. + `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 From a5d0525c6a34b614a885ec6f1c3d8ff8ddfc9e45 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 20 Dec 2020 07:54:27 +0100 Subject: [PATCH 239/659] refactor my_git_formatter to make it easier to change it so that tag is always displayed --- config/p10k-classic.zsh | 40 +++++++++++++++++++++--------------- config/p10k-lean-8colors.zsh | 40 +++++++++++++++++++++--------------- config/p10k-lean.zsh | 40 +++++++++++++++++++++--------------- config/p10k-rainbow.zsh | 40 +++++++++++++++++++++--------------- 4 files changed, 96 insertions(+), 64 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index d48bc21d..2928baeb 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -379,29 +379,37 @@ fi local res - local where # branch or tag + if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then - res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}" - where=${(V)VCS_STATUS_LOCAL_BRANCH} - elif [[ -n $VCS_STATUS_TAG ]]; then - res+="${meta}#" - where=${(V)VCS_STATUS_TAG} + local branch=${(V)VCS_STATUS_LOCAL_BRANCH} + # If local branch name is at most 32 characters long, show it in full. + # Otherwise show the first 12 … the last 12. + # Tip: To always show local branch name in full without truncation, delete the next line. + (( $#branch > 32 )) && branch[13,-13]="…" # <-- this line + res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}" fi - # If local branch name or tag is at most 32 characters long, show it in full. - # Otherwise show the first 12 … the last 12. - # Tip: To always show local branch name in full without truncation, delete the next line. - (( $#where > 32 )) && where[13,-13]="…" + if [[ -n $VCS_STATUS_TAG + # Show tag only if not on a branch. + # Tip: To always show tag, delete the next line. + && -z $VCS_STATUS_LOCAL_BRANCH # <-- this line + ]]; then + local tag=${(V)VCS_STATUS_TAG} + # If tag name is at most 32 characters long, show it in full. + # Otherwise show the first 12 … the last 12. + # Tip: To always show tag name in full without truncation, delete the next line. + (( $#tag > 32 )) && tag[13,-13]="…" # <-- this line + res+="${meta}#${clean}${tag//\%/%%}" + fi - res+="${clean}${where//\%/%%}" # escape % - - # Display the current Git commit if there is no branch or tag. - # Tip: To always display the current Git commit, remove `[[ -z $where ]] &&` from the next line. - [[ -z $where ]] && res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" + # 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 + res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" # Show tracking branch name if it differs from local branch. if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then - res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" # escape % + res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" fi # ⇣42 if behind the remote. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 34eac1f6..9a6e286c 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -377,29 +377,37 @@ fi local res - local where # branch or tag + if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then - res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}" - where=${(V)VCS_STATUS_LOCAL_BRANCH} - elif [[ -n $VCS_STATUS_TAG ]]; then - res+="${meta}#" - where=${(V)VCS_STATUS_TAG} + local branch=${(V)VCS_STATUS_LOCAL_BRANCH} + # If local branch name is at most 32 characters long, show it in full. + # Otherwise show the first 12 … the last 12. + # Tip: To always show local branch name in full without truncation, delete the next line. + (( $#branch > 32 )) && branch[13,-13]="…" # <-- this line + res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}" fi - # If local branch name or tag is at most 32 characters long, show it in full. - # Otherwise show the first 12 … the last 12. - # Tip: To always show local branch name in full without truncation, delete the next line. - (( $#where > 32 )) && where[13,-13]="…" + if [[ -n $VCS_STATUS_TAG + # Show tag only if not on a branch. + # Tip: To always show tag, delete the next line. + && -z $VCS_STATUS_LOCAL_BRANCH # <-- this line + ]]; then + local tag=${(V)VCS_STATUS_TAG} + # If tag name is at most 32 characters long, show it in full. + # Otherwise show the first 12 … the last 12. + # Tip: To always show tag name in full without truncation, delete the next line. + (( $#tag > 32 )) && tag[13,-13]="…" # <-- this line + res+="${meta}#${clean}${tag//\%/%%}" + fi - res+="${clean}${where//\%/%%}" # escape % - - # Display the current Git commit if there is no branch or tag. - # Tip: To always display the current Git commit, remove `[[ -z $where ]] &&` from the next line. - [[ -z $where ]] && res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" + # 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 + res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" # Show tracking branch name if it differs from local branch. if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then - res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" # escape % + res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" fi # ⇣42 if behind the remote. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 050c7fc5..f08078dc 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -373,29 +373,37 @@ fi local res - local where # branch or tag + if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then - res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}" - where=${(V)VCS_STATUS_LOCAL_BRANCH} - elif [[ -n $VCS_STATUS_TAG ]]; then - res+="${meta}#" - where=${(V)VCS_STATUS_TAG} + local branch=${(V)VCS_STATUS_LOCAL_BRANCH} + # If local branch name is at most 32 characters long, show it in full. + # Otherwise show the first 12 … the last 12. + # Tip: To always show local branch name in full without truncation, delete the next line. + (( $#branch > 32 )) && branch[13,-13]="…" # <-- this line + res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}" fi - # If local branch name or tag is at most 32 characters long, show it in full. - # Otherwise show the first 12 … the last 12. - # Tip: To always show local branch name in full without truncation, delete the next line. - (( $#where > 32 )) && where[13,-13]="…" + if [[ -n $VCS_STATUS_TAG + # Show tag only if not on a branch. + # Tip: To always show tag, delete the next line. + && -z $VCS_STATUS_LOCAL_BRANCH # <-- this line + ]]; then + local tag=${(V)VCS_STATUS_TAG} + # If tag name is at most 32 characters long, show it in full. + # Otherwise show the first 12 … the last 12. + # Tip: To always show tag name in full without truncation, delete the next line. + (( $#tag > 32 )) && tag[13,-13]="…" # <-- this line + res+="${meta}#${clean}${tag//\%/%%}" + fi - res+="${clean}${where//\%/%%}" # escape % - - # Display the current Git commit if there is no branch or tag. - # Tip: To always display the current Git commit, remove `[[ -z $where ]] &&` from the next line. - [[ -z $where ]] && res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" + # 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 + res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" # Show tracking branch name if it differs from local branch. if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then - res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" # escape % + res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" fi # ⇣42 if behind the remote. diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 74150d3f..f1dca984 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -380,29 +380,37 @@ local conflicted='%1F' # red foreground local res - local where # branch or tag + if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then - res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}" - where=${(V)VCS_STATUS_LOCAL_BRANCH} - elif [[ -n $VCS_STATUS_TAG ]]; then - res+="${meta}#" - where=${(V)VCS_STATUS_TAG} + local branch=${(V)VCS_STATUS_LOCAL_BRANCH} + # If local branch name is at most 32 characters long, show it in full. + # Otherwise show the first 12 … the last 12. + # Tip: To always show local branch name in full without truncation, delete the next line. + (( $#branch > 32 )) && branch[13,-13]="…" # <-- this line + res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}" fi - # If local branch name or tag is at most 32 characters long, show it in full. - # Otherwise show the first 12 … the last 12. - # Tip: To always show local branch name in full without truncation, delete the next line. - (( $#where > 32 )) && where[13,-13]="…" + if [[ -n $VCS_STATUS_TAG + # Show tag only if not on a branch. + # Tip: To always show tag, delete the next line. + && -z $VCS_STATUS_LOCAL_BRANCH # <-- this line + ]]; then + local tag=${(V)VCS_STATUS_TAG} + # If tag name is at most 32 characters long, show it in full. + # Otherwise show the first 12 … the last 12. + # Tip: To always show tag name in full without truncation, delete the next line. + (( $#tag > 32 )) && tag[13,-13]="…" # <-- this line + res+="${meta}#${clean}${tag//\%/%%}" + fi - res+="${clean}${where//\%/%%}" # escape % - - # Display the current Git commit if there is no branch or tag. - # Tip: To always display the current Git commit, remove `[[ -z $where ]] &&` from the next line. - [[ -z $where ]] && res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" + # 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 + res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" # Show tracking branch name if it differs from local branch. if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then - res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" # escape % + res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" fi # ⇣42 if behind the remote. From 38a5492b5f123acf62b7bc0aa1c06a88a9aac2d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Gr=C3=A4fenstein?= Date: Sun, 20 Dec 2020 16:28:52 +0100 Subject: [PATCH 240/659] Remove trailing whitespace (#1173) --- README.md | 12 ++++++------ config/p10k-classic.zsh | 2 +- config/p10k-lean-8colors.zsh | 2 +- config/p10k-lean.zsh | 2 +- font.md | 8 ++++---- gitstatus/install | 4 ++-- internal/icons.zsh | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 99617936..a08a8c76 100644 --- a/README.md +++ b/README.md @@ -553,7 +553,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**: 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`. - **Termux**: Type `p10k configure` and answer `Yes` when asked whether to install *Meslo Nerd Font*. @@ -563,9 +563,9 @@ applications on your system. Configure your terminal to use this font: - **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*. +- **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*. - **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and add the following section to it: ```yaml @@ -1441,11 +1441,11 @@ From [Zsh documentation]( http://zsh.sourceforge.net/Doc/Release/Parameters.html#index-ZLE_005fRPROMPT_005fINDENT): > `ZLE_RPROMPT_INDENT ` -> +> > If set, used to give the indentation between the right hand side of the right prompt in the line > editor as given by `RPS1` or `RPROMPT` and the right hand side of the screen. If not set, the > value `1` is used. -> +> > Typically this will be used to set the value to `0` so that the prompt appears flush with the > right hand side of the screen. diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 2928baeb..7cc07437 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -828,7 +828,7 @@ ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]############## # Taskwarrior color. typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=74 - + # Taskwarrior segment format. The following parameters are available within the expansion. # # - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`. diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 9a6e286c..fc201ed9 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -809,7 +809,7 @@ ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]############## # Taskwarrior color. typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=6 - + # Taskwarrior segment format. The following parameters are available within the expansion. # # - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`. diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index f08078dc..152104e4 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -805,7 +805,7 @@ ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]############## # Taskwarrior color. typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=74 - + # Taskwarrior segment format. The following parameters are available within the expansion. # # - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`. diff --git a/font.md b/font.md index 4d4f1092..7baa23f6 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**: 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`. - **Termux**: Type `p10k configure` and answer `Yes` when asked whether to install *Meslo Nerd Font*. @@ -61,9 +61,9 @@ applications on your system. Configure your terminal to use this font: - **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*. +- **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*. - **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and add the following section to it: ```yaml diff --git a/gitstatus/install b/gitstatus/install index 23501b9c..1167e42f 100755 --- a/gitstatus/install +++ b/gitstatus/install @@ -386,9 +386,9 @@ END local trapped= trap 'trapped=1' $sig - fetch 1 "$url1" & + fetch 1 "$url1" & local pid1="$!" - fetch 2 "$url2" & + fetch 2 "$url2" & local pid2="$!" local die="trap - $sig; kill -- $pid1 $pid2 2>/dev/null; wait -- $pid1 $pid2 2>/dev/null; exit 1" diff --git a/internal/icons.zsh b/internal/icons.zsh index 719c03c4..532ab0a6 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -239,7 +239,7 @@ function _p9k_init_icons() { NORDVPN_ICON '\UF023' #  EXECUTION_TIME_ICON '\uF253'$s #  SSH_ICON 'ssh' - VPN_ICON '\uF023' + VPN_ICON '\uF023' KUBERNETES_ICON '\U2388' # ⎈ DROPBOX_ICON '\UF16B'$s #  DATE_ICON '\uF073 ' #  @@ -680,7 +680,7 @@ function _p9k_init_icons() { TEST_ICON '' TODO_ICON '\u2206' # ∆ BATTERY_ICON '\U1F50B' # 🔋 - DISK_ICON 'hdd' + DISK_ICON 'hdd' OK_ICON '\u2714' # ✔ FAIL_ICON '\u2718' # ✘ SYMFONY_ICON 'SF' From 033e01a272063f4e43e8abea2364fd5b1825aff4 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 21 Dec 2020 07:33:17 +0100 Subject: [PATCH 241/659] docs: more info about greyed out vcs --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a08a8c76..f46ce285 100644 --- a/README.md +++ b/README.md @@ -925,11 +925,25 @@ computation completes. When your current directory is within a Git repository, Powerlevel10k computes up-to-date Git status after every command. If the repository is large, or the machine is slow, this computation -can take quite a bit of time. If it takes longer than 20 milliseconds (configurable via +can take quite a bit of time. If it takes longer than 10 milliseconds (configurable via `POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS`), Powerlevel10k displays the last known Git status in 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 +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, +and change the value. + +```zsh +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) + ### How do I add username and/or hostname to prompt? When using Lean, Classic or Rainbow style, prompt shows `username@hostname` when you are logged in From 9609a835ca2eb3089e35269a05369833e9ec0ba2 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 21 Dec 2020 16:19:22 +0100 Subject: [PATCH 242/659] Squashed 'gitstatus/' changes from 630915cc..6d00edd0 6d00edd0 use a native binary on darwin-arm64 4994f160 add a build server for darwin-arm64 0e922813 invoke port with sudo 576571c7 support macports in addition to homebrew when building on macos b476570a remove trailing whitespace git-subtree-dir: gitstatus git-subtree-split: 6d00edd0bfd1d65a3cbcebfc6e679e8c43726acc --- build | 35 ++++++++++++++++++++++------------- install | 22 ++-------------------- install.info | 8 ++++---- mbuild | 7 ++++--- 4 files changed, 32 insertions(+), 40 deletions(-) diff --git a/build b/build index cbd8ce1f..ad1d1484 100755 --- a/build +++ b/build @@ -98,17 +98,20 @@ if [ -n "$gitstatus_install_tools" ]; then >&2 echo "[error] please run 'xcode-select --install' and retry" exit 1 fi - if ! command -v brew >/dev/null 2>&1; then - >&2 echo "[error] please install homebrew from https://brew.sh/ and retry" + if command -v port >/dev/null 2>&1; 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 + command brew upgrade "$formula" + else + command brew install "$formula" + fi + done + else + >&2 echo "[error] please install MacPorts or Homebrew and retry" exit 1 fi - for formula in libiconv cmake git wget; do - if command brew list "$formula" &>/dev/null; then - command brew upgrade "$formula" - else - command brew install "$formula" - fi - done ;; msys*|mingw*) command pacman -Syu --noconfirm @@ -165,11 +168,17 @@ case "$gitstatus_kernel" in ;; darwin) command mkdir -- "$workdir"/lib - brew_prefix="$(command brew --prefix)" - command ln -s -- "$brew_prefix"/opt/libiconv/lib/libiconv.a "$workdir"/lib + if [ -e /opt/local/lib/libiconv.a ]; then + command ln -s -- /opt/local/lib/libiconv.a "$workdir"/lib + libgit2_cflags="$libgit2_cflags -I/opt/local/include" + gitstatus_cxxflags="$gitstatus_cxxflags -I/opt/local/include" + else + brew_prefix="$(command brew --prefix)" + command ln -s -- "$brew_prefix"/opt/libiconv/lib/libiconv.a "$workdir"/lib + libgit2_cflags="$libgit2_cflags -I"$brew_prefix"/opt/libiconv/include" + gitstatus_cxxflags="$gitstatus_cxxflags -I"$brew_prefix"/opt/libiconv/include" + fi libgit2_cmake_flags="$libgit2_cmake_flags -DUSE_ICONV=ON" - libgit2_cflags="$libgit2_cflags -I"$brew_prefix"/opt/libiconv/include" - gitstatus_cxxflags="$gitstatus_cxxflags -I"$brew_prefix"/opt/libiconv/include" gitstatus_ldlibs="$gitstatus_ldlibs -liconv" gitstatus_ldflags="$gitstatus_ldflags -L${workdir}/lib" libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=OFF" diff --git a/install b/install index 23501b9c..86824ece 100755 --- a/install +++ b/install @@ -5,24 +5,6 @@ _gitstatus_install_daemon_found() { local installed="$1" shift - - case "$daemon" in - *-darwin-x86_64) - if [ "$uname_m" = arm64 ] && - [ ! -e /Library/Apple/System/Library/LaunchDaemons/com.apple.oahd.plist ] && - [ -x /usr/sbin/softwareupdate ]; then - >&"$e" printf 'Please run the following command to install Rosetta:\n' - >&"$e" printf '\n' - >&"$e" printf ' \033[32m/usr/sbin/softwareupdate\033[0m --install-rosetta\n' - >&"$e" printf '\n' - >&"$e" printf 'See for details: \033[4mhttps://support.apple.com/en-us/HT211861\033[0m\n' - >&"$e" printf '\n' - >&"$e" printf 'Once Rosetta is installed, restart your shell.\n' - return 1 - fi - ;; - esac - [ $# = 0 ] || "$@" "$daemon" "$version" "$installed" } @@ -386,9 +368,9 @@ END local trapped= trap 'trapped=1' $sig - fetch 1 "$url1" & + fetch 1 "$url1" & local pid1="$!" - fetch 2 "$url2" & + fetch 2 "$url2" & local pid2="$!" local die="trap - $sig; kill -- $pid1 $pid2 2>/dev/null; wait -- $pid1 $pid2 2>/dev/null; exit 1" diff --git a/install.info b/install.info index 2f9c2e2f..e71a03ef 100644 --- a/install.info +++ b/install.info @@ -1,15 +1,16 @@ -# 6a3d54a5a44abb4ee46ce72a8097389364746c6a +# 0 # # This file is used by ./install and indirectly by shell bindings. # # The first line is read by powerlevel10k instant prompt. It must # be updated whenever the content of this file changes. The actual -# value doesn't matter as long as it's unique. You can use the output -# of `git rev-parse HEAD`. +# value doesn't matter as long as it's unique. Consecutive integers +# 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"; @@ -25,7 +26,6 @@ uname_s_glob="msys_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_ # 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="darwin"; uname_m_glob="arm64"; file="gitstatusd-${uname_s}-x86_64"; version="v1.3.1"; sha256="26d582fe9a0b2090c28e84e5e32a6d42d6988cedff51e41ec5f789512c53b0fc"; 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"; diff --git a/mbuild b/mbuild index 02408802..608e3aba 100755 --- a/mbuild +++ b/mbuild @@ -5,7 +5,7 @@ # Usage: mbuild [-b git-ref] [kernel-arch]... # # Builds a bunch of gitstatusd-* binaries. Without arguments builds binaries -# for all platforms. git-ref defaults to src. +# for all platforms. git-ref defaults to master. # # Before using this script you need to set up build servers and list them # in ~/.ssh/config. There should be a Host entry for every value of `assets` @@ -111,6 +111,7 @@ local -rA assets=( cygwin_nt-10.0-x86_64 build-windows-x86_64 msys_nt-10.0-i686 build-windows-x86_64 msys_nt-10.0-x86_64 build-windows-x86_64 + darwin-arm64 build-macos-arm64 darwin-x86_64 build-macos-x86_64 freebsd-amd64 build-freebsd-amd64 linux-aarch64 build-linux-aarch64 @@ -138,7 +139,7 @@ function usage() { print -r -- 'usage: mbuild [-b REF] [KERNEL-ARCH]...' } -local OPTARG opt git_ref=src +local OPTARG opt git_ref=master local -i OPTIND while getopts ":b:h" opt; do case $opt in @@ -183,7 +184,7 @@ function build-unix() { case $2 in linux-ppc64le) ;; linux-*) flags+=(-d docker);; - darwin-arm64) intro='PATH="/opt/homebrew/bin:$PATH"';; + darwin-arm64) intro='PATH="/opt/local/bin:$PATH"';; darwin-*) intro='PATH="/usr/local/bin:$PATH"';; esac ssh $1 -- /bin/sh -uex <<<" From 5ea5d4bc196d3b3c82d611149a541061e47716d5 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 22 Dec 2020 09:16:02 +0100 Subject: [PATCH 243/659] disable re_match_pcre, otherwise we can get an error when users enable this option without having zsh/pcre module --- internal/p10k.zsh | 2 +- powerlevel10k.zsh-theme | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index c6cccdbf..9aa03f94 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1,4 +1,4 @@ -if [[ $__p9k_sourced != 12 ]]; then +if [[ $__p9k_sourced != 13 ]]; then >&2 print -P "" >&2 print -P "[%F{1}ERROR%f]: Corrupted powerlevel10k installation." >&2 print -P "" diff --git a/powerlevel10k.zsh-theme b/powerlevel10k.zsh-theme index d17862af..92079d40 100644 --- a/powerlevel10k.zsh-theme +++ b/powerlevel10k.zsh-theme @@ -22,7 +22,7 @@ # Leading spaces before `local` are important. Otherwise Antigen will remove `local` (!!!). # __p9k_trapint is to work around bugs in zsh: https://www.zsh.org/mla/workers/2020/msg00612.html. # Likewise for `trap ":"` instead of the plain `trap ""`. - typeset -gr __p9k_intro_base='emulate -L zsh -o no_hist_expand -o extended_glob -o no_prompt_bang -o prompt_percent -o no_prompt_subst -o no_aliases -o no_bg_nice -o typeset_silent + typeset -gr __p9k_intro_base='emulate -L zsh -o no_hist_expand -o extended_glob -o no_prompt_bang -o prompt_percent -o no_prompt_subst -o no_aliases -o no_bg_nice -o typeset_silent -o no_rematch_pcre (( $+__p9k_trapped )) || { local -i __p9k_trapped; trap : INT; trap "trap ${(q)__p9k_trapint:--} INT" EXIT } local -a match mbegin mend local -i MBEGIN MEND OPTIND @@ -57,7 +57,7 @@ function _p9k_init_locale() { if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file ]] && (( ! $+functions[_p9k_preinit] )) && source $__p9k_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then _p9k_preinit fi - typeset -gr __p9k_sourced=12 + typeset -gr __p9k_sourced=13 if [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]]; then if [[ -w $__p9k_root_dir && -w $__p9k_root_dir/internal && -w $__p9k_root_dir/gitstatus ]]; then local f From 61c63eea6b8bc12c56dcb6cc40529cc5c643a94f Mon Sep 17 00:00:00 2001 From: Osman Tas Date: Wed, 23 Dec 2020 08:58:10 -0800 Subject: [PATCH 244/659] Update os icon at zsh.exe on git for windows (#1180) * Update os icon for windows Windows icon is not shown on git for windows zsh.exe Same update also added to wizards.zsh file. * Update os icon for windows Windows icon is not shown on git for windows zsh.exe Same update also added to p10k.zsh file. --- 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 9aa03f94..02524a2f 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8044,7 +8044,7 @@ function _p9k_init_cacheable() { case $_p9k_uname in SunOS) _p9k_set_os Solaris SUNOS_ICON;; Darwin) _p9k_set_os OSX APPLE_ICON;; - CYGWIN_NT-* | MSYS_NT-*) _p9k_set_os Windows WINDOWS_ICON;; + CYGWIN_NT-*|MSYS_NT-*|MINGW64_NT-*|MINGW32_NT-*) _p9k_set_os Windows WINDOWS_ICON;; FreeBSD|OpenBSD|DragonFly) _p9k_set_os BSD FREEBSD_ICON;; Linux) _p9k_os='Linux' diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 83fbf07e..793c8ef3 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1070,7 +1070,7 @@ function os_icon_name() { case $uname in SunOS) echo SUNOS_ICON;; Darwin) echo APPLE_ICON;; - CYGWIN_NT-* | MSYS_NT-*) echo WINDOWS_ICON;; + CYGWIN_NT-*|MSYS_NT-*|MINGW64_NT-*|MINGW32_NT-*) echo WINDOWS_ICON;; FreeBSD|OpenBSD|DragonFly) echo FREEBSD_ICON;; Linux) local os_release_id From dd62469cc7fb88d31cc85bf246b881ac1a760dc3 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 24 Dec 2020 05:26:15 +0100 Subject: [PATCH 245/659] fix ram segment on darwin-arm64 (#1181) Darwin arm64 uses 16kB pages rather than 4kB. Thanks, @johnalanwoods! --- internal/p10k.zsh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 02524a2f..e2b450c6 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -2594,7 +2594,13 @@ _p9k_prompt_ram_async() { (( free_bytes += match[1] )) [[ $stat =~ 'Pages inactive:[[:space:]]+([0-9]+)' ]] || return (( free_bytes += match[1] )) - (( free_bytes *= 4096 )) + if (( ! $+_p9k__ram_pagesize )); then + local p + (( $+commands[pagesize] )) && p=$(pagesize 2>/dev/null) && [[ $p == <1-> ]] || p=4096 + typeset -gi _p9k__ram_pagesize=p + _p9k_print_params _p9k__ram_pagesize + fi + (( free_bytes *= _p9k__ram_pagesize )) ;; BSD) local stat && stat="$(grep -F 'avail memory' /var/run/dmesg.boot 2>/dev/null)" || return From 59db4252bbe7efe3292752633974ab5bbdc1fb44 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 24 Dec 2020 05:52:27 +0100 Subject: [PATCH 246/659] uncomment BACKGROUND and FOREGROUND parameters in p10k-classic.zsh; comments confuse users (#1182) --- config/p10k-rainbow.zsh | 235 ++++++++++++++++++++-------------------- 1 file changed, 118 insertions(+), 117 deletions(-) diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index f1dca984..1f88c006 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -341,11 +341,11 @@ #####################################[ vcs: git status ]###################################### # Version control system colors. - # typeset -g POWERLEVEL9K_VCS_CLEAN_BACKGROUND=2 - # typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=3 - # typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=2 - # typeset -g POWERLEVEL9K_VCS_CONFLICTED_BACKGROUND=3 - # typeset -g POWERLEVEL9K_VCS_LOADING_BACKGROUND=8 + typeset -g POWERLEVEL9K_VCS_CLEAN_BACKGROUND=2 + typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=3 + typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=2 + 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. typeset -g POWERLEVEL9K_VCS_BRANCH_ICON= @@ -488,37 +488,37 @@ # it will signify success by turning green. typeset -g POWERLEVEL9K_STATUS_OK=true typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔' - # typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=2 - # typeset -g POWERLEVEL9K_STATUS_OK_BACKGROUND=0 + typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=2 + typeset -g POWERLEVEL9K_STATUS_OK_BACKGROUND=0 # Status when some part of a pipe command fails but the overall exit status is zero. It may look # like this: 1|0. typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔' - # typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=2 - # typeset -g POWERLEVEL9K_STATUS_OK_PIPE_BACKGROUND=0 + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=2 + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_BACKGROUND=0 # Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as # it will signify error by turning red. typeset -g POWERLEVEL9K_STATUS_ERROR=true typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘' - # typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=3 - # typeset -g POWERLEVEL9K_STATUS_ERROR_BACKGROUND=1 + typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=3 + typeset -g POWERLEVEL9K_STATUS_ERROR_BACKGROUND=1 # Status when the last command was terminated by a signal. typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true # Use terse signal names: "INT" instead of "SIGINT(2)". typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘' - # typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=3 - # typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_BACKGROUND=1 + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=3 + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_BACKGROUND=1 # Status when some part of a pipe command fails and the overall exit status is also non-zero. # It may look like this: 1|0. typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘' - # typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=3 - # typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_BACKGROUND=1 + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=3 + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_BACKGROUND=1 ###################[ command_execution_time: duration of the last command ]################### # Execution time color. @@ -537,8 +537,8 @@ #######################[ background_jobs: presence of background jobs ]####################### # Background jobs color. - # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=6 - # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND=0 + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=6 + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND=0 # Don't show the number of background jobs. typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false # Custom icon. @@ -546,8 +546,8 @@ #######################[ direnv: direnv status (https://direnv.net/) ]######################## # Direnv color. - # typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=3 - # typeset -g POWERLEVEL9K_DIRENV_BACKGROUND=0 + typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=3 + typeset -g POWERLEVEL9K_DIRENV_BACKGROUND=0 # Custom icon. # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐' @@ -711,8 +711,8 @@ ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### # NordVPN connection indicator color. - # typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=7 - # typeset -g POWERLEVEL9K_NORDVPN_BACKGROUND=4 + typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=7 + typeset -g POWERLEVEL9K_NORDVPN_BACKGROUND=4 # Hide NordVPN connection indicator when not connected. typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= @@ -721,36 +721,36 @@ #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]################## # Ranger shell color. - # typeset -g POWERLEVEL9K_RANGER_FOREGROUND=3 - # typeset -g POWERLEVEL9K_RANGER_BACKGROUND=0 + typeset -g POWERLEVEL9K_RANGER_FOREGROUND=3 + typeset -g POWERLEVEL9K_RANGER_BACKGROUND=0 # Custom icon. # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### # Nnn shell color. - # typeset -g POWERLEVEL9K_NNN_FOREGROUND=0 - # typeset -g POWERLEVEL9K_NNN_BACKGROUND=6 + typeset -g POWERLEVEL9K_NNN_FOREGROUND=0 + typeset -g POWERLEVEL9K_NNN_BACKGROUND=6 # Custom icon. # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' ###########################[ vim_shell: vim shell indicator (:sh) ]########################### # Vim shell indicator color. - # typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=0 - # typeset -g POWERLEVEL9K_VIM_SHELL_BACKGROUND=2 + typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_VIM_SHELL_BACKGROUND=2 # Custom icon. # typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]###### # Midnight Commander shell color. - # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=3 - # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_BACKGROUND=0 + typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=3 + typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_BACKGROUND=0 # Custom icon. # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]## # Nix shell color. - # typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=0 - # typeset -g POWERLEVEL9K_NIX_SHELL_BACKGROUND=4 + typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_NIX_SHELL_BACKGROUND=4 # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= @@ -760,12 +760,12 @@ ##################################[ disk_usage: disk usage ]################################## # Colors for different levels of disk usage. - # typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=3 - # typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_BACKGROUND=0 - # typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_FOREGROUND=0 - # typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_BACKGROUND=3 - # typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_FOREGROUND=7 - # typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_BACKGROUND=1 + typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=3 + typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_BACKGROUND=0 + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_FOREGROUND=0 + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_BACKGROUND=3 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_FOREGROUND=7 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_BACKGROUND=1 # Thresholds for different levels of disk usage (percentage points). typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90 typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95 @@ -792,15 +792,15 @@ ######################################[ ram: free RAM ]####################################### # RAM color. - # typeset -g POWERLEVEL9K_RAM_FOREGROUND=0 - # typeset -g POWERLEVEL9K_RAM_BACKGROUND=3 + typeset -g POWERLEVEL9K_RAM_FOREGROUND=0 + typeset -g POWERLEVEL9K_RAM_BACKGROUND=3 # Custom icon. # typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='⭐' #####################################[ swap: used swap ]###################################### # Swap color. - # typeset -g POWERLEVEL9K_SWAP_FOREGROUND=0 - # typeset -g POWERLEVEL9K_SWAP_BACKGROUND=3 + typeset -g POWERLEVEL9K_SWAP_FOREGROUND=0 + typeset -g POWERLEVEL9K_SWAP_BACKGROUND=3 # Custom icon. # typeset -g POWERLEVEL9K_SWAP_VISUAL_IDENTIFIER_EXPANSION='⭐' @@ -808,21 +808,21 @@ # Show average CPU load over this many last minutes. Valid values are 1, 5 and 15. typeset -g POWERLEVEL9K_LOAD_WHICH=5 # Load color when load is under 50%. - # typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=0 - # typeset -g POWERLEVEL9K_LOAD_NORMAL_BACKGROUND=2 + typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_LOAD_NORMAL_BACKGROUND=2 # Load color when load is between 50% and 70%. - # typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=0 - # typeset -g POWERLEVEL9K_LOAD_WARNING_BACKGROUND=3 + typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=0 + typeset -g POWERLEVEL9K_LOAD_WARNING_BACKGROUND=3 # Load color when load is over 70%. - # typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=0 - # typeset -g POWERLEVEL9K_LOAD_CRITICAL_BACKGROUND=1 + typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_LOAD_CRITICAL_BACKGROUND=1 # Custom icon. # typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='⭐' ################[ todo: todo items (https://github.com/todotxt/todo.txt-cli) ]################ # Todo color. - # typeset -g POWERLEVEL9K_TODO_FOREGROUND=0 - # typeset -g POWERLEVEL9K_TODO_BACKGROUND=8 + typeset -g POWERLEVEL9K_TODO_FOREGROUND=0 + typeset -g POWERLEVEL9K_TODO_BACKGROUND=8 # Hide todo when the total number of tasks is zero. typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true # Hide todo when the number of tasks after filtering is zero. @@ -846,8 +846,8 @@ ###########[ timewarrior: timewarrior tracking status (https://timewarrior.net/) ]############ # Timewarrior color. - # typeset -g POWERLEVEL9K_TIMEWARRIOR_FOREGROUND=255 - # typeset -g POWERLEVEL9K_TIMEWARRIOR_BACKGROUND=8 + typeset -g POWERLEVEL9K_TIMEWARRIOR_FOREGROUND=255 + typeset -g POWERLEVEL9K_TIMEWARRIOR_BACKGROUND=8 # If the tracked task is longer than 24 characters, truncate and append "…". # Tip: To always display tasks without truncation, delete the following parameter. @@ -860,8 +860,8 @@ ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]############## # Taskwarrior color. - # typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=0 - # typeset -g POWERLEVEL9K_TASKWARRIOR_BACKGROUND=6 + typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=0 + typeset -g POWERLEVEL9K_TASKWARRIOR_BACKGROUND=6 # Taskwarrior segment format. The following parameters are available within the expansion. # @@ -908,8 +908,8 @@ ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]### # Python virtual environment color. - # typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=0 - # typeset -g POWERLEVEL9K_VIRTUALENV_BACKGROUND=4 + typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_VIRTUALENV_BACKGROUND=4 # Don't show Python version next to the virtual environment name. typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false # If set to "false", won't show virtualenv if pyenv is already shown. @@ -922,8 +922,8 @@ #####################[ anaconda: conda environment (https://conda.io/) ]###################### # Anaconda environment color. - # typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=0 - # typeset -g POWERLEVEL9K_ANACONDA_BACKGROUND=4 + typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ANACONDA_BACKGROUND=4 # Anaconda segment format. The following parameters are available within the expansion. # @@ -956,8 +956,8 @@ ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################ # Pyenv color. - # typeset -g POWERLEVEL9K_PYENV_FOREGROUND=0 - # typeset -g POWERLEVEL9K_PYENV_BACKGROUND=4 + typeset -g POWERLEVEL9K_PYENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_PYENV_BACKGROUND=4 # Hide python version if it doesn't come from one of these sources. typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global) # If set to false, hide python version if it's the same as global: @@ -983,8 +983,8 @@ ################[ goenv: go environment (https://github.com/syndbg/goenv) ]################ # Goenv color. - # typeset -g POWERLEVEL9K_GOENV_FOREGROUND=0 - # typeset -g POWERLEVEL9K_GOENV_BACKGROUND=4 + typeset -g POWERLEVEL9K_GOENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_GOENV_BACKGROUND=4 # Hide go version if it doesn't come from one of these sources. typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global) # If set to false, hide go version if it's the same as global: @@ -997,8 +997,8 @@ ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]########## # Nodenv color. - # typeset -g POWERLEVEL9K_NODENV_FOREGROUND=2 - # typeset -g POWERLEVEL9K_NODENV_BACKGROUND=0 + typeset -g POWERLEVEL9K_NODENV_FOREGROUND=2 + typeset -g POWERLEVEL9K_NODENV_BACKGROUND=0 # Hide node version if it doesn't come from one of these sources. typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global) # If set to false, hide node version if it's the same as global: @@ -1011,15 +1011,15 @@ ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### # Nvm color. - # typeset -g POWERLEVEL9K_NVM_FOREGROUND=0 - # typeset -g POWERLEVEL9K_NVM_BACKGROUND=5 + typeset -g POWERLEVEL9K_NVM_FOREGROUND=0 + typeset -g POWERLEVEL9K_NVM_BACKGROUND=5 # Custom icon. # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############ # Nodeenv color. - # typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=2 - # typeset -g POWERLEVEL9K_NODEENV_BACKGROUND=0 + typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=2 + typeset -g POWERLEVEL9K_NODEENV_BACKGROUND=0 # Don't show Node version next to the environment name. typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false # Separate environment name from Node version only with a space. @@ -1029,8 +1029,8 @@ ##############################[ node_version: node.js version ]############################### # Node version color. - # typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=7 - # typeset -g POWERLEVEL9K_NODE_VERSION_BACKGROUND=2 + typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=7 + typeset -g POWERLEVEL9K_NODE_VERSION_BACKGROUND=2 # Show node version only when in a directory tree containing package.json. typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true # Custom icon. @@ -1038,8 +1038,8 @@ #######################[ go_version: go version (https://golang.org) ]######################## # Go version color. - # typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=255 - # typeset -g POWERLEVEL9K_GO_VERSION_BACKGROUND=2 + typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=255 + typeset -g POWERLEVEL9K_GO_VERSION_BACKGROUND=2 # Show go version only when in a go project subdirectory. typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true # Custom icon. @@ -1047,8 +1047,8 @@ #################[ rust_version: rustc version (https://www.rust-lang.org) ]################## # Rust version color. - # typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=0 - # typeset -g POWERLEVEL9K_RUST_VERSION_BACKGROUND=208 + typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=0 + typeset -g POWERLEVEL9K_RUST_VERSION_BACKGROUND=208 # Show rust version only when in a rust project subdirectory. typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true # Custom icon. @@ -1056,8 +1056,8 @@ ###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################ # .NET version color. - # typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=7 - # typeset -g POWERLEVEL9K_DOTNET_VERSION_BACKGROUND=5 + typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=7 + typeset -g POWERLEVEL9K_DOTNET_VERSION_BACKGROUND=5 # Show .NET version only when in a .NET project subdirectory. typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true # Custom icon. @@ -1081,8 +1081,8 @@ #############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]############## # Rbenv color. - # typeset -g POWERLEVEL9K_RBENV_FOREGROUND=0 - # typeset -g POWERLEVEL9K_RBENV_BACKGROUND=1 + typeset -g POWERLEVEL9K_RBENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_RBENV_BACKGROUND=1 # Hide ruby version if it doesn't come from one of these sources. typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global) # If set to false, hide ruby version if it's the same as global: @@ -1106,8 +1106,8 @@ ###[ package: name@version from package.json (https://docs.npmjs.com/files/package.json) ]#### # Package color. - # typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=0 - # typeset -g POWERLEVEL9K_PACKAGE_BACKGROUND=6 + typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=0 + typeset -g POWERLEVEL9K_PACKAGE_BACKGROUND=6 # Package format. The following parameters are available within the expansion. # @@ -1121,8 +1121,8 @@ #######################[ rvm: ruby version from rvm (https://rvm.io) ]######################## # Rvm color. - # typeset -g POWERLEVEL9K_RVM_FOREGROUND=0 - # typeset -g POWERLEVEL9K_RVM_BACKGROUND=240 + typeset -g POWERLEVEL9K_RVM_FOREGROUND=0 + typeset -g POWERLEVEL9K_RVM_BACKGROUND=240 # Don't show @gemset at the end. typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false # Don't show ruby- at the front. @@ -1132,15 +1132,15 @@ ###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############ # Fvm color. - # typeset -g POWERLEVEL9K_FVM_FOREGROUND=0 - # typeset -g POWERLEVEL9K_FVM_BACKGROUND=4 + typeset -g POWERLEVEL9K_FVM_FOREGROUND=0 + typeset -g POWERLEVEL9K_FVM_BACKGROUND=4 # Custom icon. # typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐' ##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]########### # Lua color. - # typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=0 - # typeset -g POWERLEVEL9K_LUAENV_BACKGROUND=4 + typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_LUAENV_BACKGROUND=4 # Hide lua version if it doesn't come from one of these sources. typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global) # If set to false, hide lua version if it's the same as global: @@ -1153,8 +1153,8 @@ ###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################ # Java color. - # typeset -g POWERLEVEL9K_JENV_FOREGROUND=1 - # typeset -g POWERLEVEL9K_JENV_BACKGROUND=7 + typeset -g POWERLEVEL9K_JENV_FOREGROUND=1 + typeset -g POWERLEVEL9K_JENV_BACKGROUND=7 # Hide java version if it doesn't come from one of these sources. typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global) # If set to false, hide java version if it's the same as global: @@ -1167,8 +1167,8 @@ ###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############ # Perl color. - # typeset -g POWERLEVEL9K_PLENV_FOREGROUND=0 - # typeset -g POWERLEVEL9K_PLENV_BACKGROUND=4 + typeset -g POWERLEVEL9K_PLENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_PLENV_BACKGROUND=4 # Hide perl version if it doesn't come from one of these sources. typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global) # If set to false, hide perl version if it's the same as global: @@ -1181,8 +1181,8 @@ ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############ # PHP color. - # typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=0 - # typeset -g POWERLEVEL9K_PHPENV_BACKGROUND=5 + typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_PHPENV_BACKGROUND=5 # Hide php version if it doesn't come from one of these sources. typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global) # If set to false, hide php version if it's the same as global: @@ -1195,8 +1195,8 @@ #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### # Scala color. - # typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=0 - # typeset -g POWERLEVEL9K_SCALAENV_BACKGROUND=1 + typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_SCALAENV_BACKGROUND=1 # Hide scala version if it doesn't come from one of these sources. typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) # If set to false, hide scala version if it's the same as global: @@ -1209,8 +1209,8 @@ ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]########### # Haskell color. - # typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=0 - # typeset -g POWERLEVEL9K_HASKELL_STACK_BACKGROUND=3 + typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=0 + typeset -g POWERLEVEL9K_HASKELL_STACK_BACKGROUND=3 # Hide haskell version if it doesn't come from one of these sources. # @@ -1379,14 +1379,14 @@ # '*prod*' PROD # These values are examples that are unlikely # '*test*' TEST # to match your needs. Customize them as needed. '*' DEFAULT) - # typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=7 - # typeset -g POWERLEVEL9K_AWS_DEFAULT_BACKGROUND=1 + typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=7 + typeset -g POWERLEVEL9K_AWS_DEFAULT_BACKGROUND=1 # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' #[ 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 - # typeset -g POWERLEVEL9K_AWS_EB_ENV_BACKGROUND=0 + typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=2 + typeset -g POWERLEVEL9K_AWS_EB_ENV_BACKGROUND=0 # Custom icon. # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' @@ -1395,8 +1395,8 @@ # 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=7 - # typeset -g POWERLEVEL9K_AZURE_BACKGROUND=4 + typeset -g POWERLEVEL9K_AZURE_FOREGROUND=7 + typeset -g POWERLEVEL9K_AZURE_BACKGROUND=4 # Custom icon. # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' @@ -1405,8 +1405,8 @@ # Tip: Remove the next line to always show gcloud. typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs' # Google cloud color. - # typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=7 - # typeset -g POWERLEVEL9K_GCLOUD_BACKGROUND=4 + typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=7 + typeset -g POWERLEVEL9K_GCLOUD_BACKGROUND=4 # Google cloud format. Change the value of POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION and/or # POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION if the default is too verbose or not informative @@ -1477,8 +1477,8 @@ # '*:*prod*:*' PROD # These values are examples that are unlikely # '*:*test*:*' TEST # to match your needs. Customize them as needed. '*' DEFAULT) - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_FOREGROUND=7 - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_BACKGROUND=4 + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_FOREGROUND=7 + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_BACKGROUND=4 # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' # Use POWERLEVEL9K_GOOGLE_APP_CRED_CONTENT_EXPANSION to specify the content displayed by @@ -1499,15 +1499,15 @@ ###############################[ public_ip: public IP address ]############################### # Public IP color. - # typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=7 - # typeset -g POWERLEVEL9K_PUBLIC_IP_BACKGROUND=0 + typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=7 + typeset -g POWERLEVEL9K_PUBLIC_IP_BACKGROUND=0 # Custom icon. # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' ########################[ vpn_ip: virtual private network indicator ]######################### # VPN IP color. - # typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=0 - # typeset -g POWERLEVEL9K_VPN_IP_BACKGROUND=6 + typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=0 + typeset -g POWERLEVEL9K_VPN_IP_BACKGROUND=6 # When on VPN, show just an icon without the IP address. # Tip: To display the private IP address when on VPN, remove the next line. typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= @@ -1544,8 +1544,8 @@ #########################[ proxy: system-wide http/https/ftp proxy ]########################## # Proxy color. - # typeset -g POWERLEVEL9K_PROXY_FOREGROUND=4 - # typeset -g POWERLEVEL9K_PROXY_BACKGROUND=0 + typeset -g POWERLEVEL9K_PROXY_FOREGROUND=4 + typeset -g POWERLEVEL9K_PROXY_BACKGROUND=0 # Custom icon. # typeset -g POWERLEVEL9K_PROXY_VISUAL_IDENTIFIER_EXPANSION='⭐' @@ -1561,12 +1561,12 @@ typeset -g POWERLEVEL9K_BATTERY_STAGES=('%K{232}▁' '%K{232}▂' '%K{232}▃' '%K{232}▄' '%K{232}▅' '%K{232}▆' '%K{232}▇' '%K{232}█') # Don't show the remaining time to charge/discharge. typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false - # typeset -g POWERLEVEL9K_BATTERY_BACKGROUND=0 + typeset -g POWERLEVEL9K_BATTERY_BACKGROUND=0 #####################################[ wifi: wifi speed ]##################################### # WiFi color. - # typeset -g POWERLEVEL9K_WIFI_FOREGROUND=0 - # typeset -g POWERLEVEL9K_WIFI_BACKGROUND=4 + typeset -g POWERLEVEL9K_WIFI_FOREGROUND=0 + typeset -g POWERLEVEL9K_WIFI_BACKGROUND=4 # Custom icon. # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐' @@ -1592,8 +1592,8 @@ ####################################[ time: current time ]#################################### # Current time color. - # typeset -g POWERLEVEL9K_TIME_FOREGROUND=0 - # typeset -g POWERLEVEL9K_TIME_BACKGROUND=7 + typeset -g POWERLEVEL9K_TIME_FOREGROUND=0 + typeset -g POWERLEVEL9K_TIME_BACKGROUND=7 # Format for the current time: 09:51:02. See `man 3 strftime`. typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' # If set to true, time will update when you hit enter. This way prompts for the past @@ -1635,7 +1635,8 @@ } # User-defined prompt segments can be customized the same way as built-in segments. - # typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=3 + typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=3 + typeset -g POWERLEVEL9K_EXAMPLE_BACKGROUND=1 # typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='⭐' # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt From 0513e0fee45b9c90247f356695f0a41b77768225 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 24 Dec 2020 05:54:50 +0100 Subject: [PATCH 247/659] simplify `uname -m` matching on Windows platforms --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index e2b450c6..ac1b74d5 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8050,7 +8050,7 @@ function _p9k_init_cacheable() { case $_p9k_uname in SunOS) _p9k_set_os Solaris SUNOS_ICON;; Darwin) _p9k_set_os OSX APPLE_ICON;; - CYGWIN_NT-*|MSYS_NT-*|MINGW64_NT-*|MINGW32_NT-*) _p9k_set_os Windows WINDOWS_ICON;; + CYGWIN*|MSYS*|MINGW*) _p9k_set_os Windows WINDOWS_ICON;; FreeBSD|OpenBSD|DragonFly) _p9k_set_os BSD FREEBSD_ICON;; Linux) _p9k_os='Linux' From d524164020a91a04e8f1982ef5e57d434ef04dfb Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 26 Dec 2020 13:23:54 +0100 Subject: [PATCH 248/659] scroll the screen before printing prompt --- internal/p10k.zsh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index ac1b74d5..91a5b3b3 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5859,6 +5859,7 @@ _p9k_dump_instant_prompt() { typeset -gi __p9k_instant_prompt_sourced='$__p9k_instant_prompt_version' return 1 fi + local _p9k__ipe local P9K_PROMPT=instant if [[ -z $P9K_TTY || $P9K_TTY == old && -n ${_P9K_TTY:#$TTY} ]]; then' if (( _POWERLEVEL9K_NEW_TTY_MAX_AGE_SECONDS < 0 )); then @@ -7882,6 +7883,23 @@ _p9k_init_prompt() { _p9k_prompt_prefix_left+='${_p9k_t[${_p9k__empty_line_i:-'$#_p9k_t'}]}' fi + local -i num_lines=$#_p9k_line_segments_left + if (( $+terminfo[cuu1] )); then + _p9k_escape $terminfo[cuu1] + if (( __p9k_ksh_arrays )); then + local scroll=$'${_p9k_t[${_p9k__ruler_i:-1}-1]:+\n'$_p9k__ret'}' + else + local scroll=$'${_p9k_t[${_p9k__ruler_i:-1}]:+\n'$_p9k__ret'}' + fi + if (( num_lines > 1 )); then + local -i line_index= + for line_index in {1..$((num_lines-1))}; do + scroll='${_p9k__'$line_index-$'\n}'$scroll'${_p9k__'$line_index-$_p9k__ret'}' + done + fi + _p9k_prompt_prefix_left+='%{${_p9k__ipe-'$scroll'}%}' + fi + _p9k_get_icon '' RULER_CHAR local ruler_char=$_p9k__ret _p9k_prompt_length $ruler_char @@ -7958,7 +7976,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v113\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v114\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 29f16b61e6a00d05b2f65a285f6959f5a8d7be5c Mon Sep 17 00:00:00 2001 From: YorkGrizzly <50973240+YorkGrizzly@users.noreply.github.com> Date: Tue, 29 Dec 2020 09:54:30 +0800 Subject: [PATCH 249/659] Update font.md --- font.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/font.md b/font.md index 7baa23f6..8d319aff 100644 --- a/font.md +++ b/font.md @@ -76,6 +76,8 @@ 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. + - **MobaXterm**: Settings → Configuration → Terminal → (Under "Terminal look and feel") change *Font* to MesloLGS NF. + (for existing sessions) Right click on session → Edit session → (Under "Terminal Settings" tab) click on *Terminal font settings* → Change font to MesloLGS NF. **IMPORTANT:** Run `p10k configure` after changing terminal font. The old `~/.p10k.zsh` may work incorrectly with the new font. From ea97f031b447286f70af1a7b72453e7f346012f0 Mon Sep 17 00:00:00 2001 From: YorkGrizzly <50973240+YorkGrizzly@users.noreply.github.com> Date: Tue, 29 Dec 2020 09:56:53 +0800 Subject: [PATCH 250/659] Update font.md --- font.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/font.md b/font.md index 8d319aff..4720ffe1 100644 --- a/font.md +++ b/font.md @@ -76,8 +76,8 @@ 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. - - **MobaXterm**: Settings → Configuration → Terminal → (Under "Terminal look and feel") change *Font* to MesloLGS NF. - (for existing sessions) Right click on session → Edit session → (Under "Terminal Settings" tab) click on *Terminal font settings* → Change font to MesloLGS NF. + - **MobaXterm**: *Settings* → *Configuration* → *Terminal* → (Under *Terminal look and feel*) change *Font* to MesloLGS NF.
+ (for existing sessions) Right click on session → *Edit session* → (Under *Terminal Settings* tab) click on *Terminal font settings* → Change font to MesloLGS NF. **IMPORTANT:** Run `p10k configure` after changing terminal font. The old `~/.p10k.zsh` may work incorrectly with the new font. From 8bafd1a2ee8e8e8ac49fb4d8d99747ab7fdc493e Mon Sep 17 00:00:00 2001 From: YorkGrizzly <50973240+YorkGrizzly@users.noreply.github.com> Date: Tue, 29 Dec 2020 09:57:22 +0800 Subject: [PATCH 251/659] Update font.md --- font.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/font.md b/font.md index 4720ffe1..641be4ec 100644 --- a/font.md +++ b/font.md @@ -76,8 +76,8 @@ 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. - - **MobaXterm**: *Settings* → *Configuration* → *Terminal* → (Under *Terminal look and feel*) change *Font* to MesloLGS NF.
- (for existing sessions) Right click on session → *Edit session* → (Under *Terminal Settings* tab) click on *Terminal font settings* → Change font to MesloLGS NF. + - **MobaXterm**: *Settings* → *Configuration* → *Terminal* → ( Under *Terminal look and feel* ) change *Font* to MesloLGS NF.
+ ( for existing sessions ) Right click on session → *Edit session* → ( Under *Terminal Settings* tab ) click on *Terminal font settings* → Change font to MesloLGS NF. **IMPORTANT:** Run `p10k configure` after changing terminal font. The old `~/.p10k.zsh` may work incorrectly with the new font. From a43748d4276f9a4b171717f7117a62c605b63e2b Mon Sep 17 00:00:00 2001 From: joxxperez <50616125+joxxperez@users.noreply.github.com> Date: Sat, 2 Jan 2021 20:10:48 +0800 Subject: [PATCH 252/659] Add font installation instructions for WSLtty --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f46ce285..b870aadc 100644 --- a/README.md +++ b/README.md @@ -578,6 +578,7 @@ 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. +- **WSLtty**: Right Click on an open terminal and open *Options*. In the *Text* section, under *Font*, click *"Select..."* and set Font to `MesloLGS NF Regular`. **IMPORTANT:** Run `p10k configure` after changing terminal font. The old `~/.p10k.zsh` may work incorrectly with the new font. From 33f20f5eaea0de5f08d77869f8cc087ddf798351 Mon Sep 17 00:00:00 2001 From: Julio Carlos Barrera Juez Date: Sat, 9 Jan 2021 23:49:12 +0100 Subject: [PATCH 253/659] Add tailscale in VPN network interface regex. (#1208) --- 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, 5 insertions(+), 5 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 7cc07437..a594b8a9 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1438,7 +1438,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))[0-9]*' + typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[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 fc201ed9..c42d3f7c 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1419,7 +1419,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))[0-9]*' + typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[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 152104e4..b4a8e728 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1415,7 +1415,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))[0-9]*' + typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[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 1f88c006..6ae412d8 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1513,7 +1513,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))[0-9]*' + typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[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/p10k.zsh b/internal/p10k.zsh index 91a5b3b3..c63564d8 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7173,7 +7173,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))[0-9]*" + _p9k_declare -s POWERLEVEL9K_VPN_IP_INTERFACE "(gpd|wg|(.*tun)|tailscale)[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 From 4fa8943960e162443f8929eb57469d4167ca66ec Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 9 Jan 2021 23:53:03 +0100 Subject: [PATCH 254/659] doc cleanup --- README.md | 2 ++ font.md | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f46ce285..cbbe683b 100644 --- a/README.md +++ b/README.md @@ -566,6 +566,8 @@ 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*) + and change *Font* to `MesloLGS NF`. - **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 641be4ec..0e3a328c 100644 --- a/font.md +++ b/font.md @@ -64,6 +64,8 @@ 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*) + and change *Font* to `MesloLGS NF`. - **Alacritty**: Create or open `~/.config/alacritty/alacritty.yml` and add the following section to it: ```yaml @@ -76,9 +78,7 @@ 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. - - **MobaXterm**: *Settings* → *Configuration* → *Terminal* → ( Under *Terminal look and feel* ) change *Font* to MesloLGS NF.
- ( for existing sessions ) Right click on session → *Edit session* → ( Under *Terminal Settings* tab ) click on *Terminal font settings* → Change font to MesloLGS NF. - + **IMPORTANT:** Run `p10k configure` after changing terminal font. The old `~/.p10k.zsh` may work incorrectly with the new font. From 00232d1b6de0931fd9394bc3f963afb88644447d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 9 Jan 2021 23:55:54 +0100 Subject: [PATCH 255/659] doc cleanup --- README.md | 3 ++- font.md | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 00888476..00c0ff9e 100644 --- a/README.md +++ b/README.md @@ -568,6 +568,8 @@ 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`. +- **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 @@ -580,7 +582,6 @@ 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. -- **WSLtty**: Right Click on an open terminal and open *Options*. In the *Text* section, under *Font*, click *"Select..."* and set Font to `MesloLGS NF Regular`. **IMPORTANT:** Run `p10k configure` after changing terminal font. The old `~/.p10k.zsh` may work incorrectly with the new font. diff --git a/font.md b/font.md index 0e3a328c..b7fa4564 100644 --- a/font.md +++ b/font.md @@ -66,6 +66,8 @@ 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`. +- **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 From 68abcc86d48e0c5a111fe14043a8b3a66744a068 Mon Sep 17 00:00:00 2001 From: Thomas Lauf Date: Wed, 13 Jan 2021 09:05:59 +0100 Subject: [PATCH 256/659] =?UTF-8?q?Change=20icon=20for=20the=20timewarrior?= =?UTF-8?q?=20segment=20to=20'=E2=8C=9A'=20(#1217)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Icon was changed in https://github.com/romkatv/powerlevel10k/commit/c65260aaab46fee3d1eab033db258d0a366f03b4 from '🛡️' to '⌚' --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 00c0ff9e..9fab9fe9 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ Note how the effect of every command is instantly reflected by the very next pro | Command | Prompt Indicator | Meaning | |-------------------------------|:----------------:|----------------------------------------------------------------------:| -| `timew start hack linux` | `🛡️ hack linux` | time tracking enabled in [timewarrior](https://timewarrior.net/) | +| `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) | From 7b0698debf56c80f4e805164537c6401cb88ab2e Mon Sep 17 00:00:00 2001 From: Jaehee Hong Date: Thu, 14 Jan 2021 23:51:52 +0900 Subject: [PATCH 257/659] README Homebrew installation script fix (#1222) make homebrew installation instructions work on darwin-arm64 and linux --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9fab9fe9..92bacb26 100644 --- a/README.md +++ b/README.md @@ -421,7 +421,7 @@ supported by Powerlevel10k. ```zsh brew install romkatv/powerlevel10k/powerlevel10k -echo 'source /usr/local/opt/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc +echo "source $(brew --prefix)/opt/powerlevel10k/powerlevel10k.zsh-theme" >>~/.zshrc ``` ### Arch Linux From d26bdcd6010cfe82bc7bab07e4363b40be834cc8 Mon Sep 17 00:00:00 2001 From: Dhananjay Tanpure Date: Fri, 15 Jan 2021 22:50:46 +0530 Subject: [PATCH 258/659] Added wlan(w) to regular expression of network interfaces. (#1224) Name of network interface is generally wlan0 or wlp3s0. --- 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 a594b8a9..8bb7e4df 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1462,7 +1462,7 @@ 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. - typeset -g POWERLEVEL9K_IP_INTERFACE='e.*' + typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*' # Custom icon. # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index c42d3f7c..2b1eabca 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1443,7 +1443,7 @@ 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. - typeset -g POWERLEVEL9K_IP_INTERFACE='e.*' + typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*' # Custom icon. # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index b4a8e728..dd6fd959 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1439,7 +1439,7 @@ 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. - typeset -g POWERLEVEL9K_IP_INTERFACE='e.*' + typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*' # Custom icon. # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 6ae412d8..318792eb 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1538,7 +1538,7 @@ 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. - typeset -g POWERLEVEL9K_IP_INTERFACE='e.*' + typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*' # Custom icon. # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' From b816abfed0e8785d8bc2e47987cc40f6bcd4bc29 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 26 Jan 2021 12:43:07 +0100 Subject: [PATCH 259/659] 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 260/659] 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 261/659] 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 262/659] 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 263/659] 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 264/659] 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 265/659] 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 266/659] 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 267/659] 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 268/659] 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 269/659] 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 270/659] 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 271/659] 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 272/659] 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 273/659] 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 274/659] 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 275/659] 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 276/659] =?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 277/659] 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 278/659] 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 279/659] 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 280/659] 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 281/659] 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 282/659] 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 283/659] 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 284/659] 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 285/659] 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 286/659] 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 287/659] 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 288/659] 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 289/659] 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 290/659] 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 291/659] 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 292/659] 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 293/659] 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 294/659] 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 295/659] 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 296/659] 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 297/659] 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 298/659] 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 299/659] 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 300/659] 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 301/659] 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 302/659] 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 303/659] 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 304/659] 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 305/659] 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 306/659] 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 307/659] 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 308/659] 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 309/659] 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 310/659] 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 311/659] 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 312/659] 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 313/659] 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 314/659] 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 315/659] =?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 316/659] =?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 317/659] * 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 318/659] 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 319/659] 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 320/659] 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 321/659] 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 322/659] 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 323/659] 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 324/659] 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 325/659] 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 326/659] 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 327/659] 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 328/659] 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 329/659] 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 330/659] 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 331/659] 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 332/659] 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 333/659] 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 334/659] 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 335/659] 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 336/659] 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 337/659] 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 338/659] 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 339/659] 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 340/659] 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 341/659] 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 342/659] 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 343/659] 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 344/659] 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 345/659] 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 346/659] 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 347/659] 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 348/659] 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 349/659] 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 350/659] 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 351/659] 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 352/659] 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 353/659] 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 354/659] 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 355/659] 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 356/659] 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 357/659] 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 358/659] 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 359/659] 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 360/659] 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 361/659] 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 362/659] 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 363/659] 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 364/659] 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 365/659] 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 366/659] 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 367/659] 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 368/659] 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 369/659] 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 370/659] 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 371/659] 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 372/659] 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 373/659] 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 374/659] 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 375/659] 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 376/659] 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 377/659] 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 378/659] 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 379/659] 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 380/659] 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 381/659] 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 382/659] 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 383/659] 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 384/659] 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 385/659] 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 386/659] 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 387/659] 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 388/659] 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 389/659] 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 390/659] 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 391/659] 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 392/659] 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 393/659] 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 394/659] 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 395/659] 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 396/659] 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 397/659] 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 398/659] 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 399/659] 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 400/659] 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 401/659] 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 402/659] 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 403/659] 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 404/659] 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 405/659] 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 406/659] 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 407/659] 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 408/659] 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 409/659] 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 410/659] 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 411/659] 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 412/659] 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 413/659] 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 414/659] 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 415/659] 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 416/659] 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 417/659] 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 418/659] 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 419/659] 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 420/659] 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 421/659] 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 422/659] 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 423/659] 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 424/659] 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 425/659] 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 426/659] 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 427/659] 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 428/659] =?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 429/659] 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 430/659] 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 431/659] 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 432/659] 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 433/659] 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 434/659] 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 435/659] 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 436/659] 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 437/659] 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 438/659] 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 439/659] 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 440/659] 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 441/659] 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 442/659] 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 443/659] 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 444/659] 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 445/659] 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 446/659] 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 447/659] 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 448/659] 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 449/659] 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 450/659] 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 451/659] 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 452/659] 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 453/659] 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 454/659] 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 455/659] 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 456/659] 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 457/659] 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 458/659] "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 459/659] 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 460/659] 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 461/659] 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 462/659] 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 463/659] 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 464/659] 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 465/659] 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 466/659] 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 467/659] 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 468/659] 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 469/659] 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 470/659] 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 471/659] 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 472/659] 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 473/659] 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 474/659] 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 475/659] 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 476/659] 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 477/659] 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 478/659] 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 479/659] 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 480/659] 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 481/659] 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 482/659] 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 483/659] 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 484/659] 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 485/659] 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 486/659] 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 487/659] 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 488/659] 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 489/659] 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 490/659] 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 491/659] 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 492/659] 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 493/659] 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 494/659] 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 495/659] 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 496/659] 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 497/659] 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 498/659] 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 499/659] 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 500/659] 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 501/659] 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 502/659] 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 503/659] 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 504/659] 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 505/659] 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 506/659] 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 507/659] 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 508/659] 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 509/659] 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 510/659] 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 511/659] 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 512/659] 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 513/659] 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 514/659] 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 515/659] 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 516/659] 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 517/659] 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 518/659] 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 519/659] 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 520/659] 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 521/659] 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 522/659] 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 523/659] 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 524/659] 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 525/659] 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 526/659] 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 527/659] 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 528/659] 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 529/659] 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 530/659] 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 531/659] 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 532/659] 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 533/659] 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 534/659] 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 535/659] 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 536/659] 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 537/659] 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 538/659] 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 539/659] 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 540/659] 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 541/659] 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 542/659] 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 543/659] 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 544/659] 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 545/659] 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 546/659] 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 547/659] 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 548/659] 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 549/659] 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 550/659] 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 551/659] 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 552/659] 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 553/659] 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 554/659] 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 555/659] 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 556/659] 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 557/659] 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 558/659] 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 559/659] 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 560/659] 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 561/659] 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 562/659] 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 563/659] 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 564/659] 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 565/659] 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 566/659] 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 567/659] 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 568/659] 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 569/659] 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 570/659] 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 571/659] 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 572/659] 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 573/659] 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 574/659] 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 575/659] 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 576/659] 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 577/659] 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 578/659] 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 579/659] 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 580/659] 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 581/659] 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 582/659] 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 583/659] 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 584/659] 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 585/659] 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 586/659] 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 587/659] 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 588/659] 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 589/659] 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 590/659] 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 591/659] 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 592/659] 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 593/659] 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 594/659] 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 595/659] 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 596/659] 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 597/659] 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 598/659] 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 599/659] 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 600/659] 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 601/659] 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 602/659] 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 603/659] 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 604/659] 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 605/659] 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 606/659] 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 607/659] 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 608/659] 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 609/659] 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 610/659] 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 611/659] 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 612/659] 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 613/659] 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 614/659] 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 615/659] 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 616/659] 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 617/659] 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 618/659] 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 619/659] 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 620/659] 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 621/659] 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 622/659] 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 623/659] 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 624/659] 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 625/659] 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 626/659] 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 627/659] 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 628/659] 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 629/659] 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 630/659] 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 631/659] 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 632/659] 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 633/659] 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 634/659] 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 635/659] 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 636/659] 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 637/659] 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 638/659] 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`. From 119e4039ef9068fa96490a90c559e7594843ec22 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 17 Aug 2024 09:34:01 +0200 Subject: [PATCH 639/659] force shell integration when running under vscode integrated terminal with shell integration enabled --- internal/p10k.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index d2d261b2..fb724cff 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -9483,7 +9483,11 @@ 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.10 +typeset -g P9K_VERSION=1.20.11 + +if [[ ${VSCODE_SHELL_INTEGRATION-} == <1-> && ${+__p9k_force_term_shell_integration} == 0 ]]; then + typeset -gri __p9k_force_term_shell_integration=1 +fi unset VSCODE_SHELL_INTEGRATION _p9k_init_ssh From a42e374e25226d2032a38b38fc544ec1d65b0d01 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 17 Aug 2024 09:47:06 +0200 Subject: [PATCH 640/659] add cmdline_url to 133;C when KITTY_SHELL_INTEGRATION is defined --- internal/p10k.zsh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index fb724cff..f45293be 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5812,7 +5812,7 @@ _p9k_preexec2() { typeset -g _p9k__preexec_cmd=$2 _p9k__timer_start=EPOCHREALTIME P9K_TTY=old - (( ! $+_p9k__iterm_cmd )) || _p9k_iterm2_preexec + (( ! $+_p9k__iterm_cmd )) || _p9k_iterm2_preexec "$1" } function _p9k_prompt_net_iface_init() { @@ -8877,7 +8877,17 @@ function _p9k_iterm2_precmd() { } function _p9k_iterm2_preexec() { - [[ -t 1 ]] && builtin print -n '\e]133;C;\a' + if [[ -t 1 ]]; then + if (( ${+__p9k_use_osc133_c_cmdline} )); then + () { + emulate -L zsh -o extended_glob -o no_multibyte + local MATCH MBEGIN MEND + builtin printf '\e]133;C;cmdline_url=%s\a' "${1//(#m)[^a-zA-Z0-9"\/:_.-!'()~"]/%${(l:2::0:)$(([##16]#MATCH))}}" + } "$1" + else + builtin print -n '\e]133;C;\a' + fi + fi typeset -gi _p9k__iterm_cmd=2 } @@ -9082,6 +9092,7 @@ _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 + (( $+__p9k_use_osc133_c_cmdline )) || typeset -gri __p9k_use_osc133_c_cmdline=1 elif [[ $TERM_PROGRAM == WarpTerminal ]]; then (( $+__p9k_force_term_shell_integration )) || typeset -gri __p9k_force_term_shell_integration=1 fi @@ -9483,7 +9494,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.11 +typeset -g P9K_VERSION=1.20.12 if [[ ${VSCODE_SHELL_INTEGRATION-} == <1-> && ${+__p9k_force_term_shell_integration} == 0 ]]; then typeset -gri __p9k_force_term_shell_integration=1 From c30068c1f1ee28c13a761648072e708b56ae2535 Mon Sep 17 00:00:00 2001 From: Oleksii Kyslytsia Date: Thu, 5 Sep 2024 13:22:34 +0300 Subject: [PATCH 641/659] docs: Add instructions for setting MesloLGS NF font in Deepin Terminal --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 884cb21f..0f2cc6bf 100644 --- a/README.md +++ b/README.md @@ -779,6 +779,14 @@ If you are using a different terminal, proceed with manual font installation. font-style: italic; } ``` + - **Deepin Terminal**: Open `~/.config/deepin/deepin-terminal/config.conf` and set `basic.interface.font` to `"MesloLGS NF"`. + ```ini + [basic.interface.font] + value="MesloLGS NF" + + [basic.interface.font_size] + value=10 + ``` **_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 d71edb83f9c7f045a0d528eeff3445ec3d518d71 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 5 Sep 2024 12:37:49 +0200 Subject: [PATCH 642/659] docs: fix font instructions for deepin terminal and copy them over to font.md (#2752) --- README.md | 10 ++++------ font.md | 6 ++++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0f2cc6bf..3c255207 100644 --- a/README.md +++ b/README.md @@ -779,15 +779,13 @@ If you are using a different terminal, proceed with manual font installation. font-style: italic; } ``` - - **Deepin Terminal**: Open `~/.config/deepin/deepin-terminal/config.conf` and set `basic.interface.font` to `"MesloLGS NF"`. + **_CAVEAT_**: If you open the normal terminal preferences these settings will be overwritten. + - **Deepin Terminal**: Create or open `~/.config/deepin/deepin-terminal/config.conf` and add the following section + to it: ```ini [basic.interface.font] - value="MesloLGS NF" - - [basic.interface.font_size] - value=10 + value = "MesloLGS NF" ``` - **_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 7a7cb005..7f0f0572 100644 --- a/font.md +++ b/font.md @@ -160,6 +160,12 @@ 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. + - **Deepin Terminal**: Create or open `~/.config/deepin/deepin-terminal/config.conf` and add the following section + to it: + ```ini + [basic.interface.font] + value = "MesloLGS NF" + ``` 1. Run `p10k configure` to generate a new `~/.p10k.zsh`. The old config may work incorrectly with the new font. From edf38f964e3c5babf86642acf7a875fae88f4b5a Mon Sep 17 00:00:00 2001 From: Daphne Pfister Date: Tue, 17 Sep 2024 00:47:40 -0400 Subject: [PATCH 643/659] Add AlmaLinux icon --- 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 d34b2c0e..b774360c 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_ALMALINUX_ICON '\uE271'$s #  LINUX_GUIX_ICON '\uE271'$s #  LINUX_NEON_ICON '\uE271'$s #  SUNOS_ICON '\U1F31E'$q # 🌞 @@ -232,6 +233,7 @@ function _p9k_init_icons() { LINUX_AMZN_ICON '\uF17C'$s #  LINUX_ENDEAVOUROS_ICON '\uF17C'$s #  LINUX_ROCKY_ICON '\uF17C'$s #  + LINUX_ALMALINUX_ICON '\uF17C'$s #  LINUX_GUIX_ICON '\uF17C'$s #  LINUX_NEON_ICON '\uF17C'$s #  SUNOS_ICON '\uF185 ' #  @@ -391,6 +393,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_ALMALINUX_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 }" @@ -543,6 +546,7 @@ function _p9k_init_icons() { LINUX_AMZN_ICON '\uF270'$s #  LINUX_ENDEAVOUROS_ICON '\UF322'$s #  LINUX_ROCKY_ICON '\UF32B'$s #  + LINUX_ALMALINUX_ICON '\UF31D'$s #  LINUX_GUIX_ICON '\UF325'$s #  LINUX_NEON_ICON '\uF17C' #  LINUX_ICON '\uF17C' #  @@ -703,6 +707,7 @@ function _p9k_init_icons() { LINUX_AMZN_ICON '\uF270'$s #  LINUX_ENDEAVOUROS_ICON '\uF17C' #  LINUX_ROCKY_ICON '\uF17C' #  + LINUX_ALMALINUX_ICON '\uF17C' #  LINUX_GUIX_ICON '\uF325'$s #  LINUX_NEON_ICON '\uF17C' #  LINUX_ICON '\uF17C' #  @@ -856,6 +861,7 @@ function _p9k_init_icons() { LINUX_AMZN_ICON 'amzn' LINUX_ENDEAVOUROS_ICON 'edvos' LINUX_ROCKY_ICON 'rocky' + LINUX_ALMALINUX_ICON 'almalinux' LINUX_GUIX_ICON 'guix' LINUX_NEON_ICON 'neon' SUNOS_ICON 'sunos' @@ -1010,6 +1016,7 @@ function _p9k_init_icons() { LINUX_AMZN_ICON 'Amzn' LINUX_ENDEAVOUROS_ICON 'Edv' LINUX_ROCKY_ICON 'Roc' + LINUX_ALMALINUX_ICON 'Alma' LINUX_GUIX_ICON 'Guix' LINUX_NEON_ICON 'Neon' SUNOS_ICON 'Sun' diff --git a/internal/p10k.zsh b/internal/p10k.zsh index f45293be..571e7de8 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8661,6 +8661,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;; + almalinux) _p9k_set_os Linux LINUX_ALMALINUX_ICON;; guix) _p9k_set_os Linux LINUX_GUIX_ICON;; neon) _p9k_set_os Linux LINUX_NEON_ICON;; *) _p9k_set_os Linux LINUX_ICON;; diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 8d20675c..5ae58002 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1164,6 +1164,7 @@ function os_icon_name() { amzn) echo LINUX_AMZN_ICON;; endeavouros) echo LINUX_ENDEAVOUROS_ICON;; rocky) echo LINUX_ROCKY_ICON;; + almalinux) echo LINUX_ALMALINUX_ICON;; guix) echo LINUX_GUIX_ICON;; neon) echo LINUX_NEON_ICON;; *) echo LINUX_ICON;; From 087405df7838f4c3e835025699bd7b98b9731acc Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 17 Sep 2024 14:10:20 +0200 Subject: [PATCH 644/659] minor cleanup (#2758) --- 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 b774360c..1d1cafbb 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -861,7 +861,7 @@ function _p9k_init_icons() { LINUX_AMZN_ICON 'amzn' LINUX_ENDEAVOUROS_ICON 'edvos' LINUX_ROCKY_ICON 'rocky' - LINUX_ALMALINUX_ICON 'almalinux' + LINUX_ALMALINUX_ICON 'alma' LINUX_GUIX_ICON 'guix' LINUX_NEON_ICON 'neon' SUNOS_ICON 'sunos' diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 571e7de8..65d67c13 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -9495,7 +9495,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.12 +typeset -g P9K_VERSION=1.20.13 if [[ ${VSCODE_SHELL_INTEGRATION-} == <1-> && ${+__p9k_force_term_shell_integration} == 0 ]]; then typeset -gri __p9k_force_term_shell_integration=1 From 140a6ade4e9d7431df697de4dfff04b353e219e2 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 3 Oct 2024 11:16:46 +0200 Subject: [PATCH 645/659] Squashed 'gitstatus/' changes from 62177e89..44504a24 44504a24 make: remove -Wall 8795883c Specify cmake generator in build file (#441) 3e08476b docs: the project is on life support 12e6a689 Add support to build e2k arch. (#432) a952c3f6 bump version to v1.5.5 git-subtree-dir: gitstatus git-subtree-split: 44504a24b1b999a4f56ff74c75b8215bdcadee1f --- Makefile | 2 +- README.md | 4 ++++ build | 13 ++++++++++++- build.info | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index adb20e9d..4a695acb 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 # -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 diff --git a/README.md b/README.md index a6631f63..609d5f82 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # gitstatus +- **THE PROJECT HAS VERY LIMITED SUPPORT** +- **NO NEW FEATURES ARE IN THE WORKS** +- **MOST BUGS WILL GO UNFIXED** + **gitstatus** is a 10x faster alternative to `git status` and `git describe`. Its primary use case is to enable fast git prompt in interactive shells. diff --git a/build b/build index e116abb2..ea96a25a 100755 --- a/build +++ b/build @@ -153,7 +153,16 @@ case "$gitstatus_cpu" in ;; esac -cflags="$archflag=$gitstatus_cpu -fno-plt -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fpie" +case "$gitstatus_arch" in + e2k) + nopltflag="" + ;; + *) + nopltflag="-fno-plt" + ;; +esac + +cflags="$archflag=$gitstatus_cpu $nopltflag -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fpie" ldflags= static_pie= @@ -384,6 +393,7 @@ CFLAGS="$libgit2_cflags" command cmake \ -DUSE_GSSAPI=OFF \ -DUSE_NTLMCLIENT=OFF \ -DBUILD_SHARED_LIBS=OFF \ + -G "Unix Makefiles" \ $libgit2_cmake_flags \ .. command make -j "$cpus" VERBOSE=1 @@ -545,6 +555,7 @@ if [ -z "$gitstatus_cpu" ]; then x86_64|amd64) gitstatus_cpu=x86-64;; x86) gitstatus_cpu=i586;; s390x) gitstatus_cpu=z900;; + e2k) gitstatus_cpu=native;; i386|i586|i686) gitstatus_cpu="$gitstatus_arch";; *) >&2 echo '[error] unable to infer target CPU architecture' diff --git a/build.info b/build.info index 9a4967e8..9bc9411d 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.4" +gitstatus_version="v1.5.5" # libgit2 is a build time dependency of gitstatusd. The values of # libgit2_version and libgit2_sha256 are read by ./build. From 0996a9411824cbfe8fdd8cb17448c94ef891be34 Mon Sep 17 00:00:00 2001 From: Filipe Date: Fri, 4 Oct 2024 20:24:49 +1300 Subject: [PATCH 646/659] Support aws-sso-cli on AWS prompt element (#2769) Adds support for `aws-sso-cli` tool in AWS prompt element. https://github.com/synfinatic/aws-sso-cli Docs: https://synfinatic.github.io/aws-sso-cli/v1.17.0/commands/#managed-variables --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 65d67c13..0942c1c1 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1179,7 +1179,7 @@ function _p9k_parse_aws_config() { ################################################################ # AWS Profile prompt_aws() { - typeset -g P9K_AWS_PROFILE="${AWS_VAULT:-${AWSUME_PROFILE:-${AWS_PROFILE:-$AWS_DEFAULT_PROFILE}}}" + typeset -g P9K_AWS_PROFILE="${AWS_SSO_PROFILE:-${AWS_VAULT:-${AWSUME_PROFILE:-${AWS_PROFILE:-$AWS_DEFAULT_PROFILE}}}}" local pat class state for pat class in "${_POWERLEVEL9K_AWS_CLASSES[@]}"; do if [[ $P9K_AWS_PROFILE == ${~pat} ]]; then From 3483f230a72a0cf2078f4874acb38b74d61dbecd Mon Sep 17 00:00:00 2001 From: QZCL Maintainer <168384680+qzcl-maintainer@users.noreply.github.com> Date: Mon, 14 Oct 2024 16:18:29 -0600 Subject: [PATCH 647/659] Updated README.md to include instructions to enable MesloLGS Terminal Font --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 3c255207..6c80c3c4 100644 --- a/README.md +++ b/README.md @@ -698,6 +698,8 @@ If you are using a different terminal, proceed with manual font installation. *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`. + - **Warp**: Open Warp and Navigate to *Settings* then *Appearance*. Scroll down to *Text* Section + and under *"Terminal Font"*, select the `MesloLGS NF` font. - **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 From 67a365b9dbf2c784ca8e655d681df10ef2d4a1a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20NICOLAS?= Date: Fri, 25 Oct 2024 10:26:44 +0200 Subject: [PATCH 648/659] Let mise-configured ancestors be anchors (#2782) --- config/p10k-classic.zsh | 1 + config/p10k-lean-8colors.zsh | 1 + config/p10k-lean.zsh | 1 + config/p10k-rainbow.zsh | 1 + 4 files changed, 4 insertions(+) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index d7be6722..623b9308 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -244,6 +244,7 @@ .perl-version .php-version .tool-versions + .mise.toml .shorten_folder_marker .svn .terraform diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index bf469df7..3f72ff4b 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -235,6 +235,7 @@ .perl-version .php-version .tool-versions + .mise.toml .shorten_folder_marker .svn .terraform diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 1595a377..cef70fd8 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -235,6 +235,7 @@ .perl-version .php-version .tool-versions + .mise.toml .shorten_folder_marker .svn .terraform diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 355ee9bb..ed74b7fa 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -244,6 +244,7 @@ .perl-version .php-version .tool-versions + .mise.toml .shorten_folder_marker .svn .terraform From 5e26473457d819fe148f7fff32db1082dae72012 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 28 Oct 2024 10:26:23 +0100 Subject: [PATCH 649/659] support cpu_arch on linux (#2776) --- internal/p10k.zsh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 0942c1c1..839aa1f0 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5752,15 +5752,19 @@ prompt_cpu_arch() { state=$_p9k__cache_val[1] text=$_p9k__cache_val[2] else - 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 + if [[ -r /proc/sys/kernel/arch ]]; then + text=$(/dev/null && [[ $text == [a-zA-Z][a-zA-Z0-9_]# ]]; then + break + else + text= + fi + done + fi state=_${${(U)text}//İ/I} _p9k_cache_ephemeral_set "$state" "$text" fi @@ -9495,7 +9499,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.13 +typeset -g P9K_VERSION=1.20.14 if [[ ${VSCODE_SHELL_INTEGRATION-} == <1-> && ${+__p9k_force_term_shell_integration} == 0 ]]; then typeset -gri __p9k_force_term_shell_integration=1 From 8a331b82108dd5c5834cebdc0abbe778cc1a2735 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 28 Oct 2024 11:32:25 +0100 Subject: [PATCH 650/659] copy warp font instructions to font.md --- font.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/font.md b/font.md index 7f0f0572..54456668 100644 --- a/font.md +++ b/font.md @@ -78,6 +78,8 @@ If you are using a different terminal, proceed with manual font installation. *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`. + - **Warp**: Open Warp and Navigate to *Settings* then *Appearance*. Scroll down to *Text* Section + and under *"Terminal Font"*, select the `MesloLGS NF` font. - **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 From f2f01499744a57a7ae3828a788c05b1e99363f11 Mon Sep 17 00:00:00 2001 From: Mad Scientist <67949699+madscientist16@users.noreply.github.com> Date: Sun, 10 Nov 2024 08:49:37 +0000 Subject: [PATCH 651/659] Update README.md (#2788) --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index 6c80c3c4..d3a5e772 100644 --- a/README.md +++ b/README.md @@ -536,11 +536,6 @@ 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/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.** - ### Alpine Linux ```zsh From ef83e13c22cf8641f7ab2d50cd1338d01bb31cd2 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 15 Nov 2024 07:10:47 +0100 Subject: [PATCH 652/659] docs: expand on what setting ZSH_THEME involves --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d3a5e772..1b45e155 100644 --- a/README.md +++ b/README.md @@ -463,7 +463,7 @@ make sure to disable the current theme in your plugin manager. See ```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`. +2. Open `~/.zshrc`, find the line that sets `ZSH_THEME`, and change its value to `"powerlevel10k/powerlevel10k"`. ### Prezto From c187964ad3edf6ba45d2cedad40bb3e460696876 Mon Sep 17 00:00:00 2001 From: Cesar William Alvarenga Date: Sat, 28 Dec 2024 22:29:05 -0800 Subject: [PATCH 653/659] Update font.md with the font configuration for Ghostty terminal --- font.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/font.md b/font.md index 54456668..cadeca6f 100644 --- a/font.md +++ b/font.md @@ -168,6 +168,11 @@ If you are using a different terminal, proceed with manual font installation. [basic.interface.font] value = "MesloLGS NF" ``` + - **Ghostty**: Open *Menu → Open Configuration* (Linux) or + *Ghostty → Settings...* (Mac) and add the following line: + ```text + font-family = "MesloLGS NF" + ``` 1. Run `p10k configure` to generate a new `~/.p10k.zsh`. The old config may work incorrectly with the new font. From c85cd0f02844ff2176273a450c955b6532a185dc Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 29 Dec 2024 10:39:03 +0100 Subject: [PATCH 654/659] docs: reformat font instructions for ghostty and copy them over to README.md (#2809) --- README.md | 5 +++++ font.md | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1b45e155..d95c46b6 100644 --- a/README.md +++ b/README.md @@ -783,6 +783,11 @@ If you are using a different terminal, proceed with manual font installation. [basic.interface.font] value = "MesloLGS NF" ``` + - **Ghostty**: Open *Menu → Open Configuration* (Linux) or *Ghostty → Settings...* (Mac) and add + the following line: + ```text + font-family = "MesloLGS NF" + ``` 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 cadeca6f..cb49af46 100644 --- a/font.md +++ b/font.md @@ -168,8 +168,8 @@ If you are using a different terminal, proceed with manual font installation. [basic.interface.font] value = "MesloLGS NF" ``` - - **Ghostty**: Open *Menu → Open Configuration* (Linux) or - *Ghostty → Settings...* (Mac) and add the following line: + - **Ghostty**: Open *Menu → Open Configuration* (Linux) or *Ghostty → Settings...* (Mac) and add + the following line: ```text font-family = "MesloLGS NF" ``` From 3e2053a9341fe4cf5ab69909d3f39d53b1dfe772 Mon Sep 17 00:00:00 2001 From: "Seyed Sajjad (Sina) Tak Tehrani" Date: Mon, 6 Jan 2025 12:24:25 +0100 Subject: [PATCH 655/659] fix(prompt): add support for AWS_SSO_PROFILE in AWS segment initialization (#2813) - Updated `_p9k_prompt_aws_init` to include `AWS_SSO_PROFILE` in the condition for activating the AWS segment. - Ensures compatibility with AWS SSO profiles in addition to other AWS environment variables. --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 839aa1f0..cd8978f2 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1206,7 +1206,7 @@ prompt_aws() { } _p9k_prompt_aws_init() { - typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${AWS_VAULT:-${AWSUME_PROFILE:-${AWS_PROFILE:-$AWS_DEFAULT_PROFILE}}}' + typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${AWS_SSO_PROFILE:-${AWS_VAULT:-${AWSUME_PROFILE:-${AWS_PROFILE:-$AWS_DEFAULT_PROFILE}}}}' } ################################################################ From f3b05b4448799cfc960da7c664207bb08a10067f Mon Sep 17 00:00:00 2001 From: "Thomas D. Spear" Date: Wed, 22 Jan 2025 16:30:02 -0600 Subject: [PATCH 656/659] Fix word splitting issues in README.md Signed-off-by: Thomas D. Spear --- README.md | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index d95c46b6..98b9c7fb 100644 --- a/README.md +++ b/README.md @@ -455,13 +455,13 @@ make sure to disable the current theme in your plugin manager. See 1. Clone the repository: ```zsh - git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k + 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 上的官方镜像加速下载. ```zsh - git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k + git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git "${ZSH_CUSTOM:-"${HOME}/.oh-my-zsh/custom"}/themes/powerlevel10k" ``` 2. Open `~/.zshrc`, find the line that sets `ZSH_THEME`, and change its value to `"powerlevel10k/powerlevel10k"`. @@ -523,7 +523,7 @@ Add `plug "romkatv/powerlevel10k"` to `~/.zshrc`. ```zsh brew install powerlevel10k -echo "source $(brew --prefix)/share/powerlevel10k/powerlevel10k.zsh-theme" >>~/.zshrc +echo "source \"$(brew --prefix)/share/powerlevel10k/powerlevel10k.zsh-theme\"" >>~/.zshrc ``` ### Arch Linux @@ -717,7 +717,7 @@ If you are using a different terminal, proceed with manual font installation. 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: + - **WezTerm**: Create or open `"${HOME}/.config/wezterm/wezterm.lua"` and add the following: ```lua local wezterm = require 'wezterm'; return { @@ -857,7 +857,7 @@ 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` | +| [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` | @@ -879,8 +879,8 @@ The command to update Powerlevel10k depends on how it was installed. 1. Remove all references to "p10k" from `~/.zshrc`. You might have this snippet at the top: ```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" + 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 ``` And this at the bottom: @@ -911,7 +911,7 @@ The command to update Powerlevel10k depends on how it was installed. | 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` | + | [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` | @@ -928,7 +928,7 @@ The command to update Powerlevel10k depends on how it was installed. 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 + 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? @@ -942,7 +942,7 @@ The command to update Powerlevel10k depends on how it was installed. ```sh target_uname="replace this with the output of the previous command" git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k - GITSTATUS_CACHE_DIR="$HOME"/powerlevel10k/gitstatus/usrbin ~/powerlevel10k/gitstatus/install -f -s "${target_uname% *}" -m "${target_uname#* }" + GITSTATUS_CACHE_DIR="${HOME}/powerlevel10k/gitstatus/usrbin" ~/powerlevel10k/gitstatus/install -f -s "${target_uname% *}" -m "${target_uname#* }" ``` 3. Copy `~/powerlevel10k` from the machine connected to the Internet to the one without Internet access. @@ -1003,7 +1003,7 @@ Powerlevel10k does not affect: 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 +git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "${ZSH_CUSTOM:-"${HOME}/.oh-my-zsh/custom"}/themes/powerlevel10k" # Replace ZSH_THEME="powerlevel9k/powerlevel9k" with ZSH_THEME="powerlevel10k/powerlevel10k". sed -i.bak 's/powerlevel9k/powerlevel10k/g' ~/.zshrc # Restart Zsh. @@ -1039,8 +1039,8 @@ code snippet at the top of `~/.zshrc`: # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. # Initialization code that may require console input (password prompts, [y/n] # confirmations, etc.) must go above this block; everything else may go below. -if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then - source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.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 ``` @@ -1063,8 +1063,8 @@ the output, or move it above the instant prompt preamble. Here's an example of `~/.zshrc` that breaks when instant prompt is enabled: ```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" +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 keychain id_rsa --agents ssh # asks for password @@ -1078,8 +1078,8 @@ Fixed version: keychain id_rsa --agents ssh # moved before instant prompt # OK to perform console I/O before this point. -if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then - source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.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 # From this point on, until zsh is fully initialized, console input won't work and # console output may appear uncolored. @@ -1116,8 +1116,8 @@ If you've enabled [instant prompt](#instant-prompt), you should have these lines `~/.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" +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 ``` @@ -1126,8 +1126,8 @@ To initialize direnv you need to add one line above that block and one line belo ```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" +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)" @@ -1141,12 +1141,12 @@ fi You can export `GPG_TTY` like this anywhere in `~/.zshrc`: ```zsh -export GPG_TTY=$TTY +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)`. +`export GPG_TTY="$(tty)"`. *Related*: [How do I initialize direnv when using instant prompt?]( #how-do-i-initialize-direnv-when-using-instant-prompt) @@ -1574,7 +1574,7 @@ When opening a terminal, or starting zsh manually, you may encounter this error - 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 + 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`. From eb487f836a9738aeef282e74fcc5bdc38c712ee5 Mon Sep 17 00:00:00 2001 From: "Thomas D. Spear" Date: Wed, 22 Jan 2025 16:30:02 -0600 Subject: [PATCH 657/659] Fix word splitting issues in README.md Signed-off-by: Thomas D. Spear --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d95c46b6..6296d04b 100644 --- a/README.md +++ b/README.md @@ -455,13 +455,13 @@ make sure to disable the current theme in your plugin manager. See 1. Clone the repository: ```zsh - git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k + 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 上的官方镜像加速下载. ```zsh - git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k + git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k" ``` 2. Open `~/.zshrc`, find the line that sets `ZSH_THEME`, and change its value to `"powerlevel10k/powerlevel10k"`. @@ -523,7 +523,7 @@ Add `plug "romkatv/powerlevel10k"` to `~/.zshrc`. ```zsh brew install powerlevel10k -echo "source $(brew --prefix)/share/powerlevel10k/powerlevel10k.zsh-theme" >>~/.zshrc +echo "source \"$(brew --prefix)/share/powerlevel10k/powerlevel10k.zsh-theme\"" >>~/.zshrc ``` ### Arch Linux @@ -717,7 +717,7 @@ If you are using a different terminal, proceed with manual font installation. 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: + - **WezTerm**: Create or open `"$HOME/.config/wezterm/wezterm.lua"` and add the following: ```lua local wezterm = require 'wezterm'; return { @@ -857,7 +857,7 @@ 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` | +| [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` | @@ -911,7 +911,7 @@ The command to update Powerlevel10k depends on how it was installed. | 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` | + | [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` | @@ -1003,7 +1003,7 @@ Powerlevel10k does not affect: 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 +git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k" # Replace ZSH_THEME="powerlevel9k/powerlevel9k" with ZSH_THEME="powerlevel10k/powerlevel10k". sed -i.bak 's/powerlevel9k/powerlevel10k/g' ~/.zshrc # Restart Zsh. @@ -1574,7 +1574,7 @@ When opening a terminal, or starting zsh manually, you may encounter this error - 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 + 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`. From 8fa10f43a0f65a5e15417128be63e68e1d5b1f66 Mon Sep 17 00:00:00 2001 From: vladislav doster Date: Wed, 29 Jan 2025 07:28:19 -0600 Subject: [PATCH 658/659] fix(parser.zsh): `_p9k_parse_buffer` docstring typo (#2820) - `pupulates` => `populates` --- internal/parser.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/parser.zsh b/internal/parser.zsh index 6c16adcd..2af06e1c 100644 --- a/internal/parser.zsh +++ b/internal/parser.zsh @@ -102,7 +102,7 @@ typeset -grA __p9k_pb_term_skip=( # Usage: _p9k_parse_buffer [token-limit] # -# Parses the specified command line buffer and pupulates array P9K_COMMANDS +# Parses the specified command line buffer and populates array P9K_COMMANDS # with commands from it. Terminates early and returns 1 if there are more # tokens than the specified limit. # From 36f3045d69d1ba402db09d09eb12b42eebe0fa3b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 29 Apr 2025 15:00:25 +0200 Subject: [PATCH 659/659] disable nordvpn as it is broken after the last upstream update (#2860) --- internal/p10k.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index cd8978f2..f73dd208 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4918,6 +4918,10 @@ function _p9k_fetch_nordvpn_status() { # POWERLEVEL9K_NORDVPN_CONNECTING_CONTENT_EXPANSION='${P9K_NORDVPN_COUNTRY_CODE}' # POWERLEVEL9K_NORDVPN_CONNECTING_BACKGROUND=cyan function prompt_nordvpn() { + # This prompt segment is broken. See https://github.com/romkatv/powerlevel10k/issues/2860. + # It is disabled until it is fixed. + return + unset $__p9k_nordvpn_tag P9K_NORDVPN_COUNTRY_CODE [[ -e /run/nordvpn/nordvpnd.sock ]] || return _p9k_fetch_nordvpn_status 2>/dev/null || return @@ -9499,7 +9503,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.14 +typeset -g P9K_VERSION=1.20.15 if [[ ${VSCODE_SHELL_INTEGRATION-} == <1-> && ${+__p9k_force_term_shell_integration} == 0 ]]; then typeset -gri __p9k_force_term_shell_integration=1