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 001/228] 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 002/228] 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 003/228] 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 004/228] 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 005/228] 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 006/228] 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 007/228] 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 008/228] 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 009/228] 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 010/228] 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 011/228] 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 012/228] 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 013/228] 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 014/228] 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 015/228] 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 016/228] 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 017/228] 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 018/228] =?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 019/228] 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 020/228] 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 021/228] 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 022/228] 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 023/228] 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 024/228] 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 025/228] 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 026/228] 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 027/228] 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 028/228] 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 029/228] 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 030/228] 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 031/228] 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 032/228] 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 033/228] 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 034/228] 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 035/228] 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 036/228] 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 037/228] 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 038/228] 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 039/228] 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 040/228] 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 041/228] 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 042/228] 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 043/228] 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 044/228] 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 045/228] 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 046/228] 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 047/228] 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 048/228] "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 049/228] 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 050/228] 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 051/228] 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 052/228] 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 053/228] 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 054/228] 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 055/228] 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 056/228] 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 057/228] 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 058/228] 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 059/228] 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 060/228] 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 061/228] 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 062/228] 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 063/228] 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 064/228] 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 065/228] 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 066/228] 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 067/228] 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 068/228] 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 069/228] 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 070/228] 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 071/228] 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 072/228] 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 073/228] 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 074/228] 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 075/228] 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 076/228] 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 077/228] 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 078/228] 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 079/228] 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 080/228] 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 081/228] 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 082/228] 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 083/228] 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 084/228] 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 085/228] 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 086/228] 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 087/228] 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 088/228] 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 089/228] 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 090/228] 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 091/228] 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 092/228] 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 093/228] 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 094/228] 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 095/228] 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 096/228] 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 097/228] 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 098/228] 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 099/228] 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 100/228] 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 101/228] 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 102/228] 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 103/228] 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 104/228] 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 105/228] 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 106/228] 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 107/228] 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 108/228] 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 109/228] 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 110/228] 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 111/228] 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 112/228] 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 113/228] 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 114/228] 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 115/228] 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 116/228] 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 117/228] 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 118/228] 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 119/228] 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 120/228] 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 121/228] 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 122/228] 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 123/228] 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 124/228] 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 125/228] 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 126/228] 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 127/228] 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 128/228] 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 129/228] 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 130/228] 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 131/228] 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 132/228] 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 133/228] 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 134/228] 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 135/228] 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 136/228] 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 137/228] 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 138/228] 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 139/228] 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 140/228] 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 141/228] 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 142/228] 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 143/228] 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 144/228] 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 145/228] 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 146/228] 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 147/228] 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 148/228] 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 149/228] 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 150/228] 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 151/228] 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 152/228] 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 153/228] 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 154/228] 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 155/228] 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 156/228] 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 157/228] 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 158/228] 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 159/228] 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 160/228] 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 161/228] 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 162/228] 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 163/228] 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 164/228] 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 165/228] 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 166/228] 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 167/228] 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 168/228] 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 169/228] 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 170/228] 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 171/228] 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 172/228] 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 173/228] 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 174/228] 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 175/228] 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 176/228] 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 177/228] 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 178/228] 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 179/228] 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 180/228] 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 181/228] 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 182/228] 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 183/228] 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 184/228] 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 185/228] 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 186/228] 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 187/228] 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 188/228] 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 189/228] 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 190/228] 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 191/228] 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 192/228] 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 193/228] 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 194/228] 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 195/228] 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 196/228] 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 197/228] 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 198/228] 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 199/228] 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 200/228] 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 201/228] 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 202/228] 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 203/228] 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 204/228] 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 205/228] 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 206/228] 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 207/228] 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 208/228] 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 209/228] 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 210/228] 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 211/228] 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 212/228] 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 213/228] 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 214/228] 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 215/228] 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 216/228] 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 217/228] 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 218/228] 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 219/228] 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 220/228] 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 221/228] 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 222/228] 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 223/228] 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 224/228] 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 225/228] 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 226/228] 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 227/228] 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 228/228] 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`.