From 2a788892434b2d5d19fb6f0f41930e06fcc47cf1 Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 28 Jan 2020 16:03:18 +0100 Subject: [PATCH 01/88] start doc overhaul --- README.md | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ff998721..9f92bd69 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,11 @@ Powerlevel10k can be used as a [fast](#is-it-really-fast) drop-in replacement fo [Powerlevel9k](https://github.com/bhilburn/powerlevel9k). When given the same configuration options it will generate the same prompt. -![Powerlevel10k](https://raw.githubusercontent.com/romkatv/powerlevel10k/master/powerlevel10k.png) +![Powerlevel10k](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/prompt-styles.png) ## Table of Contents +1. [Features](#features) 1. [Installation](#installation) 1. [Manual](#manual) 1. [Oh My Zsh](#oh-my-zsh) @@ -52,6 +53,56 @@ it will generate the same prompt. 1. [I cannot make Powerlevel10k work with my plugin manager. Help!](#i-cannot-make-powerlevel10k-work-with-my-plugin-manager-help) 1. [What is the minimum supported zsh version?](#what-is-the-minimum-supported-zsh-version) +## Features + +### Configuration wizard + +Type `p10k configure` to access the builtin configuration wizard right from your terminal. + +![Powerlevel10k Configuration Wizard]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/configuration-wizard.gif) + +Configuration wizard creates `~/.p10k.zsh` based on your preferences. Additional prompt +customization can be done by editing this file. It has many comments to help you navigate through +configuration options. + +### Unparalleled performance + +When you hit *ENTER*, the next prompt appears instantly. There is never prompt lag when using +Powerlevel10k: not when you work on Linux Git repository, or have 100,000 files in the current +directory, or use Cygwin on Raspberry Pi, or enable 50 prompt segments that fill four full prompt +lines on both sides of the screen. Powerlevel10k prompt is always blazingly fast, no matter what. + +![Powerlevel10k Performance]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/performance.png) + +### Powerlevel9k compatibility + +Powerlevel10k understands all Powerlevel9k configuration parameters. + +![Powerlevel10k Compatibility with 9k]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/p9k-compatibility.gif) + +If you are currently using Powerlevel9k, you can switch to Powerlevel10k in just a few seconds. +All your `POWERLEVEL9K` configuration parameters will still work. Prompt will look the same as +before but it will be *much* faster. + +How to switch to Powerlevel10k if you are using Powerlevel9k with Oh My Zsh: + +1. Clone powerlevel10k repository. +2. Replace `ZSH_THEME="powerlevel9k/powerlevel9k"` with `ZSH_THEME="powerlevel10k/powerlevel10k"` +3. Restart Zsh. + +```zsh +git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k +sed 's/powerlevel9k/powerlevel10k/g' -i ~/.zshrc +exec zsh +``` + +Optional: Type `p10k configure` and explore exlusive Powerlevel10k prompt styles. + +### Pure emulation + ## Installation ### Manual From 2564afb48d182fe03b3ca0371993a088cc66508a Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 28 Jan 2020 16:12:01 +0100 Subject: [PATCH 02/88] fix gif urls --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9f92bd69..981bf629 100644 --- a/README.md +++ b/README.md @@ -74,14 +74,14 @@ directory, or use Cygwin on Raspberry Pi, or enable 50 prompt segments that fill lines on both sides of the screen. Powerlevel10k prompt is always blazingly fast, no matter what. ![Powerlevel10k Performance]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/performance.png) + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/performance.gif) ### Powerlevel9k compatibility Powerlevel10k understands all Powerlevel9k configuration parameters. ![Powerlevel10k Compatibility with 9k]( - https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/p9k-compatibility.gif) + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/9k-compatibility.gif) If you are currently using Powerlevel9k, you can switch to Powerlevel10k in just a few seconds. All your `POWERLEVEL9K` configuration parameters will still work. Prompt will look the same as From e07a91c1a2575d972ef91989ec677ff69f9b2bbb Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 28 Jan 2020 22:57:29 +0100 Subject: [PATCH 03/88] some progress on docs --- README.md | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 981bf629..2029d503 100644 --- a/README.md +++ b/README.md @@ -68,17 +68,32 @@ configuration options. ### Unparalleled performance -When you hit *ENTER*, the next prompt appears instantly. There is never prompt lag when using -Powerlevel10k: not when you work on Linux Git repository, or have 100,000 files in the current -directory, or use Cygwin on Raspberry Pi, or enable 50 prompt segments that fill four full prompt -lines on both sides of the screen. Powerlevel10k prompt is always blazingly fast, no matter what. +When you hit *ENTER*, the next prompt appears instantly. With Powerlevel10k there is no prompt lag. +If you install Cygwin on Raspberry Pi, `cd` in 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 +matter what! ![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 | +| `touch x y` | `?2` | 2 untracked files | +| `rm COPYING` | `!1` | 1 unstaged change | +| `echo 2.7.3 >.python-version` | `🐍 2.7.3` | the current python version in pyenv | + +Other Zsh themes capable of displaying the same information either produce prompt lag or print stale +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. + ### Powerlevel9k compatibility -Powerlevel10k understands all Powerlevel9k configuration parameters. +Powerlevel10k understands all [Powerlevel9k](https://github.com/Powerlevel9k/powerlevel9k) +configuration parameters. ![Powerlevel10k Compatibility with 9k]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/9k-compatibility.gif) @@ -103,6 +118,15 @@ Optional: Type `p10k configure` and explore exlusive Powerlevel10k prompt styles ### Pure emulation +Powerlevel10k can produce the same prompt as [Pure](https://github.com/sindresorhus/pure). Type +`p10k configure` and select *Pure* style. + +![Powerlevel10k Pure Style]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/pure-style.gif) + +You can still use Powerlevel10k features such as *Transient Prompt* or *Instant Prompt* when +sporting Pure style. + ## Installation ### Manual From 3b281aba497f68422f532687a969ddad4c2a9a21 Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 29 Jan 2020 08:41:19 +0100 Subject: [PATCH 04/88] pure config template cleanup --- config/p10k-pure.zsh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/config/p10k-pure.zsh b/config/p10k-pure.zsh index f7a6dd1c..50299dff 100644 --- a/config/p10k-pure.zsh +++ b/config/p10k-pure.zsh @@ -12,7 +12,8 @@ # doesn't fit on one line, it wraps around with no attempt to shorten it. # # If you like the general style of Pure but not particularly attached to all its quirks, type -# `p10k configure` while having Powerlevel10k theme active and pick "Lean" style. +# `p10k configure` and pick "Lean" style. This will give you slick minimalist prompt while taking +# advantage of Powerlevel10k features that aren't present in Pure. # Temporarily change options. 'builtin' 'local' '-a' 'p10k_config_opts' @@ -117,12 +118,12 @@ typeset -g POWERLEVEL9K_VCS_{INCOMING,OUTGOING}_CHANGESFORMAT_FOREGROUND=$cyan # Don't show remote branch, current tag or stashes. typeset -g POWERLEVEL9K_VCS_GIT_HOOKS=(vcs-detect-changes git-untracked git-aheadbehind) - # Don't show the branh icon. + # Don't show the branch icon. typeset -g POWERLEVEL9K_VCS_BRANCH_ICON= # When in detached HEAD state, show @commit where branch normally goes. typeset -g POWERLEVEL9K_VCS_COMMIT_ICON='@' # Don't show staged, unstaged, untracked indicators. - typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED}_ICON=$'\b' + typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED}_ICON= # Show '*' when there are staged, unstaged or untracked files. typeset -g POWERLEVEL9K_VCS_DIRTY_ICON='*' # Show '⇣' if local branch is behind remote. @@ -131,8 +132,8 @@ typeset -g POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON='⇡' # Don't show the number of commits next to the ahead/behind arrows. typeset -g POWERLEVEL9K_VCS_{COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=1 - # Remove space between '⇣' and '⇡'. - typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${P9K_CONTENT/⇣* ⇡/⇣⇡}' + # Remove space between '⇣' and '⇡' and all trailing spaces. + typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${${P9K_CONTENT/⇣* ⇡/⇣⇡}// }' # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt # when accepting a command line. Supported values: From 6686f3ba17a4af1f3464f4f6c751299e197d2fa2 Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 29 Jan 2020 10:38:38 +0100 Subject: [PATCH 05/88] expand features section --- README.md | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 106 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2029d503..5300ddf6 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,13 @@ Configuration wizard creates `~/.p10k.zsh` based on your preferences. Additional customization can be done by editing this file. It has many comments to help you navigate through configuration options. +All styles except [Pure](#pure-compatibility) are functionally equivalent. They display the same +information and differ only in presentation. + +Tip: Install [the recommended font](#recommended-meslo-nerd-font-patched-for-powerlevel10k) before +running `p10k configure`. If you are using iTerm2, `p10k configure` can install the font for you. +Simply say *Yes* when asked. + ### Unparalleled performance When you hit *ENTER*, the next prompt appears instantly. With Powerlevel10k there is no prompt lag. @@ -86,7 +93,7 @@ Note how the effect of every command is instantly reflected by the very next pro | `rm COPYING` | `!1` | 1 unstaged change | | `echo 2.7.3 >.python-version` | `🐍 2.7.3` | the current python version in pyenv | -Other Zsh themes capable of displaying the same information either produce prompt lag or print stale +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. @@ -116,7 +123,7 @@ exec zsh Optional: Type `p10k configure` and explore exlusive Powerlevel10k prompt styles. -### Pure emulation +### Pure compatibility Powerlevel10k can produce the same prompt as [Pure](https://github.com/sindresorhus/pure). Type `p10k configure` and select *Pure* style. @@ -124,8 +131,103 @@ Powerlevel10k can produce the same prompt as [Pure](https://github.com/sindresor ![Powerlevel10k Pure Style]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/pure-style.gif) -You can still use Powerlevel10k features such as *Transient Prompt* or *Instant Prompt* when -sporting Pure style. +You can still use Powerlevel10k features such as [Transient Prompt](#transient-prompt) or +[Instant Prompt](#instant-prompt) when sporting Pure style. + +To customize prompt, edit `~/.p10k.zsh`. Powerlevel10k doesn't recognize Pure configuration +parameters, so you need to use `POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3` instead of +`PURE_CMD_MAX_EXEC_TIME=3`, etc. All relevant parameters are in the config. + +### Instant prompt + +If your `~/.zshrc` loads many plugins, or perhaps just a few slow ones (pyenv and nvm are the usual +suspects), you may have noticed that it takes some time for Zsh to start. + +![Powerlevel10k Pure Style]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/no-instant-prompt.gif) + +Powerlevel10k can remove Zsh startup lag *even if it's not caused by a theme*. + +![Powerlevel10k Pure Style]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/instant-prompt.gif) + +This feature is called *Instant Prompt*. You need to explicitly enable it through `p10k configure` +or [manually](#what-is-instant-prompt). It does what it says on the tin -- prints prompt instantly +upon Zsh startup so you can start typing while plugins are still loading. + +Other themes *increase* Zsh startup lag -- some by a lot, others by a just a little -- while +Powerlevel10k *removes* it outright. + +### Show on command + +The behavior of some commands depends on global environment. For example, `kubectl run ...` runs an +image on the cluster defined by the current kubernetes context. If you frequently change context +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 certain prompt segments appear only when they are +relevant to the command you are currently typing. + +![Powerlevel10k Show On Command]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/show-on-command.gif) + +Configs created by `p10k configure` enable Show On Command for several prompt segments by default. + +```zsh +# Show prompt segment "kubecontext" only when the command you are typing +# invokes kubectl, helm, kubens, kubectx or oc. +typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc' +``` + +To customize when different prompt segments are shown, open `~/.p10k.zsh`, search for +`SHOW_ON_COMMAND` and either remove these parameters to display affected segments unconditionally, +or change their values. + +### Transient prompt + +When *Transient Prompt* is enabled through `p10k configure`, Powerlevel10k will trim down every +prompt when accepting a command line. + +![Powerlevel10k Show On Command]( + 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 +extra space for typing commands from fixed offset without the usual downside of reduced scrollback +density. + +### Current directory that just works + +The current working directory is perhaps the most important prompt segment. Powerlevel10k goes to +great length to highlight its important parts and to truncate it with the least loss of information. + +![Powerlevel10k Directory Truncation]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/directory-truncation.gif) + +When the full directory doesn't fit, the leftmost segment gets truncated to its shortest unique +prefix. In the screencast, `~/work` becomes `~/wo`. It couldn't be truncated to `~/w` because it +would be ambiguous (there was `~/wireguard` when the session was recorded). The next segment -- +`projects` -- turns into `p` as there was nothing else that started with `p` in `~/work`. + +Directory segments are shown in one of three colors: + +- Important segments are bright and never truncated. These include the first and the last segment, + roots of Git repositories, etc. +- Truncated segments are bleak. +- 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. + +### Extremely customizable + +Powerlevel10k can be configured to look like any other Zsh theme. + +TODO + +### Batteries included + +TODO ## Installation From b3e02f54d5c1ab031c0a73a3229cdcef1f8de485 Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 29 Jan 2020 12:29:05 +0100 Subject: [PATCH 06/88] feature: customizable --- README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5300ddf6..a13ad834 100644 --- a/README.md +++ b/README.md @@ -223,7 +223,23 @@ Tip: If you copy-paste a truncated directory and hit *TAB*, it'll complete to th Powerlevel10k can be configured to look like any other Zsh theme. -TODO +![Powerlevel10k Other Theme Emulation]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/other-theme-emulation.gif) + +Note: [Pure](#pure-compatibility) and Powerlevel9k(#powerlevel9k-compatibility) emulation is +built-in. To emulate the appearence 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) + +To ~~ridiculous~~ extravagant: + +![Powerlevel10k Extravagant Style]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/extravagant-style.png) ### Batteries included From 084b0203c751a601311acf410002e0562de5169c Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 29 Jan 2020 13:18:04 +0100 Subject: [PATCH 07/88] spelling and cleanup --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a13ad834..ca408bd6 100644 --- a/README.md +++ b/README.md @@ -155,8 +155,8 @@ This feature is called *Instant Prompt*. You need to explicitly enable it throug or [manually](#what-is-instant-prompt). It does what it says on the tin -- prints prompt instantly upon Zsh startup so you can start typing while plugins are still loading. -Other themes *increase* Zsh startup lag -- some by a lot, others by a just a little -- while -Powerlevel10k *removes* it outright. +Other themes *increase* Zsh startup lag -- some by a lot, others by a just a little. Powerlevel10k +*removes* it outright. ### Show on command @@ -226,10 +226,10 @@ Powerlevel10k can be configured to look like any other Zsh theme. ![Powerlevel10k Other Theme Emulation]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/other-theme-emulation.gif) -Note: [Pure](#pure-compatibility) and Powerlevel9k(#powerlevel9k-compatibility) emulation is -built-in. To emulate the appearence 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`. +[Pure](#pure-compatibility) and [Powerlevel9k](#powerlevel9k-compatibility) emulation is built-in. +To emulate the appearence 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: From e916104c1cd008bd96a949ce3230370b8ab4ddfd Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 29 Jan 2020 15:42:27 +0100 Subject: [PATCH 08/88] add a table with all supported segments; reword the intro and font sections --- README.md | 191 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 137 insertions(+), 54 deletions(-) diff --git a/README.md b/README.md index ca408bd6..238e8040 100644 --- a/README.md +++ b/README.md @@ -1,57 +1,28 @@ # Powerlevel10k [![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's fast, flexible and easy to install and configure. - -Powerlevel10k can be used as a [fast](#is-it-really-fast) drop-in replacement for -[Powerlevel9k](https://github.com/bhilburn/powerlevel9k). When given the same configuration options -it will generate the same prompt. +Powerlevel10k is a theme for ZSH. It's fast, flexible and easy to get started with. ![Powerlevel10k](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/prompt-styles.png) -## Table of Contents +To see what Powerlevel10k is about, scroll through [features](#features). -1. [Features](#features) -1. [Installation](#installation) - 1. [Manual](#manual) - 1. [Oh My Zsh](#oh-my-zsh) - 1. [Prezto](#prezto) - 1. [Zim](#zim) - 1. [Antigen](#antigen) - 1. [Zplug](#zplug) - 1. [Zgen](#zgen) - 1. [Antibody](#antibody) - 1. [Zplugin](#zplugin) -1. [Configuration](#configuration) - 1. [For new users](#for-new-users) - 1. [For Powerlevel9k users](#for-powerlevel9k-users) -1. [Fonts](#fonts) - 1. [Recommended: Meslo Nerd Font patched for Powerlevel10k](#recommended-meslo-nerd-font-patched-for-powerlevel10k) -1. [Try it in Docker](#try-it-in-docker) -1. [Is it really fast?](#is-it-really-fast) -1. [License](#license) -1. [FAQ](#faq) - 1. [What is instant prompt?](#what-is-instant-prompt) - 1. [Why do my icons and/or powerline symbols look bad?](#why-do-my-icons-andor-powerline-symbols-look-bad) - 1. [I'm getting "character not in range" error. What gives?](#im-getting-character-not-in-range-error-what-gives) - 1. [Why is my cursor in the wrong place?](#why-is-my-cursor-in-the-wrong-place) - 1. [Why is my prompt wrapping around in a weird way?](#why-is-my-prompt-wrapping-around-in-a-weird-way) - 1. [Why is my right prompt in the wrong place?](#why-is-my-right-prompt-in-the-wrong-place) - 1. [Why does the configuration wizard run automatically every time I start zsh?](#why-does-the-configuration-wizard-run-automatically-every-time-i-start-zsh) - 1. [I cannot install the recommended font. Help!](#i-cannot-install-the-recommended-font-help) - 1. [Why do I have a question mark symbol in my prompt? Is my font broken?](#why-do-i-have-a-question-mark-symbol-in-my-prompt-is-my-font-broken) - 1. [What do different symbols in Git status mean?](#what-do-different-symbols-in-git-status-mean) - 1. [How do I change the format of Git status?](#how-do-i-change-the-format-of-git-status) - 1. [How do I add username and/or hostname to prompt?](#how-do-i-add-username-andor-hostname-to-prompt) - 1. [How do I change colors?](#how-do-i-change-colors) - 1. [Why some prompt segments appear and disappear as I'm typing?](#why-some-prompt-segments-appear-and-disappear-as-im-typing) - 1. [Why does Powerlevel10k spawn extra processes?](#why-does-powerlevel10k-spawn-extra-processes) - 1. [Are there configuration options that make Powerlevel10k slow?](#are-there-configuration-options-that-make-powerlevel10k-slow) - 1. [Is Powerlevel10k fast to load?](#is-powerlevel10k-fast-to-load) - 1. [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) - 1. [Is there an AUR package for Powerlevel10k?](#is-there-an-aur-package-for-powerlevel10k) - 1. [I cannot make Powerlevel10k work with my plugin manager. Help!](#i-cannot-make-powerlevel10k-work-with-my-plugin-manager-help) - 1. [What is the minimum supported zsh version?](#what-is-the-minimum-supported-zsh-version) +Ready to give it a try? + +1. Install [the recommended font](#recommended-meslo-nerd-font-patched-for-powerlevel10k). Optional + but highly recommended. +1. Install Powerlevel10k for your plugin manager. + - [Manual](#manual) 👈 **choose this if confused or uncertain** + - [Oh My Zsh](#oh-my-zsh) + - [Prezto](#prezto) + - [Zim](#zim) + - [Antigen](#antigen) + - [Zplug](#zplug) + - [Zgen](#zgen) + - [Antibody](#antibody) + - [Zplugin](#zplugin) + +The full [table of contents](#table-of-contents) is at the bottom. ## Features @@ -194,8 +165,7 @@ prompt when accepting a command line. 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 -extra space for typing commands from fixed offset without the usual downside of reduced scrollback -density. +extra space for typing commands without the usual downside of reduced scrollback density. ### Current directory that just works @@ -243,7 +213,62 @@ To ~~ridiculous~~ extravagant: ### Batteries included -TODO +Powerlevel10k comes with dozens of built-in high quality segments. When you run `p10k configure` +and choose any style except Pure, most of these segments get enabled by default. Some must 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 | +|--------:|---------| +| `os_icon` | your OS logo (apple for macOS, swirl for debian, etc.) | +| `dir` | current working directory | +| `vcs` | Git repository status | +| `prompt_char` | multi-functional prompt symbol; changes depending on vi mode: `❯`, `❮`, `Ⅴ`, `▶` for insert, command, visual and replace mode respectively; turns red on error | +| `context` | user@hostname | +| `status` | exit code of the last command | +| `command_execution_time` | duration (wall time) of the last command | +| `background_jobs` | presence of background jobs | +| `time` | current time | +| `direnv` | [direnv](https://direnv.net/) status | +| `virtualenv` | python environment from [venv](https://docs.python.org/3/library/venv.html) | +| `anaconda` | virtual environment from [conda](https://conda.io/) | +| `pyenv` | python environment from [pyenv](https://github.com/pyenv/pyenv) | +| `goenv` | go environment from [goenv](https://github.com/syndbg/goenv) | +| `nodenv` | node.js environment from [nodenv](https://github.com/nodenv/nodenv) | +| `nvm` | node.js environment from [nvm](https://github.com/nvm-sh/nvm) | +| `nodeenv` | node.js environment from [nodeenv](https://github.com/ekalinin/nodeenv) | +| `rbenv` | ruby environment from [rbenv](https://github.com/rbenv/rbenv) | +| `rvm` | ruby environment from [rvm](https://rvm.io) | +| `fvm` | flutter environment from [fvm](https://github.com/leoafarias/fvm) | +| `luaenv` | lua environment from [luaenv](https://github.com/cehoffman/luaenv) | +| `jenv` | java environment from [jenv](https://github.com/jenv/jenv) | +| `plenv` | perl environment from [plenv](https://github.com/tokuhirom/plenv) | +| `node_version` | [node.js](https://nodejs.org/) version | +| `go_version` | [go](https://golang.org) version | +| `rust_version` | [rustc](https://www.rust-lang.org) version | +| `dotnet_version` | [dotnet](https://dotnet.microsoft.com) version | +| `kubecontext` | current [kubernetes](https://kubernetes.io/) context | +| `terraform` | [terraform](https://www.terraform.io) workspace | +| `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 | +| `gcloud` | [google cloud](https://cloud.google.com/) cli acccount and project | +| `google_app_cred` | [google application credentials](https://cloud.google.com/docs/authentication/production) | +| `nordvpn` | [nordvpn](https://nordvpn.com/) connection status | +| `ranger` | [ranger](https://github.com/ranger/ranger) shell | +| `nnn` | [nnn](https://github.com/jarun/nnn) shell | +| `vim_shell` | [vim](https://www.vim.org/) shell (`:sh`) | +| `midnight_commander` | [midnight commander](https://midnight-commander.org/) shell | +| `todo` | [todo](https://github.com/todotxt/todo.txt-cli) items | +| `timewarrior` | [timewarrior](https://timewarrior.net/) tracking status | +| `vpn_ip` | virtual private network indicator | +| `load` | CPU load | +| `disk_usage` | disk usage | +| `ram` | free RAM | +| `swap` | used swap | +| `public_ip` | public ip address | +| `proxy` | system-wide http/https/ftp proxy | +| `battery` | internal battery state and charge level (yep, batteries *literally* included) | ## Installation @@ -326,7 +351,23 @@ It works well with [Nerd Fonts](https://github.com/ryanoasis/nerd-fonts), the default system fonts. The full choice of style options is available only when using [Nerd Fonts](https://github.com/ryanoasis/nerd-fonts). -### Recommended: Meslo Nerd Font patched for Powerlevel10k +👇 **Recommended font**: Meslo Nerd Font patched for Powerlevel10k. 👇 + +### Meslo Nerd Font patched for Powerlevel10k + +Gorgeous monospace font designed by Jim Lyles for Apple, customized by André Berg, patched by Ryan +L McIntyre of Nerd Fonts, and hand-edited in FontForge by yours trully. Contains all glyphs and +symbols that Powerlevel10k may need. Battle-tested in dozens of different terminals on all major +operating systems. + +#### Automatic font installation + +If you are using iTerm2 or Termux, `p10k configure` can install the recommended font for you. +Simply answer `Yes` when asked whether to install *Meslo Nerd Font*. + +If you are using a different terminal, proceed with manual font installation. + +#### Manual font installation Download these four ttf files: - [MesloLGS NF Regular.ttf](https://github.com/romkatv/dotfiles-public/raw/master/.local/share/fonts/NerdFonts/MesloLGS%20NF%20Regular.ttf) @@ -337,9 +378,7 @@ Download these four ttf files: Double-click on each file and press "Install". This will make `MesloLGS NF` font available to all applications on your system. Configure your terminal to use this font: -- **iTerm2**: Type `p10k configure`, answer `Yes` when asked whether to install - *Meslo Nerd Font* and restart iTerm2 for the changes to take effect. Alternatively, open - *iTerm2 → Preferences → Profiles → Text* and set *Font* to `MesloLGS NF`. +- **iTerm2**: Open *iTerm2 → Preferences → Profiles → Text* and set *Font* to `MesloLGS NF`. - **Apple Terminal** Open *Terminal → Preferences → Profiles → Text*, click *Change* under *Font* and select `MesloLGS NF` family. - **Hyper**: Open *Hyper → Edit → Preferences* and change the value of `fontFamily` under @@ -799,3 +838,47 @@ This method of installation won't make anything slower or otherwise sub-par. ### What is the minimum supported zsh version? Zsh 5.1 or newer should work. Fast startup requires zsh >= 5.4. + +## Table of contents + +1. [Features](#features) +1. [Installation](#installation) + 1. [Manual](#manual) + 1. [Oh My Zsh](#oh-my-zsh) + 1. [Prezto](#prezto) + 1. [Zim](#zim) + 1. [Antigen](#antigen) + 1. [Zplug](#zplug) + 1. [Zgen](#zgen) + 1. [Antibody](#antibody) + 1. [Zplugin](#zplugin) +1. [Configuration](#configuration) + 1. [For new users](#for-new-users) + 1. [For Powerlevel9k users](#for-powerlevel9k-users) +1. [Fonts](#fonts) + 1. [Recommended: Meslo Nerd Font patched for Powerlevel10k](#recommended-meslo-nerd-font-patched-for-powerlevel10k) +1. [Try it in Docker](#try-it-in-docker) +1. [Is it really fast?](#is-it-really-fast) +1. [License](#license) +1. [FAQ](#faq) + 1. [What is instant prompt?](#what-is-instant-prompt) + 1. [Why do my icons and/or powerline symbols look bad?](#why-do-my-icons-andor-powerline-symbols-look-bad) + 1. [I'm getting "character not in range" error. What gives?](#im-getting-character-not-in-range-error-what-gives) + 1. [Why is my cursor in the wrong place?](#why-is-my-cursor-in-the-wrong-place) + 1. [Why is my prompt wrapping around in a weird way?](#why-is-my-prompt-wrapping-around-in-a-weird-way) + 1. [Why is my right prompt in the wrong place?](#why-is-my-right-prompt-in-the-wrong-place) + 1. [Why does the configuration wizard run automatically every time I start zsh?](#why-does-the-configuration-wizard-run-automatically-every-time-i-start-zsh) + 1. [I cannot install the recommended font. Help!](#i-cannot-install-the-recommended-font-help) + 1. [Why do I have a question mark symbol in my prompt? Is my font broken?](#why-do-i-have-a-question-mark-symbol-in-my-prompt-is-my-font-broken) + 1. [What do different symbols in Git status mean?](#what-do-different-symbols-in-git-status-mean) + 1. [How do I change the format of Git status?](#how-do-i-change-the-format-of-git-status) + 1. [How do I add username and/or hostname to prompt?](#how-do-i-add-username-andor-hostname-to-prompt) + 1. [How do I change colors?](#how-do-i-change-colors) + 1. [Why some prompt segments appear and disappear as I'm typing?](#why-some-prompt-segments-appear-and-disappear-as-im-typing) + 1. [Why does Powerlevel10k spawn extra processes?](#why-does-powerlevel10k-spawn-extra-processes) + 1. [Are there configuration options that make Powerlevel10k slow?](#are-there-configuration-options-that-make-powerlevel10k-slow) + 1. [Is Powerlevel10k fast to load?](#is-powerlevel10k-fast-to-load) + 1. [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) + 1. [Is there an AUR package for Powerlevel10k?](#is-there-an-aur-package-for-powerlevel10k) + 1. [I cannot make Powerlevel10k work with my plugin manager. Help!](#i-cannot-make-powerlevel10k-work-with-my-plugin-manager-help) + 1. [What is the minimum supported zsh version?](#what-is-the-minimum-supported-zsh-version) From 7ae901212c678a5fd9f3b732650663cfd4c6ac03 Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 29 Jan 2020 16:36:16 +0100 Subject: [PATCH 09/88] update toc; explain how the screenshots and gifs were produced; clean things up --- README.md | 69 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 238e8040..8cac1421 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,20 @@ # Powerlevel10k [![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's fast, flexible and easy to get started with. +Powerlevel10k is a theme for ZSH. It emphasizes [speed](#unparalleled-performance), +[flexibility](#extremely-customizable) and [out-of-the-box experience](#configuration-wizard). -![Powerlevel10k](https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/prompt-styles.png) +![Powerlevel10k]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/prompt-styles.png) To see what Powerlevel10k is about, scroll through [features](#features). -Ready to give it a try? +Powerlevel9k users, go [here](#powerlevel9k-compatibility). -1. Install [the recommended font](#recommended-meslo-nerd-font-patched-for-powerlevel10k). Optional - but highly recommended. +Ready to give Powerlevel10k a try? + +1. Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). *Optional but highly + recommended.* 1. Install Powerlevel10k for your plugin manager. - [Manual](#manual) 👈 **choose this if confused or uncertain** - [Oh My Zsh](#oh-my-zsh) @@ -21,8 +25,9 @@ Ready to give it a try? - [Zgen](#zgen) - [Antibody](#antibody) - [Zplugin](#zplugin) +1. Restart Zsh. If the configuration wizard doesn't start automatically, type `p10k configure`. -The full [table of contents](#table-of-contents) is at the bottom. +The full [table of contents](#table-of-contents) is at the bottom of the page. ## Features @@ -33,16 +38,16 @@ Type `p10k configure` to access the builtin configuration wizard right from your ![Powerlevel10k Configuration Wizard]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/configuration-wizard.gif) +All styles except [Pure](#pure-compatibility) are functionally equivalent. They display the same +information and differ only in presentation. + Configuration wizard creates `~/.p10k.zsh` based on your preferences. Additional prompt customization can be done by editing this file. It has many comments to help you navigate through configuration options. -All styles except [Pure](#pure-compatibility) are functionally equivalent. They display the same -information and differ only in presentation. - Tip: Install [the recommended font](#recommended-meslo-nerd-font-patched-for-powerlevel10k) before -running `p10k configure`. If you are using iTerm2, `p10k configure` can install the font for you. -Simply say *Yes* when asked. +running `p10k configure`. If you are using iTerm2 or Termux, `p10k configure` can install the font +for you. Simply say *Yes* when asked. ### Unparalleled performance @@ -92,7 +97,10 @@ sed 's/powerlevel9k/powerlevel10k/g' -i ~/.zshrc exec zsh ``` -Optional: Type `p10k configure` and explore exlusive Powerlevel10k prompt styles. +Optional steps (highly recommended): + +4. Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). +5. Type `p10k configure` and explore exlusive Powerlevel10k prompt styles. ### Pure compatibility @@ -129,6 +137,8 @@ upon Zsh startup so you can 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. +For details, see [FAQ](#what-is-instant-prompt). + ### Show on command The behavior of some commands depends on global environment. For example, `kubectl run ...` runs an @@ -454,7 +464,7 @@ covered by the same license. ## FAQ -### What is instant prompt? +### What is instant prompt? *Instant Prompt* is an optional feature of Powerlevel10k. When enabled, it gives you a limited prompt within a few milliseconds of starting zsh, allowing you to start hacking right away while zsh @@ -816,20 +826,20 @@ theme (so that you end up with no theme) and then installing Powerlevel10k manua 1. Disable the current theme in your framework / plugin manager. +- **oh-my-zsh:** Open `~/.zshrc` and remove the line that sets `ZSH_THEME`. It might look like this: + `ZSH_THEME="powerlevel9k/powerlevel9k"`. - **zplug:** Open `~/.zshrc` and remove the `zplug` command that refers to your current theme. For example, if you are currently using Powerlevel9k, look for `zplug bhilburn/powerlevel9k, use:powerlevel9k.zsh-theme`. - **prezto:** Open `~/.zpreztorc` and put `zstyle :prezto:module:prompt theme off` in it. Remove any other command that sets `theme` such as `zstyle :prezto:module:prompt theme powerlevel9k`. -- **oh-my-zsh:** Open `~/.zshrc` and remove the line that sets `ZSH_THEME`, such as - `ZSH_THEME=powerlevel9k/powerlevel9k`. -- **antigen:** Open `~/.zshrc` and remove the line that sets `antigen theme`, such as - `antigen theme powerlevel9k/powerlevel9k`. +- **antigen:** Open `~/.zshrc` and remove the line that sets `antigen theme`. It might look like + this: `antigen theme powerlevel9k/powerlevel9k`. 2. Install Powerlevel10k manually. ```zsh -git clone https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k +git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc ``` @@ -839,9 +849,27 @@ This method of installation won't make anything slower or otherwise sub-par. Zsh 5.1 or newer should work. Fast startup requires zsh >= 5.4. +### How were these screenshots and animated gifs created? + +All screenshots and animated gifs were recorded in GNOME Terminal with white text on black +background, Tango palette, and [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). + +![GNOME Terminal Color Settings]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/gnome-terminal-colors.png) + ## Table of contents 1. [Features](#features) + 1. [Configuration wizard](#configuration-wizard) + 1. [Unparalleled performance](#unparalleled-performance) + 1. [Powerlevel9k compatibility](#powerlevel9k-compatibility) + 1. [Pure compatibility](#pure-compatibility) + 1. [Instant prompt](#instant-prompt) + 1. [Show On Command](#show-on-command) + 1. [Transient prompt](#transient-prompt) + 1. [Current directory that just works](#current-directory-that-just-works) + 1. [Extremely customizable](#extremely-customizable) + 1. [Batteries included](#batteries-included) 1. [Installation](#installation) 1. [Manual](#manual) 1. [Oh My Zsh](#oh-my-zsh) @@ -856,7 +884,9 @@ Zsh 5.1 or newer should work. Fast startup requires zsh >= 5.4. 1. [For new users](#for-new-users) 1. [For Powerlevel9k users](#for-powerlevel9k-users) 1. [Fonts](#fonts) - 1. [Recommended: Meslo Nerd Font patched for Powerlevel10k](#recommended-meslo-nerd-font-patched-for-powerlevel10k) + 1. [Meslo Nerd Font patched for Powerlevel10k](#meslo-nerd-font-patched-for-powerlevel10k) + 1. [Automatic font installation](#automatic-font-installation) + 1. [Manual font installation](#manual-font-installation) 1. [Try it in Docker](#try-it-in-docker) 1. [Is it really fast?](#is-it-really-fast) 1. [License](#license) @@ -882,3 +912,4 @@ Zsh 5.1 or newer should work. Fast startup requires zsh >= 5.4. 1. [Is there an AUR package for Powerlevel10k?](#is-there-an-aur-package-for-powerlevel10k) 1. [I cannot make Powerlevel10k work with my plugin manager. Help!](#i-cannot-make-powerlevel10k-work-with-my-plugin-manager-help) 1. [What is the minimum supported zsh version?](#what-is-the-minimum-supported-zsh-version) + 1. [How were these screenshots and animated gifs created?](#how-were-these-screenshots-and-animated-gifs-created) From 6c507767b83d67ff8684605b97ef8263da24300c Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 29 Jan 2020 18:42:39 +0100 Subject: [PATCH 10/88] minor style fixes --- README.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 8cac1421..68c6e5fa 100644 --- a/README.md +++ b/README.md @@ -46,16 +46,15 @@ customization can be done by editing this file. It has many comments to help you configuration options. Tip: Install [the recommended font](#recommended-meslo-nerd-font-patched-for-powerlevel10k) before -running `p10k configure`. If you are using iTerm2 or Termux, `p10k configure` can install the font -for you. Simply say *Yes* when asked. +running `p10k configure`. ### Unparalleled performance When you hit *ENTER*, the next prompt appears instantly. With Powerlevel10k there is no prompt lag. -If you install Cygwin on Raspberry Pi, `cd` in a Linux Git repository and activate enough prompt +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 -matter what! +matter what you do! ![Powerlevel10k Performance]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/performance.gif) @@ -91,13 +90,15 @@ How to switch to Powerlevel10k if you are using Powerlevel9k with Oh My Zsh: 2. Replace `ZSH_THEME="powerlevel9k/powerlevel9k"` with `ZSH_THEME="powerlevel10k/powerlevel10k"` 3. Restart Zsh. +Copy-paste this command to perform the 3 steps automatically: + ```zsh git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k sed 's/powerlevel9k/powerlevel10k/g' -i ~/.zshrc exec zsh ``` -Optional steps (highly recommended): +Optional steps (*highly recommended*): 4. Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). 5. Type `p10k configure` and explore exlusive Powerlevel10k prompt styles. @@ -132,7 +133,7 @@ Powerlevel10k can remove Zsh startup lag *even if it's not caused by a theme*. This feature is called *Instant Prompt*. You need to explicitly enable it through `p10k configure` or [manually](#what-is-instant-prompt). It does what it says on the tin -- prints prompt instantly -upon Zsh startup so you can start typing while plugins are still loading. +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. @@ -146,13 +147,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 certain prompt segments appear only when they are -relevant to the command you are currently typing. +Enter *Show On Command*. This feature makes prompt segments appear only when they are relevant to +the command you are currently typing. ![Powerlevel10k Show On Command]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/show-on-command.gif) Configs created by `p10k configure` enable Show On Command for several prompt segments by default. +Here's the relevant parameter for kubernetes context: ```zsh # Show prompt segment "kubecontext" only when the command you are typing @@ -175,7 +177,7 @@ prompt when accepting a command line. 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 -extra space for typing commands without the usual downside of reduced scrollback density. +extra space for typing commands without the usual drawback of reduced scrollback density. ### Current directory that just works @@ -192,9 +194,9 @@ would be ambiguous (there was `~/wireguard` when the session was recorded). The Directory segments are shown in one of three colors: +- Truncated segments are bleak. - Important segments are bright and never truncated. These include the first and the last segment, roots of Git repositories, etc. -- Truncated segments are bleak. - 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. From 73878f398ac5ba73ff858e215b0045bf41d493c4 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 30 Jan 2020 08:25:24 +0100 Subject: [PATCH 11/88] add nix_shell prompt segment; see #448 --- config/p10k-classic.zsh | 11 +++++++++++ config/p10k-lean-8colors.zsh | 11 +++++++++++ config/p10k-lean.zsh | 11 +++++++++++ config/p10k-rainbow.zsh | 12 ++++++++++++ internal/icons.zsh | 5 +++++ internal/p10k.zsh | 14 +++++++++++++- 6 files changed, 63 insertions(+), 1 deletion(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 5cc282a9..78d02561 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -78,6 +78,7 @@ nnn # nnn shell (https://github.com/jarun/nnn) 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) vi_mode # vi mode (you don't need this if you've enabled prompt_char) # vpn_ip # virtual private network indicator # load # CPU load @@ -548,6 +549,16 @@ # Custom icon. # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' + #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]## + # Nix shell color. + typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=74 + + # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. + # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################################[ disk_usgae: 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 acb922c0..cb097be0 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -78,6 +78,7 @@ nnn # nnn shell (https://github.com/jarun/nnn) 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) # vpn_ip # virtual private network indicator # load # CPU load # disk_usage # disk usage @@ -544,6 +545,16 @@ # Custom icon. # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' + #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]## + # Nix shell color. + typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=4 + + # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. + # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################################[ disk_usgae: 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 018e6302..f7fd5f45 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -78,6 +78,7 @@ nnn # nnn shell (https://github.com/jarun/nnn) 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) # vpn_ip # virtual private network indicator # load # CPU load # disk_usage # disk usage @@ -544,6 +545,16 @@ # Custom icon. # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' + #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]## + # Nix shell color. + typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=74 + + # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. + # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################################[ disk_usgae: disk usage ]################################## # Colors for different levels of disk usage. typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=35 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 808236e9..37da7fb8 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -78,6 +78,7 @@ nnn # nnn shell (https://github.com/jarun/nnn) 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) vi_mode # vi mode (you don't need this if you've enabled prompt_char) # vpn_ip # virtual private network indicator # load # CPU load @@ -550,6 +551,17 @@ # Custom icon. # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' + #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]## + # Nix shell color. + # typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=0 + # typeset -g POWERLEVEL9K_NIX_SHELL_BACKGROUND=4 + + # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. + # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################################[ disk_usgae: 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 a96b747c..1c1bb0ee 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -124,6 +124,7 @@ function _p9k_init_icons() { PERL_ICON 'perl' NNN_ICON 'nnn' TIMEWARRIOR_ICON 'tw' + NIX_SHELL_ICON 'nix' ) ;; 'awesome-fontconfig') @@ -235,6 +236,7 @@ function _p9k_init_icons() { PERL_ICON 'perl' NNN_ICON 'nnn' TIMEWARRIOR_ICON 'tw' + NIX_SHELL_ICON 'nix' ) ;; 'awesome-mapped-fontconfig') @@ -350,6 +352,7 @@ function _p9k_init_icons() { PERL_ICON 'perl' NNN_ICON 'nnn' TIMEWARRIOR_ICON 'tw' + NIX_SHELL_ICON 'nix' ) ;; 'nerdfont-complete'|'nerdfont-fontconfig') @@ -462,6 +465,7 @@ function _p9k_init_icons() { PERL_ICON '\uE769' #  NNN_ICON 'nnn' TIMEWARRIOR_ICON '\uF132' #  + NIX_SHELL_ICON '\uF313' #  ) ;; *) @@ -573,6 +577,7 @@ function _p9k_init_icons() { PERL_ICON 'perl' NNN_ICON 'nnn' TIMEWARRIOR_ICON 'tw' + NIX_SHELL_ICON 'nix' ) ;; esac diff --git a/internal/p10k.zsh b/internal/p10k.zsh index a2c3f756..ce85b43b 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4289,6 +4289,18 @@ function instant_prompt_vim_shell() { _p9k_prompt_segment prompt_vim_shell green $_p9k_color1 VIM_ICON 0 '$VIMRUNTIME' '' } +function prompt_nix_shell() { + _p9k_prompt_segment $0 4 $_p9k_color1 NIX_SHELL_ICON 0 '' "${(M)IN_NIX_SHELL:#(pure|impure)}" +} + +_p9k_prompt_nix_shell_init() { + typeset -g "_p9k__segment_cond_${_p9k_prompt_side}[_p9k_segment_index]"='${IN_NIX_SHELL:#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)}' +} + function prompt_terraform() { local ws=default if [[ -n $TF_WORKSPACE ]]; then @@ -6441,7 +6453,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v30\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v31\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$DEFAULT_USER\1${ZLE_RPROMPT_INDENT:-1}\1$P9K_SSH\1$__p9k_ksh_arrays' From 1f2251b79924dfb179b9ef842b044fd0cd1571a1 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 30 Jan 2020 08:29:20 +0100 Subject: [PATCH 12/88] bug fix: don't cache range and nnn segments as their content is not static --- internal/p10k.zsh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index ce85b43b..73c1f821 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4234,9 +4234,7 @@ _p9k_prompt_nordvpn_init() { } function prompt_ranger() { - local -i len=$#_p9k__prompt _p9k_prompt_segment $0 $_p9k_color1 yellow RANGER_ICON 0 '' $RANGER_LEVEL - typeset -g "_p9k__segment_val_${_p9k_prompt_side}[_p9k_segment_index]"=$_p9k__prompt[len+1,-1] } _p9k_prompt_ranger_init() { @@ -4262,9 +4260,7 @@ function instant_prompt_midnight_commander() { } function prompt_nnn() { - local -i len=$#_p9k__prompt _p9k_prompt_segment $0 6 $_p9k_color1 NNN_ICON 0 '' $NNNLVL - typeset -g "_p9k__segment_val_${_p9k_prompt_side}[_p9k_segment_index]"=$_p9k__prompt[len+1,-1] } _p9k_prompt_nnn_init() { From 788ee7df4d134b91942c54a6f5a1e7153bf6df98 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 30 Jan 2020 09:01:16 +0100 Subject: [PATCH 13/88] bug fix: remove spurious "entry=" from instant prompt --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 73c1f821..da3cda57 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4956,7 +4956,7 @@ _p9k_dump_instant_prompt() { echo -n >$tmp || return fi - { print -rn -- entry=$'\x1e'$_p9k__instant_prompt_sig$'\x1f'${(pj:\x1f:)_p9k_t}$'\x1f'$_p9k_instant_prompt >>$tmp } 2>/dev/null || return + { print -rn -- $'\x1e'$_p9k__instant_prompt_sig$'\x1f'${(pj:\x1f:)_p9k_t}$'\x1f'$_p9k_instant_prompt >>$tmp } 2>/dev/null || return zf_mv -f $tmp $prompt_file 2>/dev/null || return } From 23e241bf6730c7ca6c6fe728950fe81e29804655 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 30 Jan 2020 09:44:25 +0100 Subject: [PATCH 14/88] update color scheme --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 68c6e5fa..daff0962 100644 --- a/README.md +++ b/README.md @@ -853,8 +853,9 @@ Zsh 5.1 or newer should work. Fast startup requires zsh >= 5.4. ### How were these screenshots and animated gifs created? -All screenshots and animated gifs were recorded in GNOME Terminal with white text on black -background, Tango palette, and [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). +All screenshots and animated gifs were recorded in GNOME Terminal with +[the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) and Tango Dark color scheme 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) From c65260aaab46fee3d1eab033db258d0a366f03b4 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 30 Jan 2020 10:57:11 +0100 Subject: [PATCH 15/88] change the default timewarrior icon (shield => watch); see #295 --- 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 1c1bb0ee..6b8dd9f8 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -464,7 +464,7 @@ function _p9k_init_icons() { LUA_ICON '\uE620' #  PERL_ICON '\uE769' #  NNN_ICON 'nnn' - TIMEWARRIOR_ICON '\uF132' #  + TIMEWARRIOR_ICON '\uF49B' #  NIX_SHELL_ICON '\uF313' #  ) ;; diff --git a/internal/p10k.zsh b/internal/p10k.zsh index da3cda57..2b8ce324 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6449,7 +6449,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v31\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v32\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$DEFAULT_USER\1${ZLE_RPROMPT_INDENT:-1}\1$P9K_SSH\1$__p9k_ksh_arrays' From d800fd5f41b9108e75e7dbee936495cb49454a58 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 30 Jan 2020 12:57:28 +0100 Subject: [PATCH 16/88] rewrite the color faq; move omz p9k migration instructions to faq --- README.md | 111 ++++++++++++++++++++++------------- config/p10k-classic.zsh | 2 +- config/p10k-lean-8colors.zsh | 2 +- config/p10k-lean.zsh | 2 +- config/p10k-rainbow.zsh | 2 +- 5 files changed, 73 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index daff0962..07e0cd82 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ Powerlevel10k is a theme for ZSH. It emphasizes [speed](#unparalleled-performance), [flexibility](#extremely-customizable) and [out-of-the-box experience](#configuration-wizard). +Powerlevel10k is committed to being best-in-class in each of these categories. ![Powerlevel10k]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/prompt-styles.png) @@ -25,9 +26,8 @@ Ready to give Powerlevel10k a try? - [Zgen](#zgen) - [Antibody](#antibody) - [Zplugin](#zplugin) -1. Restart Zsh. If the configuration wizard doesn't start automatically, type `p10k configure`. - -The full [table of contents](#table-of-contents) is at the bottom of the page. +1. Restart Zsh. +1. Type `p10k configure` if the configuration wizard doesn't start automatically. ## Features @@ -61,12 +61,12 @@ matter what you do! 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 | -| `touch x y` | `?2` | 2 untracked files | -| `rm COPYING` | `!1` | 1 unstaged change | -| `echo 2.7.3 >.python-version` | `🐍 2.7.3` | the current python version in 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 2.7.3 >.python-version` | `🐍 2.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 @@ -82,26 +82,12 @@ configuration parameters. If you are currently using Powerlevel9k, you can switch to Powerlevel10k in just a few seconds. All your `POWERLEVEL9K` configuration parameters will still work. Prompt will look the same as -before but it will be *much* faster. +before ([almost]( + #does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config)) +but it will be [much faster](#unparalleled-performance) ([certainly](#is-it-really-fast)). -How to switch to Powerlevel10k if you are using Powerlevel9k with Oh My Zsh: - -1. Clone powerlevel10k repository. -2. Replace `ZSH_THEME="powerlevel9k/powerlevel9k"` with `ZSH_THEME="powerlevel10k/powerlevel10k"` -3. Restart Zsh. - -Copy-paste this command to perform the 3 steps automatically: - -```zsh -git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k -sed 's/powerlevel9k/powerlevel10k/g' -i ~/.zshrc -exec zsh -``` - -Optional steps (*highly recommended*): - -4. Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). -5. Type `p10k configure` and explore exlusive Powerlevel10k prompt styles. +FAQ: [I'm using Powerlevel9k with Oh My Zsh. How do I migrate?]( + #im-using-powerlevel9k-with-oh-my-zsh-how-do-i-migrate) ### Pure compatibility @@ -431,7 +417,31 @@ docker run -e TERM -it --rm debian:buster bash -uec ' exec zsh' ``` -## Is it really fast? +## License + +Powerlevel10k is released under the +[MIT license](https://github.com/romkatv/powerlevel10k/blob/master/LICENSE). + +## FAQ + +### 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 +# Replace ZSH_THEME="powerlevel9k/powerlevel9k" with ZSH_THEME="powerlevel10k/powerlevel10k". +sed 's/powerlevel9k/powerlevel10k/g' -i ~/.zshrc +# Restart Zsh. +exec zsh +``` +2. *Optional but highly recommended:* + 1. Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). + 1. Type `p10k configure` and chose your favorite prompt style. + +Related: [Powerlevel9k compatibility](#powerlevel9k-compatibility). + +### Is it really fast? Yes. @@ -458,14 +468,6 @@ Powerlevel10k, on the other hand, doesn't require trading latency for utility -- instant with any configuration. It stays well below the 50 ms mark, leaving most of the latency budget for other plugins you might install. -## License - -Powerlevel10k is released under the -[MIT license](https://github.com/romkatv/powerlevel10k/blob/master/LICENSE). Contributions are -covered by the same license. - -## FAQ - ### What is instant prompt? *Instant Prompt* is an optional feature of Powerlevel10k. When enabled, it gives you a limited @@ -749,15 +751,39 @@ parameters or change their values. ### How do I change colors? +You can either change the color palette used by your terminal or set colors through Powerlevel10k +configuration parameters. + +#### Change the color palette used by your terminal + +How exactly you change the terminal color pallete (a.k.a. color scheme, or theme) depends on the +kind of terminal you are using. Look around in terminal's settings/preferences or consult +documentation. + +When you change the color palette used by your terminal, 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 with 8 colors* or *Pure with original colors*. Other styles use higher-numbered +colors, so they look the same in any terminal color palette. + +#### Set colors through Powerlevel10k configuration parameters + Open `~/.p10k.zsh`, search for "color", "foreground" and "background" and change values of -appropriate parameters. Colors are specified using numbers from 0 to 255. Colors from 0 to 15 look -differently in different terminals. Many terminals also support customization of these colors -through color schemes or themes. Colors from 16 to 255 always look the same. +appropriate parameters. For example, here's how you can set the foreground of `time` prompt segment +to bright red: + +```zsh +typeset -g POWERLEVEL9K_TIME_FOREGROUND=160 +``` + +Colors are specified using numbers from 0 to 255. Colors from 0 to 15 look differently in different +terminals. Many terminals also support customization of these colors through color palettes +(a.k.a. color schemes, or themes). Colors from 16 to 255 always look the same. To see how different colors look in your terminal, run the following command: ```zsh -for i in {0..255}; do print -Pn "%${i}F${(l:3::0:)i}%f " ${${(M)$((i%8)):#7}:+$'\n'}; done +for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%8)):#7}:+$'\n'}; done ``` ### Why does Powerlevel10k spawn extra processes? @@ -891,9 +917,10 @@ custom background color (`#171A1B` instead of `#2E3436` -- twice as dark). 1. [Automatic font installation](#automatic-font-installation) 1. [Manual font installation](#manual-font-installation) 1. [Try it in Docker](#try-it-in-docker) -1. [Is it really fast?](#is-it-really-fast) 1. [License](#license) 1. [FAQ](#faq) + 1. [I'm using Powerlevel9k with Oh My Zsh. How do I migrate?](#im-using-powerlevel9k-with-oh-my-zsh-how-do-i-migrate) + 1. [Is it really fast?](#is-it-really-fast) 1. [What is instant prompt?](#what-is-instant-prompt) 1. [Why do my icons and/or powerline symbols look bad?](#why-do-my-icons-andor-powerline-symbols-look-bad) 1. [I'm getting "character not in range" error. What gives?](#im-getting-character-not-in-range-error-what-gives) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 78d02561..609f88be 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -3,7 +3,7 @@ # # Tip: Looking for a nice color? Here's a one-liner to print colormap. # -# for i in {0..255}; do print -Pn "%${i}F${(l:3::0:)i}%f " ${${(M)$((i%8)):#7}:+$'\n'}; done +# for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%8)):#7}:+$'\n'}; done # Temporarily change options. 'builtin' 'local' '-a' 'p10k_config_opts' diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index cb097be0..6ee08adb 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -3,7 +3,7 @@ # # Tip: Looking for a nice color? Here's a one-liner to print colormap. # -# for i in {0..255}; do print -Pn "%${i}F${(l:3::0:)i}%f " ${${(M)$((i%8)):#7}:+$'\n'}; done +# for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%8)):#7}:+$'\n'}; done # Temporarily change options. 'builtin' 'local' '-a' 'p10k_config_opts' diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index f7fd5f45..8f4a4b5f 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -3,7 +3,7 @@ # # Tip: Looking for a nice color? Here's a one-liner to print colormap. # -# for i in {0..255}; do print -Pn "%${i}F${(l:3::0:)i}%f " ${${(M)$((i%8)):#7}:+$'\n'}; done +# for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%8)):#7}:+$'\n'}; done # Temporarily change options. 'builtin' 'local' '-a' 'p10k_config_opts' diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 37da7fb8..56bdef02 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -3,7 +3,7 @@ # # Tip: Looking for a nice color? Here's a one-liner to print colormap. # -# for i in {0..255}; do print -Pn "%${i}F${(l:3::0:)i}%f " ${${(M)$((i%8)):#7}:+$'\n'}; done +# for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%8)):#7}:+$'\n'}; done # Temporarily change options. 'builtin' 'local' '-a' 'p10k_config_opts' From 2913765868f8f386da8d488970627bbb5fb85f9f Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 30 Jan 2020 13:36:15 +0100 Subject: [PATCH 17/88] update 'try it in docker' section --- README.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 07e0cd82..62b5d04d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Powerlevel10k [![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](#unparalleled-performance), +Powerlevel10k is a theme for ZSH. It emphasizes [speed](#uncompromising-performance), [flexibility](#extremely-customizable) and [out-of-the-box experience](#configuration-wizard). Powerlevel10k is committed to being best-in-class in each of these categories. @@ -48,7 +48,7 @@ configuration options. Tip: Install [the recommended font](#recommended-meslo-nerd-font-patched-for-powerlevel10k) before running `p10k configure`. -### Unparalleled performance +### Uncompromising performance 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 @@ -84,7 +84,7 @@ If you are currently using Powerlevel9k, you can switch to Powerlevel10k in just 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)) -but it will be [much faster](#unparalleled-performance) ([certainly](#is-it-really-fast)). +but it will be [much faster](#uncompromising-performance) ([certainly](#is-it-really-fast)). FAQ: [I'm using Powerlevel9k with Oh My Zsh. How do I migrate?]( #im-using-powerlevel9k-with-oh-my-zsh-how-do-i-migrate) @@ -408,15 +408,20 @@ Try Powerlevel10k in Docker. You can safely make any changes to the file system the theme. Once you exit zsh, the image is deleted. ```zsh -docker run -e TERM -it --rm debian:buster bash -uec ' +docker run -e TERM -e COLORTERM -it --rm debian:buster bash -uec ' apt update - apt install -y git zsh + apt install -y git zsh nano vim git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k echo "source ~/powerlevel10k/powerlevel10k.zsh-theme" >>~/.zshrc cd ~/powerlevel10k exec zsh' ``` +Tip: Install [the recommended font](#recommended-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. + ## License Powerlevel10k is released under the @@ -890,7 +895,7 @@ custom background color (`#171A1B` instead of `#2E3436` -- twice as dark). 1. [Features](#features) 1. [Configuration wizard](#configuration-wizard) - 1. [Unparalleled performance](#unparalleled-performance) + 1. [Uncompromising performance](#uncompromising-performance) 1. [Powerlevel9k compatibility](#powerlevel9k-compatibility) 1. [Pure compatibility](#pure-compatibility) 1. [Instant prompt](#instant-prompt) From 1bdee256e5d274f428fdcbadea46c9442139b365 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 30 Jan 2020 16:42:34 +0100 Subject: [PATCH 18/88] add POWERLEVEL9K_LEGACY_ICON_SPACING --- internal/icons.zsh | 368 +++++++++++++++++++++++---------------------- 1 file changed, 188 insertions(+), 180 deletions(-) diff --git a/internal/icons.zsh b/internal/icons.zsh index 1c1bb0ee..782217f7 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -1,8 +1,8 @@ typeset -gA icons function _p9k_init_icons() { - [[ $+_p9k_icon_mode == 1 && $_p9k_icon_mode == $POWERLEVEL9K_MODE ]] && return - typeset -g _p9k_icon_mode=$POWERLEVEL9K_MODE + [[ $+_p9k_icon_mode == 1 && $_p9k_icon_mode == $POWERLEVEL9K_MODE/$POWERLEVEL9K_LEGACY_ICON_SPACING ]] && return + typeset -g _p9k_icon_mode=$POWERLEVEL9K_MODE/$POWERLEVEL9K_LEGACY_ICON_SPACING zmodload zsh/langinfo if [[ ${langinfo[CODESET]:-} != (utf|UTF)(-|)8 ]]; then typeset -g _p9k_locale=${${(@M)$(locale -a):#*.(utf|UTF)(-|)8}[1]:-en_US.UTF-8} @@ -10,6 +10,14 @@ function _p9k_init_icons() { typeset -g _p9k_locale= fi + if [[ $POWERLEVEL9K_LEGACY_ICON_SPACING == true ]]; then + local s= + local q=' ' + else + local s=' ' + local q= + fi + case $POWERLEVEL9K_MODE in 'flat'|'awesome-patched') # Awesome-Patched Font required! See: @@ -21,61 +29,61 @@ function _p9k_init_icons() { LEFT_SEGMENT_END_SEPARATOR ' ' # Whitespace LEFT_SUBSEGMENT_SEPARATOR '\uE0B1' #  RIGHT_SUBSEGMENT_SEPARATOR '\uE0B3' #  - CARRIAGE_RETURN_ICON '\u21B5 ' # ↵ + CARRIAGE_RETURN_ICON '\u21B5'$s # ↵ ROOT_ICON '\uE801' #  SUDO_ICON '\uE0A2' #  RUBY_ICON '\uE847 ' #  - AWS_ICON '\uE895 ' #  - AWS_EB_ICON '\U1F331' # 🌱 + AWS_ICON '\uE895'$s #  + AWS_EB_ICON '\U1F331'$q # 🌱 BACKGROUND_JOBS_ICON '\uE82F ' #  - TEST_ICON '\uE891 ' #  + TEST_ICON '\uE891'$s #  TODO_ICON '\u2611' # ☑ - BATTERY_ICON '\uE894 ' #  + BATTERY_ICON '\uE894'$s #  DISK_ICON '\uE1AE ' #  OK_ICON '\u2714' # ✔ FAIL_ICON '\u2718' # ✘ SYMFONY_ICON 'SF' - NODE_ICON '\u2B22 ' # ⬢ + NODE_ICON '\u2B22'$s # ⬢ MULTILINE_FIRST_PROMPT_PREFIX '\u256D\U2500' # ╭─ MULTILINE_NEWLINE_PROMPT_PREFIX '\u251C\U2500' # ├─ MULTILINE_LAST_PROMPT_PREFIX '\u2570\U2500 ' # ╰─ - APPLE_ICON '\uE26E ' #  - WINDOWS_ICON '\uE26F ' #  - FREEBSD_ICON '\U1F608' # 😈 - ANDROID_ICON '\uE270 ' #  - LINUX_ICON '\uE271 ' #  - LINUX_ARCH_ICON '\uE271 ' #  - LINUX_DEBIAN_ICON '\uE271 ' #  - LINUX_RASPBIAN_ICON '\uE271 ' #  - LINUX_UBUNTU_ICON '\uE271 ' #  - LINUX_CENTOS_ICON '\uE271 ' #  - LINUX_COREOS_ICON '\uE271 ' #  - LINUX_ELEMENTARY_ICON '\uE271 ' #  - LINUX_MINT_ICON '\uE271 ' #  - LINUX_FEDORA_ICON '\uE271 ' #  - LINUX_GENTOO_ICON '\uE271 ' #  - LINUX_MAGEIA_ICON '\uE271 ' #  - LINUX_NIXOS_ICON '\uE271 ' #  - LINUX_MANJARO_ICON '\uE271 ' #  - LINUX_DEVUAN_ICON '\uE271 ' #  - LINUX_ALPINE_ICON '\uE271 ' #  - LINUX_AOSC_ICON '\uE271 ' #  - LINUX_OPENSUSE_ICON '\uE271 ' #  - LINUX_SABAYON_ICON '\uE271 ' #  - LINUX_SLACKWARE_ICON '\uE271 ' #  - SUNOS_ICON '\U1F31E' # 🌞 - HOME_ICON '\uE12C ' #  - HOME_SUB_ICON '\uE18D ' #  - FOLDER_ICON '\uE818 ' #  - NETWORK_ICON '\uE1AD ' #  - ETC_ICON '\uE82F ' #  + APPLE_ICON '\uE26E'$s #  + WINDOWS_ICON '\uE26F'$s #  + FREEBSD_ICON '\U1F608'$q # 😈 + ANDROID_ICON '\uE270'$s #  + LINUX_ICON '\uE271'$s #  + LINUX_ARCH_ICON '\uE271'$s #  + LINUX_DEBIAN_ICON '\uE271'$s #  + LINUX_RASPBIAN_ICON '\uE271'$s #  + LINUX_UBUNTU_ICON '\uE271'$s #  + LINUX_CENTOS_ICON '\uE271'$s #  + LINUX_COREOS_ICON '\uE271'$s #  + LINUX_ELEMENTARY_ICON '\uE271'$s #  + LINUX_MINT_ICON '\uE271'$s #  + LINUX_FEDORA_ICON '\uE271'$s #  + LINUX_GENTOO_ICON '\uE271'$s #  + LINUX_MAGEIA_ICON '\uE271'$s #  + LINUX_NIXOS_ICON '\uE271'$s #  + LINUX_MANJARO_ICON '\uE271'$s #  + LINUX_DEVUAN_ICON '\uE271'$s #  + LINUX_ALPINE_ICON '\uE271'$s #  + LINUX_AOSC_ICON '\uE271'$s #  + LINUX_OPENSUSE_ICON '\uE271'$s #  + LINUX_SABAYON_ICON '\uE271'$s #  + LINUX_SLACKWARE_ICON '\uE271'$s #  + SUNOS_ICON '\U1F31E'$q # 🌞 + HOME_ICON '\uE12C'$s #  + HOME_SUB_ICON '\uE18D'$s #  + FOLDER_ICON '\uE818'$s #  + NETWORK_ICON '\uE1AD'$s #  + ETC_ICON '\uE82F'$s #  LOAD_ICON '\uE190 ' #  - SWAP_ICON '\uE87D ' #  + SWAP_ICON '\uE87D'$s #  RAM_ICON '\uE1E2 ' #  - SERVER_ICON '\uE895 ' #  - VCS_UNTRACKED_ICON '\uE16C ' #  - VCS_UNSTAGED_ICON '\uE17C ' #  - VCS_STAGED_ICON '\uE168 ' #  + SERVER_ICON '\uE895'$s #  + VCS_UNTRACKED_ICON '\uE16C'$s #  + VCS_UNSTAGED_ICON '\uE17C'$s #  + VCS_STAGED_ICON '\uE168'$s #  VCS_STASH_ICON '\uE133 ' #  #VCS_INCOMING_CHANGES_ICON '\uE1EB ' #  #VCS_INCOMING_CHANGES_ICON '\uE80D ' #  @@ -94,20 +102,20 @@ function _p9k_init_icons() { VCS_GIT_BITBUCKET_ICON '\uE20E ' # VCS_GIT_GITLAB_ICON '\uE20E ' # VCS_HG_ICON '\uE1C3 ' #  - VCS_SVN_ICON 'svn' + VCS_SVN_ICON 'svn'$q RUST_ICON 'R' - PYTHON_ICON '\uE63C ' #  (doesn't always work) + PYTHON_ICON '\uE63C'$s #  (doesn't always work) SWIFT_ICON 'Swift' GO_ICON 'Go' PUBLIC_IP_ICON 'IP' LOCK_ICON '\UE138' #  - EXECUTION_TIME_ICON '\UE89C ' #  + EXECUTION_TIME_ICON '\UE89C'$s #  SSH_ICON 'ssh' VPN_ICON '\UE138' - KUBERNETES_ICON '\U2388 ' # ⎈ - DROPBOX_ICON '\UF16B ' #  (doesn't always work) - DATE_ICON '\uE184 ' #  - TIME_ICON '\uE12E ' #  + KUBERNETES_ICON '\U2388'$s # ⎈ + DROPBOX_ICON '\UF16B'$s #  (doesn't always work) + DATE_ICON '\uE184'$s #  + TIME_ICON '\uE12E'$s #  JAVA_ICON '\U2615' # ☕︎ LARAVEL_ICON '' RANGER_ICON '\u2B50' # ⭐ @@ -138,13 +146,13 @@ function _p9k_init_icons() { LEFT_SUBSEGMENT_SEPARATOR '\uE0B1' #  RIGHT_SUBSEGMENT_SEPARATOR '\uE0B3' #  CARRIAGE_RETURN_ICON '\u21B5' # ↵ - ROOT_ICON '\uF201 ' #  - SUDO_ICON '\uF09C ' #  + ROOT_ICON '\uF201'$s #  + SUDO_ICON '\uF09C'$s #  RUBY_ICON '\uF219 ' #  - AWS_ICON '\uF270 ' #  - AWS_EB_ICON '\U1F331' # 🌱 + AWS_ICON '\uF270'$s #  + AWS_EB_ICON '\U1F331'$q # 🌱 BACKGROUND_JOBS_ICON '\uF013 ' #  - TEST_ICON '\uF291 ' #  + TEST_ICON '\uF291'$s #  TODO_ICON '\u2611' # ☑ BATTERY_ICON '\U1F50B' # 🔋 DISK_ICON '\uF0A0 ' #  @@ -155,43 +163,43 @@ function _p9k_init_icons() { MULTILINE_FIRST_PROMPT_PREFIX '\u256D\U2500' # ╭─ MULTILINE_NEWLINE_PROMPT_PREFIX '\u251C\U2500' # ├─ MULTILINE_LAST_PROMPT_PREFIX '\u2570\U2500 ' # ╰─ - APPLE_ICON '\uF179 ' #  - WINDOWS_ICON '\uF17A ' #  - FREEBSD_ICON '\U1F608' # 😈 - ANDROID_ICON '\uE17B ' #  (doesn't always work) - LINUX_ICON '\uF17C ' #  - LINUX_ARCH_ICON '\uF17C ' #  - LINUX_DEBIAN_ICON '\uF17C ' #  - LINUX_RASPBIAN_ICON '\uF17C ' #  - LINUX_UBUNTU_ICON '\uF17C ' #  - LINUX_CENTOS_ICON '\uF17C ' #  - LINUX_COREOS_ICON '\uF17C ' #  - LINUX_ELEMENTARY_ICON '\uF17C ' #  - LINUX_MINT_ICON '\uF17C ' #  - LINUX_FEDORA_ICON '\uF17C ' #  - LINUX_GENTOO_ICON '\uF17C ' #  - LINUX_MAGEIA_ICON '\uF17C ' #  - LINUX_NIXOS_ICON '\uF17C ' #  - LINUX_MANJARO_ICON '\uF17C ' #  - LINUX_DEVUAN_ICON '\uF17C ' #  - LINUX_ALPINE_ICON '\uF17C ' #  - LINUX_AOSC_ICON '\uF17C ' #  - LINUX_OPENSUSE_ICON '\uF17C ' #  - LINUX_SABAYON_ICON '\uF17C ' #  - LINUX_SLACKWARE_ICON '\uF17C ' #  + APPLE_ICON '\uF179'$s #  + WINDOWS_ICON '\uF17A'$s #  + FREEBSD_ICON '\U1F608'$q # 😈 + ANDROID_ICON '\uE17B'$s #  (doesn't always work) + LINUX_ICON '\uF17C'$s #  + LINUX_ARCH_ICON '\uF17C'$s #  + LINUX_DEBIAN_ICON '\uF17C'$s #  + LINUX_RASPBIAN_ICON '\uF17C'$s #  + LINUX_UBUNTU_ICON '\uF17C'$s #  + LINUX_CENTOS_ICON '\uF17C'$s #  + LINUX_COREOS_ICON '\uF17C'$s #  + LINUX_ELEMENTARY_ICON '\uF17C'$s #  + LINUX_MINT_ICON '\uF17C'$s #  + LINUX_FEDORA_ICON '\uF17C'$s #  + LINUX_GENTOO_ICON '\uF17C'$s #  + LINUX_MAGEIA_ICON '\uF17C'$s #  + LINUX_NIXOS_ICON '\uF17C'$s #  + LINUX_MANJARO_ICON '\uF17C'$s #  + LINUX_DEVUAN_ICON '\uF17C'$s #  + LINUX_ALPINE_ICON '\uF17C'$s #  + LINUX_AOSC_ICON '\uF17C'$s #  + LINUX_OPENSUSE_ICON '\uF17C'$s #  + LINUX_SABAYON_ICON '\uF17C'$s #  + LINUX_SLACKWARE_ICON '\uF17C'$s #  SUNOS_ICON '\uF185 ' #  - HOME_ICON '\uF015 ' #  - HOME_SUB_ICON '\uF07C ' #  - FOLDER_ICON '\uF115 ' #  + HOME_ICON '\uF015'$s #  + HOME_SUB_ICON '\uF07C'$s #  + FOLDER_ICON '\uF115'$s #  ETC_ICON '\uF013 ' #  - NETWORK_ICON '\uF09E ' #  + NETWORK_ICON '\uF09E'$s #  LOAD_ICON '\uF080 ' #  - SWAP_ICON '\uF0E4 ' #  - RAM_ICON '\uF0E4 ' #  - SERVER_ICON '\uF233 ' #  - VCS_UNTRACKED_ICON '\uF059 ' #  - VCS_UNSTAGED_ICON '\uF06A ' #  - VCS_STAGED_ICON '\uF055 ' #  + SWAP_ICON '\uF0E4'$s #  + RAM_ICON '\uF0E4'$s #  + SERVER_ICON '\uF233'$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 ' #  @@ -206,18 +214,18 @@ function _p9k_init_icons() { VCS_GIT_BITBUCKET_ICON '\uF171 ' #  VCS_GIT_GITLAB_ICON '\uF296 ' #  VCS_HG_ICON '\uF0C3 ' #  - VCS_SVN_ICON 'svn' + VCS_SVN_ICON 'svn'$q RUST_ICON '\uE6A8' #  - PYTHON_ICON '\uE63C ' #  + PYTHON_ICON '\uE63C'$s #  SWIFT_ICON 'Swift' GO_ICON 'Go' PUBLIC_IP_ICON 'IP' LOCK_ICON '\UF023' #  - EXECUTION_TIME_ICON '\uF253 ' #  + EXECUTION_TIME_ICON '\uF253'$s #  SSH_ICON 'ssh' VPN_ICON '\uF023' KUBERNETES_ICON '\U2388' # ⎈ - DROPBOX_ICON '\UF16B ' #  + DROPBOX_ICON '\UF16B'$s #  DATE_ICON '\uF073 ' #  TIME_ICON '\uF017 ' #  JAVA_ICON '\U2615' # ☕︎ @@ -258,57 +266,57 @@ function _p9k_init_icons() { RIGHT_SUBSEGMENT_SEPARATOR '\uE0B3' #  CARRIAGE_RETURN_ICON '\u21B5' # ↵ ROOT_ICON "${CODEPOINT_OF_OCTICONS_ZAP:+\\u$CODEPOINT_OF_OCTICONS_ZAP}" - SUDO_ICON "${CODEPOINT_OF_AWESOME_UNLOCK:+\\u$CODEPOINT_OF_AWESOME_UNLOCK }" + SUDO_ICON "${CODEPOINT_OF_AWESOME_UNLOCK:+\\u$CODEPOINT_OF_AWESOME_UNLOCK$s}" RUBY_ICON "${CODEPOINT_OF_OCTICONS_RUBY:+\\u$CODEPOINT_OF_OCTICONS_RUBY }" - AWS_ICON "${CODEPOINT_OF_AWESOME_SERVER:+\\u$CODEPOINT_OF_AWESOME_SERVER }" - AWS_EB_ICON '\U1F331' # 🌱 + AWS_ICON "${CODEPOINT_OF_AWESOME_SERVER:+\\u$CODEPOINT_OF_AWESOME_SERVER$s}" + AWS_EB_ICON '\U1F331'$q # 🌱 BACKGROUND_JOBS_ICON "${CODEPOINT_OF_AWESOME_COG:+\\u$CODEPOINT_OF_AWESOME_COG }" - TEST_ICON "${CODEPOINT_OF_AWESOME_BUG:+\\u$CODEPOINT_OF_AWESOME_BUG }" - TODO_ICON "${CODEPOINT_OF_AWESOME_CHECK_SQUARE_O:+\\u$CODEPOINT_OF_AWESOME_CHECK_SQUARE_O }" - BATTERY_ICON "${CODEPOINT_OF_AWESOME_BATTERY_FULL:+\\U$CODEPOINT_OF_AWESOME_BATTERY_FULL }" + TEST_ICON "${CODEPOINT_OF_AWESOME_BUG:+\\u$CODEPOINT_OF_AWESOME_BUG$s}" + TODO_ICON "${CODEPOINT_OF_AWESOME_CHECK_SQUARE_O:+\\u$CODEPOINT_OF_AWESOME_CHECK_SQUARE_O$s}" + BATTERY_ICON "${CODEPOINT_OF_AWESOME_BATTERY_FULL:+\\U$CODEPOINT_OF_AWESOME_BATTERY_FULL$s}" DISK_ICON "${CODEPOINT_OF_AWESOME_HDD_O:+\\u$CODEPOINT_OF_AWESOME_HDD_O }" - OK_ICON "${CODEPOINT_OF_AWESOME_CHECK:+\\u$CODEPOINT_OF_AWESOME_CHECK }" + OK_ICON "${CODEPOINT_OF_AWESOME_CHECK:+\\u$CODEPOINT_OF_AWESOME_CHECK$s}" FAIL_ICON "${CODEPOINT_OF_AWESOME_TIMES:+\\u$CODEPOINT_OF_AWESOME_TIMES}" SYMFONY_ICON 'SF' NODE_ICON '\u2B22' # ⬢ MULTILINE_FIRST_PROMPT_PREFIX '\u256D\U2500' # ╭─ MULTILINE_NEWLINE_PROMPT_PREFIX '\u251C\U2500' # ├─ MULTILINE_LAST_PROMPT_PREFIX '\u2570\U2500 ' # ╰─ - APPLE_ICON "${CODEPOINT_OF_AWESOME_APPLE:+\\u$CODEPOINT_OF_AWESOME_APPLE }" - FREEBSD_ICON '\U1F608' # 😈 - LINUX_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX }" - LINUX_ARCH_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX }" - LINUX_DEBIAN_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX }" - LINUX_RASPBIAN_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX }" - LINUX_UBUNTU_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX }" - LINUX_CENTOS_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX }" - LINUX_COREOS_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX }" - LINUX_ELEMENTARY_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX }" - LINUX_MINT_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX }" - LINUX_FEDORA_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX }" - LINUX_GENTOO_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX }" - LINUX_MAGEIA_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX }" - LINUX_NIXOS_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX }" - LINUX_MANJARO_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX }" - LINUX_DEVUAN_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX }" - LINUX_ALPINE_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX }" - LINUX_AOSC_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX }" - LINUX_OPENSUSE_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX }" - LINUX_SABAYON_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX }" - LINUX_SLACKWARE_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX }" + APPLE_ICON "${CODEPOINT_OF_AWESOME_APPLE:+\\u$CODEPOINT_OF_AWESOME_APPLE$s}" + FREEBSD_ICON '\U1F608'$q # 😈 + LINUX_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" + LINUX_ARCH_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" + 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_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}" + LINUX_MINT_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" + LINUX_FEDORA_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" + LINUX_GENTOO_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" + LINUX_MAGEIA_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" + LINUX_NIXOS_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" + LINUX_MANJARO_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" + LINUX_DEVUAN_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" + LINUX_ALPINE_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" + LINUX_AOSC_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" + LINUX_OPENSUSE_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" + LINUX_SABAYON_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" + LINUX_SLACKWARE_ICON "${CODEPOINT_OF_AWESOME_LINUX:+\\u$CODEPOINT_OF_AWESOME_LINUX$s}" SUNOS_ICON "${CODEPOINT_OF_AWESOME_SUN_O:+\\u$CODEPOINT_OF_AWESOME_SUN_O }" - HOME_ICON "${CODEPOINT_OF_AWESOME_HOME:+\\u$CODEPOINT_OF_AWESOME_HOME }" - HOME_SUB_ICON "${CODEPOINT_OF_AWESOME_FOLDER_OPEN:+\\u$CODEPOINT_OF_AWESOME_FOLDER_OPEN }" - FOLDER_ICON "${CODEPOINT_OF_AWESOME_FOLDER_O:+\\u$CODEPOINT_OF_AWESOME_FOLDER_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}" + FOLDER_ICON "${CODEPOINT_OF_AWESOME_FOLDER_O:+\\u$CODEPOINT_OF_AWESOME_FOLDER_O$s}" ETC_ICON "${CODEPOINT_OF_AWESOME_COG:+\\u$CODEPOINT_OF_AWESOME_COG }" - NETWORK_ICON "${CODEPOINT_OF_AWESOME_RSS:+\\u$CODEPOINT_OF_AWESOME_RSS }" + NETWORK_ICON "${CODEPOINT_OF_AWESOME_RSS:+\\u$CODEPOINT_OF_AWESOME_RSS$s}" LOAD_ICON "${CODEPOINT_OF_AWESOME_BAR_CHART:+\\u$CODEPOINT_OF_AWESOME_BAR_CHART }" - SWAP_ICON "${CODEPOINT_OF_AWESOME_DASHBOARD:+\\u$CODEPOINT_OF_AWESOME_DASHBOARD }" - RAM_ICON "${CODEPOINT_OF_AWESOME_DASHBOARD:+\\u$CODEPOINT_OF_AWESOME_DASHBOARD }" - SERVER_ICON "${CODEPOINT_OF_AWESOME_SERVER:+\\u$CODEPOINT_OF_AWESOME_SERVER }" - VCS_UNTRACKED_ICON "${CODEPOINT_OF_AWESOME_QUESTION_CIRCLE:+\\u$CODEPOINT_OF_AWESOME_QUESTION_CIRCLE }" - VCS_UNSTAGED_ICON "${CODEPOINT_OF_AWESOME_EXCLAMATION_CIRCLE:+\\u$CODEPOINT_OF_AWESOME_EXCLAMATION_CIRCLE }" - VCS_STAGED_ICON "${CODEPOINT_OF_AWESOME_PLUS_CIRCLE:+\\u$CODEPOINT_OF_AWESOME_PLUS_CIRCLE }" + SWAP_ICON "${CODEPOINT_OF_AWESOME_DASHBOARD:+\\u$CODEPOINT_OF_AWESOME_DASHBOARD$s}" + RAM_ICON "${CODEPOINT_OF_AWESOME_DASHBOARD:+\\u$CODEPOINT_OF_AWESOME_DASHBOARD$s}" + SERVER_ICON "${CODEPOINT_OF_AWESOME_SERVER:+\\u$CODEPOINT_OF_AWESOME_SERVER$s}" + VCS_UNTRACKED_ICON "${CODEPOINT_OF_AWESOME_QUESTION_CIRCLE:+\\u$CODEPOINT_OF_AWESOME_QUESTION_CIRCLE$s}" + VCS_UNSTAGED_ICON "${CODEPOINT_OF_AWESOME_EXCLAMATION_CIRCLE:+\\u$CODEPOINT_OF_AWESOME_EXCLAMATION_CIRCLE$s}" + VCS_STAGED_ICON "${CODEPOINT_OF_AWESOME_PLUS_CIRCLE:+\\u$CODEPOINT_OF_AWESOME_PLUS_CIRCLE$s}" VCS_STASH_ICON "${CODEPOINT_OF_AWESOME_INBOX:+\\u$CODEPOINT_OF_AWESOME_INBOX }" VCS_INCOMING_CHANGES_ICON "${CODEPOINT_OF_AWESOME_ARROW_CIRCLE_DOWN:+\\u$CODEPOINT_OF_AWESOME_ARROW_CIRCLE_DOWN }" VCS_OUTGOING_CHANGES_ICON "${CODEPOINT_OF_AWESOME_ARROW_CIRCLE_UP:+\\u$CODEPOINT_OF_AWESOME_ARROW_CIRCLE_UP }" @@ -316,24 +324,24 @@ function _p9k_init_icons() { VCS_BOOKMARK_ICON "${CODEPOINT_OF_OCTICONS_BOOKMARK:+\\u$CODEPOINT_OF_OCTICONS_BOOKMARK}" VCS_COMMIT_ICON "${CODEPOINT_OF_OCTICONS_GIT_COMMIT:+\\u$CODEPOINT_OF_OCTICONS_GIT_COMMIT }" VCS_BRANCH_ICON "${CODEPOINT_OF_OCTICONS_GIT_BRANCH:+\\u$CODEPOINT_OF_OCTICONS_GIT_BRANCH }" - VCS_REMOTE_BRANCH_ICON "${CODEPOINT_OF_OCTICONS_REPO_PUSH:+\\u$CODEPOINT_OF_OCTICONS_REPO_PUSH }" + VCS_REMOTE_BRANCH_ICON "${CODEPOINT_OF_OCTICONS_REPO_PUSH:+\\u$CODEPOINT_OF_OCTICONS_REPO_PUSH$s}" VCS_LOADING_ICON '' VCS_GIT_ICON "${CODEPOINT_OF_AWESOME_GIT:+\\u$CODEPOINT_OF_AWESOME_GIT }" 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_HG_ICON "${CODEPOINT_OF_AWESOME_FLASK:+\\u$CODEPOINT_OF_AWESOME_FLASK }" - VCS_SVN_ICON 'svn' + VCS_SVN_ICON 'svn'$q RUST_ICON '\uE6A8' #  PYTHON_ICON '\U1F40D' # 🐍 - SWIFT_ICON '\uE655 ' #  - PUBLIC_IP_ICON "${CODEPOINT_OF_AWESOME_GLOBE:+\\u$CODEPOINT_OF_AWESOME_GLOBE }" + 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}" - EXECUTION_TIME_ICON "${CODEPOINT_OF_AWESOME_HOURGLASS_END:+\\u$CODEPOINT_OF_AWESOME_HOURGLASS_END }" + EXECUTION_TIME_ICON "${CODEPOINT_OF_AWESOME_HOURGLASS_END:+\\u$CODEPOINT_OF_AWESOME_HOURGLASS_END$s}" SSH_ICON 'ssh' VPN_ICON "${CODEPOINT_OF_AWESOME_LOCK:+\\u$CODEPOINT_OF_AWESOME_LOCK}" KUBERNETES_ICON '\U2388' # ⎈ - DROPBOX_ICON "${CODEPOINT_OF_AWESOME_DROPBOX:+\\u$CODEPOINT_OF_AWESOME_DROPBOX }" + DROPBOX_ICON "${CODEPOINT_OF_AWESOME_DROPBOX:+\\u$CODEPOINT_OF_AWESOME_DROPBOX$s}" DATE_ICON '\uF073 ' #  TIME_ICON '\uF017 ' #  JAVA_ICON '\U2615' # ☕︎ @@ -367,17 +375,17 @@ function _p9k_init_icons() { LEFT_SUBSEGMENT_SEPARATOR '\uE0B1' #  RIGHT_SUBSEGMENT_SEPARATOR '\uE0B3' #  CARRIAGE_RETURN_ICON '\u21B5' # ↵ - ROOT_ICON '\uE614' #  - SUDO_ICON '\uF09C ' #  + ROOT_ICON '\uE614'$q #  + SUDO_ICON '\uF09C'$s #  RUBY_ICON '\uF219 ' #  - AWS_ICON '\uF270 ' #  - AWS_EB_ICON '\UF1BD' #  + AWS_ICON '\uF270'$s #  + AWS_EB_ICON '\UF1BD'$q$q #  BACKGROUND_JOBS_ICON '\uF013 ' #  - TEST_ICON '\uF188 ' #  + TEST_ICON '\uF188'$s #  TODO_ICON '\u2611' # ☑ BATTERY_ICON '\UF240 ' #  - DISK_ICON '\uF0A0 ' #  - OK_ICON '\uF00C ' #  + DISK_ICON '\uF0A0'$s #  + OK_ICON '\uF00C'$s #  FAIL_ICON '\uF00D' #  SYMFONY_ICON '\uE757' #  NODE_ICON '\uE617 ' #  @@ -385,42 +393,42 @@ function _p9k_init_icons() { MULTILINE_NEWLINE_PROMPT_PREFIX '\u251C\U2500' # ├─ MULTILINE_LAST_PROMPT_PREFIX '\u2570\U2500 ' # ╰─ APPLE_ICON '\uF179' #  - WINDOWS_ICON '\uF17A ' #  + WINDOWS_ICON '\uF17A'$s #  FREEBSD_ICON '\UF30C ' #  ANDROID_ICON '\uF17B' #  LINUX_ARCH_ICON '\uF303' #  - LINUX_CENTOS_ICON '\uF304 ' #  - LINUX_COREOS_ICON '\uF305 ' #  + LINUX_CENTOS_ICON '\uF304'$s #  + LINUX_COREOS_ICON '\uF305'$s #  LINUX_DEBIAN_ICON '\uF306' #  LINUX_RASPBIAN_ICON '\uF315' #  - LINUX_ELEMENTARY_ICON '\uF309 ' #  - LINUX_FEDORA_ICON '\uF30a ' #  - LINUX_GENTOO_ICON '\uF30d ' #  + LINUX_ELEMENTARY_ICON '\uF309'$s #  + LINUX_FEDORA_ICON '\uF30a'$s #  + LINUX_GENTOO_ICON '\uF30d'$s #  LINUX_MAGEIA_ICON '\uF310' #  - LINUX_MINT_ICON '\uF30e ' #  - LINUX_NIXOS_ICON '\uF313 ' #  - LINUX_MANJARO_ICON '\uF312 ' #  - LINUX_DEVUAN_ICON '\uF307 ' #  - LINUX_ALPINE_ICON '\uF300 ' #  - LINUX_AOSC_ICON '\uF301 ' #  - LINUX_OPENSUSE_ICON '\uF314 ' #  - LINUX_SABAYON_ICON '\uF317 ' #  - LINUX_SLACKWARE_ICON '\uF319 ' #  - LINUX_UBUNTU_ICON '\uF31b ' #  + 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_UBUNTU_ICON '\uF31b'$s #  LINUX_ICON '\uF17C' #  SUNOS_ICON '\uF185 ' #  - HOME_ICON '\uF015 ' #  - HOME_SUB_ICON '\uF07C ' #  - FOLDER_ICON '\uF115 ' #  - ETC_ICON '\uF013 ' #  - NETWORK_ICON '\uF1EB ' #  + HOME_ICON '\uF015'$s #  + HOME_SUB_ICON '\uF07C'$s #  + FOLDER_ICON '\uF115'$s #  + ETC_ICON '\uF013'$s #  + NETWORK_ICON '\uF1EB'$s #  LOAD_ICON '\uF080 ' #  - SWAP_ICON '\uF464 ' #  - RAM_ICON '\uF0E4 ' #  - SERVER_ICON '\uF0AE ' #  - VCS_UNTRACKED_ICON '\uF059 ' #  - VCS_UNSTAGED_ICON '\uF06A ' #  - VCS_STAGED_ICON '\uF055 ' #  + 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 ' #  @@ -435,22 +443,22 @@ function _p9k_init_icons() { VCS_GIT_BITBUCKET_ICON '\uE703 ' #  VCS_GIT_GITLAB_ICON '\uF296 ' #  VCS_HG_ICON '\uF0C3 ' #  - VCS_SVN_ICON '\uE72D' #  - RUST_ICON '\uE7A8' #  + VCS_SVN_ICON '\uE72D'$q #  + RUST_ICON '\uE7A8'$q #  PYTHON_ICON '\UE73C ' #  SWIFT_ICON '\uE755' #  GO_ICON '\uE626' #  - PUBLIC_IP_ICON '\UF0AC ' #  + PUBLIC_IP_ICON '\UF0AC'$s #  LOCK_ICON '\UF023' #  - EXECUTION_TIME_ICON '\uF252 ' #  - SSH_ICON '\uF489 ' #  + EXECUTION_TIME_ICON '\uF252'$s #  + SSH_ICON '\uF489'$s #  VPN_ICON '\UF023' KUBERNETES_ICON '\U2388' # ⎈ - DROPBOX_ICON '\UF16B ' #  + DROPBOX_ICON '\UF16B'$s #  DATE_ICON '\uF073 ' #  TIME_ICON '\uF017 ' #  JAVA_ICON '\U2615' # ☕︎ - LARAVEL_ICON '\ue73f' #  + LARAVEL_ICON '\ue73f'$q #  RANGER_ICON '\u2B50' # ⭐ MIDNIGHT_COMMANDER_ICON 'mc' VIM_ICON '\uE62B' #  @@ -483,7 +491,7 @@ function _p9k_init_icons() { SUDO_ICON '' RUBY_ICON 'Ruby' AWS_ICON 'AWS' - AWS_EB_ICON '\U1F331' # 🌱 + AWS_EB_ICON '\U1F331'$q # 🌱 BACKGROUND_JOBS_ICON '\u2699' # ⚙ TEST_ICON '' TODO_ICON '\u2206' # ∆ From ea2b2f1e027a8e4682dcf5029edc92f285e3db62 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 30 Jan 2020 17:17:21 +0100 Subject: [PATCH 19/88] split troubleshooting out of faq; expand on spacing differences between 9k and 10k --- README.md | 361 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 209 insertions(+), 152 deletions(-) diff --git a/README.md b/README.md index 62b5d04d..9277e3b5 100644 --- a/README.md +++ b/README.md @@ -104,17 +104,17 @@ To customize prompt, edit `~/.p10k.zsh`. Powerlevel10k doesn't recognize Pure co parameters, so you need to use `POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3` instead of `PURE_CMD_MAX_EXEC_TIME=3`, etc. All relevant parameters are in the config. -### Instant prompt +### Instant prompt If your `~/.zshrc` loads many plugins, or perhaps just a few slow ones (pyenv and nvm are the usual suspects), you may have noticed that it takes some time for Zsh to start. -![Powerlevel10k Pure Style]( +![Powerlevel10k No Instant Prompt]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/no-instant-prompt.gif) Powerlevel10k can remove Zsh startup lag *even if it's not caused by a theme*. -![Powerlevel10k Pure Style]( +![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` @@ -124,7 +124,7 @@ 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. -For details, see [FAQ](#what-is-instant-prompt). +For caveats and details, see [FAQ](#how-do-i-enable-instant-prompt). ### Show on command @@ -473,14 +473,12 @@ Powerlevel10k, on the other hand, doesn't require trading latency for utility -- instant with any configuration. It stays well below the 50 ms mark, leaving most of the latency budget for other plugins you might install. -### What is instant prompt? +### How do I enable instant prompt? -*Instant Prompt* is an optional feature of Powerlevel10k. When enabled, it gives you a limited -prompt within a few milliseconds of starting zsh, allowing you to start hacking right away while zsh -is initializing. Once initialization is complete, the full-featured Powerlevel10k prompt will -seamlessly replace instant prompt. +See [instant prompt](#instant-prompt) to learn what instant prompt is. This section explains how +you can enable it, and caveats that you should be aware of. -You can enable instant prompt either by running `p10k configure` or by manually adding the following +Instant prompt can be enabled either through `p10k configure` or by manually adding the following code snippet at the top of `~/.zshrc`: ```zsh @@ -517,6 +515,7 @@ fi keychain id_rsa --agents ssh # asks for password chatty-script # spams to stdout even when everything is fine +# ... ``` Fixed version: @@ -532,6 +531,7 @@ fi # console output may appear uncolored. chatty-script >/dev/null # spam output suppressed +# ... ``` If `POWERLEVEL9K_INSTANT_PROMPT` is unset or set to `verbose`, Powerlevel10k will print a warning @@ -545,125 +545,6 @@ initialization and you don't know how to fix it. *NOTE: Instant prompt requires zsh >= 5.4. It's OK to enable it even when using an older version of zsh but it won't do anything.* -### Why do my icons and/or powerline symbols look bad? - -It's likely your font's fault. -[Install the recommended font](#recommended-meslo-nerd-font-patched-for-powerlevel10k) and run -`p10k configure`. - -### I'm getting "character not in range" error. What gives? - -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*". - -### Why is my cursor in the wrong place? - -Type `echo '\u276F'`. If you get an error saying "zsh: character not in range", see the -[previous question](#im-getting-character-not-in-range-error-what-gives). - -If the `echo` command prints `❯` but the cursor is still in the wrong place, install -[the recommended font](#recommended-meslo-nerd-font-patched-for-powerlevel10k) and run -`p10k configure`. - -If this doesn't help, add `unset ZLE_RPROMPT_INDENT` at the bottom of `~/.zshrc`. - -Still having issues? Run the following command to diagnose the problem: - -```zsh -() { - emulate -L zsh - setopt err_return no_unset - local text - print -rl -- 'Select a part of your prompt from the terminal window and paste it below.' '' - read -r '?Prompt: ' text - local -i len=${(m)#text} - local frame="+-${(pl.$len..-.):-}-+" - print -lr -- $frame "| $text |" $frame -} -``` - -#### If the prompt line aligns with the frame - -```text -+------------------------------+ -| romka@adam ✓ ~/powerlevel10k | -+------------------------------+ -``` - -If the output of the command is aligned for every part of your prompt (left and right), this -indicates a bug in the theme or your config. Use this command to diagnose it: - -```zsh -print -rl -- ${(eq+)PROMPT} ${(eq+)RPROMPT} -``` - -Look for `%{...%}` and backslash escapes in the output. If there are any, they are the likely -culprits. Open an issue if you get stuck. - -#### If the prompt line is longer than the frame - -```text -+-----------------------------+ -| romka@adam ✓ ~/powerlevel10k | -+-----------------------------+ -``` - -This is usually caused by a terminal bug or misconfiguration that makes it print ambiguous-width -characters as double-width instead of single width. For example, -[this issue](https://github.com/romkatv/powerlevel10k/issues/165). - -#### If the prompt line is shorter than the frame and is mangled - -```text -+------------------------------+ -| romka@adam ✓~/powerlevel10k | -+------------------------------+ -``` - -Note that this prompt is different from the original as it's missing a space after the checkmark. - -This can be caused by a low-level bug in macOS. See -[this issue](https://github.com/romkatv/powerlevel10k/issues/241). - -#### If the prompt line is shorter than the frame and is not mangled - -```text -+--------------------------------+ -| romka@adam ✓ ~/powerlevel10k | -+--------------------------------+ -``` - -This can be caused by misconfigured locale. See -[this issue](https://github.com/romkatv/powerlevel10k/issues/251). - -### Why is my prompt wrapping around in a weird way? - -See [Why is my cursor in the wrong place?](#why-is-my-cursor-in-the-wrong-place) - -### Why is my right prompt in the wrong place? - -See [Why is my cursor in the wrong place?](#why-is-my-cursor-in-the-wrong-place) - -### Why does the configuration wizard run automatically every time I start zsh? - -When Powerlevel10k starts, it automatically runs `p10k configure` if no `POWERLEVEL9K_*` -parameters are defined. Based on your prompt style choices, the configuration wizard creates -`~/.p10k.zsh` with a bunch of `POWERLEVEL9K_*` parameters in it and adds a line to `~/.zshrc` to -source this file. The next time you start zsh, the configuration wizard shouldn't run automatically. -If it does, this means the evaluation of `~/.zshrc` terminates prematurely before it reaches the -line that sources `~/.p10k.zsh`. This most often happens due to syntax errors in `~/.zshrc`. These -errors get hidden by the configuration wizard screen, so you don't notice them. Scroll up in the -first configuration wizard screen to see these errors. Alternatively, run -`POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true zsh` to start zsh without automatically running the -configuration wizard. Once you can see the errors, fix `~/.zshrc` to get rid of them. - -### I cannot install the recommended font. Help! - -Once you download [the recommended font](#recommended-meslo-nerd-font-patched-for-powerlevel10k), -you can install it just like any other font. Google "how to install fonts on *your OS*". - ### Why do I have a question mark symbol in my prompt? Is my font broken? If it looks like a regular `?`, that's normal. It means you have untracked files in the current Git @@ -796,8 +677,8 @@ for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%8) Powerlevel10k uses [gitstatus](https://github.com/romkatv/gitstatus) as the backend behind `vcs` prompt; gitstatus spawns `gitstatusd` and `zsh`. See [gitstatus](https://github.com/romkatv/gitstatus) for details. Powerlevel10k may also spawn `zsh` -to trigger async prompt refresh. To avoid security hazard, these background processes aren't shared -by different interactive shells. +to perform computation without blocking prompt. To avoid security hazard, these background processes +aren't shared by different interactive shells. ### Are there configuration options that make Powerlevel10k slow? @@ -824,22 +705,25 @@ times faster than powerlevel9k/master and 17 times faster than powerlevel9k/next ### Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config? -This is the goal. You should be able to switch from Powerlevel9k to Powerlevel10k with no -visible changes except for performance. There are, however, several differences. +Almost. There are a few differences. -- By default only `git` vcs backend is enabled in Powerlevel10k. If you need `svn` and `hg`, you'll - need to add them to `POWERLEVEL9K_VCS_BACKENDS`. +- By default only `git` vcs backend is enabled in Powerlevel10k. If you need `svn` and `hg`, add + them to `POWERLEVEL9K_VCS_BACKENDS`. - 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 Powerlevel10k. Some examples: - - Powerlevel9k doesn't respect `ZLE_RPROMPT_INDENT`. As a result, right prompt in Powerlevel10k - can have an extra space at the end compared to Powerlevel9k. Set `ZLE_RPROMPT_INDENT=0` if you - don't want that space. - Powerlevel9k ignores some options that are set after the theme is sourced while Powerlevel10k respects all options. If you see different icons in Powerlevel9k and Powerlevel10k, you've probably defined `POWERLEVEL9K_MODE` before sourcing the theme. This parameter gets ignored by Powerlevel9k but honored by Powerlevel10k. If you want your prompt to look in Powerlevel10k the same as in Powerlevel9k, remove `POWERLEVEL9K_MODE`. + - Powerlevel9k doesn't respect `ZLE_RPROMPT_INDENT`. As a result, right prompt in Powerlevel10k + can have an extra space at the end compared to Powerlevel9k. Set `ZLE_RPROMPT_INDENT=0` if you + 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 + details in [troubleshooting](#extra-spaces-after-some-icons). - There are [dozens more bugs](https://github.com/Powerlevel9k/powerlevel9k/issues/created_by/romkatv) in Powerlevel9k that don't exist in Powerlevel10k. @@ -852,7 +736,192 @@ Powerlevel10k, please [open an issue](https://github.com/romkatv/powerlevel10k/i Yes, [zsh-theme-powerlevel10k-git](https://aur.archlinux.org/packages/zsh-theme-powerlevel10k-git/). This package is owned by an unaffiliated volunteer. -### I cannot make Powerlevel10k work with my plugin manager. Help! +### What is the minimum supported zsh version? + +Zsh 5.1 or newer should work. Fast startup requires zsh >= 5.4. + +### How were these screenshots and animated gifs created? + +All screenshots and animated gifs were recorded in GNOME Terminal with +[the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) and Tango Dark color scheme 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) + +## Troubleshooting + +### Icons, glyphs or powerline symbols don't render. + +Restart your terminal, [install the recommended font]( + #recommended-meslo-nerd-font-patched-for-powerlevel10k) and run `p10k configure`. + +### zsh: character not in range + +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*". + +### Cursor is in the wrong place + +Type `echo '\u276F'`. If you get an error saying "zsh: character not in range", see the +[previous section](#zsh-character-not-in-range). + +If the `echo` command prints `❯` but the cursor is still in the wrong place, install +[the recommended font](#recommended-meslo-nerd-font-patched-for-powerlevel10k) and run +`p10k configure`. + +If this doesn't help, add `unset ZLE_RPROMPT_INDENT` at the bottom of `~/.zshrc`. + +Still having issues? Run the following command to diagnose the problem: + +```zsh +() { + emulate -L zsh + setopt err_return no_unset + local text + print -rl -- 'Select a part of your prompt from the terminal window and paste it below.' '' + read -r '?Prompt: ' text + local -i len=${(m)#text} + local frame="+-${(pl.$len..-.):-}-+" + print -lr -- $frame "| $text |" $frame +} +``` + +#### If the prompt line aligns with the frame + +```text ++------------------------------+ +| romka@adam ✓ ~/powerlevel10k | ++------------------------------+ +``` + +If the output of the command is aligned for every part of your prompt (left and right), this +indicates a bug in the theme or your config. Use this command to diagnose it: + +```zsh +print -rl -- ${(eq+)PROMPT} ${(eq+)RPROMPT} +``` + +Look for `%{...%}` and backslash escapes in the output. If there are any, they are the likely +culprits. Open an issue if you get stuck. + +#### If the prompt line is longer than the frame + +```text ++-----------------------------+ +| romka@adam ✓ ~/powerlevel10k | ++-----------------------------+ +``` + +This is usually caused by a terminal bug or misconfiguration that makes it print ambiguous-width +characters as double-width instead of single width. For example, +[this issue](https://github.com/romkatv/powerlevel10k/issues/165). + +#### If the prompt line is shorter than the frame and is mangled + +```text ++------------------------------+ +| romka@adam ✓~/powerlevel10k | ++------------------------------+ +``` + +Note that this prompt is different from the original as it's missing a space after the checkmark. + +This can be caused by a low-level bug in macOS. See +[this issue](https://github.com/romkatv/powerlevel10k/issues/241). + +#### If the prompt line is shorter than the frame and is not mangled + +```text ++--------------------------------+ +| romka@adam ✓ ~/powerlevel10k | ++--------------------------------+ +``` + +This can be caused by misconfigured locale. See +[this issue](https://github.com/romkatv/powerlevel10k/issues/251). + +### Prompt wrapping around in a weird way + +See [cursor is in the wrong place](#cursor-is-in-the-wrong-place). + +### Right prompt is in the wrong place + +See [cursor is in the wrong place](#cursor-is-in-the-wrong-place). + +### Configuration wizard run automatically every time zsh is started + +When Powerlevel10k starts, it automatically runs `p10k configure` if no `POWERLEVEL9K_*` +parameters are defined. Based on your prompt style choices, the configuration wizard creates +`~/.p10k.zsh` with a bunch of `POWERLEVEL9K_*` parameters in it and adds a line to `~/.zshrc` to +source this file. The next time you start zsh, the configuration wizard shouldn't run automatically. +If it does, this means the evaluation of `~/.zshrc` terminates prematurely before it reaches the +line that sources `~/.p10k.zsh`. This most often happens due to syntax errors in `~/.zshrc`. These +errors get hidden by the configuration wizard screen, so you don't notice them. Scroll up in the +first configuration wizard screen to see these errors. Alternatively, run +`POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true zsh` to start zsh without automatically running the +configuration wizard. Once you can see the errors, fix `~/.zshrc` to get rid of them. + +### Cannot install the recommended font + +Once you download [the recommended font](#recommended-meslo-nerd-font-patched-for-powerlevel10k), +you can install it just like any other font. Google "how to install fonts on *your OS*". + +### Extra spaces in prompt compared to Powerlevel9k + +When using Powerlevel10k with a Powerlevel9k config, you might get additional spaces in prompt here +and there. These come in two flavors. + +#### Extra space without background on the right side of right prompt + +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): + +> `ZLE_RPROMPT_INDENT ` +> +> If set, used to give the indentation between the right hand side of the right prompt in the line +> editor as given by `RPS1` or `RPROMPT` and the right hand side of the screen. If not set, the +> value `1` is used. +> +> Typically this will be used to set the value to `0` so that the prompt appears flush with the +> right hand side of the screen. + +Powerlevel10k respects this parameter. If you set `ZLE_RPROMPT_INDENT=1` (or leave it unset, which +is the same thing as setting it to `1`), you'll get an empty space to the right of right prompt. If +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) + +Bug against Powerlevel9k: [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 `master`. + +Add `ZLE_RPROMPT_INDENT=0` to `~/.zshrc` to get the same spacing on the right edge of prompt as in +Powerlevel9k. + +#### Extra spaces after some icons + +tl;dr: Add `POWERLEVEL9K_LEGACY_ICON_SPACING=true` to `~/.zshrc` to get rid of these spaces. + +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) + +This inconsistency is a constant source of annoyance, so it was fixed in Powerlevel10k. +Unfortunately, this means that users upgrading from Powerlevel9k will notice differences in spacing +around some icons. + +Add `POWERLEVEL9K_LEGACY_ICON_SPACING=true` to `~/.zshrc` to get the same spacing around icons as in +Powerlevel9k. + +### Cannot make Powerlevel10k work with my plugin manager If the [installation instructions](#installation) didn't work for you, try disabling your current theme (so that you end up with no theme) and then installing Powerlevel10k manually. @@ -878,19 +947,6 @@ echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc This method of installation won't make anything slower or otherwise sub-par. -### What is the minimum supported zsh version? - -Zsh 5.1 or newer should work. Fast startup requires zsh >= 5.4. - -### How were these screenshots and animated gifs created? - -All screenshots and animated gifs were recorded in GNOME Terminal with -[the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) and Tango Dark color scheme 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) - ## Table of contents 1. [Features](#features) @@ -944,6 +1000,7 @@ custom background color (`#171A1B` instead of `#2E3436` -- twice as dark). 1. [Are there configuration options that make Powerlevel10k slow?](#are-there-configuration-options-that-make-powerlevel10k-slow) 1. [Is Powerlevel10k fast to load?](#is-powerlevel10k-fast-to-load) 1. [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) + 1. [Why do I get extra spaces in prompt when I use my Powerlevel9k config with Powerlevel10k?](#why-do-i-get-extra-spaces-in-prompt-when-i-use-my-powerlevel9k-config-with-powerlevel10k) 1. [Is there an AUR package for Powerlevel10k?](#is-there-an-aur-package-for-powerlevel10k) 1. [I cannot make Powerlevel10k work with my plugin manager. Help!](#i-cannot-make-powerlevel10k-work-with-my-plugin-manager-help) 1. [What is the minimum supported zsh version?](#what-is-the-minimum-supported-zsh-version) From f562a837d81ef8f87178998c74b6ac1e3c9be6cd Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 30 Jan 2020 17:27:18 +0100 Subject: [PATCH 20/88] expand on commitment --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9277e3b5..a47622a0 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,9 @@ Powerlevel10k is a theme for ZSH. It emphasizes [speed](#uncompromising-performance), [flexibility](#extremely-customizable) and [out-of-the-box experience](#configuration-wizard). -Powerlevel10k is committed to being best-in-class in each of these categories. +Powerlevel10k is committed to being best-in-class in each of these categories. If you ever consider +switching to another theme because Powerlevel10k is not fast enough, not flexible enough or fails +to Just Work, please file an issue. ![Powerlevel10k]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/prompt-styles.png) @@ -476,7 +478,7 @@ budget for other plugins you might install. ### How do I enable instant prompt? See [instant prompt](#instant-prompt) to learn what instant prompt is. This section explains how -you can enable it, and caveats that you should be aware of. +you can enable it and lists caveats that you should be aware of. Instant prompt can be enabled either through `p10k configure` or by manually adding the following code snippet at the top of `~/.zshrc`: From adfbbb741ab77578135cef87cb1e574605026008 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 30 Jan 2020 17:42:41 +0100 Subject: [PATCH 21/88] cleanup --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a47622a0..f5ebd949 100644 --- a/README.md +++ b/README.md @@ -900,9 +900,9 @@ 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) -Bug against Powerlevel9k: [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 `master`. +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 +`master`. Add `ZLE_RPROMPT_INDENT=0` to `~/.zshrc` to get the same spacing on the right edge of prompt as in Powerlevel9k. From 808ccfc7bddf96dc141af791fd5549944fdc2a35 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 30 Jan 2020 17:43:33 +0100 Subject: [PATCH 22/88] cleanup --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f5ebd949..f995106b 100644 --- a/README.md +++ b/README.md @@ -281,7 +281,7 @@ echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc This is the simplest kind of installation and it works even if you are using a plugin manager. Just make sure to disable your current theme in your plugin manager. See -[FAQ](#i-cannot-make-powerlevel10k-work-with-my-plugin-manager-help) for help. +[troubleshooting](#cannot-make-powerlevel10k-work-with-my-plugin-manager) for help. ### Oh My Zsh From 2c65a0c1c4f6fa3c75f5da5f4d815452f360d175 Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 31 Jan 2020 08:26:19 +0100 Subject: [PATCH 23/88] add nix_shell to the list of segments --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f995106b..5f84b6e6 100644 --- a/README.md +++ b/README.md @@ -259,6 +259,7 @@ you like. It won't slow down your prompt or Zsh startup. | `nnn` | [nnn](https://github.com/jarun/nnn) shell | | `vim_shell` | [vim](https://www.vim.org/) shell (`:sh`) | | `midnight_commander` | [midnight commander](https://midnight-commander.org/) shell | +| `nix_shell` | [nix shell](https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) indicator | | `todo` | [todo](https://github.com/todotxt/todo.txt-cli) items | | `timewarrior` | [timewarrior](https://timewarrior.net/) tracking status | | `vpn_ip` | virtual private network indicator | From ae12802bbeeb032e40248dafbc449b4a2c32a98b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Foray?= Date: Sun, 15 Dec 2019 21:15:48 +0100 Subject: [PATCH 24/88] Add support for classes to terraform segment --- internal/p10k.zsh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 2b8ce324..5ba6159d 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4306,7 +4306,14 @@ function prompt_terraform() { [[ -r $f ]] && _p9k_read_file $f && ws=$_p9k_ret fi ws=${${ws##[[:space:]]#}%%[[:space:]]#} - [[ $ws == default ]] || _p9k_prompt_segment $0 $_p9k_color1 blue TERRAFORM_ICON 0 '' $ws + local pat class + for pat class in "${_POWERLEVEL9K_TERRAFORM_CLASSES[@]}"; do + if [[ $ws == ${~pat} ]]; then + [[ -n $class ]] && state=_${(U)class} + break + fi + done + [[ $ws == default ]] || _p9k_prompt_segment "$0$state" $_p9k_color1 blue TERRAFORM_ICON 0 '' $ws } _p9k_prompt_terraform_init() { @@ -5887,6 +5894,7 @@ _p9k_init_params() { # POWERLEVEL9K_KUBECONTEXT_OTHER_BACKGROUND=yellow _p9k_declare -a POWERLEVEL9K_KUBECONTEXT_CLASSES -- _p9k_declare -a POWERLEVEL9K_AWS_CLASSES -- + _p9k_declare -a POWERLEVEL9K_TERRAFORM_CLASSES -- _p9k_declare -a POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES -- 'service_account:*' SERVICE_ACCOUNT # Specifies the format of java version. # From 4b99ca847c8d76b166f6e31f7a424e97b4677d7d Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 31 Jan 2020 10:26:06 +0100 Subject: [PATCH 25/88] doc cleanup --- README.md | 199 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 117 insertions(+), 82 deletions(-) diff --git a/README.md b/README.md index 5f84b6e6..581bc974 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,8 @@ # Powerlevel10k [![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), +Powerlevel10k is a theme for Zsh. It emphasizes [speed](#uncompromising-performance), [flexibility](#extremely-customizable) and [out-of-the-box experience](#configuration-wizard). -Powerlevel10k is committed to being best-in-class in each of these categories. If you ever consider -switching to another theme because Powerlevel10k is not fast enough, not flexible enough or fails -to Just Work, please file an issue. ![Powerlevel10k]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/prompt-styles.png) @@ -44,12 +41,21 @@ All styles except [Pure](#pure-compatibility) are functionally equivalent. They information and differ only in presentation. Configuration wizard creates `~/.p10k.zsh` based on your preferences. Additional prompt -customization can be done by editing this file. It has many comments to help you navigate through -configuration options. +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](#recommended-meslo-nerd-font-patched-for-powerlevel10k) before +*Tip*: Install [the recommended font](#recommended-meslo-nerd-font-patched-for-powerlevel10k) before running `p10k configure`. +*FAQ:* + +- [Why do I have a question mark symbol in my prompt? Is my font broken?](#why-do-i-have-a-question-mark-symbol-in-my-prompt-is-my-font-broken) +- [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 change colors?](#how-do-i-change-colors) +- [Why some prompt segments appear and disappear as I'm typing?](#why-some-prompt-segments-appear-and-disappear-as-im-typing) + ### Uncompromising performance When you hit *ENTER*, the next prompt appears instantly. With Powerlevel10k there is no prompt lag. @@ -74,6 +80,8 @@ Other Zsh themes capable of displaying the same information either produce promp 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. +*FAQ*: [Is it really fast?](#is-it-really-fast) + ### Powerlevel9k compatibility Powerlevel10k understands all [Powerlevel9k](https://github.com/Powerlevel9k/powerlevel9k) @@ -82,14 +90,17 @@ configuration parameters. ![Powerlevel10k Compatibility with 9k]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/9k-compatibility.gif) -If you are currently using Powerlevel9k, you can switch to Powerlevel10k in just a few seconds. -All your `POWERLEVEL9K` configuration parameters will still work. Prompt will look the same as -before ([almost]( +Migration 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)) but it will be [much faster](#uncompromising-performance) ([certainly](#is-it-really-fast)). -FAQ: [I'm using Powerlevel9k with Oh My Zsh. How do I migrate?]( - #im-using-powerlevel9k-with-oh-my-zsh-how-do-i-migrate) +*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) ### Pure compatibility @@ -99,22 +110,24 @@ Powerlevel10k can produce the same prompt as [Pure](https://github.com/sindresor ![Powerlevel10k Pure Style]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/pure-style.gif) -You can still use Powerlevel10k features such as [Transient Prompt](#transient-prompt) or -[Instant Prompt](#instant-prompt) when sporting Pure style. +You can still use Powerlevel10k features such as [transient Prompt](#transient-prompt) or +[instant Prompt](#instant-prompt) when sporting Pure style. To customize prompt, edit `~/.p10k.zsh`. Powerlevel10k doesn't recognize Pure configuration parameters, so you need to use `POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3` instead of -`PURE_CMD_MAX_EXEC_TIME=3`, etc. All relevant parameters are in the config. +`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. ### Instant prompt -If your `~/.zshrc` loads many plugins, or perhaps just a few slow ones (pyenv and nvm are the usual -suspects), you may have noticed that it takes some time for Zsh to start. +If your `~/.zshrc` loads many plugins, or perhaps just a few slow ones +(for example, [pyenv](https://github.com/pyenv/pyenv) or [nvm](https://github.com/nvm-sh/nvm), you +may have noticed that it takes some time for Zsh to start. ![Powerlevel10k No Instant Prompt]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/no-instant-prompt.gif) -Powerlevel10k can remove Zsh startup lag *even if it's not caused by a theme*. +Powerlevel10k can remove Zsh startup lag **even if it's not caused by a theme**. ![Powerlevel10k Instant Prompt]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/instant-prompt.gif) @@ -126,7 +139,7 @@ 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. -For caveats and details, see [FAQ](#how-do-i-enable-instant-prompt). +*FAQ:* [How do I enable instant prompt?](#how-do-i-enable-instant-prompt) ### Show on command @@ -141,7 +154,7 @@ the command you are currently typing. ![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. +Configs created by `p10k configure` enable show on command for several prompt segments by default. Here's the relevant parameter for kubernetes context: ```zsh @@ -159,18 +172,19 @@ or change their values. When *Transient Prompt* is enabled through `p10k configure`, Powerlevel10k will trim down every prompt when accepting a command line. -![Powerlevel10k Show On Command]( +![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. +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. ### Current directory that just works The current working directory is perhaps the most important prompt segment. Powerlevel10k goes to -great length to highlight its important parts and to truncate it with the least loss of information. +great length to highlight its important parts and to truncate it with the least loss of information +when horizontal space gets scarce. ![Powerlevel10k Directory Truncation]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/directory-truncation.gif) @@ -178,7 +192,7 @@ great length to highlight its important parts and to truncate it with the least When the full directory doesn't fit, the leftmost segment gets truncated to its shortest unique prefix. In the screencast, `~/work` becomes `~/wo`. It couldn't be truncated to `~/w` because it would be ambiguous (there was `~/wireguard` when the session was recorded). The next segment -- -`projects` -- turns into `p` as there was nothing else that started with `p` in `~/work`. +`projects` -- turns into `p` as there was nothing else that started with `p` in `~/work/`. Directory segments are shown in one of three colors: @@ -187,16 +201,16 @@ 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. ### Extremely customizable -Powerlevel10k can be configured to look like any other Zsh theme. +Powerlevel10k can be configured to look like any other Zsh theme out there. ![Powerlevel10k Other Theme Emulation]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/other-theme-emulation.gif) -[Pure](#pure-compatibility) and [Powerlevel9k](#powerlevel9k-compatibility) emulation is built-in. +[Pure](#pure-compatibility) and [Powerlevel9k](#powerlevel9k-compatibility) emulations are built-in. To emulate the appearence 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`. @@ -214,9 +228,9 @@ 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, most of these segments get enabled by default. Some must 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. +and choose any style except [Pure](#pure-compatibility), most of these segments get enabled by +default. Some must 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 | |--------:|---------| @@ -281,7 +295,7 @@ echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc ``` This is the simplest kind of installation and it works even if you are using a plugin manager. Just -make sure to disable your current theme in your plugin manager. See +make sure to disable the current theme in your plugin manager. See [troubleshooting](#cannot-make-powerlevel10k-work-with-my-plugin-manager) for help. ### Oh My Zsh @@ -290,36 +304,36 @@ make sure to disable your current theme in your plugin manager. See git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k ``` -Set `ZSH_THEME=powerlevel10k/powerlevel10k` in your `~/.zshrc`. +Set `ZSH_THEME="powerlevel10k/powerlevel10k"` in `~/.zshrc`. ### Prezto -Add `zstyle :prezto:module:prompt theme powerlevel10k` to your `~/.zpreztorc`. +Add `zstyle :prezto:module:prompt theme powerlevel10k` to `~/.zpreztorc`. ### Zim -Add `zmodule romkatv/powerlevel10k` to your `.zimrc` and run `zimfw install`. +Add `zmodule romkatv/powerlevel10k` to `~/.zimrc` and run `zimfw install`. ### Antigen -Add `antigen theme romkatv/powerlevel10k` to your `~/.zshrc`. Make sure you have `antigen apply` +Add `antigen theme romkatv/powerlevel10k` to `~/.zshrc`. Make sure you have `antigen apply` somewhere after it. ### Zplug -Add `zplug romkatv/powerlevel10k, as:theme, depth:1` to your `~/.zshrc`. +Add `zplug romkatv/powerlevel10k, as:theme, depth:1` to `~/.zshrc`. ### Zgen -Add `zgen load romkatv/powerlevel10k powerlevel10k` to your `~/.zshrc`. +Add `zgen load romkatv/powerlevel10k powerlevel10k` to `~/.zshrc`. ### Antibody -Add `antibody bundle romkatv/powerlevel10k` to your `~/.zshrc`. +Add `antibody bundle romkatv/powerlevel10k` to `~/.zshrc`. ### Zplugin -Add `zplugin ice depth=1; zplugin light romkatv/powerlevel10k` to your `~/.zshrc`. +Add `zplugin ice depth=1; zplugin 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. @@ -328,20 +342,17 @@ supported by Powerlevel10k. ### For new users -On the first run, Powerlevel10k configuration wizard will ask you a few questions and configure -your prompt. If it doesn't trigger automatically, type `p10k configure`. You can further customize -your prompt by editing `~/.p10k.zsh`. +On the first run, Powerlevel10k [configuration wizard](#configuration-wizard) will ask you a few +questions and configure your prompt. If it doesn't trigger automatically, type `p10k configure`. +Configuration wizard creates `~/.p10k.zsh` based on your preferences. Additional prompt +customization can be done by editing this file. It has plenty of comments to help you navigate +through configuration options. ### For Powerlevel9k users If you've been using Powerlevel9k before, **do not remove the configuration options**. Powerlevel10k -will pick them up and provide you with the same prompt UI you are used to. Powerlevel10k recognized -all configuration options used by Powerlevel9k. See Powerlevel9k -[configuration guide](https://github.com/Powerlevel9k/powerlevel9k/blob/master/README.md#prompt-customization). - -To go beyond the functionality of Powerlevel9k, type `p10k configure` and explore the unique styles -and features Powerlevel10k has to offer. You can further customize your prompt by editing -`~/.p10k.zsh`. +will pick them up and provide you with the same prompt UI you are used to. See +[Powerlevel9k compatibility](#powerlevel9k-compatibility). ## Fonts @@ -366,7 +377,7 @@ operating systems. If you are using iTerm2 or Termux, `p10k configure` can install the recommended font for you. Simply answer `Yes` when asked whether to install *Meslo Nerd Font*. -If you are using a different terminal, proceed with manual font installation. +If you are using a different terminal, proceed with manual font installation. 👇 #### Manual font installation @@ -376,10 +387,12 @@ Download these four ttf files: - [MesloLGS NF Italic.ttf](https://github.com/romkatv/dotfiles-public/raw/master/.local/share/fonts/NerdFonts/MesloLGS%20NF%20Italic.ttf) - [MesloLGS NF Bold Italic.ttf](https://github.com/romkatv/dotfiles-public/raw/master/.local/share/fonts/NerdFonts/MesloLGS%20NF%20Bold%20Italic.ttf) -Double-click on each file and press "Install". This will make `MesloLGS NF` font available to all +Double-click on each file and click "Install". This will make `MesloLGS NF` font available to all applications on your system. Configure your terminal to use this font: - **iTerm2**: Open *iTerm2 → Preferences → Profiles → Text* and set *Font* to `MesloLGS NF`. + Alternatively, type `p10k configure` and answer `Yes` when asked whether to install + *Meslo Nerd Font*. - **Apple Terminal** Open *Terminal → Preferences → Profiles → Text*, click *Change* under *Font* and select `MesloLGS NF` family. - **Hyper**: Open *Hyper → Edit → Preferences* and change the value of `fontFamily` under @@ -400,15 +413,16 @@ applications on your system. Configure your terminal to use this font: - **Termux**: Type `p10k configure` and answer `Yes` when asked whether to install *Meslo Nerd Font*. -Run `p10k configure` to pick the best style for your new font. +**IMPORTANT:** Run `p10k configure` after changing terminal font. The old `~/.p10k.zsh` may work +incorrectly with the new font. -_Using a different terminal and know how to set the font for it? Share your knowledge by sending a PR -to expand the list!_ +_Using a different terminal and know how to set the font for it? Share your knowledge by sending a +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 image is deleted. ```zsh docker run -e TERM -e COLORTERM -it --rm debian:buster bash -uec ' @@ -420,10 +434,10 @@ docker run -e TERM -e COLORTERM -it --rm debian:buster bash -uec ' exec zsh' ``` -Tip: Install [the recommended font](#recommended-meslo-nerd-font-patched-for-powerlevel10k) before +*Tip*: Install [the recommended font](#recommended-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 @@ -447,7 +461,10 @@ exec zsh 1. Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). 1. Type `p10k configure` and chose your favorite prompt style. -Related: [Powerlevel9k compatibility](#powerlevel9k-compatibility). +*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) ### Is it really fast? @@ -580,13 +597,16 @@ feature:master ⇣42⇡42 *42 merge ~42 +42 !42 ?42 | `!42` | this many unstaged changes | `git status` | | `?42` | this many untracked files | `git status` | -See also: [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) + ### How do I add username and/or hostname to prompt? When using *Lean*, *Classic* or *Rainbow* style, prompt shows `username@hostname` when you are @@ -602,7 +622,7 @@ them are enabled, others are commented out. One of them is of interest to you. ```zsh typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( ... - context # user@hostname + context # user@hostname ... ) ``` @@ -620,8 +640,8 @@ If you follow the tip and remove (or comment out) the last line, you'll always s `username@hostname` in prompt. You can change the format to just `username`, or change the color, by adjusting the values of parameters nearby. There are plenty of comments to help you navigate. -Finally, you can move `context` segment to where you want it to be in your prompt. Perhaps somewhere -within `POWERLEVEL9K_LEFT_PROMPT_ELEMENTS`. +You can also move `context` to a different position in `POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS` or even +to `POWERLEVEL9K_LEFT_PROMPT_ELEMENTS`. ### Why some prompt segments appear and disappear as I'm typing? @@ -640,8 +660,10 @@ parameters or change their values. ### How do I change colors? -You can either change the color palette used by your terminal or 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 @@ -649,11 +671,11 @@ How exactly you change the terminal color pallete (a.k.a. color scheme, or theme kind of terminal you are using. Look around in terminal's settings/preferences or consult documentation. -When you change the color palette used by your terminal, 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 with 8 colors* or *Pure with original colors*. Other styles use higher-numbered -colors, so they look the same in any terminal color palette. +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 +terminal color palette. #### Set colors through Powerlevel10k configuration parameters @@ -681,7 +703,8 @@ Powerlevel10k uses [gitstatus](https://github.com/romkatv/gitstatus) as the back prompt; gitstatus spawns `gitstatusd` and `zsh`. See [gitstatus](https://github.com/romkatv/gitstatus) for details. Powerlevel10k may also spawn `zsh` to perform computation without blocking prompt. To avoid security hazard, these background processes -aren't shared by different interactive shells. +aren't shared by different interactive shells. They terminate automatically when the parent `zsh` +process terminates or runs `exec(3)`. ### Are there configuration options that make Powerlevel10k slow? @@ -699,8 +722,8 @@ Loading time, or time to first prompt, can be measured with the following benchm time (repeat 1000 zsh -dfis <<< 'source ~/powerlevel10k/powerlevel10k.zsh-theme') ``` -*NOTE: This measures time to first complete prompt. Powerlevel10k can also display a -[limited prompt](#what-is-instant-prompt) before the full-featured prompt is ready.* +*Note:* This measures time to first complete prompt. Powerlevel10k can also display a +[limited prompt](#what-is-instant-prompt) before the full-featured prompt is ready. Running this command with `~/powerlevel10k` as the current directory on the same machine as in the [prompt benchmark](#is-it-really-fast) takes 29 seconds (29 ms per invocation). This is about 6 @@ -712,6 +735,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`. +- 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 Powerlevel10k. Some examples: @@ -726,7 +750,7 @@ Almost. There are a few differences. [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 - details in [troubleshooting](#extra-spaces-after-some-icons). + details in [troubleshooting](#extra-or-missing-spaces-after-some-icons). - There are [dozens more bugs](https://github.com/Powerlevel9k/powerlevel9k/issues/created_by/romkatv) in Powerlevel9k that don't exist in Powerlevel10k. @@ -754,11 +778,15 @@ custom background color (`#171A1B` instead of `#2E3436` -- twice as dark). ## Troubleshooting -### Icons, glyphs or powerline symbols don't render. +### Icons, glyphs or powerline symbols don't render Restart your terminal, [install the recommended font]( #recommended-meslo-nerd-font-patched-for-powerlevel10k) and run `p10k configure`. +### Small imperfections around powerline symbols + +TODO + ### zsh: character not in range Type `echo '\u276F'`. If you get an error saying "zsh: character not in range", your locale @@ -872,7 +900,10 @@ configuration wizard. Once you can see the errors, fix `~/.zshrc` to get rid of Once you download [the recommended font](#recommended-meslo-nerd-font-patched-for-powerlevel10k), you can install it just like any other font. Google "how to install fonts on *your OS*". -### Extra spaces in prompt compared to Powerlevel9k +### Extra or missing spaces in prompt compared to Powerlevel9k + +tl;dr: Add `ZLE_RPROMPT_INDENT=0` and `POWERLEVEL9K_LEGACY_ICON_SPACING=true` to `~/.zshrc` to get +the same prompt spacing as in Powerlevel9k. When using Powerlevel10k with a Powerlevel9k config, you might get additional spaces in prompt here and there. These come in two flavors. @@ -908,7 +939,11 @@ 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. -#### Extra spaces after some icons +*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`. + +#### Extra or missing spaces after some icons tl;dr: Add `POWERLEVEL9K_LEGACY_ICON_SPACING=true` to `~/.zshrc` to get rid of these spaces. @@ -917,13 +952,13 @@ 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) -This inconsistency is a constant source of annoyance, so it was fixed in Powerlevel10k. -Unfortunately, this means that users upgrading from Powerlevel9k will notice differences in spacing -around some icons. - -Add `POWERLEVEL9K_LEGACY_ICON_SPACING=true` to `~/.zshrc` to get the same spacing around icons as in +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 +`p10k configure`. + ### Cannot make Powerlevel10k work with my plugin manager If the [installation instructions](#installation) didn't work for you, try disabling your current From f91597fe7bae81c23ad315efe7c7327db09d40ae Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 31 Jan 2020 10:52:34 +0100 Subject: [PATCH 26/88] speed up terraform, add classes to configs, bump version --- config/p10k-classic.zsh | 35 +++++++++++++++++++++++++++++----- config/p10k-lean-8colors.zsh | 35 +++++++++++++++++++++++++++++----- config/p10k-lean.zsh | 35 +++++++++++++++++++++++++++++----- config/p10k-rainbow.zsh | 37 ++++++++++++++++++++++++++++++------ internal/p10k.zsh | 16 +++++++--------- 5 files changed, 128 insertions(+), 30 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 78d02561..f2fe3f1a 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -832,10 +832,35 @@ # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' ################[ terraform: terraform workspace (https://www.terraform.io) ]################# - # Terraform color. - typeset -g POWERLEVEL9K_TERRAFORM_FOREGROUND=38 - # Custom icon. - # typeset -g POWERLEVEL9K_TERRAFORM_VISUAL_IDENTIFIER_EXPANSION='⭐' + # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current terraform workspace 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_TERRAFORM_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' DEFAULT) + # + # If your current terraform workspace 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_TERRAFORM_TEST_FOREGROUND=28 + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_FOREGROUND=38 + # typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the the command you are typing invokes one of these tools. @@ -934,7 +959,7 @@ # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters, # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_AWS_CLASSES defines the context class. Patterns are tried in order. The + # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The # first match wins. # # For example, given these settings: diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index cb097be0..23a0e491 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -898,10 +898,35 @@ # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%fat ' ################[ terraform: terraform workspace (https://www.terraform.io) ]################# - # Terraform color. - typeset -g POWERLEVEL9K_TERRAFORM_FOREGROUND=4 - # Custom icon. - # typeset -g POWERLEVEL9K_TERRAFORM_VISUAL_IDENTIFIER_EXPANSION='⭐' + # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current terraform workspace 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_TERRAFORM_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' DEFAULT) + # + # If your current terraform workspace 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_TERRAFORM_TEST_FOREGROUND=2 + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_FOREGROUND=4 + # typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# # Show aws only when the the command you are typing invokes one of these tools. @@ -913,7 +938,7 @@ # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters, # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_AWS_CLASSES defines the context class. Patterns are tried in order. The + # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The # first match wins. # # For example, given these settings: diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index f7fd5f45..3734f7ef 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -898,10 +898,35 @@ # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%fat ' ################[ terraform: terraform workspace (https://www.terraform.io) ]################# - # Terraform color. - typeset -g POWERLEVEL9K_TERRAFORM_FOREGROUND=38 - # Custom icon. - # typeset -g POWERLEVEL9K_TERRAFORM_VISUAL_IDENTIFIER_EXPANSION='⭐' + # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current terraform workspace 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_TERRAFORM_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' DEFAULT) + # + # If your current terraform workspace 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_TERRAFORM_TEST_FOREGROUND=28 + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_FOREGROUND=38 + # typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# # Show aws only when the the command you are typing invokes one of these tools. @@ -913,7 +938,7 @@ # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters, # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_AWS_CLASSES defines the context class. Patterns are tried in order. The + # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The # first match wins. # # For example, given these settings: diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 37da7fb8..ac503971 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -864,11 +864,36 @@ # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' ################[ terraform: terraform workspace (https://www.terraform.io) ]################# - # Terraform color. - # typeset -g POWERLEVEL9K_TERRAFORM_FOREGROUND=4 - # typeset -g POWERLEVEL9K_TERRAFORM_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_TERRAFORM_VISUAL_IDENTIFIER_EXPANSION='⭐' + # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current terraform workspace 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_TERRAFORM_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' DEFAULT) + # + # If your current terraform workspace 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_TERRAFORM_TEST_FOREGROUND=2 + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_FOREGROUND=4 + typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_BACKGROUND=0 + # typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the the command you are typing invokes one of these tools. @@ -969,7 +994,7 @@ # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters, # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_AWS_CLASSES defines the context class. Patterns are tried in order. The + # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The # first match wins. # # For example, given these settings: diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 5ba6159d..55922b90 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -209,6 +209,7 @@ function _p9k_read_word() { _p9k_ret=${cached#*:} else local rest + _p9k_ret= { read _p9k_ret rest <$1 } 2>/dev/null _p9k__read_word_cache[$1]=$stat[1]:$_p9k_ret fi @@ -4298,14 +4299,11 @@ function instant_prompt_nix_shell() { } function prompt_terraform() { - local ws=default - if [[ -n $TF_WORKSPACE ]]; then - ws=$TF_WORKSPACE - else - local f=${TF_DATA_DIR:-.terraform}/environment - [[ -r $f ]] && _p9k_read_file $f && ws=$_p9k_ret + local ws=$TF_WORKSPACE + if [[ -z $TF_WORKSPACE ]]; then + _p9k_read_word ${${TF_DATA_DIR:-.terraform}:A}/environment && ws=$_p9k_ret fi - ws=${${ws##[[:space:]]#}%%[[:space:]]#} + [[ $ws == (|default) ]] && return local pat class for pat class in "${_POWERLEVEL9K_TERRAFORM_CLASSES[@]}"; do if [[ $ws == ${~pat} ]]; then @@ -4313,7 +4311,7 @@ function prompt_terraform() { break fi done - [[ $ws == default ]] || _p9k_prompt_segment "$0$state" $_p9k_color1 blue TERRAFORM_ICON 0 '' $ws + _p9k_prompt_segment "$0$state" $_p9k_color1 blue TERRAFORM_ICON 0 '' $ws } _p9k_prompt_terraform_init() { @@ -6457,7 +6455,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v32\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v33\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$DEFAULT_USER\1${ZLE_RPROMPT_INDENT:-1}\1$P9K_SSH\1$__p9k_ksh_arrays' From 6ca69df39f0d9198245a4d74dbefac713cdcbc92 Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 31 Jan 2020 12:01:40 +0100 Subject: [PATCH 27/88] doc: sub-pixel imperfections --- README.md | 87 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 61 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 581bc974..0720d812 100644 --- a/README.md +++ b/README.md @@ -44,12 +44,11 @@ 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](#recommended-meslo-nerd-font-patched-for-powerlevel10k) before +*Tip*: Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) before running `p10k configure`. *FAQ:* -- [Why do I have a question mark symbol in my prompt? Is my font broken?](#why-do-i-have-a-question-mark-symbol-in-my-prompt-is-my-font-broken) - [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) @@ -434,7 +433,7 @@ docker run -e TERM -e COLORTERM -it --rm debian:buster bash -uec ' exec zsh' ``` -*Tip*: Install [the recommended font](#recommended-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. @@ -562,19 +561,8 @@ to move it above the instant prompt preamble or to suppress its output. You can instant prompt with `POWERLEVEL9K_INSTANT_PROMPT=off`. Do this if instant prompt breaks zsh initialization and you don't know how to fix it. -*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.* - -### Why do I have a question mark symbol in my prompt? Is my font broken? - -If it looks like a regular `?`, that's normal. It means you have untracked files in the current Git -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`. - -You can also get a weird-looking question mark in your prompt if your terminal's font is missing -some glyphs. To fix this problem, -[install the recommended font](#recommended-meslo-nerd-font-patched-for-powerlevel10k) and run -`p10k configure`. +*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. ### What do different symbols in Git status mean? @@ -750,7 +738,7 @@ Almost. There are a few differences. [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 - details in [troubleshooting](#extra-or-missing-spaces-after-some-icons). + details in [troubleshooting](#extra-or-missing-spaces-around-icons). - There are [dozens more bugs](https://github.com/Powerlevel9k/powerlevel9k/issues/created_by/romkatv) in Powerlevel9k that don't exist in Powerlevel10k. @@ -778,16 +766,62 @@ custom background color (`#171A1B` instead of `#2E3436` -- twice as dark). ## Troubleshooting +### Question mark in prompt + +If it looks like a regular `?`, that's normal. It means you have untracked files in the current Git +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) + +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-dont-render]( + icons, glyphs or powerline symbols don't render). + ### Icons, glyphs or powerline symbols don't render -Restart your terminal, [install the recommended font]( - #recommended-meslo-nerd-font-patched-for-powerlevel10k) and run `p10k configure`. +Restart your terminal, [install the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) +and run `p10k configure`. -### Small imperfections around powerline symbols +### Sub-pixel imperfections around powerline symbols -TODO +![Powerline Prompt Imperfections]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/powerline-imperfections.png) -### zsh: character not in range +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. +1. Incorrect alignment of a powerline connection and the following prompt segment. The connection +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 seen 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) + +If Powerlevel10k prompt has imperfections around powerline symbols, you'll see exactly the same +imperfections with all powerline themes (Agnoster, Powerlevel9k, Powerline, etc.) + +There are several things you can try to deal with these imperfections: + +- Try [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). If you are already using + it, switching to another font may help but is unlikely. +- Change terminal font size one point up or down. For example, in iTerm2 powerline prompt looks + perfect at font sizes 11 and 13 but breaks down at 12. +- Change font hinting and/or antialiasing mode in the terminal settings. +- Shift all text one pixel up/down/left/right if your terminal has an option to do so. +- 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 +rendering imperfections that afflict powerline-style prompt. + +### zsh: character not in range 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 @@ -800,7 +834,7 @@ Type `echo '\u276F'`. If you get an error saying "zsh: character not in range", [previous section](#zsh-character-not-in-range). If the `echo` command prints `❯` but the cursor is still in the wrong place, install -[the recommended font](#recommended-meslo-nerd-font-patched-for-powerlevel10k) and run +[the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) and run `p10k configure`. If this doesn't help, add `unset ZLE_RPROMPT_INDENT` at the bottom of `~/.zshrc`. @@ -897,7 +931,7 @@ configuration wizard. Once you can see the errors, fix `~/.zshrc` to get rid of ### Cannot install the recommended font -Once you download [the recommended font](#recommended-meslo-nerd-font-patched-for-powerlevel10k), +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*". ### Extra or missing spaces in prompt compared to Powerlevel9k @@ -943,9 +977,10 @@ Powerlevel9k. 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`. -#### Extra or missing spaces after some icons +#### Extra or missing spaces around icons -tl;dr: Add `POWERLEVEL9K_LEGACY_ICON_SPACING=true` to `~/.zshrc` to get rid of these spaces. +tl;dr: Add `POWERLEVEL9K_LEGACY_ICON_SPACING=true` to `~/.zshrc` to get the same spacing around +icons as in Powerlevel9k. Spacing around icons in Powerlevel9k is inconsistent. From 44bf61ac2cdd7c736bef7f68bccd8b51f97d836b Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 31 Jan 2020 13:18:56 +0100 Subject: [PATCH 28/88] doc: describe how p9k and p10k are related --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 0720d812..5e81369b 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,8 @@ but it will be [much faster](#uncompromising-performance) ([certainly](#is-it-re #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 @@ -717,6 +719,27 @@ Running this command with `~/powerlevel10k` as the current directory on the same [prompt benchmark](#is-it-really-fast) takes 29 seconds (29 ms per invocation). This is about 6 times faster than powerlevel9k/master and 17 times faster than powerlevel9k/next. +### What is the relationship between Powerlevel9k and Powerlevel10k? + +Powerlevel10k was forked from Powerlevel9k in March 2019 after a week-long discussion in +[powerlevel9k#1170](https://github.com/Powerlevel9k/powerlevel9k/issues/1170). Powerlevel9k was +already a mature project with large user base and release cycle measured in months. Powerlevel10k +was spun off to iterate on performance improvements and new features at much higher pace. + +Powerlevel9k and Powerlevel10k are independent projects. When using one, you shouldn't install the +other. Issues should be filed against the project that you actually use. There are no individuals +that have commit rights in both repositories. All bug fixes and new features committed to +Powerlevel9k repository get ported to Powerlevel10k. + +Over time, virtually all code in Powerlevel10k has been rewritten. There is currently no meaningful +overlap between the implementations of Powerlevel9k and Powerlevel10k. + +Powerlevel10k is committed to maintaining backward compatiblity with all configs indefinitely. This +committment covers all configuration parameters recognized by Powerlevel9k (see +[Powerlevel9k compatibility](#powerlevel9k-compatibility)) and additional parameters that only +Powerlevel10k understands. Names of all parameters in Powerlevel10k start with `POWERLEVEL9K_` for +consistency. + ### Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config? Almost. There are a few differences. From 0d6859cae8d622be48b83a0ac9784ea2423c8089 Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 31 Jan 2020 14:12:30 +0100 Subject: [PATCH 29/88] add configuration wizard tips --- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5e81369b..a0ca91ee 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ Powerlevel10k can produce the same prompt as [Pure](https://github.com/sindresor ![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 +You can still use Powerlevel10k features such as [transient prompt](#transient-prompt) or [instant Prompt](#instant-prompt) when sporting Pure style. To customize prompt, edit `~/.p10k.zsh`. Powerlevel10k doesn't recognize Pure configuration @@ -178,7 +178,7 @@ prompt when accepting a command line. 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. ### Current directory that just works @@ -447,6 +447,18 @@ Powerlevel10k is released under the ## FAQ +### Which aspects of shell and terminal does Powerlevel10k affect? + +Powerlevel10k defines prompt and nothing else. It sets prompt-related options (their names start +`prompt`), and parameters `PS1` and `RPS1`. + +Powerlevel10k does not affect: + +- Terminal window title. +- Colors used by `ls`. +- Command line colors (syntax highlighting). +- Prompt parameters other than `PS1` and `RPS1`. + ### I'm using Powerlevel9k with Oh My Zsh. How do I migrate? 1. Run this command: @@ -769,6 +781,39 @@ Almost. There are a few differences. If you notice any other changes in prompt appearance when switching from Powerlevel9k to Powerlevel10k, please [open an issue](https://github.com/romkatv/powerlevel10k/issues). +### What is the best prompt style in the configuration wizard? + +There are as many opinions on what constitutes the best prompt as there are people. It mostly comes +down to personal preference. There are, however, a few hidden implications of different choices. + +Pure style is an exact replication of [Pure Zsh theme](https://github.com/sindresorhus/pure). It +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 +look the same in any terminal color palette. + +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. Having +all commands start from the same offset is also nice. + +Similarly, if you enable transient prompt, sparse prompt (with an empty line before prompt) is a +great choice. + +If you are using vi keymap, choose prompt with `prompt_char` in it (shown as green `❯` in the +wizard). This symbol changes depending on vi mode: `❯`, `❮`, `Ⅴ`, `▶` for insert, command, visual +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, disable *current time* and 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 +prompt style. + ### Is there an AUR package for Powerlevel10k? Yes, [zsh-theme-powerlevel10k-git](https://aur.archlinux.org/packages/zsh-theme-powerlevel10k-git/). @@ -787,6 +832,9 @@ 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) +Syntax highlighting, where present, was provided by [zsh-syntax-highlighting]( + https://github.com/zsh-users/zsh-syntax-highlighting). + ## Troubleshooting ### Question mark in prompt From b6cb9618a873ec0392c816a8d6e1e9fd4aa6adac Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 31 Jan 2020 15:18:39 +0100 Subject: [PATCH 30/88] spelling and cleanup --- README.md | 103 ++++++++++++++++++++++------------- config/p10k-classic.zsh | 4 +- config/p10k-lean-8colors.zsh | 4 +- config/p10k-lean.zsh | 4 +- config/p10k-rainbow.zsh | 4 +- 5 files changed, 72 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index a0ca91ee..30289135 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # 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). @@ -45,15 +46,15 @@ customization can be done by editing this file. It has plenty of comments to hel through configuration options. *Tip*: Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) before -running `p10k configure`. +running `p10k configure` to unlock all prompt styles. *FAQ:* -- [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 change colors?](#how-do-i-change-colors) -- [Why some prompt segments appear and disappear as I'm typing?](#why-some-prompt-segments-appear-and-disappear-as-im-typing) +- [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) ### Uncompromising performance @@ -115,14 +116,14 @@ You can still use Powerlevel10k features such as [transient prompt](#transient-p [instant Prompt](#instant-prompt) when sporting Pure style. To customize prompt, edit `~/.p10k.zsh`. Powerlevel10k doesn't recognize Pure configuration -parameters, so you need to use `POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3` instead of +parameters, so you'll need to use `POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3` instead of `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. ### Instant prompt If your `~/.zshrc` loads many plugins, or perhaps just a few slow ones -(for example, [pyenv](https://github.com/pyenv/pyenv) or [nvm](https://github.com/nvm-sh/nvm), you +(for example, [pyenv](https://github.com/pyenv/pyenv) or [nvm](https://github.com/nvm-sh/nvm)), you may have noticed that it takes some time for Zsh to start. ![Powerlevel10k No Instant Prompt]( @@ -179,7 +180,8 @@ prompt when accepting a command line. 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 -extra space for typing commands without the usual drawback of reduced scrollback density. +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. ### Current directory that just works @@ -204,6 +206,9 @@ Directory segments are shown in one of three colors: *Tip*: If you copy-paste a truncated directory and hit *TAB*, it'll complete to the original. +*Troubleshooting*: [Directory is hard to see in prompt when using Rainbow style.]( + #directory-is-hard-to-see-in-prompt-when-using-rainbow-style) + ### Extremely customizable Powerlevel10k can be configured to look like any other Zsh theme out there. @@ -212,7 +217,7 @@ Powerlevel10k can be configured to look like any other Zsh theme out there. https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/other-theme-emulation.gif) [Pure](#pure-compatibility) and [Powerlevel9k](#powerlevel9k-compatibility) emulations are built-in. -To emulate the appearence of other themes, you'll need to write a suitable configuration file. The +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`. @@ -229,8 +234,8 @@ 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), most of these segments get enabled by -default. Some must be manually enabled by opening `~/.p10k.zsh` and uncommenting them. You can +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 enable as many segments as you like. It won't slow down your prompt or Zsh startup. | Segment | Meaning | @@ -267,7 +272,7 @@ enable as many segments as you like. It won't slow down your prompt or Zsh start | `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 | -| `gcloud` | [google cloud](https://cloud.google.com/) cli acccount and project | +| `gcloud` | [google cloud](https://cloud.google.com/) cli account and project | | `google_app_cred` | [google application credentials](https://cloud.google.com/docs/authentication/production) | | `nordvpn` | [nordvpn](https://nordvpn.com/) connection status | | `ranger` | [ranger](https://github.com/ranger/ranger) shell | @@ -369,7 +374,7 @@ the default system fonts. The full choice of style options is available only whe ### Meslo Nerd Font patched for Powerlevel10k Gorgeous monospace font designed by Jim Lyles for Apple, customized by André Berg, patched by Ryan -L McIntyre of Nerd Fonts, and hand-edited in FontForge by yours trully. Contains all glyphs and +L McIntyre of Nerd Fonts, and hand-edited in FontForge by yours truly. Contains all glyphs and symbols that Powerlevel10k may need. Battle-tested in dozens of different terminals on all major operating systems. @@ -449,8 +454,8 @@ Powerlevel10k is released under the ### Which aspects of shell and terminal does Powerlevel10k affect? -Powerlevel10k defines prompt and nothing else. It sets prompt-related options (their names start -`prompt`), 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`. Powerlevel10k does not affect: @@ -476,14 +481,18 @@ exec zsh *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) + - [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? Yes. -[![asciicast](https://asciinema.org/a/NHRjK3BMePw66jtRVY2livHwZ.svg)](https://asciinema.org/a/NHRjK3BMePw66jtRVY2livHwZ) +[![asciicast](https://asciinema.org/a/NHRjK3BMePw66jtRVY2livHwZ.svg)]( + https://asciinema.org/a/NHRjK3BMePw66jtRVY2livHwZ) Benchmark results obtained with [zsh-prompt-benchmark](https://github.com/romkatv/zsh-prompt-benchmark) on an Intel i9-7900X @@ -508,8 +517,8 @@ budget for other plugins you might install. ### How do I enable instant prompt? -See [instant prompt](#instant-prompt) to learn what instant prompt is. This section explains how -you can enable it and lists caveats that you should be aware of. +See [instant prompt](#instant-prompt) to learn about instant prompt. This section explains how you +can enable it and lists caveats that you should be aware of. Instant prompt can be enabled either through `p10k configure` or by manually adding the following code snippet at the top of `~/.zshrc`: @@ -580,7 +589,7 @@ zsh but it won't do anything. ### What do different symbols in Git status mean? -When using *Lean*, *Classic* or *Rainbow* style, Git status may look like this: +When using Lean, Classic or Rainbow style, Git status may look like this: ```text feature:master ⇣42⇡42 *42 merge ~42 +42 !42 ?42 @@ -611,11 +620,10 @@ source code. ### How do I add username and/or hostname to prompt? -When using *Lean*, *Classic* or *Rainbow* style, prompt shows `username@hostname` when you are -logged in as root or via SSH. There is little value in showing `username` or `hostname` when you are -logged in to your local machine as a normal user. So the absence of `username@hostname` in your -prompt is an indication that you are working locally and that you aren't root. You can change it, -however. +When using Lean, Classic or Rainbow style, prompt shows `username@hostname` when you are logged in +as root or via SSH. There is little value in showing `username` or `hostname` when you are logged in +to your local machine as a normal user. So the absence of `username@hostname` in your prompt is an +indication that you are working locally and that you aren't root. You can change it, however. Open `~/.p10k.zsh`. Close to the top you can see the most important parameters that define which segments are shown in your prompt. All generally useful prompt segments are listed in there. Some of @@ -648,7 +656,7 @@ to `POWERLEVEL9K_LEFT_PROMPT_ELEMENTS`. ### Why some prompt segments appear and disappear as I'm typing? Prompt segments can be configured to be shown only when the current command you are typing invokes -a releavant tool. +a relevant tool. ```zsh # Show prompt segment "kubecontext" only when the command you are typing @@ -660,7 +668,7 @@ Configs created by `p10k configure` may contain parameters of this kind. To cust prompt segments are shown, open `~/.p10k.zsh`, search for `SHOW_ON_COMMAND` and either remove these parameters or change their values. -### How do I change colors? +### 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 @@ -669,7 +677,7 @@ You can either [change the color palette used by your terminal]( #### Change the color palette used by your terminal -How exactly you change the terminal color pallete (a.k.a. color scheme, or theme) depends on the +How exactly you change the terminal color palette (a.k.a. color scheme, or theme) depends on the kind of terminal you are using. Look around in terminal's settings/preferences or consult documentation. @@ -693,6 +701,8 @@ Colors are specified using numbers from 0 to 255. Colors from 0 to 15 look diffe terminals. Many terminals also support customization of these colors through color palettes (a.k.a. color schemes, or themes). Colors from 16 to 255 always look the same. +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: ```zsh @@ -725,7 +735,7 @@ time (repeat 1000 zsh -dfis <<< 'source ~/powerlevel10k/powerlevel10k.zsh-theme' ``` *Note:* This measures time to first complete prompt. Powerlevel10k can also display a -[limited prompt](#what-is-instant-prompt) before the full-featured prompt is ready. +[limited prompt](#instant-prompt) before the full-featured prompt is ready. Running this command with `~/powerlevel10k` as the current directory on the same machine as in the [prompt benchmark](#is-it-really-fast) takes 29 seconds (29 ms per invocation). This is about 6 @@ -746,8 +756,8 @@ Powerlevel9k repository get ported to Powerlevel10k. Over time, virtually all code in Powerlevel10k has been rewritten. There is currently no meaningful overlap between the implementations of Powerlevel9k and Powerlevel10k. -Powerlevel10k is committed to maintaining backward compatiblity with all configs indefinitely. This -committment covers all configuration parameters recognized by Powerlevel9k (see +Powerlevel10k is committed to maintaining backward compatibility with all configs indefinitely. This +commitment covers all configuration parameters recognized by Powerlevel9k (see [Powerlevel9k compatibility](#powerlevel9k-compatibility)) and additional parameters that only Powerlevel10k understands. Names of all parameters in Powerlevel10k start with `POWERLEVEL9K_` for consistency. @@ -847,8 +857,8 @@ of untracked files altogether. Search for `untracked files` in `~/.p10k.zsh`. #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-dont-render]( - icons, glyphs or powerline symbols don't 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 @@ -884,7 +894,7 @@ There are several things you can try to deal with these imperfections: it, switching to another font may help but is unlikely. - Change terminal font size one point up or down. For example, in iTerm2 powerline prompt looks perfect at font sizes 11 and 13 but breaks down at 12. -- Change font hinting and/or antialiasing mode in the terminal settings. +- Change font hinting and/or anti-aliasing mode in the terminal settings. - Shift all text one pixel up/down/left/right if your terminal has an option to do so. - Try a different terminal. @@ -963,7 +973,7 @@ characters as double-width instead of single width. For example, +------------------------------+ ``` -Note that this prompt is different from the original as it's missing a space after the checkmark. +Note that this prompt is different from the original as it's missing a space after the check mark. This can be caused by a low-level bug in macOS. See [this issue](https://github.com/romkatv/powerlevel10k/issues/241). @@ -1091,6 +1101,21 @@ echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc This method of installation won't make anything slower or otherwise sub-par. +### Directory is hard to see in prompt when using Rainbow style + +In Classic style the current working directory is shown with bright white white text on blue +background. The white is fixed and always looks the same but the appearance of "blue" is defined +by your terminal color palette. If it's very light, it's difficult to see white text on it. + +There are several ways to fix this. + +- Type `p10k configure` and choose a more readable prompt style. +- [Change terminal color palette](#change-the-color-palette-used-by-your-terminal). Try Tango Dark + or Solarized Dark, or change just the "blue" color. +- [Change directory background color](#set-colors-through-Powerlevel10k-configuration-parameters). + The parameter you are looking for is called `POWERLEVEL9K_DIR_BACKGROUND`. You can find it in + in `~/.p10k.zsh`. Uncomment it if it's commented out and try different values. + ## Table of contents 1. [Features](#features) @@ -1138,7 +1163,7 @@ This method of installation won't make anything slower or otherwise sub-par. 1. [What do different symbols in Git status mean?](#what-do-different-symbols-in-git-status-mean) 1. [How do I change the format of Git status?](#how-do-i-change-the-format-of-git-status) 1. [How do I add username and/or hostname to prompt?](#how-do-i-add-username-andor-hostname-to-prompt) - 1. [How do I change colors?](#how-do-i-change-colors) + 1. [How do I change prompt colors?](#how-do-i-change-prompt-colors) 1. [Why some prompt segments appear and disappear as I'm typing?](#why-some-prompt-segments-appear-and-disappear-as-im-typing) 1. [Why does Powerlevel10k spawn extra processes?](#why-does-powerlevel10k-spawn-extra-processes) 1. [Are there configuration options that make Powerlevel10k slow?](#are-there-configuration-options-that-make-powerlevel10k-slow) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 59879ada..f34ac403 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -70,7 +70,7 @@ aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) - gcloud # google cloud cli acccount and project (https://cloud.google.com/) + gcloud # google cloud cli account and project (https://cloud.google.com/) google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) context # user@hostname nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) @@ -999,7 +999,7 @@ # Custom icon. # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' - ##########[ gcloud: google cloud acccount and project (https://cloud.google.com/) ]########### + ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### # Show gcloud only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show gcloud. typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs' diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 27cd4444..a8917178 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -70,7 +70,7 @@ aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) - gcloud # google cloud cli acccount and project (https://cloud.google.com/) + gcloud # google cloud cli account and project (https://cloud.google.com/) google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) context # user@hostname nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) @@ -978,7 +978,7 @@ # Custom icon. # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' - ##########[ gcloud: google cloud acccount and project (https://cloud.google.com/) ]########### + ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### # Show gcloud only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show gcloud. typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs' diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index a17e92df..b28fbd64 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -70,7 +70,7 @@ aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) - gcloud # google cloud cli acccount and project (https://cloud.google.com/) + gcloud # google cloud cli account and project (https://cloud.google.com/) google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) context # user@hostname nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) @@ -978,7 +978,7 @@ # Custom icon. # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' - ##########[ gcloud: google cloud acccount and project (https://cloud.google.com/) ]########### + ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### # Show gcloud only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show gcloud. typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs' diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index ded749d8..2381c6f1 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -70,7 +70,7 @@ aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) - gcloud # google cloud cli acccount and project (https://cloud.google.com/) + gcloud # google cloud cli account and project (https://cloud.google.com/) google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) context # user@hostname nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) @@ -1037,7 +1037,7 @@ # Custom icon. # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' - ##########[ gcloud: google cloud acccount and project (https://cloud.google.com/) ]########### + ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### # Show gcloud only when the the command you are typing invokes one of these tools. # Tip: Remove the next line to always show gcloud. typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs' From c34c567be29a1fd4f67a1007044d211bc264a2b0 Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 31 Jan 2020 15:45:44 +0100 Subject: [PATCH 31/88] update toc --- README.md | 126 +++++++++++++++++++++++++++++------------------------- 1 file changed, 67 insertions(+), 59 deletions(-) diff --git a/README.md b/README.md index 30289135..3bc8855a 100644 --- a/README.md +++ b/README.md @@ -206,8 +206,8 @@ Directory segments are shown in one of three colors: *Tip*: If you copy-paste a truncated directory and hit *TAB*, it'll complete to the original. -*Troubleshooting*: [Directory is hard to see in prompt when using Rainbow style.]( - #directory-is-hard-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 @@ -1101,7 +1101,7 @@ echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc This method of installation won't make anything slower or otherwise sub-par. -### Directory is hard to see in prompt when using Rainbow style +### Directory is difficult to see in prompt when using Rainbow style In Classic style the current working directory is shown with bright white white text on blue background. The white is fixed and always looks the same but the appearance of "blue" is defined @@ -1118,59 +1118,67 @@ There are several ways to fix this. ## Table of contents -1. [Features](#features) - 1. [Configuration wizard](#configuration-wizard) - 1. [Uncompromising performance](#uncompromising-performance) - 1. [Powerlevel9k compatibility](#powerlevel9k-compatibility) - 1. [Pure compatibility](#pure-compatibility) - 1. [Instant prompt](#instant-prompt) - 1. [Show On Command](#show-on-command) - 1. [Transient prompt](#transient-prompt) - 1. [Current directory that just works](#current-directory-that-just-works) - 1. [Extremely customizable](#extremely-customizable) - 1. [Batteries included](#batteries-included) -1. [Installation](#installation) - 1. [Manual](#manual) - 1. [Oh My Zsh](#oh-my-zsh) - 1. [Prezto](#prezto) - 1. [Zim](#zim) - 1. [Antigen](#antigen) - 1. [Zplug](#zplug) - 1. [Zgen](#zgen) - 1. [Antibody](#antibody) - 1. [Zplugin](#zplugin) -1. [Configuration](#configuration) - 1. [For new users](#for-new-users) - 1. [For Powerlevel9k users](#for-powerlevel9k-users) -1. [Fonts](#fonts) - 1. [Meslo Nerd Font patched for Powerlevel10k](#meslo-nerd-font-patched-for-powerlevel10k) - 1. [Automatic font installation](#automatic-font-installation) - 1. [Manual font installation](#manual-font-installation) -1. [Try it in Docker](#try-it-in-docker) -1. [License](#license) -1. [FAQ](#faq) - 1. [I'm using Powerlevel9k with Oh My Zsh. How do I migrate?](#im-using-powerlevel9k-with-oh-my-zsh-how-do-i-migrate) - 1. [Is it really fast?](#is-it-really-fast) - 1. [What is instant prompt?](#what-is-instant-prompt) - 1. [Why do my icons and/or powerline symbols look bad?](#why-do-my-icons-andor-powerline-symbols-look-bad) - 1. [I'm getting "character not in range" error. What gives?](#im-getting-character-not-in-range-error-what-gives) - 1. [Why is my cursor in the wrong place?](#why-is-my-cursor-in-the-wrong-place) - 1. [Why is my prompt wrapping around in a weird way?](#why-is-my-prompt-wrapping-around-in-a-weird-way) - 1. [Why is my right prompt in the wrong place?](#why-is-my-right-prompt-in-the-wrong-place) - 1. [Why does the configuration wizard run automatically every time I start zsh?](#why-does-the-configuration-wizard-run-automatically-every-time-i-start-zsh) - 1. [I cannot install the recommended font. Help!](#i-cannot-install-the-recommended-font-help) - 1. [Why do I have a question mark symbol in my prompt? Is my font broken?](#why-do-i-have-a-question-mark-symbol-in-my-prompt-is-my-font-broken) - 1. [What do different symbols in Git status mean?](#what-do-different-symbols-in-git-status-mean) - 1. [How do I change the format of Git status?](#how-do-i-change-the-format-of-git-status) - 1. [How do I add username and/or hostname to prompt?](#how-do-i-add-username-andor-hostname-to-prompt) - 1. [How do I change prompt colors?](#how-do-i-change-prompt-colors) - 1. [Why some prompt segments appear and disappear as I'm typing?](#why-some-prompt-segments-appear-and-disappear-as-im-typing) - 1. [Why does Powerlevel10k spawn extra processes?](#why-does-powerlevel10k-spawn-extra-processes) - 1. [Are there configuration options that make Powerlevel10k slow?](#are-there-configuration-options-that-make-powerlevel10k-slow) - 1. [Is Powerlevel10k fast to load?](#is-powerlevel10k-fast-to-load) - 1. [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) - 1. [Why do I get extra spaces in prompt when I use my Powerlevel9k config with Powerlevel10k?](#why-do-i-get-extra-spaces-in-prompt-when-i-use-my-powerlevel9k-config-with-powerlevel10k) - 1. [Is there an AUR package for Powerlevel10k?](#is-there-an-aur-package-for-powerlevel10k) - 1. [I cannot make Powerlevel10k work with my plugin manager. Help!](#i-cannot-make-powerlevel10k-work-with-my-plugin-manager-help) - 1. [What is the minimum supported zsh version?](#what-is-the-minimum-supported-zsh-version) - 1. [How were these screenshots and animated gifs created?](#how-were-these-screenshots-and-animated-gifs-created) +- [Features](#features) + - [Configuration wizard](#configuration-wizard) + - [Uncompromising performance](#uncompromising-performance) + - [Powerlevel9k compatibility](#powerlevel9k-compatibility) + - [Pure compatibility](#pure-compatibility) + - [Instant prompt](#instant-prompt) + - [Show on command](#show-on-command) + - [Transient prompt](#transient-prompt) + - [Current directory that just works](#current-directory-that-just-works) + - [Extremely customizable](#extremely-customizable) + - [Batteries included](#batteries-included) +- [Installation](#installation) + - [Manual](#manual) + - [Oh My Zsh](#oh-my-zsh) + - [Prezto](#prezto) + - [Zim](#zim) + - [Antigen](#antigen) + - [Zplug](#zplug) + - [Zgen](#zgen) + - [Antibody](#antibody) + - [Zplugin](#zplugin) +- [Configuration](#configuration) + - [For new users](#for-new-users) + - [For Powerlevel9k users](#for-powerlevel9k-users) +- [Fonts](#fonts) + - [Meslo Nerd Font patched for Powerlevel10k](#meslo-nerd-font-patched-for-powerlevel10k) + - [Automatic font installation](#automatic-font-installation) + - [Manual font installation](#manual-font-installation) +- [Try it in Docker](#try-it-in-docker) +- [License](#license) +- [FAQ](#faq) + - [Which aspects of shell and terminal does Powerlevel10k affect?](#which-aspects-of-shell-and-terminal-does-powerlevel10k-affect) + - [I'm using Powerlevel9k with Oh My Zsh. How do I migrate?](#im-using-powerlevel9k-with-oh-my-zsh-how-do-i-migrate) + - [Is it really fast?](#is-it-really-fast) + - [How do I enable instant prompt?](#how-do-i-enable-instant-prompt) + - [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) + - [Why some prompt segments appear and disappear as I'm typing?](#why-some-prompt-segments-appear-and-disappear-as-im-typing) + - [How do I change prompt colors?](#how-do-i-change-prompt-colors) + - [Why does Powerlevel10k spawn extra processes?](#why-does-powerlevel10k-spawn-extra-processes) + - [Are there configuration options that make Powerlevel10k slow?](#are-there-configuration-options-that-make-powerlevel10k-slow) + - [Is Powerlevel10k fast to load?](#is-powerlevel10k-fast-to-load) + - [What is the relationship between Powerlevel9k and Powerlevel10k?](#what-is-the-relationship-between-powerlevel9k-and-powerlevel10k) + - [Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config?](#does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config) + - [What is the best prompt style in the configuration wizard?](#what-is-the-best-prompt-style-in-the-configuration-wizard) + - [Is there an AUR package for Powerlevel10k?](#is-there-an-aur-package-for-powerlevel10k) + - [What is the minimum supported zsh version?](#what-is-the-minimum-supported-zsh-version) + - [How were these screenshots and animated gifs created?](#how-were-these-screenshots-and-animated-gifs-created) +- [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) + - [zsh: character not in range](#zsh-character-not-in-range) + - [Cursor is in the wrong place](#cursor-is-in-the-wrong-place) + - [Prompt wrapping around in a weird way](#prompt-wrapping-around-in-a-weird-way) + - [Right prompt is in the wrong place](#right-prompt-is-in-the-wrong-place) + - [Configuration wizard run automatically every time zsh is started](#configuration-wizard-run-automatically-every-time-zsh-is-started) + - [Cannot install the recommended font](#cannot-install-the-recommended-font) + - [Extra or missing spaces in prompt compared to Powerlevel9k](#extra-or-missing-spaces-in-prompt-compared-to-powerlevel9k) + - [Extra space without background on the right side of right prompt](#extra-space-without-background-on-the-right-side-of-right-prompt) + - [Extra or missing spaces around icons](#extra-or-missing-spaces-around-icons) + - [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) From 828a776a7b0b39f8fb482d3ad8f9acb9cb60de8d Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 31 Jan 2020 16:03:56 +0100 Subject: [PATCH 32/88] fix links --- README.md | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 3bc8855a..65ea1583 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ Powerlevel10k can produce the same prompt as [Pure](https://github.com/sindresor https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/pure-style.gif) You can still use Powerlevel10k features such as [transient prompt](#transient-prompt) or -[instant Prompt](#instant-prompt) when sporting Pure style. +[instant prompt](#instant-prompt) when sporting Pure style. To customize prompt, edit `~/.p10k.zsh`. Powerlevel10k doesn't recognize Pure configuration parameters, so you'll need to use `POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3` instead of @@ -135,8 +135,8 @@ Powerlevel10k can remove Zsh startup lag **even if it's not caused by a theme**. https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/instant-prompt.gif) This feature is called *Instant Prompt*. You need to explicitly enable it through `p10k configure` -or [manually](#what-is-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. +or [manually](#how-do-i-enable-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. @@ -388,10 +388,15 @@ If you are using a different terminal, proceed with manual font installation. #### Manual font installation Download these four ttf files: -- [MesloLGS NF Regular.ttf](https://github.com/romkatv/dotfiles-public/raw/master/.local/share/fonts/NerdFonts/MesloLGS%20NF%20Regular.ttf) -- [MesloLGS NF Bold.ttf](https://github.com/romkatv/dotfiles-public/raw/master/.local/share/fonts/NerdFonts/MesloLGS%20NF%20Bold.ttf) -- [MesloLGS NF Italic.ttf](https://github.com/romkatv/dotfiles-public/raw/master/.local/share/fonts/NerdFonts/MesloLGS%20NF%20Italic.ttf) -- [MesloLGS NF Bold Italic.ttf](https://github.com/romkatv/dotfiles-public/raw/master/.local/share/fonts/NerdFonts/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) Double-click on each file and click "Install". This will make `MesloLGS NF` font available to all applications on your system. Configure your terminal to use this font: @@ -784,9 +789,7 @@ Almost. There are a few differences. - 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 details in [troubleshooting](#extra-or-missing-spaces-around-icons). - - There are - [dozens more bugs](https://github.com/Powerlevel9k/powerlevel9k/issues/created_by/romkatv) in - Powerlevel9k that don't exist in Powerlevel10k. + - There are dozens more bugs in Powerlevel9k that don't exist in Powerlevel10k. If you notice any other changes in prompt appearance when switching from Powerlevel9k to Powerlevel10k, please [open an issue](https://github.com/romkatv/powerlevel10k/issues). @@ -836,7 +839,7 @@ Zsh 5.1 or newer should work. Fast startup requires zsh >= 5.4. ### How were these screenshots and animated gifs created? All screenshots and animated gifs were recorded in GNOME Terminal with -[the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) and Tango Dark color scheme 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]( From aea3e1393ec7d1b576f7378b81b12e654e410ea3 Mon Sep 17 00:00:00 2001 From: romkatv Date: Sat, 1 Feb 2020 00:45:44 +0100 Subject: [PATCH 33/88] cleanup --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 65ea1583..cce14f8d 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,9 @@ 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) + ### Instant prompt If your `~/.zshrc` loads many plugins, or perhaps just a few slow ones @@ -881,7 +884,7 @@ powerline connection. 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 seen on the +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). From 1b0ab85f870310456102dc5ee276b88b7c7d6e4c Mon Sep 17 00:00:00 2001 From: romkatv Date: Sat, 1 Feb 2020 11:10:54 +0100 Subject: [PATCH 34/88] link to installation --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cce14f8d..a10172e8 100644 --- a/README.md +++ b/README.md @@ -90,8 +90,9 @@ configuration parameters. ![Powerlevel10k Compatibility with 9k]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/9k-compatibility.gif) -Migration from Powerlevel9k to Powerlevel10k is a straightforward process. All your `POWERLEVEL9K` -configuration parameters will still work. Prompt will look the same as before ([almost]( +[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)) but it will be [much faster](#uncompromising-performance) ([certainly](#is-it-really-fast)). From d54f6f50cae037b17b03c8f3e5c3d9b30ac62ac2 Mon Sep 17 00:00:00 2001 From: romkatv Date: Sat, 1 Feb 2020 11:37:54 +0100 Subject: [PATCH 35/88] more links --- README.md | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a10172e8..c3806f9f 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,15 @@ running `p10k configure` to unlock all prompt styles. #what-do-different-symbols-in-git-status-mean) - [How do I change prompt colors?](#how-do-i-change-prompt-colors) +*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). + ### Uncompromising performance When you hit *ENTER*, the next prompt appears instantly. With Powerlevel10k there is no prompt lag. @@ -358,12 +367,46 @@ 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*: + +- [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 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) + +*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). + ### For Powerlevel9k users If you've been using Powerlevel9k before, **do not remove the configuration options**. Powerlevel10k will pick them up and provide you with the same prompt UI you are used to. See [Powerlevel9k compatibility](#powerlevel9k-compatibility). +*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) + +*Troubleshooting*: [Extra or missing spaces in prompt compared to Powerlevel9k]( + #extra-or-missing-spaces-in-prompt-compared-to-powerlevel9k.) + ## Fonts Powerlevel10k doesn't require custom fonts but can take advantage of them if they are available. @@ -486,7 +529,7 @@ exec zsh ``` 2. *Optional but highly recommended:* 1. Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). - 1. Type `p10k configure` and chose your favorite prompt style. + 1. Type `p10k configure` and choose your favorite prompt style. *Related:* - [Powerlevel9k compatibility.](#powerlevel9k-compatibility) From 8bad59ef135229aab86816a124e8c2a2f9842080 Mon Sep 17 00:00:00 2001 From: romkatv Date: Sat, 1 Feb 2020 12:10:36 +0100 Subject: [PATCH 36/88] s/zsh/Zsh/ in docs --- README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index c3806f9f..5920dbf2 100644 --- a/README.md +++ b/README.md @@ -587,12 +587,12 @@ fi It's important that you copy the lines verbatim. Don't replace `source` with something else, don't call `zcompile`, don't redirect output, etc. -When instant prompt is enabled, for the duration of zsh initialization standard input is redirected -to `/dev/null` and standard output with standard error are redirected to a temporary file. Once zsh +When instant prompt is enabled, for the duration of Zsh initialization standard input is redirected +to `/dev/null` and standard output with standard error are redirected to a temporary file. Once Zsh is fully initialized, standard file descriptors are restored and the content of the temporary file is printed out. -When using instant prompt, you should carefully check any output that appears on zsh startup as it +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 @@ -633,11 +633,11 @@ when it detects console output during initialization to bring attention to poten silence this warning (without suppressing console output) with `POWERLEVEL9K_INSTANT_PROMPT=quiet`. This is recommended if some initialization code in `~/.zshrc` prints to console and it's infeasible to move it above the instant prompt preamble or to suppress its output. You can completely disable -instant prompt with `POWERLEVEL9K_INSTANT_PROMPT=off`. Do this if instant prompt breaks zsh +instant prompt with `POWERLEVEL9K_INSTANT_PROMPT=off`. Do this if instant prompt breaks Zsh initialization and you don't know how to fix it. -*Note*: Instant prompt requires zsh >= 5.4. It's OK to enable it even when using an older version of -zsh but it won't do anything. +*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. ### What do different symbols in Git status mean? @@ -778,7 +778,7 @@ prompt latency when using Powerlevel10k, please ### Is Powerlevel10k fast to load? -Yes, provided that you are using zsh >= 5.4. +Yes, provided that you are using Zsh >= 5.4. Loading time, or time to first prompt, can be measured with the following benchmark: @@ -879,9 +879,9 @@ prompt style. Yes, [zsh-theme-powerlevel10k-git](https://aur.archlinux.org/packages/zsh-theme-powerlevel10k-git/). This package is owned by an unaffiliated volunteer. -### What is the minimum supported zsh version? +### What is the minimum supported Zsh version? -Zsh 5.1 or newer should work. Fast startup requires zsh >= 5.4. +Zsh 5.1 or newer should work. Fast startup requires Zsh >= 5.4. ### How were these screenshots and animated gifs created? @@ -955,9 +955,9 @@ rendering imperfections that afflict powerline-style prompt. ### zsh: character not in range 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 +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 @@ -1047,17 +1047,17 @@ See [cursor is in the wrong place](#cursor-is-in-the-wrong-place). See [cursor is in the wrong place](#cursor-is-in-the-wrong-place). -### Configuration wizard run automatically every time zsh is started +### Configuration wizard run automatically every time Zsh is started When Powerlevel10k starts, it automatically runs `p10k configure` if no `POWERLEVEL9K_*` parameters are defined. Based on your prompt style choices, the configuration wizard creates `~/.p10k.zsh` with a bunch of `POWERLEVEL9K_*` parameters in it and adds a line to `~/.zshrc` to -source this file. The next time you start zsh, the configuration wizard shouldn't run automatically. +source this file. The next time you start Zsh, the configuration wizard shouldn't run automatically. If it does, this means the evaluation of `~/.zshrc` terminates prematurely before it reaches the line that sources `~/.p10k.zsh`. This most often happens due to syntax errors in `~/.zshrc`. These errors get hidden by the configuration wizard screen, so you don't notice them. Scroll up in the first configuration wizard screen to see these errors. Alternatively, run -`POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true zsh` to start zsh without automatically running the +`POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true zsh` to start Zsh without automatically running the configuration wizard. Once you can see the errors, fix `~/.zshrc` to get rid of them. ### Cannot install the recommended font @@ -1215,7 +1215,7 @@ There are several ways to fix this. - [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) - [Is there an AUR package for Powerlevel10k?](#is-there-an-aur-package-for-powerlevel10k) - - [What is the minimum supported zsh version?](#what-is-the-minimum-supported-zsh-version) + - [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) - [Troubleshooting](#troubleshooting) - [Question mark in prompt](#question-mark-in-prompt) @@ -1225,7 +1225,7 @@ There are several ways to fix this. - [Cursor is in the wrong place](#cursor-is-in-the-wrong-place) - [Prompt wrapping around in a weird way](#prompt-wrapping-around-in-a-weird-way) - [Right prompt is in the wrong place](#right-prompt-is-in-the-wrong-place) - - [Configuration wizard run automatically every time zsh is started](#configuration-wizard-run-automatically-every-time-zsh-is-started) + - [Configuration wizard run automatically every time Zsh is started](#configuration-wizard-run-automatically-every-time-zsh-is-started) - [Cannot install the recommended font](#cannot-install-the-recommended-font) - [Extra or missing spaces in prompt compared to Powerlevel9k](#extra-or-missing-spaces-in-prompt-compared-to-powerlevel9k) - [Extra space without background on the right side of right prompt](#extra-space-without-background-on-the-right-side-of-right-prompt) From 994a1e1371a635ddf498200d9141b1cdd4d0da42 Mon Sep 17 00:00:00 2001 From: romkatv Date: Sat, 1 Feb 2020 12:50:11 +0100 Subject: [PATCH 37/88] remove antibody, add "how to update" The instructions for installation with Antibody are likely wrong anyway. Dunno how to fix them, so Antibody goes. --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5920dbf2..39a429b4 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,8 @@ Ready to give Powerlevel10k a try? - [Antigen](#antigen) - [Zplug](#zplug) - [Zgen](#zgen) - - [Antibody](#antibody) - [Zplugin](#zplugin) + - [Zinit](#zinit) 1. Restart Zsh. 1. Type `p10k configure` if the configuration wizard doesn't start automatically. @@ -346,10 +346,6 @@ Add `zplug romkatv/powerlevel10k, as:theme, depth:1` to `~/.zshrc`. Add `zgen load romkatv/powerlevel10k powerlevel10k` to `~/.zshrc`. -### Antibody - -Add `antibody bundle romkatv/powerlevel10k` to `~/.zshrc`. - ### Zplugin Add `zplugin ice depth=1; zplugin light romkatv/powerlevel10k` to `~/.zshrc`. @@ -357,6 +353,13 @@ Add `zplugin ice depth=1; zplugin 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. +### Zinit + +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. + ## Configuration ### For new users @@ -504,6 +507,25 @@ Powerlevel10k is released under the ## FAQ +### How do I update Powerlevel10k? + +The command to update Powerlevel10k depends on how it was installed. + +| Installation | Update command | +|-------------------------------|----------------| +| [Manual](#manual) | `git -C ~/powerlevel10k pull` | +| [Oh My Zsh](#oh-my-zsh) | `git -C $ZSH_CUSTOM/themes/powerlevel10k pull` | +| [Prezto](#prezto) | `zprezto-update` | +| [Zim](#zim) | `zimfw update` | +| [Antigen](#antigen) | `antigen update` | +| [Zplug](#zplug) | `zplug update` | +| [Zgen](#zgen) | `zgen update` | +| [Zplugin](#zplugin) | `zplugin update` | +| [Zinit](#zinit) | `zinit update` | + +**IMPORTANT**: Restart Zsh after updating Powerlevel10k. [Do not use `source ~/.zshrc`]( + #weird-things-happen-after-typing-source-zshrc). + ### Which aspects of shell and terminal does Powerlevel10k affect? Powerlevel10k defines prompt and nothing else. It sets [prompt-related options]( @@ -1125,6 +1147,16 @@ Powerlevel9k. *Note:* It's not a good idea to define `POWERLEVEL9K_LEGACY_ICON_SPACING` when using `p10k configure`. +### Weird things happen after typing `source ~/.zshrc` + +It's almost always a bad idea to run `source ~/.zshrc`, whether you are using Powerlevel10k or not. +This command may result in random errors, misbehaving code and progressive slowdown of Zsh. + +If you've made changes to `~/.zshrc` or to files sourced by it, restart Zsh to apply them. The most +reliable way to do this is to type `exit` and then start start a new Zsh session. You can also use +`exec zsh`. While not exactly equivalent to complete Zsh restart, this command is much more reliable +than `source ~/.zshrc`. + ### Cannot make Powerlevel10k work with my plugin manager If the [installation instructions](#installation) didn't work for you, try disabling your current @@ -1187,8 +1219,8 @@ There are several ways to fix this. - [Antigen](#antigen) - [Zplug](#zplug) - [Zgen](#zgen) - - [Antibody](#antibody) - [Zplugin](#zplugin) + - [Zinit](#zinit) - [Configuration](#configuration) - [For new users](#for-new-users) - [For Powerlevel9k users](#for-powerlevel9k-users) @@ -1199,6 +1231,7 @@ There are several ways to fix this. - [Try it in Docker](#try-it-in-docker) - [License](#license) - [FAQ](#faq) + - [How do I update Powerlevel10k?](#how-do-i-update-powerlevel10k) - [Which aspects of shell and terminal does Powerlevel10k affect?](#which-aspects-of-shell-and-terminal-does-powerlevel10k-affect) - [I'm using Powerlevel9k with Oh My Zsh. How do I migrate?](#im-using-powerlevel9k-with-oh-my-zsh-how-do-i-migrate) - [Is it really fast?](#is-it-really-fast) @@ -1230,5 +1263,6 @@ There are several ways to fix this. - [Extra or missing spaces in prompt compared to Powerlevel9k](#extra-or-missing-spaces-in-prompt-compared-to-powerlevel9k) - [Extra space without background on the right side of right prompt](#extra-space-without-background-on-the-right-side-of-right-prompt) - [Extra or missing spaces around icons](#extra-or-missing-spaces-around-icons) + - [Weird things happen after typing `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc) - [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) From 04767278bd015b335b03de7dadc7939000a64524 Mon Sep 17 00:00:00 2001 From: romkatv Date: Sat, 1 Feb 2020 12:52:35 +0100 Subject: [PATCH 38/88] formatting --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 39a429b4..e4165884 100644 --- a/README.md +++ b/README.md @@ -511,17 +511,17 @@ Powerlevel10k is released under the The command to update Powerlevel10k depends on how it was installed. -| Installation | Update command | -|-------------------------------|----------------| -| [Manual](#manual) | `git -C ~/powerlevel10k pull` | -| [Oh My Zsh](#oh-my-zsh) | `git -C $ZSH_CUSTOM/themes/powerlevel10k pull` | -| [Prezto](#prezto) | `zprezto-update` | -| [Zim](#zim) | `zimfw update` | -| [Antigen](#antigen) | `antigen update` | -| [Zplug](#zplug) | `zplug update` | -| [Zgen](#zgen) | `zgen update` | -| [Zplugin](#zplugin) | `zplugin update` | -| [Zinit](#zinit) | `zinit update` | +| Installation | Update command | +|-------------------------|------------------------------------------------| +| [Manual](#manual) | `git -C ~/powerlevel10k pull` | +| [Oh My Zsh](#oh-my-zsh) | `git -C $ZSH_CUSTOM/themes/powerlevel10k pull` | +| [Prezto](#prezto) | `zprezto-update` | +| [Zim](#zim) | `zimfw update` | +| [Antigen](#antigen) | `antigen update` | +| [Zplug](#zplug) | `zplug update` | +| [Zgen](#zgen) | `zgen update` | +| [Zplugin](#zplugin) | `zplugin update` | +| [Zinit](#zinit) | `zinit update` | **IMPORTANT**: Restart Zsh after updating Powerlevel10k. [Do not use `source ~/.zshrc`]( #weird-things-happen-after-typing-source-zshrc). From cea51ee86638230dc68a967c6899649ab162e8e9 Mon Sep 17 00:00:00 2001 From: romkatv Date: Sat, 1 Feb 2020 12:54:51 +0100 Subject: [PATCH 39/88] formatting --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e4165884..7dbff5b2 100644 --- a/README.md +++ b/README.md @@ -408,7 +408,7 @@ will pick them up and provide you with the same prompt UI you are used to. See #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.) + #extra-or-missing-spaces-in-prompt-compared-to-powerlevel9k). ## Fonts From 0b9829d409cba321f77729e1010c5b0480529cfa Mon Sep 17 00:00:00 2001 From: romkatv Date: Sat, 1 Feb 2020 17:37:04 +0100 Subject: [PATCH 40/88] add "mess when resizing" to troubleshooting --- README.md | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) diff --git a/README.md b/README.md index 7dbff5b2..73e9d4dc 100644 --- a/README.md +++ b/README.md @@ -1198,6 +1198,133 @@ There are several ways to fix this. The parameter you are looking for is called `POWERLEVEL9K_DIR_BACKGROUND`. You can find it in in `~/.p10k.zsh`. Uncomment it if it's commented out and try different values. +### Horrific mess when resizing terminal window + +When you resize terminal window horizontally back and forth a few times, you might see this ugly +picture. + +![Powerlevel10k Resizing Mess]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resizing-mess.png) + +tl;dr: This is a bug in Zsh that isn't specific to Powerlevel10k. See [mitigation](#mitigation). + +#### Zsh bug + +This issue is caused by a bug in Zsh that gets triggered the vertical distance between the start of +the current prompt and the cursor (henceforth `VD`) changes when the terminal window is resized. +This bug is not specific to Powerlevel10k. + +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*. + +Terminal content before shrinking: + +![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 truncates text when shrinking: + +![Terminal Truncates Text When Shrinking]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-truncate.png) + +Reflowing strategy can change the hight of terminal content. If such content happens to be between +the start of the current prompt and the cursor, Zsh will print prompt on the wrong line. Truncation +strategy never changes the hight of terminal content, so it doesn't trigger this bug in Zsh. + +Let's see how the bug plays out in slow motion. We'll start by launching `zsh -df` and pasting +the following code: + +```zsh +function pause() { read -s } +functions -M pause 0 + +reset +print -l {1..3} +setopt prompt_subst +PROMPT=$'${$((pause()))+}left>${(pl.$((COLUMNS-12))..-.)} ' +``` + +When `PROMPT` gets expanded, it calls `pause` to let us observe the state of the terminal. Here's +the initial state: + +![Zsh Resizing Bug 1]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-bug-1.png) + +Zsh keeps track of the cursor position relative to the start of the current prompt. In this case it +knows that the cursor is one line below. When we shrink the terminal window, it looks like this: + +![Zsh Resizing Bug 2]( + 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. + +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 +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. + +![Zsh 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 +higher than intended, potentially erasing useful content in the process. + +Here are a few more examples where shrinking terminal window increased `VD`. + +Simple one-line left prompt with right prompt. No `prompt_subst`. Note that the cursor is below the +prompt line (hit *ESC-ENTER* to get it there). + +![Zsh Prompt That Breaks on Terminal Shrinking 1]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-breakable-1.png) + +Simple one-line left prompt. No `prompt_subst`, no right prompt. Here `VD` is bound to increase +upon terminal shrinking due to the command line wrapping around. + +![Zsh Prompt That Breaks on Terminal Shrinking 2]( + https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-breakable-2.png) + +#### Zsh patch + +The bug described above has been fixed in [this branch]( + https://github.com/romkatv/zsh/tree/fix-winchanged). The idea behind the fix is to use `sc` (save +cursor) terminal capability before printing prompt and `rc` (restore cursor) to move cursor back +to the same position when prompt needs to be refreshed. + +There are two alternative approaches to fixing the bug that may seem to work at fight glance but in +fact don't: + +- Instead of `sc`, use `u7` terminal capability to query the current cursor position and then `cup` + to go back to it. This doesn't work because the absolute position of the start of the current + prompt changes when text gets reflown. +- Recompute `VD` based on new terminal dimensions before attempting to refresh prompt. This doesn't + work because Zsh doesn't know whether terminal reflows text or truncates it. If Zsh could somehow + know that the terminal reflows text, this approach still wouldn't work on terminals that + 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). + +#### Mitigation + +There are a few mitigation options for this issue. + +- Apply [the patch](#zsh-patch) and rebuild Zsh from source. +- Disable text reflowing on window resize in terminal settings. If your terminal doesn't have this + setting, try a different terminal. +- Avoid long lines between the start of prompt and cursor. + 1. Disable right prompt with `POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=()`. + 2. Disable ruler with `POWERLEVEL9K_SHOW_RULER=false`. + 3. Disable prompt gap with `POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' '`. + ## Table of contents - [Features](#features) @@ -1266,3 +1393,4 @@ There are several ways to fix this. - [Weird things happen after typing `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc) - [Cannot make Powerlevel10k work with my plugin manager](#cannot-make-powerlevel10k-work-with-my-plugin-manager) - [Directory is difficult to see in prompt when using Rainbow style](#directory-is-difficult-to-see-in-prompt-when-using-rainbow-style) + - [Horrific mess when resizing terminal window](#horrific-mess-when-resizing-terminal-window) From c983ff6a41613a3131c159cfe55c631595f2020c Mon Sep 17 00:00:00 2001 From: romkatv Date: Sat, 1 Feb 2020 17:50:37 +0100 Subject: [PATCH 41/88] typo --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 73e9d4dc..959147bf 100644 --- a/README.md +++ b/README.md @@ -1210,9 +1210,9 @@ tl;dr: This is a bug in Zsh that isn't specific to Powerlevel10k. See [mitigatio #### Zsh bug -This issue is caused by a bug in Zsh that gets triggered the vertical distance between the start of -the current prompt and the cursor (henceforth `VD`) changes when the terminal window is resized. -This bug is not specific to Powerlevel10k. +This issue is caused by a bug in Zsh that gets triggered when the vertical distance between the +start of the current prompt and the cursor (henceforth `VD`) changes when the terminal window is +resized. This bug is not specific to Powerlevel10k. 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*. From b71a19c92e97e628166506230357c0dfbd8943be Mon Sep 17 00:00:00 2001 From: romkatv Date: Sat, 1 Feb 2020 18:18:54 +0100 Subject: [PATCH 42/88] more precise mitigation for the resizing bug --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 959147bf..2d4b1914 100644 --- a/README.md +++ b/README.md @@ -1321,9 +1321,15 @@ There are a few mitigation options for this issue. - Disable text reflowing on window resize in terminal settings. If your terminal doesn't have this setting, try a different terminal. - Avoid long lines between the start of prompt and cursor. - 1. Disable right prompt with `POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=()`. - 2. Disable ruler with `POWERLEVEL9K_SHOW_RULER=false`. - 3. Disable prompt gap with `POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' '`. + 1. Disable ruler with `POWERLEVEL9K_SHOW_RULER=false`. + 1. Disable prompt connection with `POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' '`. + 1. Disable right frame with `POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX=` and + `POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX=` and + `POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX=`. + 1. Remove all elements from `POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS`. Right prompt on the last prompt + line will cause resizing issues only when the cursor is below it. This isn't very common, so + you might want to keep some elements in `POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS` provided that + none of them are succeeded by `newline`. ## Table of contents From c08d1e846bd944d7e73a578c67fc63aa893ae888 Mon Sep 17 00:00:00 2001 From: romkatv Date: Sat, 1 Feb 2020 18:21:09 +0100 Subject: [PATCH 43/88] link to zsh building instructions --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2d4b1914..c96e2cfc 100644 --- a/README.md +++ b/README.md @@ -1317,7 +1317,8 @@ There is no ETA for the patch making its way into upstream Zsh. See [discussion] There are a few mitigation options for this issue. -- Apply [the patch](#zsh-patch) and rebuild Zsh from source. +- Apply [the patch](#zsh-patch) and [rebuild Zsh from source]( + https://github.com/zsh-users/zsh/blob/master/INSTALL). - Disable text reflowing on window resize in terminal settings. If your terminal doesn't have this setting, try a different terminal. - Avoid long lines between the start of prompt and cursor. From eb9da89ad9a8bd886e43c7f1d907495c5a48acc5 Mon Sep 17 00:00:00 2001 From: romkatv Date: Sat, 1 Feb 2020 22:03:42 +0100 Subject: [PATCH 44/88] quote $foo when running with unknown options; fixes #453 --- internal/configure.zsh | 2 +- internal/p10k.zsh | 26 +++++++++++++------------- internal/parser.zsh | 2 +- internal/worker.zsh | 4 ++-- powerlevel10k.zsh-theme | 4 ++-- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/internal/configure.zsh b/internal/configure.zsh index 588dd02a..8a21c639 100644 --- a/internal/configure.zsh +++ b/internal/configure.zsh @@ -59,7 +59,7 @@ function _p9k_can_configure() { } function p9k_configure() { - eval $__p9k_intro + eval "$__p9k_intro" ( set -- -f source $__p9k_root_dir/internal/wizard.zsh diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 55922b90..57a6ded6 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1,4 +1,4 @@ -if [[ $__p9k_sourced != 3 ]]; then +if [[ $__p9k_sourced != 4 ]]; then >&2 print -P "" >&2 print -P "[%F{1}ERROR%f]: Corrupted powerlevel10k installation." >&2 print -P "" @@ -112,7 +112,7 @@ typeset -grA __p9k_colors=( # # Type `getColorCode background` or `getColorCode foreground` to see the list of predefined colors. function getColorCode() { - eval $__p9k_intro + eval "$__p9k_intro" if (( ARGC == 1 )); then case $1 in foreground) @@ -139,7 +139,7 @@ function getColorCode() { # Sadly, this is a part of public API. Its use is emphatically discouraged. function print_icon() { - eval $__p9k_intro + eval "$__p9k_intro" (( $+functions[_p9k_print_icon] )) || source "${__p9k_root_dir}/internal/icons.zsh" _p9k_print_icon "$@" } @@ -150,7 +150,7 @@ function print_icon() { # otherwise "print_icon" is used, which takes the users # overrides into account. function get_icon_names() { - eval $__p9k_intro + eval "$__p9k_intro" (( $+functions[_p9k_get_icon_names] )) || source "${__p9k_root_dir}/internal/icons.zsh" _p9k_get_icon_names "$@" } @@ -3589,7 +3589,7 @@ function _p9k_maybe_ignore_git_repo() { } function _p9k_vcs_resume() { - eval $__p9k_intro + eval "$__p9k_intro" _p9k_maybe_ignore_git_repo @@ -5215,7 +5215,7 @@ function _p9k_on_expand() { (( _p9k__expanded && ! $+__p9k_instant_prompt_active )) && return () { - eval $__p9k_intro + eval "$__p9k_intro" _p9k_maybe_dump (( $+__p9k_instant_prompt_active )) && _p9k_clear_instant_prompt @@ -5305,7 +5305,7 @@ function _p9k_on_expand() { functions -M _p9k_on_expand _p9k_precmd_impl() { - eval $__p9k_intro + eval "$__p9k_intro" (( __p9k_enabled )) || return @@ -5404,7 +5404,7 @@ _p9k_precmd_impl() { _p9k_trapint() { if (( __p9k_enabled )); then - eval $__p9k_intro + eval "$__p9k_intro" zle && _p9k_on_widget_zle-line-finish int fi return 0 @@ -6023,7 +6023,7 @@ function _p9k_widget_hook() { fi fi - eval $__p9k_intro + eval "$__p9k_intro" (( _p9k__restore_prompt_fd )) && _p9k_restore_prompt $_p9k__restore_prompt_fd __p9k_reset_state=1 local pat idx var @@ -6097,7 +6097,7 @@ function _p9k_wrap_widgets() { } function _p9k_restore_prompt() { - eval $__p9k_intro + eval "$__p9k_intro" { (( _p9k__must_restore_prompt )) || return _p9k__must_restore_prompt=0 @@ -6891,7 +6891,7 @@ _p9k_setup() { prompt_opts+=cr fi - eval $__p9k_intro + eval "$__p9k_intro" prompt_powerlevel9k_teardown __p9k_enabled=1 typeset -ga preexec_functions=(_p9k_preexec1 $preexec_functions _p9k_preexec2) @@ -6901,7 +6901,7 @@ _p9k_setup() { prompt_powerlevel9k_setup() { _p9k_setup } prompt_powerlevel9k_teardown() { - eval $__p9k_intro + eval "$__p9k_intro" add-zsh-hook -D precmd '(_p9k_|powerlevel9k_)*' add-zsh-hook -D preexec '(_p9k_|powerlevel9k_)*' PROMPT='%m%# ' @@ -7069,7 +7069,7 @@ typeset -gi __p9k_reset_state function p10k() { [[ $# != 1 || $1 != finalize ]] || { p10k-instant-prompt-finalize; return 0 } - eval $__p9k_intro + eval "$__p9k_intro" if (( !ARGC )); then print -rP -- $__p9k_p10k_usage >&2 diff --git a/internal/parser.zsh b/internal/parser.zsh index 1f5d6eb3..7fe96abd 100644 --- a/internal/parser.zsh +++ b/internal/parser.zsh @@ -141,7 +141,7 @@ function _p9k_parse_buffer() { local rcquotes [[ -o rcquotes ]] && rcquotes=rcquotes - eval $__p9k_intro + eval "$__p9k_intro" setopt no_nomatch $rcquotes typeset -ga P9K_COMMANDS=() diff --git a/internal/worker.zsh b/internal/worker.zsh index 518b34fd..6b369740 100644 --- a/internal/worker.zsh +++ b/internal/worker.zsh @@ -85,7 +85,7 @@ function _p9k_worker_invoke() { } function _p9k_worker_cleanup() { - eval $__p9k_intro + eval "$__p9k_intro" [[ $_p9k__worker_shell_pid == $sysparams[pid] ]] && _p9k_worker_stop return 0 } @@ -106,7 +106,7 @@ function _p9k_worker_stop() { } function _p9k_worker_receive() { - eval $__p9k_intro + eval "$__p9k_intro" [[ -z $_p9k__worker_resp_fd ]] && return diff --git a/powerlevel10k.zsh-theme b/powerlevel10k.zsh-theme index c81da2f9..fd01648a 100644 --- a/powerlevel10k.zsh-theme +++ b/powerlevel10k.zsh-theme @@ -26,7 +26,7 @@ [[ -z $_p9k_locale ]] || local LC_ALL=$_p9k_locale' () { - eval $__p9k_intro + eval "$__p9k_intro" if (( $+__p9k_sourced )); then (( $+functions[_p9k_setup] )) && _p9k_setup return 0 @@ -35,7 +35,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file ]] && (( ! $+functions[_p9k_preinit] )) && source $__p9k_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then _p9k_preinit fi - typeset -gr __p9k_sourced=3 + typeset -gr __p9k_sourced=4 if [[ -w $__p9k_root_dir && -w $__p9k_root_dir/internal && -w $__p9k_root_dir/gitstatus && ${(%):-%#} == % ]]; then local f for f in $__p9k_root_dir/{powerlevel9k.zsh-theme,powerlevel10k.zsh-theme,internal/p10k.zsh,internal/icons.zsh,internal/configure.zsh,internal/worker.zsh,internal/parser.zsh,gitstatus/gitstatus.plugin.zsh}; do From 4599ad9f2c6352b5f3ea4cff4305d426cf9e3b31 Mon Sep 17 00:00:00 2001 From: romkatv Date: Sun, 2 Feb 2020 06:49:17 +0100 Subject: [PATCH 45/88] add extra options to pure style - non-permanent content location (left or right) - show current time - prompt height (one or two lines) - prompt spacing (with empty line between prompts or without) --- config/p10k-classic.zsh | 4 +- config/p10k-lean-8colors.zsh | 4 +- config/p10k-lean.zsh | 2 +- config/p10k-pure.zsh | 23 ++++++- config/p10k-rainbow.zsh | 2 +- internal/wizard.zsh | 126 +++++++++++++++++++++++------------ 6 files changed, 109 insertions(+), 52 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index f34ac403..ca737e05 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -34,7 +34,7 @@ dir # current directory vcs # git status # =========================[ Line #2 ]========================= - newline + newline # \n # prompt_char # prompt symbol ) @@ -89,7 +89,7 @@ timewarrior # timewarrior tracking status (https://timewarrior.net/) # time # current time # =========================[ Line #2 ]========================= - newline + newline # \n # public_ip # public IP address # proxy # system-wide http/https/ftp proxy # battery # internal battery diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index a8917178..ccfe6d65 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -34,7 +34,7 @@ dir # current directory vcs # git status # =========================[ Line #2 ]========================= - newline + newline # \n prompt_char # prompt symbol ) @@ -88,7 +88,7 @@ timewarrior # timewarrior tracking status (https://timewarrior.net/) # time # current time # =========================[ Line #2 ]========================= - newline + newline # \n # public_ip # public IP address # proxy # system-wide http/https/ftp proxy # battery # internal battery diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index b28fbd64..ad23a80f 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -34,7 +34,7 @@ dir # current directory vcs # git status # =========================[ Line #2 ]========================= - newline + newline # \n prompt_char # prompt symbol ) diff --git a/config/p10k-pure.zsh b/config/p10k-pure.zsh index 50299dff..8eeaedac 100644 --- a/config/p10k-pure.zsh +++ b/config/p10k-pure.zsh @@ -42,17 +42,27 @@ # Left prompt segments. typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( + # =========================[ Line #1 ]========================= dir # current directory vcs # git status context # user@host command_execution_time # previous command duration + # =========================[ Line #2 ]========================= newline # \n virtualenv # python virtual environment prompt_char # prompt symbol ) # Right prompt segments. - typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=() + typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( + # =========================[ Line #1 ]========================= + # command_execution_time # previous command duration + # virtualenv # python virtual environment + # context # user@host + # time # current time + # =========================[ Line #2 ]========================= + newline # \n + ) # Basic style options that define the overall prompt look. typeset -g POWERLEVEL9K_BACKGROUND= # transparent background @@ -62,7 +72,7 @@ typeset -g POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION= # no segment icons # Add an empty line before each prompt except the first. This doesn't emulate the bug - # in Pure that makes prompt drift down whenever you use the ALT-C binding from fzf or similar. + # in Pure that makes prompt drift down whenever you use the Alt-C binding from fzf or similar. typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true # Magenta prompt symbol if the last command succeeded. @@ -135,6 +145,15 @@ # Remove space between '⇣' and '⇡' and all trailing spaces. typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${${P9K_CONTENT/⇣* ⇡/⇣⇡}// }' + # Grey current time. + typeset -g POWERLEVEL9K_TIME_FOREGROUND=$grey + # Format for the current time: 09:51:02. See `man 3 strftime`. + typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' + # If set to true, time will update when you hit enter. This way prompts for the past + # commands will contain the start times of their commands rather than the end times of + # their preceding commands. + typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false + # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt # when accepting a command line. Supported values: # diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 2381c6f1..8618186c 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -34,7 +34,7 @@ dir # current directory vcs # git status # =========================[ Line #2 ]========================= - newline + newline # \n # prompt_char # prompt symbol ) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index ac8bcad6..24dca594 100755 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -80,12 +80,12 @@ local -ra classic_right=( ) local -ra pure_left=( - '' '%F{$pure_color[blue]}~/src%f %F{$pure_color[grey]}master%f %F{$pure_color[yellow]}5s%f' + '' '%F{$pure_color[blue]}~/src%f %F{$pure_color[grey]}master%f ${pure_use_rprompt-%F{$pure_color[yellow]\}5s%f }' '' '%F{$pure_color[magenta]}❯%f ${buffer:-█}' ) local -ra pure_right=( - '' '' + '${pure_use_rprompt+%F{$pure_color[yellow]\}5s%f${show_time:+ }}${show_time:+%F{$pure_color[grey]\}16:23:42%f}' '' '' '' ) @@ -769,7 +769,7 @@ function ask_ornaments_color() { } function ask_time() { - if (( wizard_columns < 80 )); then + if (( wizard_columns < 80 )) && [[ $style != pure ]]; then show_time= return 0 fi @@ -801,6 +801,35 @@ function ask_time() { done } +function ask_use_rprompt() { + [[ $style != pure ]] && return + while true; do + clear + flowing -c "%BNon-permanent content location%b" + print -P "" + print -P "%B(1) Left.%b" + print -P "" + print_prompt + print -P "" + print -P "%B(2) Right.%b" + print -P "" + pure_use_rprompt= print_prompt + print -P "" + print -P "(r) Restart from the beginning." + print -P "(q) Quit and do nothing." + print -P "" + + local key= + read -k key${(%):-"?%BChoice [12rq]: %b"} || quit -c + case $key in + q) quit;; + r) return 1;; + 1) break;; + 2) pure_use_rprompt=; options+=rpromt; break;; + esac + done +} + function os_icon_name() { local uname="$(uname)" if [[ $uname == Linux && "$(uname -o 2>/dev/null)" == Android ]]; then @@ -846,7 +875,7 @@ function os_icon_name() { } function ask_extra_icons() { - if [[ $POWERLEVEL9K_MODE == (powerline|compatible) ]]; then + if [[ $style == pure || $POWERLEVEL9K_MODE == (powerline|compatible) ]]; then return 0 fi local os_icon=${(g::)icons[$(os_icon_name)]} @@ -900,6 +929,7 @@ function ask_extra_icons() { } function ask_prefixes() { + [[ $style == pure ]] && return local concise=('' '' '') local fluent=('on ' 'took ' 'at ') if (( wizard_columns < 80 )); then @@ -1201,9 +1231,7 @@ function ask_num_lines() { } function ask_gap_char() { - if [[ $num_lines != 2 ]]; then - return 0 - fi + [[ $num_lines != 2 || $style == pure ]] && return while true; do clear flowing -c "%BPrompt Connection%b" @@ -1599,10 +1627,6 @@ function generate_config() { sub RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL "'$right_tail'" fi - if [[ -n $show_time ]]; then - uncomment time - fi - if [[ -n ${(j::)extra_icons} ]]; then local branch_icon=${icons[VCS_BRANCH_ICON]// } sub VCS_BRANCH_ICON "'$branch_icon '" @@ -1633,15 +1657,6 @@ function generate_config() { fi fi - if (( num_lines == 1 )); then - local -a tmp - local line - for line in "$lines[@]"; do - [[ $line == (' newline'|*'===[ Line #'*) ]] || tmp+=$line - done - lines=("$tmp[@]") - fi - sub MULTILINE_FIRST_PROMPT_GAP_CHAR "'$gap_char'" if [[ $style == (classic|rainbow) && $num_lines == 2 ]]; then @@ -1683,10 +1698,32 @@ function generate_config() { uncomment vi_mode fi fi - - (( empty_line )) && sub PROMPT_ADD_NEWLINE true || sub PROMPT_ADD_NEWLINE false fi + if (( $+pure_use_rprompt )); then + local segment + for segment in command_execution_time virtualenv context; do + rep " $segment" " tmp_$segment" + uncomment $segment + rep " tmp_$segment " " # $segment" + done + fi + + if [[ -n $show_time ]]; then + uncomment time + fi + + if (( num_lines == 1 )); then + local -a tmp + local line + for line in "$lines[@]"; do + [[ $line == (' newline'*|*'===[ Line #'*) ]] || tmp+=$line + done + lines=("$tmp[@]") + fi + + (( empty_line )) && sub PROMPT_ADD_NEWLINE true || sub PROMPT_ADD_NEWLINE false + sub INSTANT_PROMPT $instant_prompt (( transient_prompt )) && sub TRANSIENT_PROMPT always @@ -1793,6 +1830,8 @@ while true; do local -A pure_color=(${(kv)pure_original}) fi + unset pure_use_rprompt + ask_font || continue ask_diamond || continue if [[ $AWESOME_GLYPHS_LOADED == 1 ]]; then @@ -1847,27 +1886,26 @@ while true; do right_head=$fade_in fi _p9k_init_icons - ask_narrow_icons || continue - ask_style || continue - ask_color_scheme || continue - if [[ $style != pure ]]; then - ask_color || continue - ask_time || continue - ask_separators || continue - ask_heads || continue - ask_tails || continue - ask_num_lines || continue - ask_gap_char || continue - ask_frame || continue - ask_ornaments_color || continue - ask_empty_line || continue - ask_extra_icons || continue - ask_prefixes || continue - fi - ask_transient_prompt || continue - ask_instant_prompt || continue - ask_config_overwrite || continue - ask_zshrc_edit || continue + ask_narrow_icons || continue + ask_style || continue + ask_color_scheme || continue + ask_color || continue + ask_use_rprompt || continue + ask_time || continue + ask_separators || continue + ask_heads || continue + ask_tails || continue + ask_num_lines || continue + ask_gap_char || continue + ask_frame || continue + ask_ornaments_color || continue + ask_empty_line || continue + ask_extra_icons || continue + ask_prefixes || continue + ask_transient_prompt || continue + ask_instant_prompt || continue + ask_config_overwrite || continue + ask_zshrc_edit || continue break done @@ -1882,7 +1920,7 @@ if [[ -n $zshrc_backup ]]; then fi generate_config || return -change_zshrc || return +change_zshrc || return print -rP "" flowing +c File feature requests and bug reports at "$(href https://github.com/romkatv/powerlevel10k/issues)." From 9d9c50611da19044370ee759e593ccadbad32a6a Mon Sep 17 00:00:00 2001 From: romkatv Date: Sun, 2 Feb 2020 08:20:46 +0100 Subject: [PATCH 46/88] s/hight/height/ --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c96e2cfc..c4ed0fc1 100644 --- a/README.md +++ b/README.md @@ -1232,9 +1232,9 @@ Terminal truncates text when shrinking: ![Terminal Truncates Text When Shrinking]( https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-truncate.png) -Reflowing strategy can change the hight of terminal content. If such content happens to be between +Reflowing strategy can change the height of terminal content. If such content happens to be between the start of the current prompt and the cursor, Zsh will print prompt on the wrong line. Truncation -strategy never changes the hight of terminal content, so it doesn't trigger this bug in Zsh. +strategy never changes the height of terminal content, so it doesn't trigger this bug in Zsh. Let's see how the bug plays out in slow motion. We'll start by launching `zsh -df` and pasting the following code: From 84a7ad7cc247a4b1e291c2119016bf067b6a46dd Mon Sep 17 00:00:00 2001 From: romkatv Date: Sun, 2 Feb 2020 18:43:26 +0100 Subject: [PATCH 47/88] add "some prompt styles missing from the wizard" --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index c4ed0fc1..80c9a339 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ running `p10k configure` to unlock all prompt styles. *Troubleshooting*: +- [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]( @@ -1082,6 +1084,22 @@ first configuration wizard screen to see these errors. Alternatively, run `POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true zsh` to start Zsh without automatically running the configuration wizard. Once you can see the errors, fix `~/.zshrc` to get rid of them. +### Some prompt styles are missing from the configuration wizard + +tl;dr: To see all prompt styles in the configuration wizard, install [the recommended font]( + #meslo-nerd-font-patched-for-powerlevel10k) and resize your terminal to at least 80 columns by 25 +lines prior to running `p10k configure`. + +The first few questions in the configuration wizard are meant to assess the 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. If you'd like to see all prompt styles, install +[the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). + +The minimum screen size at which configuration wizard can function is 55 columns by 21 lines. +However, not all prompt styles are offered at such small screen size as there is simply not enough +space to present them. Resize your terminal to at least 80 columns by 25 lines prior to running +`p10k configure` to see all prompt styles. + ### Cannot install the recommended font Once you download [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k), @@ -1393,6 +1411,7 @@ There are a few mitigation options for this issue. - [Prompt wrapping around in a weird way](#prompt-wrapping-around-in-a-weird-way) - [Right prompt is in the wrong place](#right-prompt-is-in-the-wrong-place) - [Configuration wizard run automatically every time Zsh is started](#configuration-wizard-run-automatically-every-time-zsh-is-started) + - [Some prompt styles are missing from the configuration wizard](#some-prompt-styles-are-missing-from-the-configuration-wizard) - [Cannot install the recommended font](#cannot-install-the-recommended-font) - [Extra or missing spaces in prompt compared to Powerlevel9k](#extra-or-missing-spaces-in-prompt-compared-to-powerlevel9k) - [Extra space without background on the right side of right prompt](#extra-space-without-background-on-the-right-side-of-right-prompt) From 4de584652c0e53266ea7ea51ae22312ec48f033a Mon Sep 17 00:00:00 2001 From: romkatv Date: Sun, 2 Feb 2020 18:45:34 +0100 Subject: [PATCH 48/88] rm p9k-vs-p10k.cast --- p9k-vs-p10k.cast | 573 ----------------------------------------------- 1 file changed, 573 deletions(-) delete mode 100644 p9k-vs-p10k.cast diff --git a/p9k-vs-p10k.cast b/p9k-vs-p10k.cast deleted file mode 100644 index e7bf370f..00000000 --- a/p9k-vs-p10k.cast +++ /dev/null @@ -1,573 +0,0 @@ -{"version": 2, "width": 127, "height": 45, "timestamp": 1559376160, "env": {"SHELL": "/usr/bin/zsh", "TERM": "xterm-256color"}, "title": "p9k vs p10k"} -[0.53704, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[1.802793, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[42m \u001b[30mL \u001b[30m0.54 \u001b[48;5;244m\u001b[32m \u001b[30m☑ \u001b[30m7 \u001b[45m\u001b[38;5;244m \u001b[37m⎈ \u001b[37mminikube \u001b[45m\u001b[30m \u001b[30m⬢ \u001b[30m12.3.1 \u001b[44m\u001b[35m \u001b[30mcode-oss-dev \u001b[42m\u001b[34m \u001b[30m master \u001b[49m\u001b[32m\u001b[39m \u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[K\u001b[00m\u001b[60D\u001b[?2004h"] -[2.645571, "i", "c"] -[2.645863, "o", "c"] -[2.749229, "i", "a"] -[2.749471, "o", "\bca"] -[2.821008, "i", "t"] -[2.821208, "o", "t"] -[2.917345, "i", " "] -[2.917563, "o", " "] -[3.141259, "i", "~"] -[3.141483, "o", "~"] -[3.317344, "i", "/"] -[3.31756, "o", "/"] -[3.501341, "i", "."] -[3.501574, "o", "."] -[3.709525, "i", "z"] -[3.709787, "o", "z"] -[4.285646, "i", "s"] -[4.28589, "o", "s"] -[4.40539, "i", "h"] -[4.405619, "o", "h"] -[4.517287, "i", "r"] -[4.517532, "o", "r"] -[4.741459, "i", "c"] -[4.741702, "o", "c"] -[5.957417, "i", "\r"] -[5.957699, "o", "\u001b[?2004l\r\r\n"] -[5.963966, "o", "export NVM_DIR=~/nvm\r\nsource $NVM_DIR/nvm.sh\r\n\r\nPOWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(load todo background_jobs kubecontext nvm dir vcs)\r\nPOWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=()\r\nPOWERLEVEL9K_DIR_PATH_ABSOLUTE=true\r\nPOWERLEVEL9K_SHORTEN_STRATEGY=truncate_with_package_name\r\n\r\nsource ~/powerlevel9k/powerlevel9k.zsh-theme\r\n"] -[5.964191, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[6.960979, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[42m \u001b[30mL \u001b[30m0.53 \u001b[48;5;244m\u001b[32m \u001b[30m☑ \u001b[30m7 \u001b[45m\u001b[38;5;244m \u001b[37m⎈ \u001b[37mminikube \u001b[45m\u001b[30m \u001b[30m⬢ \u001b[30m12.3.1 \u001b[44m\u001b[35m \u001b[30mcode-oss-dev \u001b[42m\u001b[34m \u001b[30m master \u001b[49m\u001b[32m\u001b[39m \u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[K\u001b[00m\u001b[60D\u001b[?2004h"] -[7.341627, "i", "e"] -[7.341903, "o", "e"] -[7.557579, "i", "c"] -[7.557797, "o", "\bec"] -[7.629363, "i", "h"] -[7.629586, "o", "h"] -[7.757141, "i", "o"] -[7.757369, "o", "o"] -[7.837404, "i", " "] -[7.83764, "o", " "] -[7.965308, "i", "o"] -[7.965505, "o", "o"] -[8.085223, "i", "r"] -[8.08542, "o", "r"] -[8.181345, "i", "i"] -[8.181584, "o", "i"] -[8.285333, "i", "g"] -[8.285535, "o", "g"] -[8.357376, "i", "i"] -[8.357591, "o", "i"] -[8.501418, "i", "n"] -[8.501621, "o", "n"] -[8.581417, "i", "a"] -[8.581623, "o", "a"] -[8.661315, "i", "l"] -[8.661516, "o", "l"] -[8.789288, "i", " "] -[8.78952, "o", " "] -[8.973335, "i", "p"] -[8.97356, "o", "p"] -[9.125345, "i", "o"] -[9.125551, "o", "o"] -[9.253231, "i", "w"] -[9.253426, "o", "w"] -[9.301294, "i", "e"] -[9.301469, "o", "e"] -[9.373118, "i", "r"] -[9.373317, "o", "r"] -[9.516979, "i", "l"] -[9.517165, "o", "l"] -[9.557044, "i", "e"] -[9.557246, "o", "e"] -[9.741259, "i", "v"] -[9.741461, "o", "v"] -[9.797193, "i", "e"] -[9.797413, "o", "e"] -[9.868882, "i", "l"] -[9.869078, "o", "l"] -[10.036815, "i", "9"] -[10.037002, "o", "9"] -[10.180929, "i", "k"] -[10.181134, "o", "k"] -[10.413048, "i", "\r"] -[10.413272, "o", "\u001b[?2004l\r\r\n"] -[10.413438, "o", "original powerlevel9k\r\n"] -[10.413519, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[11.421676, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[42m \u001b[30mL \u001b[30m0.53 \u001b[48;5;244m\u001b[32m \u001b[30m☑ \u001b[30m7 \u001b[45m\u001b[38;5;244m \u001b[37m⎈ \u001b[37mminikube \u001b[45m\u001b[30m \u001b[30m⬢ \u001b[30m12.3.1 \u001b[44m\u001b[35m \u001b[30mcode-oss-dev \u001b[42m\u001b[34m \u001b[30m master \u001b[49m\u001b[32m\u001b[39m \u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[K\u001b[00m\u001b[60D\u001b[?2004h"] -[11.573397, "i", "l"] -[11.573648, "o", "l"] -[11.773387, "i", "s"] -[11.773623, "o", "\bls"] -[12.013242, "i", "\r"] -[12.013481, "o", "\u001b[?2004l\r\r\n"] -[12.015871, "o", "azure-pipelines.yml cgmanifest.json gulpfile.js product.json resources test\t\t tslint.json\r\nbuild\t\t CONTRIBUTING.md LICENSE.txt README.md\t scripts ThirdPartyNotices.txt yarn.lock\r\ncglicenses.json extensions package.json remote\t src\t tsfmt.json\r\n"] -[12.016178, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[12.36554, "i", "p"] -[12.365781, "o", "p"] -[12.493436, "i", "w"] -[12.493666, "o", "w"] -[12.693192, "i", "d"] -[12.693423, "o", "d"] -[13.00701, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[42m \u001b[30mL \u001b[30m0.53 \u001b[48;5;244m\u001b[32m \u001b[30m☑ \u001b[30m7 \u001b[45m\u001b[38;5;244m \u001b[37m⎈ \u001b[37mminikube \u001b[45m\u001b[30m \u001b[30m⬢ \u001b[30m12.3.1 \u001b[44m\u001b[35m \u001b[30mcode-oss-dev \u001b[42m\u001b[34m \u001b[30m master \u001b[49m\u001b[32m\u001b[39m \u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[K\u001b[00m\u001b[60D\u001b[?2004h"] -[13.007104, "o", "p\bpwd"] -[13.453428, "i", "\r"] -[13.45367, "o", "\u001b[?2004l\r\r\n"] -[13.453791, "o", "/home/romka/projects/vscode\r\n"] -[13.453887, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[14.349251, "i", "\r"] -[14.349349, "o", "\r\n"] -[14.456024, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[42m \u001b[30mL \u001b[30m0.53 \u001b[48;5;244m\u001b[32m \u001b[30m☑ \u001b[30m7 \u001b[45m\u001b[38;5;244m \u001b[37m⎈ \u001b[37mminikube \u001b[45m\u001b[30m \u001b[30m⬢ \u001b[30m12.3.1 \u001b[44m\u001b[35m \u001b[30mcode-oss-dev \u001b[42m\u001b[34m \u001b[30m master \u001b[49m\u001b[32m\u001b[39m \u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[K\u001b[00m\u001b[60D\u001b[?2004h\u001b[?2004l\r\r\n\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[14.485142, "i", "\r"] -[14.485402, "o", "\r\n"] -[14.637102, "i", "\r"] -[14.637302, "o", "\r\n"] -[14.797341, "i", "\r"] -[14.797434, "o", "\r\n"] -[14.94944, "i", "\r"] -[14.949542, "o", "\r\n"] -[15.109413, "i", "e"] -[15.109507, "o", "e"] -[15.309269, "i", "c"] -[15.309362, "o", "c"] -[15.397125, "i", "h"] -[15.39722, "o", "h"] -[15.493601, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[42m \u001b[30mL \u001b[30m0.52 \u001b[48;5;244m\u001b[32m \u001b[30m☑ \u001b[30m7 \u001b[45m\u001b[38;5;244m \u001b[37m⎈ \u001b[37mminikube \u001b[45m\u001b[30m \u001b[30m⬢ \u001b[30m12.3.1 \u001b[44m\u001b[35m \u001b[30mcode-oss-dev \u001b[42m\u001b[34m \u001b[30m master \u001b[49m\u001b[32m\u001b[39m \u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[K\u001b[00m\u001b[60D\u001b[?2004h\u001b[?2004l\r\r\n"] -[15.493698, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[15.509382, "i", "o"] -[15.509602, "o", "o"] -[15.653098, "i", " "] -[15.653296, "o", " "] -[16.501217, "i", "a"] -[16.501314, "o", "a"] -[16.511071, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[42m \u001b[30mL \u001b[30m0.52 \u001b[48;5;244m\u001b[32m \u001b[30m☑ \u001b[30m7 \u001b[45m\u001b[38;5;244m \u001b[37m⎈ \u001b[37mminikube \u001b[45m\u001b[30m \u001b[30m⬢ \u001b[30m12.3.1 \u001b[44m\u001b[35m \u001b[30mcode-oss-dev \u001b[42m\u001b[34m \u001b[30m master \u001b[49m\u001b[32m\u001b[39m \u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[K\u001b[00m\u001b[60D\u001b[?2004h\u001b[?2004l\r\r\n"] -[16.511154, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[16.701189, "i", " "] -[16.701425, "o", " "] -[17.093404, "i", "b"] -[17.093502, "o", "b"] -[17.221118, "i", "i"] -[17.221356, "o", "i"] -[17.300863, "i", "t"] -[17.301097, "o", "t"] -[17.532571, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[42m \u001b[30mL \u001b[30m0.52 \u001b[48;5;244m\u001b[32m \u001b[30m☑ \u001b[30m7 \u001b[45m\u001b[38;5;244m \u001b[37m⎈ \u001b[37mminikube \u001b[45m\u001b[30m \u001b[30m⬢ \u001b[30m12.3.1 \u001b[44m\u001b[35m \u001b[30mcode-oss-dev \u001b[42m\u001b[34m \u001b[30m master \u001b[49m\u001b[32m\u001b[39m \u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[K\u001b[00m\u001b[60D\u001b[?2004h\u001b[?2004l\r\r\n\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[17.877348, "i", " "] -[17.877587, "o", " "] -[18.205341, "i", "s"] -[18.205619, "o", "s"] -[18.325276, "i", "l"] -[18.3255, "o", "l"] -[18.469261, "i", "o"] -[18.469534, "o", "o"] -[18.533346, "i", "w"] -[18.533582, "o", "w"] -[18.547089, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[42m \u001b[30mL \u001b[30m0.52 \u001b[48;5;244m\u001b[32m \u001b[30m☑ \u001b[30m7 \u001b[45m\u001b[38;5;244m \u001b[37m⎈ \u001b[37mminikube \u001b[45m\u001b[30m \u001b[30m⬢ \u001b[30m12.3.1 \u001b[44m\u001b[35m \u001b[30mcode-oss-dev \u001b[42m\u001b[34m \u001b[30m master \u001b[49m\u001b[32m\u001b[39m \u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[K\u001b[00m\u001b[60D\u001b[?2004h\u001b[?2004l\r\r\n"] -[18.547178, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[19.565682, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[42m \u001b[30mL \u001b[30m0.52 \u001b[48;5;244m\u001b[32m \u001b[30m☑ \u001b[30m7 \u001b[45m\u001b[38;5;244m \u001b[37m⎈ \u001b[37mminikube \u001b[45m\u001b[30m \u001b[30m⬢ \u001b[30m12.3.1 \u001b[44m\u001b[35m \u001b[30mcode-oss-dev \u001b[42m\u001b[34m \u001b[30m master \u001b[49m\u001b[32m\u001b[39m "] -[19.565787, "o", "\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[K\u001b[00m\u001b[60D\u001b[?2004he\becho a bi"] -[19.565836, "o", "t sl"] -[19.566076, "o", "ow"] -[19.589236, "i", " "] -[19.589418, "o", " "] -[19.749008, "i", "h"] -[19.749231, "o", "h"] -[19.876872, "i", "u"] -[19.877089, "o", "u"] -[20.053127, "i", "h"] -[20.053343, "o", "h"] -[20.7413, "i", "\r"] -[20.741536, "o", "\u001b[?2004l\r\r\n"] -[20.741719, "o", "a bit slow huh\r\n"] -[20.741768, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[21.727487, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[42m \u001b[30mL \u001b[30m0.52 \u001b[48;5;244m\u001b[32m \u001b[30m☑ \u001b[30m7 \u001b[45m\u001b[38;5;244m \u001b[37m⎈ \u001b[37mminikube \u001b[45m\u001b[30m \u001b[30m⬢ \u001b[30m12.3.1 \u001b[44m\u001b[35m \u001b[30mcode-oss-dev \u001b[42m\u001b[34m \u001b[30m master \u001b[49m\u001b[32m\u001b[39m \u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[K\u001b[00m\u001b[60D\u001b[?2004h"] -[22.829268, "i", "\r"] -[22.829523, "o", "\u001b[?2004l\r\r\n"] -[22.829632, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[22.973134, "i", "\r"] -[22.973394, "o", "\r\n"] -[23.10913, "i", "\r"] -[23.109377, "o", "\r\n"] -[23.237105, "i", "\r"] -[23.237321, "o", "\r\n"] -[23.348944, "i", "\r"] -[23.349046, "o", "\r\n"] -[23.837798, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[42m \u001b[30mL \u001b[30m0.52 \u001b[48;5;244m\u001b[32m \u001b[30m☑ \u001b[30m7 \u001b[45m\u001b[38;5;244m \u001b[37m⎈ \u001b[37mminikube \u001b[45m\u001b[30m \u001b[30m⬢ \u001b[30m12.3.1 \u001b[44m\u001b[35m \u001b[30mcode-oss-dev \u001b[42m\u001b[34m \u001b[30m master \u001b[49m\u001b[32m\u001b[39m \u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[K\u001b[00m\u001b[60D\u001b[?2004h\u001b[?2004l\r\r\n"] -[23.837904, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[24.832648, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[42m \u001b[30mL \u001b[30m0.52 \u001b[48;5;244m\u001b[32m \u001b[30m☑ \u001b[30m7 \u001b[45m\u001b[38;5;244m \u001b[37m⎈ \u001b[37mminikube \u001b[45m\u001b[30m \u001b[30m⬢ \u001b[30m12.3.1 \u001b[44m\u001b[35m \u001b[30mcode-oss-dev \u001b[42m\u001b[34m \u001b[30m master \u001b[49m\u001b[32m\u001b[39m \u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[K\u001b[00m\u001b[60D\u001b[?2004h"] -[24.832756, "o", "\u001b[?2004l\r\r\n\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[25.832667, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[42m \u001b[30mL \u001b[30m0.52 \u001b[48;5;244m\u001b[32m \u001b[30m☑ \u001b[30m7 \u001b[45m\u001b[38;5;244m \u001b[37m⎈ \u001b[37mminikube \u001b[45m\u001b[30m \u001b[30m⬢ \u001b[30m12.3.1 \u001b[44m\u001b[35m \u001b[30mcode-oss-dev \u001b[42m\u001b[34m \u001b[30m master \u001b[49m\u001b[32m\u001b[39m \u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[K\u001b[00m\u001b[60D\u001b[?2004h\u001b[?2004l\r\r\n\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[26.181402, "i", "\u0003"] -[26.181692, "o", "^C"] -[26.182089, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m"] -[26.182196, "o", "\u001b[K\u001b[105C\u001b[39m\u001b[0m\u001b[49m$(build_right_prompt)$reset_color\r\u001b[?2004h"] -[27.445169, "i", "c"] -[27.445436, "o", "c"] -[27.612934, "i", "d"] -[27.613158, "o", "\rcd"] -[27.756896, "i", " "] -[27.757162, "o", " "] -[28.165022, "i", "s"] -[28.165255, "o", "s"] -[28.268955, "i", "r"] -[28.269166, "o", "r"] -[28.484901, "i", "c"] -[28.485152, "o", "c"] -[29.637189, "i", "\r"] -[29.63745, "o", "\u001b[?2004l\r\r\n"] -[29.637628, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[30.143699, "o", "truncatePath:4: bad math expression: illegal character: \\\r\n"] -[30.646309, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[42m \u001b[30mL \u001b[30m0.52 \u001b[48;5;244m\u001b[32m \u001b[30m☑ \u001b[30m7 \u001b[45m\u001b[38;5;244m \u001b[37m⎈ \u001b[37mminikube \u001b[45m\u001b[30m \u001b[30m⬢ \u001b[30m12.3.1 \u001b[44m\u001b[35m \u001b[30mcode-oss-dev \u001b[42m\u001b[34m \u001b[30m master \u001b[49m\u001b[32m\u001b[39m \u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[K\u001b[00m\u001b[60D\u001b[?2004h"] -[32.013179, "i", "\r"] -[32.013428, "o", "\u001b[?2004l\r\r\n"] -[32.013549, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[32.517756, "o", "truncatePath:4: bad math expression: illegal character: \\\r\n"] -[32.973297, "i", "w"] -[32.973372, "o", "w"] -[33.03069, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[42m \u001b[30mL \u001b[30m0.52 \u001b[48;5;244m\u001b[32m \u001b[30m☑ \u001b[30m7 \u001b[45m\u001b[38;5;244m \u001b[37m⎈ \u001b[37mminikube \u001b[45m\u001b[30m \u001b[30m⬢ \u001b[30m12.3.1 \u001b[44m\u001b[35m \u001b[30mcode-oss-dev \u001b[42m\u001b[34m \u001b[30m master \u001b[49m\u001b[32m\u001b[39m \u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[K\u001b[00m\u001b[60D\u001b[?2004h"] -[33.030753, "o", "w"] -[33.125041, "i", "t"] -[33.125269, "o", "\bwt"] -[33.269129, "i", "f"] -[33.269353, "o", "f"] -[33.653444, "i", "\r"] -[33.653708, "o", "\u001b[?2004l\r\r\n"] -[33.654751, "o", "zsh: command not found: wtf\r\n"] -[33.655067, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[34.154929, "o", "truncatePath:4: bad math expression: illegal character: \\\r\n"] -[34.663887, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[42m \u001b[30mL \u001b[30m0.52 \u001b[48;5;244m\u001b[32m \u001b[30m☑ \u001b[30m7 \u001b[45m\u001b[38;5;244m \u001b[37m⎈ \u001b[37mminikube \u001b[45m\u001b[30m \u001b[30m⬢ \u001b[30m12.3.1 \u001b[44m\u001b[35m \u001b[30mcode-oss-dev \u001b[42m\u001b[34m \u001b[30m master \u001b[49m\u001b[32m\u001b[39m \u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[K\u001b[00m\u001b[60D\u001b[?2004h"] -[34.725177, "i", "c"] -[34.725427, "o", "c"] -[34.924913, "i", "d"] -[34.925115, "o", "\bcd"] -[35.077086, "i", " "] -[35.07735, "o", " "] -[35.292953, "i", "."] -[35.293177, "o", "."] -[35.42103, "i", "."] -[35.421273, "o", "."] -[35.629217, "i", "\r"] -[35.629483, "o", "\u001b[?2004l\r\r\n"] -[35.629712, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[36.638245, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[42m \u001b[30mL \u001b[30m0.56 \u001b[48;5;244m\u001b[32m \u001b[30m☑ \u001b[30m7 \u001b[45m\u001b[38;5;244m \u001b[37m⎈ \u001b[37mminikube \u001b[45m\u001b[30m \u001b[30m⬢ \u001b[30m12.3.1 \u001b[44m\u001b[35m \u001b[30mcode-oss-dev \u001b[42m\u001b[34m \u001b[30m master \u001b[49m\u001b[32m\u001b[39m \u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[K\u001b[00m\u001b[60D\u001b[?2004h"] -[37.477061, "i", "s"] -[37.47733, "o", "s"] -[37.588878, "i", "o"] -[37.589089, "o", "\bso"] -[37.700765, "i", "u"] -[37.700985, "o", "u"] -[37.796705, "i", "r"] -[37.796949, "o", "r"] -[37.988864, "i", "c"] -[37.989098, "o", "c"] -[38.180799, "i", "e"] -[38.181013, "o", "e"] -[38.420809, "i", " "] -[38.421035, "o", " "] -[38.604822, "i", "~"] -[38.605035, "o", "~"] -[38.764974, "i", "/"] -[38.765208, "o", "/"] -[39.197038, "i", "o"] -[39.197274, "o", "o"] -[39.36479, "i", "w"] -[39.365033, "o", "w"] -[39.404619, "i", "e"] -[39.404787, "o", "e"] -[39.500881, "i", "r"] -[39.501076, "o", "r"] -[39.981133, "i", ""] -[39.981387, "o", "\b \b"] -[40.100922, "i", ""] -[40.101164, "o", "\b \b"] -[40.244966, "i", ""] -[40.245181, "o", "\b \b"] -[40.781038, "i", ""] -[40.781341, "o", "\b \b"] -[41.397117, "i", "p"] -[41.397357, "o", "p"] -[41.549006, "i", "o"] -[41.549223, "o", "o"] -[41.66894, "i", "\t"] -[41.669987, "o", "werlevel"] -[42.39715, "i", "1"] -[42.397388, "o", "1"] -[42.637011, "i", "\t"] -[42.637557, "o", "0k"] -[43.317189, "i", "/"] -[43.317426, "o", "/"] -[43.50879, "i", "p"] -[43.508993, "o", "p"] -[43.669076, "i", "o"] -[43.669314, "o", "o"] -[43.74891, "i", "\t"] -[43.749325, "o", "werlevel"] -[44.077215, "i", "1"] -[44.077486, "o", "1"] -[44.340992, "i", "\t"] -[44.341411, "o", "0k.zsh-theme\u001b[1m \u001b[0m"] -[45.261252, "i", "\r"] -[45.261515, "o", "\b\u001b[0m \b\u001b[?2004l\r\r\n"] -[45.287095, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[45.595079, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[46.077089, "i", "e"] -[46.077322, "o", "e"] -[46.276969, "i", "c"] -[46.277208, "o", "\bec"] -[46.348751, "i", "h"] -[46.348969, "o", "h"] -[46.508875, "i", "o"] -[46.509094, "o", "o"] -[46.604929, "i", " "] -[46.605148, "o", " "] -[46.740751, "i", "t"] -[46.740977, "o", "t"] -[46.828853, "i", "h"] -[46.829071, "o", "h"] -[46.908719, "i", "e"] -[46.90893, "o", "e"] -[47.068923, "i", " "] -[47.069147, "o", " "] -[47.205066, "i", "s"] -[47.205306, "o", "s"] -[47.373022, "i", "a"] -[47.373266, "o", "a"] -[47.516846, "i", "m"] -[47.517072, "o", "m"] -[47.588891, "i", "e"] -[47.589101, "o", "e"] -[47.732787, "i", " "] -[47.733003, "o", " "] -[47.908991, "i", "c"] -[47.909219, "o", "c"] -[47.98101, "i", "o"] -[47.981233, "o", "o"] -[48.132892, "i", "n"] -[48.133112, "o", "n"] -[48.501069, "i", "f"] -[48.501307, "o", "f"] -[48.605085, "i", "i"] -[48.605318, "o", "i"] -[48.692956, "i", "g"] -[48.693179, "o", "g"] -[48.836976, "i", "\r"] -[48.837202, "o", "\u001b[?2004l\r\r\n"] -[48.837389, "o", "the same config\r\n"] -[48.837478, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[48.848952, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[49.301199, "i", "e"] -[49.301437, "o", "e"] -[49.492908, "i", "c"] -[49.49313, "o", "\bec"] -[49.540911, "i", "h"] -[49.541102, "o", "h"] -[49.644811, "i", "o"] -[49.64501, "o", "o"] -[49.732905, "i", " "] -[49.733092, "o", " "] -[49.805042, "i", "t"] -[49.805265, "o", "t"] -[49.884917, "i", "h"] -[49.885119, "o", "h"] -[49.9726, "i", "e"] -[49.972829, "o", "e"] -[50.036777, "i", " "] -[50.036994, "o", " "] -[50.132761, "i", "s"] -[50.132964, "o", "s"] -[50.300762, "i", "a"] -[50.300978, "o", "a"] -[50.420838, "i", "m"] -[50.421037, "o", "m"] -[50.476859, "i", "e"] -[50.477044, "o", "e"] -[50.556939, "i", " "] -[50.557134, "o", " "] -[50.692809, "i", "p"] -[50.693014, "o", "p"] -[50.756686, "i", "r"] -[50.756859, "o", "r"] -[50.86083, "i", "o"] -[50.861015, "o", "o"] -[51.325156, "i", "m"] -[51.325389, "o", "m"] -[51.524926, "i", "p"] -[51.525147, "o", "p"] -[51.645054, "i", "t"] -[51.645277, "o", "t"] -[51.821133, "i", "\r"] -[51.82137, "o", "\u001b[?2004l\r\r\n"] -[51.82155, "o", "the same prompt\r\n"] -[51.82163, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[51.833309, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.53 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[52.373203, "i", "e"] -[52.373441, "o", "e"] -[52.549106, "i", "c"] -[52.549339, "o", "\bec"] -[52.612882, "i", "h"] -[52.613054, "o", "h"] -[52.732732, "i", "o"] -[52.732936, "o", "o"] -[52.81272, "i", " "] -[52.812893, "o", " "] -[52.892775, "i", "b"] -[52.892965, "o", "b"] -[52.988718, "i", "u"] -[52.988905, "o", "u"] -[53.068771, "i", "t"] -[53.068984, "o", "t"] -[53.16478, "i", " "] -[53.164995, "o", " "] -[53.26088, "i", "f"] -[53.261093, "o", "f"] -[53.364842, "i", "a"] -[53.365037, "o", "a"] -[53.548877, "i", "s"] -[53.549081, "o", "s"] -[53.620878, "i", "t"] -[53.621084, "o", "t"] -[53.828977, "i", "!"] -[53.829212, "o", "!"] -[54.00484, "i", "\r"] -[54.005073, "o", "\u001b[?2004l\r\r\n"] -[54.005239, "o", "but fast!\r\n"] -[54.005328, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[54.01702, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.55 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[54.941013, "i", "l"] -[54.941252, "o", "l"] -[54.996943, "i", "s"] -[54.997163, "o", "\bls"] -[55.212915, "i", "\r"] -[55.213166, "o", "\u001b[?2004l\r\r\n"] -[55.215862, "o", "azure-pipelines.yml cgmanifest.json gulpfile.js product.json resources test\t\t tslint.json\r\nbuild\t\t CONTRIBUTING.md LICENSE.txt README.md\t scripts ThirdPartyNotices.txt yarn.lock\r\ncglicenses.json extensions package.json remote\t src\t tsfmt.json\r\n"] -[55.21612, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[55.22789, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.55 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[55.701246, "i", "p"] -[55.701481, "o", "p"] -[55.780794, "i", "w"] -[55.781022, "o", "\bpw"] -[55.924905, "i", "d"] -[55.925126, "o", "d"] -[56.045009, "i", "\r"] -[56.04525, "o", "\u001b[?2004l\r\r\n"] -[56.045413, "o", "/home/romka/projects/vscode\r\n"] -[56.045495, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[56.057015, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.55 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[56.24519, "i", "c"] -[56.24544, "o", "c"] -[56.421036, "i", "d"] -[56.421263, "o", "\bcd"] -[56.524989, "i", " "] -[56.525211, "o", " "] -[56.645023, "i", "s"] -[56.645242, "o", "s"] -[56.684883, "i", "r"] -[56.685114, "o", "r"] -[56.876966, "i", "c"] -[56.877193, "o", "c"] -[56.972829, "i", "\r"] -[56.973067, "o", "\u001b[?2004l\r\r\n"] -[56.973332, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[56.985413, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.55 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev/\u001b[0m\u001b[30m\u001b[44m\u001b[30msrc \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[56C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[56D\u001b[?2004h"] -[57.205194, "i", "c"] -[57.205449, "o", "c"] -[57.373149, "i", "d"] -[57.373389, "o", "\bcd"] -[57.47697, "i", " "] -[57.477182, "o", " "] -[57.620957, "i", "."] -[57.621177, "o", "."] -[57.756947, "i", "."] -[57.757161, "o", "."] -[57.941039, "i", "\r"] -[57.941263, "o", "\u001b[?2004l\r\r\n"] -[57.941513, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[57.953015, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.55 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[58.581266, "i", "\r"] -[58.581538, "o", "\u001b[?2004l\r\r\n\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[58.593219, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.55 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.081009, "i", "\r"] -[59.081281, "o", "\u001b[?2004l\r\r\n"] -[59.081429, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.093237, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.110986, "i", "\r"] -[59.111193, "o", "\u001b[?2004l\r\r\n"] -[59.111314, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.12356, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.143273, "i", "\r"] -[59.143485, "o", "\u001b[?2004l\r\r\n"] -[59.143613, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.155374, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.173369, "i", "\r"] -[59.17359, "o", "\u001b[?2004l\r\r\n"] -[59.173683, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.185113, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.20241, "i", "\r"] -[59.202603, "o", "\u001b[?2004l\r\r\n"] -[59.202716, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.214455, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.233834, "i", "\r"] -[59.234018, "o", "\u001b[?2004l\r\r\n"] -[59.234128, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.24564, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.262345, "i", "\r"] -[59.262542, "o", "\u001b[?2004l\r\r\n"] -[59.262655, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.274662, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.292442, "i", "\r"] -[59.292644, "o", "\u001b[?2004l\r\r\n"] -[59.292742, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.30501, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.322867, "i", "\r"] -[59.323066, "o", "\u001b[?2004l\r\r\n"] -[59.323163, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.335113, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.352291, "i", "\r"] -[59.352496, "o", "\u001b[?2004l\r\r\n"] -[59.352635, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.364051, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.383162, "i", "\r"] -[59.383361, "o", "\u001b[?2004l\r\r\n"] -[59.383485, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.395, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.414121, "i", "\r"] -[59.414333, "o", "\u001b[?2004l\r\r\n"] -[59.414437, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.425938, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.444624, "i", "\r"] -[59.444904, "o", "\u001b[?2004l\r\r\n"] -[59.445057, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.456824, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.474566, "i", "\r"] -[59.474735, "o", "\u001b[?2004l\r\r\n"] -[59.474827, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.486114, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.504654, "i", "\r"] -[59.504847, "o", "\u001b[?2004l\r\r\n"] -[59.504961, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.516844, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.534681, "i", "\r"] -[59.534897, "o", "\u001b[?2004l\r\r\n"] -[59.534989, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.547367, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.564722, "i", "\r"] -[59.564909, "o", "\u001b[?2004l\r\r\n"] -[59.565018, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.576476, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.59495, "i", "\r"] -[59.595135, "o", "\u001b[?2004l\r\r\n"] -[59.595259, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.606554, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.625117, "i", "\r"] -[59.625332, "o", "\u001b[?2004l\r\r\n"] -[59.625445, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.637157, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.656009, "i", "\r"] -[59.656191, "o", "\u001b[?2004l\r\r\n"] -[59.656301, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.667971, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.68654, "i", "\r"] -[59.686754, "o", "\u001b[?2004l\r\r\n"] -[59.686864, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.698208, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.718816, "i", "\r"] -[59.719023, "o", "\u001b[?2004l\r\r\n"] -[59.719125, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.730853, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[59.750483, "i", "\r"] -[59.750685, "o", "\u001b[?2004l\r\r\n"] -[59.750823, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] -[59.762142, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[39m\u001b[0m\u001b[49m\u001b[0m\u001b[42m \u001b[30mL \u001b[0m\u001b[30m\u001b[42m\u001b[30m0.54 \u001b[32m\u001b[0m\u001b[32m\u001b[42m\u001b[48;5;244m \u001b[30m☑ \u001b[0m\u001b[30m\u001b[48;5;244m\u001b[30m7 \u001b[38;5;244m\u001b[0m\u001b[38;5;244m\u001b[48;5;244m\u001b[45m \u001b[37m⎈ \u001b[0m\u001b[37m\u001b[45m\u001b[37mminikube \u001b[0m\u001b[37m\u001b[45m\u001b[45m\u001b[0m\u001b[37m\u001b[45m\u001b[30m \u001b[30m⬢ \u001b[0m\u001b[30m\u001b[45m\u001b[30m12.3.1 \u001b[35m\u001b[0m\u001b[35m\u001b[45m\u001b[44m \u001b[0m\u001b[35m\u001b[44m\u001b[30mcode-oss-dev \u001b[34m\u001b[0m\u001b[34m\u001b[44m\u001b[42m \u001b[0m\u001b[34m\u001b[42m\u001b[30m\u001b[0m\u001b[30m\u001b[42m\u001b[30m master \u001b[49m\u001b[0m\u001b[30m\u001b[32m\u001b[39m \u001b[39m\u001b[49m\u001b[0m\u001b[K\u001b[60C\u001b[39m\u001b[0m\u001b[49m\u001b[39m\u001b[0m\u001b[49m\u001b[60D\u001b[?2004h"] -[60.412948, "i", "\u0004"] -[60.413188, "o", "\u001b[?2004l\r\r\n"] From 45a71cbc05173c937ba8d11dd32c44c90a7462bc Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 3 Feb 2020 06:37:00 +0100 Subject: [PATCH 49/88] "restart your terminal" should help iTerm users who fail to restart iTerm when asked to --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 80c9a339..dee6ae3d 100644 --- a/README.md +++ b/README.md @@ -1086,14 +1086,14 @@ configuration wizard. Once you can see the errors, fix `~/.zshrc` to get rid of ### Some prompt styles are missing from the configuration wizard -tl;dr: To see all prompt styles in the configuration wizard, install [the recommended font]( - #meslo-nerd-font-patched-for-powerlevel10k) and resize your terminal to at least 80 columns by 25 -lines prior to running `p10k configure`. +tl;dr: To see all prompt styles in the configuration wizard, restart your terminal, install +[the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) and resize your terminal to at +least 80 columns by 25 lines prior to running `p10k configure`. The first few questions in the configuration wizard are meant to assess the 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. If you'd like to see all prompt styles, install -[the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). +wizard won't offer prompt styles that use them. If you'd like to see all prompt styles, restart your +terminal and install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). The minimum screen size at which configuration wizard can function is 55 columns by 21 lines. However, not all prompt styles are offered at such small screen size as there is simply not enough From 6db57923b1508b79f39072be1fa17e9a22ee73bd Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 3 Feb 2020 07:30:45 +0100 Subject: [PATCH 50/88] add POWERLEVEL9K_BATTERY_${state}_{STAGES,LEVEL_BACKGROUND,LEVEL_FOREGROUND} --- internal/p10k.zsh | 61 +++++++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 21 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 57a6ded6..9378907f 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1374,24 +1374,27 @@ _p9k_prompt_battery_set_args() { [[ $_POWERLEVEL9K_BATTERY_VERBOSE == 1 && -n $remain ]] && msg+=" ($remain)" local icon=BATTERY_ICON - if (( $#_POWERLEVEL9K_BATTERY_STAGES )); then - local -i idx=$#_POWERLEVEL9K_BATTERY_STAGES - (( bat_percent < 100 )) && idx=$((bat_percent * $#_POWERLEVEL9K_BATTERY_STAGES / 100 + 1)) - icon=$'\1'$_POWERLEVEL9K_BATTERY_STAGES[idx] + local var=_POWERLEVEL9K_BATTERY_${state}_STAGES + local -i idx="${#${(@P)var}}" + if (( idx )); then + (( bat_percent < 100 )) && idx=$((bat_percent * idx / 100 + 1)) + icon=$'\1'"${${(@P)var}[idx]}" fi local bg=$_p9k_color1 - if (( $#_POWERLEVEL9K_BATTERY_LEVEL_BACKGROUND )); then - local -i idx=$#_POWERLEVEL9K_BATTERY_LEVEL_BACKGROUND - (( bat_percent < 100 )) && idx=$((bat_percent * $#_POWERLEVEL9K_BATTERY_LEVEL_BACKGROUND / 100 + 1)) - bg=$_POWERLEVEL9K_BATTERY_LEVEL_BACKGROUND[idx] + local var=_POWERLEVEL9K_BATTERY_${state}_LEVEL_BACKGROUND + local -i idx="${#${(@P)var}}" + if (( idx )); then + (( bat_percent < 100 )) && idx=$((bat_percent * idx / 100 + 1)) + bg="${${(@P)var}[idx]}" fi local fg=$_p9k_battery_states[$state] - if (( $#_POWERLEVEL9K_BATTERY_LEVEL_FOREGROUND )); then - local -i idx=$#_POWERLEVEL9K_BATTERY_LEVEL_FOREGROUND - (( bat_percent < 100 )) && idx=$((bat_percent * $#_POWERLEVEL9K_BATTERY_LEVEL_FOREGROUND / 100 + 1)) - fg=$_POWERLEVEL9K_BATTERY_LEVEL_FOREGROUND[idx] + local var=_POWERLEVEL9K_BATTERY_${state}_LEVEL_FOREGROUND + local -i idx="${#${(@P)var}}" + if (( idx )); then + (( bat_percent < 100 )) && idx=$((bat_percent * idx / 100 + 1)) + fg="${${(@P)var}[idx]}" fi _p9k__battery_args=(prompt_battery_$state "$bg" "$fg" $icon 0 '' $msg) @@ -5679,16 +5682,32 @@ _p9k_init_params() { _p9k_declare -i POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL 95 _p9k_declare -i POWERLEVEL9K_BATTERY_LOW_THRESHOLD 10 _p9k_declare -i POWERLEVEL9K_BATTERY_HIDE_ABOVE_THRESHOLD 999 + _p9k_declare -b POWERLEVEL9K_BATTERY_VERBOSE 1 _p9k_declare -a POWERLEVEL9K_BATTERY_LEVEL_BACKGROUND -- _p9k_declare -a POWERLEVEL9K_BATTERY_LEVEL_FOREGROUND -- - _p9k_declare -b POWERLEVEL9K_BATTERY_VERBOSE 1 - if [[ $parameters[POWERLEVEL9K_BATTERY_STAGES] == scalar ]]; then - _p9k_declare -e POWERLEVEL9K_BATTERY_STAGES - else - [[ -z $_p9k_locale ]] || local LC_ALL=$_p9k_locale - _p9k_declare -a POWERLEVEL9K_BATTERY_STAGES -- - _POWERLEVEL9K_BATTERY_STAGES=("${(@g::)_POWERLEVEL9K_BATTERY_STAGES}") - fi + case $parameters[POWERLEVEL9K_BATTERY_STAGES] in + scalar*) typeset -ga _POWERLEVEL9K_BATTERY_STAGES=("${(@s::)${(g::)POWERLEVEL9K_BATTERY_STAGES}}");; + array*) typeset -ga _POWERLEVEL9K_BATTERY_STAGES=("${(@g::)POWERLEVEL9K_BATTERY_STAGES}");; + esac + local state + for state in CHARGED CHARGING LOW DISCONNECTED; do + local var=POWERLEVEL9K_BATTERY_${state}_STAGES + case $parameters[$var] in + scalar*) eval "typeset -ga _$var=(${(@qq)${(@s::)${(g::)${(P)var}}}})";; + array*) eval "typeset -ga _$var=(${(@qq)${(@g::)${(@P)var}}})";; + *) eval "typeset -ga _$var=(${(@qq)_POWERLEVEL9K_BATTERY_STAGES})";; + esac + local var=POWERLEVEL9K_BATTERY_${state}_LEVEL_BACKGROUND + case $parameters[$var] in + array*) eval "typeset -ga _$var=(${(@qq)${(@P)var}})";; + *) eval "typeset -ga _$var=(${(@qq)_POWERLEVEL9K_BATTERY_LEVEL_BACKGROUND})";; + esac + local var=POWERLEVEL9K_BATTERY_${state}_LEVEL_FOREGROUND + case $parameters[$var] in + array*) eval "typeset -ga _$var=(${(@qq)${(@P)var}})";; + *) eval "typeset -ga _$var=(${(@qq)_POWERLEVEL9K_BATTERY_LEVEL_FOREGROUND})";; + esac + done _p9k_declare -F POWERLEVEL9K_PUBLIC_IP_TIMEOUT 300 _p9k_declare -a POWERLEVEL9K_PUBLIC_IP_METHODS -- dig curl wget _p9k_declare -e POWERLEVEL9K_PUBLIC_IP_NONE "" @@ -6455,7 +6474,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v33\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v34\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$DEFAULT_USER\1${ZLE_RPROMPT_INDENT:-1}\1$P9K_SSH\1$__p9k_ksh_arrays' From c321e50f3863b64fb8ca2d6704fc6d72cc9f6a50 Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 3 Feb 2020 07:32:48 +0100 Subject: [PATCH 51/88] remove redundant expansion of C-escapes --- internal/wizard.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 24dca594..016ab84e 100755 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1597,7 +1597,7 @@ function generate_config() { fi if [[ $POWERLEVEL9K_MODE == nerdfont-complete ]]; then - sub BATTERY_STAGES "\$'\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578'" + sub BATTERY_STAGES "'\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578'" fi if [[ $style == (classic|rainbow) ]]; then From 1a9c8d126c97fe87f9754b9011f442798bc9b0ae Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 3 Feb 2020 07:55:54 +0100 Subject: [PATCH 52/88] typo --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 9378907f..5b06d463 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -517,7 +517,7 @@ _p9k_param() { # _p9k_get_icon prompt_foo_BAR BAZ_ICON quix _p9k_get_icon() { - local key="_p9k_param ${(pj:\0:)*}" + local key="_p9k_get_icon ${(pj:\0:)*}" _p9k_ret=$_p9k_cache[$key] if [[ -n $_p9k_ret ]]; then _p9k_ret[-1,-1]='' @@ -6474,7 +6474,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v34\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v35\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$DEFAULT_USER\1${ZLE_RPROMPT_INDENT:-1}\1$P9K_SSH\1$__p9k_ksh_arrays' From a0535ffcd6c352007868ffb6a57c0187997f64bc Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 3 Feb 2020 08:40:49 +0100 Subject: [PATCH 53/88] replace all wide glyphs with narrow in nerdfont configuration; many terminals have bugs that prevents them from properly rendering wide glyphs --- internal/icons.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/icons.zsh b/internal/icons.zsh index 4f7e8e22..d88f8992 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -421,7 +421,7 @@ function _p9k_init_icons() { HOME_SUB_ICON '\uF07C'$s #  FOLDER_ICON '\uF115'$s #  ETC_ICON '\uF013'$s #  - NETWORK_ICON '\uF1EB'$s #  + NETWORK_ICON '\uFBF1'$s # ﯱ LOAD_ICON '\uF080 ' #  SWAP_ICON '\uF464'$s #  RAM_ICON '\uF0E4'$s #  @@ -457,9 +457,9 @@ function _p9k_init_icons() { DROPBOX_ICON '\UF16B'$s #  DATE_ICON '\uF073 ' #  TIME_ICON '\uF017 ' #  - JAVA_ICON '\U2615' # ☕︎ + JAVA_ICON '\uE738' #  LARAVEL_ICON '\ue73f'$q #  - RANGER_ICON '\u2B50' # ⭐ + RANGER_ICON '\uF00b' #  MIDNIGHT_COMMANDER_ICON 'mc' VIM_ICON '\uE62B' #  TERRAFORM_ICON '\U1F6E0\u00A0' # 🛠️ From 4b62cd7380b55115f5f7e184484c9b8081f2f1a7 Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 3 Feb 2020 11:47:39 +0100 Subject: [PATCH 54/88] bug fix: make reset=2 sticky --- internal/worker.zsh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/worker.zsh b/internal/worker.zsh index 6b369740..a7db4596 100644 --- a/internal/worker.zsh +++ b/internal/worker.zsh @@ -121,7 +121,7 @@ function _p9k_worker_receive() { sysread -i $_p9k__worker_resp_fd 'buf[$#buf+1]' || return done - local -i reset + local -i reset max_reset for resp in ${(ps:\x1e:)${buf//$'\x05'}}; do local arg=$resp[2,-1] case $resp[1] in @@ -142,6 +142,7 @@ function _p9k_worker_receive() { start_time=0 fi () { eval $arg } + (( reset > max_reset )) && max_reset=reset ;; s) [[ -z $_p9k__worker_pid ]] || return @@ -160,12 +161,12 @@ function _p9k_worker_receive() { esac done - if (( reset == 2 )); then + if (( max_reset == 2 )); then _p9k_refresh_reason=worker _p9k_set_prompt _p9k_refresh_reason='' fi - (( reset )) && _p9k_reset_prompt + (( max_reset )) && _p9k_reset_prompt return 0 } always { (( $? )) && _p9k_worker_stop From 71f4eade9f5f7edc67fed77c9de2ef9a70b0d87a Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 3 Feb 2020 11:47:55 +0100 Subject: [PATCH 55/88] add wifi prompt segment --- config/p10k-classic.zsh | 31 +++++++++++ config/p10k-lean-8colors.zsh | 31 +++++++++++ config/p10k-lean.zsh | 31 +++++++++++ config/p10k-rainbow.zsh | 32 +++++++++++ internal/icons.zsh | 5 ++ internal/p10k.zsh | 105 ++++++++++++++++++++++++++++++++++- 6 files changed, 233 insertions(+), 2 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index ca737e05..83d960a1 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -93,6 +93,7 @@ # public_ip # public IP address # proxy # system-wide http/https/ftp proxy # battery # internal battery + # wifi # wifi speed # example # example user-defined segment (see prompt_example function below) ) @@ -1109,6 +1110,36 @@ # Don't show the remaining time to charge/discharge. typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false + #####################################[ wifi: wifi speed ]##################################### + # WiFi color. + typeset -g POWERLEVEL9K_WIFI_FOREGROUND=68 + # Custom icon. + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS). + # + # # Wifi colors and icons for different signal strength levels (low to high). + # typeset -g my_wifi_fg=(68 68 68 68 68) # <-- change these values + # typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') # <-- change these values + # + # typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps' + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}' + # + # The following parameters are accessible within the expansions: + # + # Parameter | Meaning + # ----------------------+--------------- + # P9K_WIFI_SSID | service set identifier, a.k.a. network name + # P9K_WIFI_LINK_AUTH | authentication protocol + # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second + # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 + # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 + # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) + # + # All parameters except P9K_WIFI_BARS are extracted from the output of the following command: + # + # /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I + ####################################[ time: current time ]#################################### # Current time color. typeset -g POWERLEVEL9K_TIME_FOREGROUND=66 diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index ccfe6d65..2897b554 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -92,6 +92,7 @@ # public_ip # public IP address # proxy # system-wide http/https/ftp proxy # battery # internal battery + # wifi # wifi speed # example # example user-defined segment (see prompt_example function below) ) @@ -1088,6 +1089,36 @@ # Don't show the remaining time to charge/discharge. typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false + #####################################[ wifi: wifi speed ]##################################### + # WiFi color. + typeset -g POWERLEVEL9K_WIFI_FOREGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS). + # + # # Wifi colors and icons for different signal strength levels (low to high). + # typeset -g my_wifi_fg=(4 4 4 4 4) # <-- change these values + # typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') # <-- change these values + # + # typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps' + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}' + # + # The following parameters are accessible within the expansions: + # + # Parameter | Meaning + # ----------------------+--------------- + # P9K_WIFI_SSID | service set identifier, a.k.a. network name + # P9K_WIFI_LINK_AUTH | authentication protocol + # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second + # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 + # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 + # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) + # + # All parameters except P9K_WIFI_BARS are extracted from the output of the following command: + # + # /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I + ####################################[ time: current time ]#################################### # Current time color. typeset -g POWERLEVEL9K_TIME_FOREGROUND=6 diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index ad23a80f..100c1365 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -92,6 +92,7 @@ # public_ip # public IP address # proxy # system-wide http/https/ftp proxy # battery # internal battery + # wifi # wifi speed # example # example user-defined segment (see prompt_example function below) ) @@ -1088,6 +1089,36 @@ # Don't show the remaining time to charge/discharge. typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false + #####################################[ wifi: wifi speed ]##################################### + # WiFi color. + typeset -g POWERLEVEL9K_WIFI_FOREGROUND=68 + # Custom icon. + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS). + # + # # Wifi colors and icons for different signal strength levels (low to high). + # typeset -g my_wifi_fg=(68 68 68 68 68) # <-- change these values + # typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') # <-- change these values + # + # typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps' + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}' + # + # The following parameters are accessible within the expansions: + # + # Parameter | Meaning + # ----------------------+--------------- + # P9K_WIFI_SSID | service set identifier, a.k.a. network name + # P9K_WIFI_LINK_AUTH | authentication protocol + # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second + # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 + # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 + # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) + # + # All parameters except P9K_WIFI_BARS are extracted from the output of the following command: + # + # /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I + ####################################[ time: current time ]#################################### # Current time color. typeset -g POWERLEVEL9K_TIME_FOREGROUND=66 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 8618186c..46813c8f 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -93,6 +93,7 @@ # public_ip # public IP address # proxy # system-wide http/https/ftp proxy # battery # internal battery + # wifi # wifi speed # example # example user-defined segment (see prompt_example function below) ) @@ -1153,6 +1154,37 @@ typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false # typeset -g POWERLEVEL9K_BATTERY_BACKGROUND=0 + #####################################[ wifi: wifi speed ]##################################### + # WiFi color. + # typeset -g POWERLEVEL9K_WIFI_FOREGROUND=0 + # typeset -g POWERLEVEL9K_WIFI_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS). + # + # # Wifi colors and icons for different signal strength levels (low to high). + # typeset -g my_wifi_fg=(0 0 0 0 0) # <-- change these values + # typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') # <-- change these values + # + # typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps' + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}' + # + # The following parameters are accessible within the expansions: + # + # Parameter | Meaning + # ----------------------+--------------- + # P9K_WIFI_SSID | service set identifier, a.k.a. network name + # P9K_WIFI_LINK_AUTH | authentication protocol + # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second + # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 + # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 + # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) + # + # All parameters except P9K_WIFI_BARS are extracted from the output of the following command: + # + # /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I + ####################################[ time: current time ]#################################### # Current time color. # typeset -g POWERLEVEL9K_TIME_FOREGROUND=0 diff --git a/internal/icons.zsh b/internal/icons.zsh index d88f8992..012c520a 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -133,6 +133,7 @@ function _p9k_init_icons() { NNN_ICON 'nnn' TIMEWARRIOR_ICON 'tw' NIX_SHELL_ICON 'nix' + WIFI_ICON 'WiFi' ) ;; 'awesome-fontconfig') @@ -245,6 +246,7 @@ function _p9k_init_icons() { NNN_ICON 'nnn' TIMEWARRIOR_ICON 'tw' NIX_SHELL_ICON 'nix' + WIFI_ICON 'WiFi' ) ;; 'awesome-mapped-fontconfig') @@ -361,6 +363,7 @@ function _p9k_init_icons() { NNN_ICON 'nnn' TIMEWARRIOR_ICON 'tw' NIX_SHELL_ICON 'nix' + WIFI_ICON 'WiFi' ) ;; 'nerdfont-complete'|'nerdfont-fontconfig') @@ -474,6 +477,7 @@ function _p9k_init_icons() { NNN_ICON 'nnn' TIMEWARRIOR_ICON '\uF49B' #  NIX_SHELL_ICON '\uF313' #  + WIFI_ICON '\uF1EB' #  ) ;; *) @@ -586,6 +590,7 @@ function _p9k_init_icons() { NNN_ICON 'nnn' TIMEWARRIOR_ICON 'tw' NIX_SHELL_ICON 'nix' + WIFI_ICON 'WiFi' ) ;; esac diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 5b06d463..4a5250bb 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4409,6 +4409,107 @@ function _p9k_prompt_timewarrior_init() { typeset -g "_p9k__segment_cond_${_p9k_prompt_side}[_p9k_segment_index]"='$commands[timew]' } +prompt_wifi() { + local -i len=$#_p9k__prompt + _p9k_prompt_segment $0 green $_p9k_color1 WIFI_ICON 1 '$_p9k__wifi_on' '$P9K_WIFI_LAST_TX_RATE Mbps' + typeset -g "_p9k__segment_val_${_p9k_prompt_side}[_p9k_segment_index]"=$_p9k__prompt[len+1,-1] +} + +_p9k_prompt_wifi_init() { + if [[ -x /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport ]]; then + typeset -g _p9k__wifi_on= + typeset -g P9K_WIFI_LAST_TX_RATE= + typeset -g P9K_WIFI_SSID= + typeset -g P9K_WIFI_LINK_AUTH= + typeset -g P9K_WIFI_RSSI= + typeset -g P9K_WIFI_NOISE= + typeset -g P9K_WIFI_BARS= + _p9k__async_segments_compute+=_p9k_prompt_wifi_compute + else + typeset -g "_p9k__segment_cond_${_p9k_prompt_side}[_p9k_segment_index]"='${:-}' + fi +} + +_p9k_prompt_wifi_compute() { + _p9k_worker_async _p9k_prompt_wifi_async _p9k_prompt_wifi_sync +} + +_p9k_prompt_wifi_async() { + local airport=/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport + local last_tx_rate ssid link_auth rssi noise bars on out line v state + { + [[ -x $airport ]] || return 0 + out="$($airport -I)" || return 0 + for line in ${${${(f)out}##[[:space:]]#}%%[[:space:]]#}; do + v=${line#*: } + case $line[1,-$#v-3] in + agrCtlRSSI) rssi=$v;; + agrCtlNoise) noise=$v;; + state) state=$v;; + lastTxRate) last_tx_rate=$v;; + link\ auth) link_auth=$v;; + SSID) ssid=$v;; + esac + done + if [[ $state != running || $rssi != (0|-<->) || $noise != (0|-<->) ]]; then + rssi= + noise= + last_tx_rate= + link_auth= + ssid= + bars= + return 0 + fi + # https://www.speedguide.net/faq/how-to-read-rssisignal-and-snrnoise-ratings-440 + # http://www.wireless-nets.com/resources/tutorials/define_SNR_values.html + local -i snr_margin='rssi - noise' + if (( snr_margin >= 40 )); then + bars=4 + elif (( snr_margin >= 25 )); then + bars=3 + elif (( snr_margin >= 15 )); then + bars=2 + elif (( snr_margin >= 10 )); then + bars=1 + else + bars=0 + fi + on=1 + } always { + if [[ $_p9k__wifi_on != $on || + $P9K_WIFI_LAST_TX_RATE != $last_tx_rate || + $P9K_WIFI_SSID != $ssid || + $P9K_WIFI_LINK_AUTH != $link_auth || + $P9K_WIFI_RSSI != $rssi || + $P9K_WIFI_NOISE != $noise || + $P9K_WIFI_BARS != $bars ]]; then + _p9k__wifi_on=$on + P9K_WIFI_LAST_TX_RATE=$last_tx_rate + P9K_WIFI_SSID=$ssid + P9K_WIFI_LINK_AUTH=$link_auth + P9K_WIFI_RSSI=$rssi + P9K_WIFI_NOISE=$noise + P9K_WIFI_BARS=$bars + _p9k_print_params \ + _p9k__wifi_on \ + P9K_WIFI_LAST_TX_RATE \ + P9K_WIFI_SSID \ + P9K_WIFI_LINK_AUTH \ + P9K_WIFI_RSSI \ + P9K_WIFI_NOISE \ + P9K_WIFI_BARS + echo -E - 'reset=1' + fi + } +} + +_p9k_prompt_wifi_sync() { + if [[ -n $REPLY ]]; then + eval $REPLY + _p9k_worker_reply $REPLY + fi +} + # 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() { @@ -5609,7 +5710,7 @@ _p9k_init_vars() { typeset -g _p9k__last_prompt_pwd typeset -gA _p9k_display_k typeset -ga _p9k__display_v - typeset -ga _p9k__async_segments_compute + typeset -gaU _p9k__async_segments_compute typeset -gA _p9k__dotnet_stat_cache typeset -gA _p9k__dir_stat_cache @@ -6474,7 +6575,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v35\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v36\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$DEFAULT_USER\1${ZLE_RPROMPT_INDENT:-1}\1$P9K_SSH\1$__p9k_ksh_arrays' From 637752ef7bc790c4d8f6ff0498d1e70496ff9a96 Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 3 Feb 2020 12:04:04 +0100 Subject: [PATCH 56/88] 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 83d960a1..8801de27 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1130,7 +1130,7 @@ # Parameter | Meaning # ----------------------+--------------- # P9K_WIFI_SSID | service set identifier, a.k.a. network name - # P9K_WIFI_LINK_AUTH | authentication protocol + # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none" # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 2897b554..f34d2680 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -1109,7 +1109,7 @@ # Parameter | Meaning # ----------------------+--------------- # P9K_WIFI_SSID | service set identifier, a.k.a. network name - # P9K_WIFI_LINK_AUTH | authentication protocol + # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none" # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 100c1365..48bf1e26 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1109,7 +1109,7 @@ # Parameter | Meaning # ----------------------+--------------- # P9K_WIFI_SSID | service set identifier, a.k.a. network name - # P9K_WIFI_LINK_AUTH | authentication protocol + # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none" # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 46813c8f..426973ea 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -1175,7 +1175,7 @@ # Parameter | Meaning # ----------------------+--------------- # P9K_WIFI_SSID | service set identifier, a.k.a. network name - # P9K_WIFI_LINK_AUTH | authentication protocol + # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none" # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 From 3b2fa36cd6fd34ccd764f410013d91440db180f4 Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 3 Feb 2020 13:51:58 +0100 Subject: [PATCH 57/88] comments --- internal/p10k.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 4a5250bb..476f65c1 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4086,6 +4086,7 @@ _p9k_prompt_azure_init() { } prompt_gcloud() { + # TODO: Use `gcloud config configurations list` instead. unset P9K_GCLOUD_PROJECT P9K_GCLOUD_ACCOUNT if ! _p9k_cache_stat_get $0 ~/.config/gcloud/active_config ~/.config/gcloud/configurations/config_default; then _p9k_cache_stat_set "$(gcloud config get-value account 2>/dev/null)" "$(gcloud config get-value project 2>/dev/null)" From fab13389f17b1dc08f080bef4e0143f3d59d104c Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 3 Feb 2020 16:16:45 +0100 Subject: [PATCH 58/88] remove profiling instrumentation --- internal/worker.zsh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/internal/worker.zsh b/internal/worker.zsh index a7db4596..ce38af98 100644 --- a/internal/worker.zsh +++ b/internal/worker.zsh @@ -135,12 +135,6 @@ function _p9k_worker_receive() { fi ;; e) - if (( start_time )); then - local -F end_time=EPOCHREALTIME - local -F3 latency=$((1000*(end_time-start_time))) - echo "latency: $latency ms" >>/tmp/log - start_time=0 - fi () { eval $arg } (( reset > max_reset )) && max_reset=reset ;; From 4095a018dc4149541a71ef05c38c681e50f7e0c0 Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 3 Feb 2020 17:42:04 +0100 Subject: [PATCH 59/88] basic asdf design --- internal/notes.txt | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/internal/notes.txt b/internal/notes.txt index a37fbaa2..f45137cd 100644 --- a/internal/notes.txt +++ b/internal/notes.txt @@ -8,3 +8,34 @@ disabling implicit reset on every eval in _p9k_worker_receive. - implement fake gitstatus api on top of vcs_info (or plain git?) + worker and use it if there is no gitstatus. + +## asdf + +- https://asdf-vm.com/#/core-configuration?id=environment-variables +- https://asdf-vm.com/#/core-configuration?id=tool-versions +- https://asdf-vm.com/#/core-configuration?id=homeasdfrc +- https://asdf-vm.com/#/plugins-create?id=binlist-legacy-filenames +- https://asdf-vm.com/#/plugins-create?id=binparse-legacy-file +- `print -lr -- ${ASDF_DATA_DIR:-~/.asdf}/plugins/*(/N:t)` +- `print -lr -- $(${ASDF_DATA_DIR:-~/.asdf}/plugins/ruby/bin/list-legacy-filenames)` +- `${ASDF_DATA_DIR:-~/.asdf}/plugins/ruby/bin/parse-legacy-file ~/powerlevel10k/test/foo/.ruby-version` + - if empty, keep looking +- deeper version overrides win +- .tool-versions wins over .ruby-version when in the same directory +- versions for different tools are looked up independently: if /foo/bar/.tool-versions doesn't + override "ruby" it's as if it doesn't exist as far as ruby version is concerned. +- ${ASDF_CONFIG_FILE:-~/.asdfrc} parsing: + opt="$( + grep -E "^\\s*legacy_version_file\\s*=\\s*" "$config_path" | + head | + awk -F '=' '{print $2}' | + sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" + [[ $opt == yes ]] + +Stat caches: +- ${ASDF_CONFIG_FILE:-~/.asdfrc} => legacy_version_file (yes or no) +- ${ASDF_DATA_DIR:-~/.asdf}/plugins => list of plugins +- ${ASDF_DATA_DIR:-~/.asdf}/plugins/ruby/bin => list of relevant scripts + (list-legacy-filenames and parse-legacy-file) +- ${ASDF_DATA_DIR:-~/.asdf}/plugins/ruby/bin/list-legacy-filenames => list (or pattern made from it?) +- /foo/bar => { tool => version } From 5e5ff583a36f3e1a26aa28e2e5631b55304153c1 Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 4 Feb 2020 13:07:05 +0100 Subject: [PATCH 60/88] extend the ZLE_RPROMPT_INDENT=0 workaround to a few more cases If the last right prompt line can be proven to always have zero length after prompt expansion, we can unset RPROMPT thus avoiding triggering zsh bugs related to ZLE_RPROMPT_INDENT=0. Fixes #458. --- internal/p10k.zsh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 476f65c1..53f1a896 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4752,6 +4752,8 @@ function _p9k_set_prompt() { _p9k_prompt_side= (( $#_p9k_cache < _POWERLEVEL9K_MAX_CACHE_SIZE )) || _p9k_cache=() (( $#_p9k__cache_ephemeral < _POWERLEVEL9K_MAX_CACHE_SIZE )) || _p9k__cache_ephemeral=() + + [[ -n $RPROMPT ]] || unset RPROMPT } _p9k_set_instant_prompt() { @@ -4761,6 +4763,7 @@ _p9k_set_instant_prompt() { typeset -g _p9k_instant_prompt=$PROMPT$'\x1f'$_p9k__prompt$'\x1f'$RPROMPT PROMPT=$saved_prompt RPROMPT=$saved_rprompt + [[ -n $RPROMPT ]] || unset RPROMPT } typeset -gri __p9k_instant_prompt_version=18 @@ -6327,6 +6330,13 @@ _p9k_init_lines() { [[ -n $_p9k_ret ]] && _p9k_line_never_empty_right+=1 || _p9k_line_never_empty_right+=0 _p9k_line_prefix_right+='${_p9k__'$i'r-${${:-${_p9k_bg::=NONE}${_p9k_i::=0}${_p9k_sss::='$_p9k_ret'}}+}' _p9k_line_suffix_right+='$_p9k_sss%b%k%f}' # gets overridden for _p9k_emulate_zero_rprompt_indent + if (( i == num_lines )); then + typeset -p i num_lines _p9k_ret + # it's safe to use _p9k_prompt_length on the last line because it cannot have prompt connection + _p9k_prompt_length ${(e)_p9k_ret} + typeset -p i num_lines _p9k_ret + (( _p9k_ret )) || _p9k_line_never_empty_right[-1]=0 + fi done _p9k_get_icon '' LEFT_SEGMENT_END_SEPARATOR @@ -6380,7 +6390,9 @@ _p9k_init_lines() { if [[ -n $_p9k_ret ]]; then [[ _p9k_ret == *%* ]] && _p9k_ret+=%b%k%f _p9k_line_suffix_right[-1]+='${_p9k__'$num_lines'r_frame-'${(qqq)_p9k_ret}'}' - _p9k_line_never_empty_right[-1]=1 + # it's safe to use _p9k_prompt_length on the last line because it cannot have prompt connection + _p9k_prompt_length $_p9k_ret + (( _p9k_ret )) && _p9k_line_never_empty_right[-1]=1 fi if (( num_lines > 2 )); then From 1ac3624463f229a8ec0214487d60b357aa753d0c Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 4 Feb 2020 15:43:25 +0100 Subject: [PATCH 61/88] progress on asdf design --- internal/notes.txt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/internal/notes.txt b/internal/notes.txt index f45137cd..37b59191 100644 --- a/internal/notes.txt +++ b/internal/notes.txt @@ -20,10 +20,13 @@ - `print -lr -- $(${ASDF_DATA_DIR:-~/.asdf}/plugins/ruby/bin/list-legacy-filenames)` - `${ASDF_DATA_DIR:-~/.asdf}/plugins/ruby/bin/parse-legacy-file ~/powerlevel10k/test/foo/.ruby-version` - if empty, keep looking +- ASDF_${upcase_name}_VERSION wins over everything - deeper version overrides win - .tool-versions wins over .ruby-version when in the same directory - versions for different tools are looked up independently: if /foo/bar/.tool-versions doesn't override "ruby" it's as if it doesn't exist as far as ruby version is concerned. +- after upglob look $HOME (same file patterns) +- finally look at $ASDF_DEFAULT_TOOL_VERSIONS_FILENAME (single file; parse it like .tool-versions) - ${ASDF_CONFIG_FILE:-~/.asdfrc} parsing: opt="$( grep -E "^\\s*legacy_version_file\\s*=\\s*" "$config_path" | @@ -38,4 +41,16 @@ Stat caches: - ${ASDF_DATA_DIR:-~/.asdf}/plugins/ruby/bin => list of relevant scripts (list-legacy-filenames and parse-legacy-file) - ${ASDF_DATA_DIR:-~/.asdf}/plugins/ruby/bin/list-legacy-filenames => list (or pattern made from it?) -- /foo/bar => { tool => version } +- /foo/bar => { tool => version } (permanent cache via stat cache) + +--- + +typeset -ga _p9k_asdf_meta_files=( + ${ASDF_CONFIG_FILE:-~/.asdfrc} + ${ASDF_DATA_DIR:-~/.asdf}/plugins + ${ASDF_DATA_DIR:-~/.asdf}/plugins/*/bin{,/list-legacy-filenames,/parse-legacy-file}(N) +) +typeset -g _p9k_asdf_meta_sig # $ASDF_CONFIG_FILE ':' $ASDF_DATA_DIR ':' $ASDF_DEFAULT_TOOL_VERSIONS_FILENAME ':' $ASDF_DEFAULT_TOOL_VERSIONS_FILENAME ':' ${(j.:.)mtimes} + +typeset -g _p9k_asdf_file_pat # example: '(.tool-versions|.ruby-version)' +typeset -gA _p9k_asdf_file_info # .ruby-version => ruby1 ('1' means parse-legacy-file is present) From afb7a59fbec06b23c4826c980a940c29d05b36b9 Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 4 Feb 2020 15:55:57 +0100 Subject: [PATCH 62/88] add contacts to docs --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index dee6ae3d..7b7c7572 100644 --- a/README.md +++ b/README.md @@ -528,6 +528,20 @@ The command to update Powerlevel10k depends on how it was installed. **IMPORTANT**: Restart Zsh after updating Powerlevel10k. [Do not use `source ~/.zshrc`]( #weird-things-happen-after-typing-source-zshrc). +### 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). + +[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). + ### Which aspects of shell and terminal does Powerlevel10k affect? Powerlevel10k defines prompt and nothing else. It sets [prompt-related options]( @@ -1384,6 +1398,7 @@ There are a few mitigation options for this issue. - [License](#license) - [FAQ](#faq) - [How do I update Powerlevel10k?](#how-do-i-update-powerlevel10k) + - [Where can I ask for help and report bugs?](#where-can-i-ask-for-help-and-report-bugs) - [Which aspects of shell and terminal does Powerlevel10k affect?](#which-aspects-of-shell-and-terminal-does-powerlevel10k-affect) - [I'm using Powerlevel9k with Oh My Zsh. How do I migrate?](#im-using-powerlevel9k-with-oh-my-zsh-how-do-i-migrate) - [Is it really fast?](#is-it-really-fast) From 47e8c1b38cf8f643f6540c3c1d4f297cfe708891 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 4 Feb 2020 18:11:41 +0100 Subject: [PATCH 63/88] remove debug messages; fixes #466 --- internal/p10k.zsh | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 53f1a896..9ba33a78 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6331,10 +6331,8 @@ _p9k_init_lines() { _p9k_line_prefix_right+='${_p9k__'$i'r-${${:-${_p9k_bg::=NONE}${_p9k_i::=0}${_p9k_sss::='$_p9k_ret'}}+}' _p9k_line_suffix_right+='$_p9k_sss%b%k%f}' # gets overridden for _p9k_emulate_zero_rprompt_indent if (( i == num_lines )); then - typeset -p i num_lines _p9k_ret # it's safe to use _p9k_prompt_length on the last line because it cannot have prompt connection _p9k_prompt_length ${(e)_p9k_ret} - typeset -p i num_lines _p9k_ret (( _p9k_ret )) || _p9k_line_never_empty_right[-1]=0 fi done From f7645af7e38c2ee8b5bbcd63c5cd342bcf308c68 Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 5 Feb 2020 09:27:39 +0100 Subject: [PATCH 64/88] add wifi prompt segment to docs --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7b7c7572..96dc1f9a 100644 --- a/README.md +++ b/README.md @@ -304,6 +304,7 @@ enable as many segments as you like. It won't slow down your prompt or Zsh start | `swap` | used swap | | `public_ip` | public ip address | | `proxy` | system-wide http/https/ftp proxy | +| `wifi` | WiFi speed | | `battery` | internal battery state and charge level (yep, batteries *literally* included) | ## Installation From 27b25196d8815f08391a6ff97abc72509305c4a2 Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 5 Feb 2020 09:52:53 +0100 Subject: [PATCH 65/88] comments --- internal/p10k.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 9ba33a78..ac9e3bc9 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1312,6 +1312,7 @@ _p9k_prompt_battery_set_args() { ;; Linux|Android) + # See https://sourceforge.net/projects/acpiclient. local -a bats=( /sys/class/power_supply/(BAT*|battery)/(FN) ) (( $#bats )) || return From e2571dc95a432d443999d45a1606f4ed8890d36c Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 5 Feb 2020 12:26:05 +0100 Subject: [PATCH 66/88] comments --- internal/p10k.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index ac9e3bc9..ca88207d 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4554,6 +4554,7 @@ function _p9k_prompt_net_iface_compute() { } function _p9k_prompt_net_iface_async() { + # netstat -inbI en0 local iface ip line var typeset -A iface2ip if [[ -x /sbin/ifconfig ]]; then From a12f7ac8eefd47cd9b58b0ff77c576e194029a0c Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 5 Feb 2020 12:50:51 +0100 Subject: [PATCH 67/88] when the user's locale is misconfigured, set it to utf8 at the top level fixes #469 --- internal/icons.zsh | 8 -------- internal/p10k.zsh | 36 +++++++++++++++++++++++++----------- internal/wizard.zsh | 7 ------- powerlevel10k.zsh-theme | 4 ++-- 4 files changed, 27 insertions(+), 28 deletions(-) diff --git a/internal/icons.zsh b/internal/icons.zsh index 012c520a..9c672b38 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -3,12 +3,6 @@ typeset -gA icons function _p9k_init_icons() { [[ $+_p9k_icon_mode == 1 && $_p9k_icon_mode == $POWERLEVEL9K_MODE/$POWERLEVEL9K_LEGACY_ICON_SPACING ]] && return typeset -g _p9k_icon_mode=$POWERLEVEL9K_MODE/$POWERLEVEL9K_LEGACY_ICON_SPACING - zmodload zsh/langinfo - if [[ ${langinfo[CODESET]:-} != (utf|UTF)(-|)8 ]]; then - typeset -g _p9k_locale=${${(@M)$(locale -a):#*.(utf|UTF)(-|)8}[1]:-en_US.UTF-8} - else - typeset -g _p9k_locale= - fi if [[ $POWERLEVEL9K_LEGACY_ICON_SPACING == true ]]; then local s= @@ -614,7 +608,6 @@ function _p9k_init_icons() { # Sadly, this is a part of public API. Its use is emphatically discouraged. function _p9k_print_icon() { _p9k_init_icons - [[ -z $_p9k_locale ]] || local LC_ALL=$_p9k_locale local icon_name=$1 local var_name=POWERLEVEL9K_${icon_name} if [[ -n "${(tP)var_name}" ]]; then @@ -631,7 +624,6 @@ function _p9k_print_icon() { # overrides into account. function _p9k_get_icon_names() { _p9k_init_icons - [[ -z $_p9k_locale ]] || local LC_ALL=$_p9k_locale # Iterate over a ordered list of keys of the icons array for key in ${(@kon)icons}; do echo -n "POWERLEVEL9K_$key: " diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 9ba33a78..e2a98408 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1,4 +1,4 @@ -if [[ $__p9k_sourced != 4 ]]; then +if [[ $__p9k_sourced != 5 ]]; then >&2 print -P "" >&2 print -P "[%F{1}ERROR%f]: Corrupted powerlevel10k installation." >&2 print -P "" @@ -140,6 +140,10 @@ function getColorCode() { # Sadly, this is a part of public API. Its use is emphatically discouraged. function print_icon() { eval "$__p9k_intro" + if (( ! $+_p9k__locale )); then + _p9k_init_locale + [[ -z $_p9k__locale ]] || local LC_ALL=$_p9k__locale + fi (( $+functions[_p9k_print_icon] )) || source "${__p9k_root_dir}/internal/icons.zsh" _p9k_print_icon "$@" } @@ -151,6 +155,10 @@ function print_icon() { # overrides into account. function get_icon_names() { eval "$__p9k_intro" + if (( ! $+_p9k__locale )); then + _p9k_init_locale + [[ -z $_p9k__locale ]] || local LC_ALL=$_p9k__locale + fi (( $+functions[_p9k_get_icon_names] )) || source "${__p9k_root_dir}/internal/icons.zsh" _p9k_get_icon_names "$@" } @@ -188,7 +196,6 @@ function _p9k_declare() { (( set )) && typeset -g _$2=${(P)2} || typeset -g _$2=$3 ;; -e) - [[ -z $_p9k_locale ]] || local LC_ALL=$_p9k_locale if (( set )); then local v=${(P)2} typeset -g _$2=${(g::)v} @@ -529,7 +536,6 @@ _p9k_get_icon() { if [[ $_p9k_ret == $'\1'* ]]; then _p9k_ret=${_p9k_ret[2,-1]} else - [[ -z $_p9k_locale ]] || local LC_ALL=$_p9k_locale _p9k_ret=${(g::)_p9k_ret} [[ $_p9k_ret != $'\b'? ]] || _p9k_ret="%{$_p9k_ret%}" # penance for past sins fi @@ -767,7 +773,6 @@ _p9k_left_prompt_segment() { p+='${${_p9k_e:#00}:+${${_p9k_t[$_p9k_n]/'$ss'/$_p9k_ss}/'$s'/$_p9k_s}' - [[ -z $_p9k_locale ]] || local LC_ALL=$_p9k_locale _p9k_param $1 ICON_BEFORE_CONTENT '' if [[ $_p9k_ret != false ]]; then _p9k_param $1 PREFIX '' @@ -988,7 +993,6 @@ _p9k_right_prompt_segment() { p+='${${_p9k_e:#00}:+${_p9k_t[$_p9k_n]/'$w'/$_p9k_w}' - [[ -z $_p9k_locale ]] || local LC_ALL=$_p9k_locale _p9k_param $1 ICON_BEFORE_CONTENT '' if [[ $_p9k_ret != true ]]; then _p9k_param $1 PREFIX '' @@ -1503,7 +1507,6 @@ prompt_context() { if [[ -z $text ]]; then local var=_POWERLEVEL9K_CONTEXT_${state}_TEMPLATE if (( $+parameters[$var] )); then - [[ -z $_p9k_locale ]] || local LC_ALL=$_p9k_locale text=${(P)var} text=${(g::)text} else @@ -1677,7 +1680,6 @@ prompt_dir() { fi local -i fake_first=0 expand=0 - [[ -z $_p9k_locale ]] || local LC_ALL=$_p9k_locale local delim=${_POWERLEVEL9K_SHORTEN_DELIMITER-$'\u2026'} local -i shortenlen=${_POWERLEVEL9K_SHORTEN_DIR_LENGTH:--1} @@ -4804,7 +4806,7 @@ _p9k_dump_instant_prompt() { local prompt_dir=${(q)prompt_dir} zmodload zsh/langinfo if [[ \${langinfo[CODESET]:-} != (utf|UTF)(-|)8 ]]; then - local lc=${(q)${${${_p9k_locale:-${(M)LC_CTYPE:#*.(utf|UTF)(-|)8}}:-${(M)LC_ALL:#*.(utf|UTF)(-|)8}}}:-${(M)LANG:#*.(utf|UTF)(-|)8}} + local lc=${(q)${${${_p9k__locale:-${(M)LC_CTYPE:#*.(utf|UTF)(-|)8}}:-${(M)LC_ALL:#*.(utf|UTF)(-|)8}}}:-${(M)LANG:#*.(utf|UTF)(-|)8}} local LC_ALL=\${lc:-\${\${(@M)\$(locale -a 2>/dev/null):#*.(utf|UTF)(-|)8}[1]:-en_US.UTF-8}} fi" >&$fd print -r -- ' @@ -5417,6 +5419,11 @@ _p9k_precmd_impl() { (( __p9k_enabled )) || return + if (( ! $+_p9k__locale )); then + _p9k_init_locale + [[ -z $_p9k__locale ]] || local LC_ALL=$_p9k__locale + fi + if ! zle || [[ -z $_p9k__param_sig ]]; then if zle; then __p9k_new_status=0 @@ -5562,6 +5569,15 @@ function _p9k_prompt_overflow_bug() { is-at-least 5.5 && ! is-at-least 5.7.2 } +function _p9k_init_locale() { + zmodload zsh/langinfo + if [[ ${langinfo[CODESET]:-} != (utf|UTF)(-|)8 ]]; then + typeset -g _p9k__locale=${${(@M)$(locale -a):#*.(utf|UTF)(-|)8}[1]:-en_US.UTF-8} + else + typeset -g _p9k__locale= + fi +} + typeset -g _p9k__param_pat typeset -g _p9k__param_sig @@ -6289,7 +6305,6 @@ _p9k_build_gap_post() { } _p9k_init_lines() { - [[ -z $_p9k_locale ]] || local LC_ALL=$_p9k_locale local -a left_segments=($_POWERLEVEL9K_LEFT_PROMPT_ELEMENTS) local -a right_segments=($_POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS) @@ -6586,7 +6601,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v36\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v37\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$DEFAULT_USER\1${ZLE_RPROMPT_INDENT:-1}\1$P9K_SSH\1$__p9k_ksh_arrays' @@ -6748,7 +6763,6 @@ function _p9k_init_cacheable() { if _p9k_segment_in_use dir; then if (( $+_POWERLEVEL9K_DIR_CLASSES )); then - [[ -z $_p9k_locale ]] || local LC_ALL=$_p9k_locale local -i i=3 for ((; i <= $#_POWERLEVEL9K_DIR_CLASSES; i+=3)); do _POWERLEVEL9K_DIR_CLASSES[i]=${(g::)_POWERLEVEL9K_DIR_CLASSES[i]} diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 016ab84e..66150bb0 100755 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1,10 +1,3 @@ -zmodload zsh/langinfo -if [[ ${langinfo[CODESET]:-} != (utf|UTF)(-|)8 ]]; then - local LC_ALL=${${(@M)$(locale -a):#*.(utf|UTF)(-|)8}[1]:-en_US.UTF-8} -fi - -zmodload -F zsh/files b:zf_mv b:zf_rm - local -i force=0 local opt diff --git a/powerlevel10k.zsh-theme b/powerlevel10k.zsh-theme index fd01648a..9bb680fe 100644 --- a/powerlevel10k.zsh-theme +++ b/powerlevel10k.zsh-theme @@ -23,7 +23,7 @@ local -a match mbegin mend reply local -i MBEGIN MEND OPTIND local MATCH REPLY OPTARG IFS=$'\'' \t\n\0'\'' - [[ -z $_p9k_locale ]] || local LC_ALL=$_p9k_locale' + [[ -z $_p9k__locale ]] || local LC_ALL=$_p9k__locale' () { eval "$__p9k_intro" @@ -35,7 +35,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file ]] && (( ! $+functions[_p9k_preinit] )) && source $__p9k_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then _p9k_preinit fi - typeset -gr __p9k_sourced=4 + typeset -gr __p9k_sourced=5 if [[ -w $__p9k_root_dir && -w $__p9k_root_dir/internal && -w $__p9k_root_dir/gitstatus && ${(%):-%#} == % ]]; then local f for f in $__p9k_root_dir/{powerlevel9k.zsh-theme,powerlevel10k.zsh-theme,internal/p10k.zsh,internal/icons.zsh,internal/configure.zsh,internal/worker.zsh,internal/parser.zsh,gitstatus/gitstatus.plugin.zsh}; do From 7354eeaa96e04eaec8e2a9a33801e26c88df3c68 Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 5 Feb 2020 14:37:43 +0100 Subject: [PATCH 68/88] workaround for a bug in sysread There is a bug in sysread from zsh/system. It triggers in the following case: 1. zsh has been compiled with HAVE_SELECT and without HAVE_POLL. 2. sysread is called with timeout (-t). 3. the input file descriptor is valid but there is no data to read. 4. errno happens to be EINTR prior to the call to sysread. This results in an infinite loop in sysread: while ((ret = select(infd+1, (SELECT_ARG_2_T) &fds, NULL, NULL,&select_tv)) < 1) { if (errno != EINTR || errflag || retflag || breaks || contflag) break; } Here select() keeps returning 0, indicating timeout. This is not an error, so errno doesn't get set. If it was EINTR prior to the call, it stays EINTR, and the loop keeps spinning. As a workaround, powerlevel10k sets errno to ENOTTY (any value other than EINTR will do) prior to calling sysread with timeout. --- internal/p10k.zsh | 37 +++++++++++++++++++++---------------- internal/worker.zsh | 2 ++ 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index e2a98408..912a990e 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4154,22 +4154,27 @@ function _p9k_fetch_nordvpn_status() { >&$fd echo -nE - $'PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n\0\0\0\4\1\0\0\0\0\0\0N\1\4\0\0\0\1\203\206E\221bA\226\223\325\\k\337\31i=LnH\323j?A\223\266\243y\270\303\fYmLT{$\357]R.\203\223\257_\213\35u\320b\r&=LMedz\212\232\312\310\264\307`+\210K\203@\2te\206M\2035\5\261\37\0\0\5\0\1\0\0\0\1\0\0\0\0\0' local tag len val local -i n - IFS='' read -t 0.25 -r tag <&3 - tag=$'\015' - while true; do - tag=$((#tag)) - (( (tag >>= 3) && tag <= $#__p9k_nordvpn_tag )) || break - tag=$__p9k_nordvpn_tag[tag] - sysread -c n -s 1 -t 0.25 len <&3 - len=$((#len)) - val= - (( ! len )) || { - sysread -c n -s $len -t 0.25 val <&3 - (( n == len )) - } - typeset -g $tag=$val - sysread -c n -s 1 -t 0.25 tag <&3 - done + { + IFS='' read -t 0.25 -r tag + tag=$'\015' + while true; do + tag=$((#tag)) + (( (tag >>= 3) && tag <= $#__p9k_nordvpn_tag )) || break + tag=$__p9k_nordvpn_tag[tag] + [[ -t $fd ]] || true + sysread -c n -s 1 -t 0.25 len + len=$((#len)) + val= + (( ! len )) || { + [[ -t $fd ]] || true + sysread -c n -s $len -t 0.25 val + (( n == len )) + } + typeset -g $tag=$val + [[ -t $fd ]] || true + sysread -c n -s 1 -t 0.25 tag + done + } <&$fd } always { exec {fd}>&- } diff --git a/internal/worker.zsh b/internal/worker.zsh index ce38af98..cca786fc 100644 --- a/internal/worker.zsh +++ b/internal/worker.zsh @@ -34,6 +34,7 @@ function _p9k_worker_main() { if [[ $fd == 0 ]]; then local buf= while true; do + [[ -t 0 ]] sysread -t 0 'buf[$#buf+1]' && continue (( $? == 4 )) || return [[ $buf[-1] == (|$'\x1e') ]] && break @@ -115,6 +116,7 @@ function _p9k_worker_receive() { local buf resp while true; do + [[ -t $_p9k__worker_resp_fd ]] sysread -t 0 -i $_p9k__worker_resp_fd 'buf[$#buf+1]' && continue (( $? == 4 )) || return [[ $buf == (|*$'\x1e')$'\x05'# ]] && break From d9b9aa43833f03987d16130b5c5fb259880869f6 Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 5 Feb 2020 16:22:44 +0100 Subject: [PATCH 69/88] add network bandwidth stats to `ip` segment --- internal/p10k.zsh | 82 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 70 insertions(+), 12 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 912a990e..4fc1da58 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -2067,7 +2067,7 @@ _p9k_prompt_detect_virt_init() { # Segment to display the current IP address prompt_ip() { local -i len=$#_p9k__prompt - _p9k_prompt_segment "$0" "cyan" "$_p9k_color1" 'NETWORK_ICON' 1 '$_p9k__ip_ip' '$_p9k__ip_ip' + _p9k_prompt_segment "$0" "cyan" "$_p9k_color1" 'NETWORK_ICON' 1 '$P9K_IP_IP' '$P9K_IP_IP' typeset -g "_p9k__segment_val_${_p9k_prompt_side}[_p9k_segment_index]"=$_p9k__prompt[len+1,-1] } @@ -4540,15 +4540,21 @@ _p9k_preexec2() { function _p9k_prompt_net_iface_init() { typeset -g _p9k__public_ip_vpn= typeset -g _p9k__public_ip_not_vpn= - typeset -g _p9k__ip_ip= + typeset -g P9K_IP_IP= + typeset -g P9K_IP_INTERFACE= + typeset -g P9K_IP_TX_BYTES= + typeset -g P9K_IP_RX_BYTES= + typeset -g P9K_IP_TX_RATE= + typeset -g P9K_IP_RX_RATE= + typeset -g _p9__ip_timestamp= typeset -g _p9k__vpn_ip_ip= [[ -z $_POWERLEVEL9K_PUBLIC_IP_VPN_INTERFACE ]] && _p9k__public_ip_not_vpn=1 _p9k__async_segments_compute+=_p9k_prompt_net_iface_compute } -# reads `iface2ip` and sets `ip` +# reads `iface2ip` and sets `iface` and `ip` function _p9k_prompt_net_iface_match() { - local iface_regex="^($1)\$" iface + local iface_regex="^($1)\$" for iface ip in "${(@kv)iface2ip}"; do [[ $iface =~ $iface_regex ]] && return done @@ -4561,13 +4567,13 @@ function _p9k_prompt_net_iface_compute() { function _p9k_prompt_net_iface_async() { local iface ip line var - typeset -A iface2ip + typeset -a iface2ip if [[ -x /sbin/ifconfig ]]; then for line in ${(f)"$(/sbin/ifconfig 2>/dev/null)"}; do if [[ $line == (#b)([^[:space:]]##):[[:space:]]##flags=(<->)'<'* ]]; then [[ $match[2] == *[13579] ]] && iface=$match[1] || iface= elif [[ -n $iface && $line == (#b)[[:space:]]##inet[[:space:]]##([0-9.]##)* ]]; then - iface2ip[$iface]=$match[1] + iface2ip+=($iface $match[1]) iface= fi done @@ -4576,7 +4582,7 @@ function _p9k_prompt_net_iface_async() { 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] + iface2ip+=($iface $match[1]) iface= fi done @@ -4590,9 +4596,40 @@ function _p9k_prompt_net_iface_async() { local public_ip_not_vpn=1 fi if _p9k_prompt_net_iface_match $_POWERLEVEL9K_IP_INTERFACE; then - local ip_ip=$ip + local ip_ip=$ip ip_interface=$iface ip_timestamp=$EPOCHREALTIME + local ip_tx_bytes=0 ip_rx_bytes=0 ip_tx_rate='0 Bps' ip_rx_rate='0 Bps' + if [[ $_p9k_os == (Linux|Android) ]]; then + if [[ -r /sys/class/net/$iface/statistics/rx_bytes ]] && + _p9k_read_file /sys/class/net/$iface/statistics/rx_bytes; then + ip_rx_bytes=$_p9k_ret + fi + if [[ -r /sys/class/net/$iface/statistics/tx_bytes ]] && + _p9k_read_file /sys/class/net/$iface/statistics/tx_bytes; then + ip_tx_bytes=$_p9k_ret + fi + elif [[ $_p9k_os == (BSD|OSX) && $commands[netstat] == 1 ]]; then + local -a ns + if ns="$(netstat -inbI $iface)"; then + for line in ${${(f)ns}:1}; do + (( ip_rx_bytes += ${line[(w)8]} )) + (( ip_tx_bytes += ${line[(w)11]} )) + done + fi + fi + if [[ $ip_ip == $P9K_IP_IP && $iface == $P9K_IP_INTERFACE ]]; then + local -F t='ip_timestamp - _p9__ip_timestamp' + if (( t <= 0 )); then + ip_tx_rate=$P9K_IP_TX_RATE + ip_rx_rate=$P9K_IP_RX_RATE + else + _p9k_human_readable_bytes $((8 * (ip_tx_bytes - P9K_IP_TX_BYTES) / t)) + ip_tx_rate="$_p9k_ret[1,-2] $_p9k_ret[-1]bps" + _p9k_human_readable_bytes $((8 * (ip_rx_bytes - P9K_IP_RX_BYTES) / t)) + ip_rx_rate="$_p9k_ret[1,-2] $_p9k_ret[-1]bps" + fi + fi else - local ip_ip= + local ip_ip= ip_interface= ip_tx_bytes= ip_rx_bytes= ip_tx_rate= ip_rx_rate= ip_timestamp= fi if _p9k_prompt_net_iface_match $_POWERLEVEL9K_VPN_IP_INTERFACE; then local vpn_ip_ip=$ip @@ -4601,13 +4638,34 @@ function _p9k_prompt_net_iface_async() { fi [[ $_p9k__public_ip_vpn == $public_ip_vpn && $_p9k__public_ip_not_vpn == $public_ip_not_vpn && - $_p9k__ip_ip == $ip_ip && + $P9K_IP_IP == $ip_ip && + $P9K_IP_INTERFACE == $ip_interface && + $P9K_IP_TX_BYTES == $ip_tx_bytes && + $P9K_IP_RX_BYTES == $ip_rx_bytes && + $P9K_IP_TX_RATE == $ip_tx_rate && + $P9K_IP_RX_RATE == $ip_rx_rate && $_p9k__vpn_ip_ip == $vpn_ip_ip ]] && return 1 _p9k__public_ip_vpn=$public_ip_vpn _p9k__public_ip_not_vpn=$public_ip_not_vpn - _p9k__ip_ip=$ip_ip + P9K_IP_IP=$ip_ip + P9K_IP_INTERFACE=$ip_interface + P9K_IP_TX_BYTES=$ip_tx_bytes + P9K_IP_RX_BYTES=$ip_rx_bytes + P9K_IP_TX_RATE=$ip_tx_rate + P9K_IP_RX_RATE=$ip_rx_rate + _p9__ip_timestamp=$ip_timestamp _p9k__vpn_ip_ip=$vpn_ip_ip - _p9k_print_params _p9k__public_ip_vpn _p9k__public_ip_not_vpn _p9k__ip_ip _p9k__vpn_ip_ip + _p9k_print_params \ + _p9k__public_ip_vpn \ + _p9k__public_ip_not_vpn \ + P9K_IP_IP \ + P9K_IP_INTERFACE \ + P9K_IP_TX_BYTES \ + P9K_IP_RX_BYTES \ + P9K_IP_TX_RATE \ + P9K_IP_RX_RATE \ + _p9__ip_timestamp \ + _p9k__vpn_ip_ip echo -E - 'reset=1' } From 80015c7c71d0ff8aa2b26655a576b70f3b089025 Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 5 Feb 2020 16:33:46 +0100 Subject: [PATCH 70/88] fix netstat parsing on macos --- internal/p10k.zsh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 4fc1da58..34663187 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4608,11 +4608,14 @@ function _p9k_prompt_net_iface_async() { ip_tx_bytes=$_p9k_ret fi elif [[ $_p9k_os == (BSD|OSX) && $commands[netstat] == 1 ]]; then - local -a ns - if ns="$(netstat -inbI $iface)"; then - for line in ${${(f)ns}:1}; do - (( ip_rx_bytes += ${line[(w)8]} )) - (( ip_tx_bytes += ${line[(w)11]} )) + local -a lines + if lines=(${(f)"$(netstat -inbI $iface)"}); then + local header=($=lines[1]) + local -i rx_idx=$header[(Ie)Ibytes] + local -i tx_idx=$header[(Ie)Obytes] + for line in ${lines:1}; do + (( ip_rx_bytes += ${line[(w)rx_idx]} )) + (( ip_tx_bytes += ${line[(w)tx_idx]} )) done fi fi From 01cce2c4eb91bbcfa08394b452f88b872df356f5 Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 5 Feb 2020 16:38:09 +0100 Subject: [PATCH 71/88] fix netstat parsing on macos --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 34663187..7fe3f237 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4607,7 +4607,7 @@ function _p9k_prompt_net_iface_async() { _p9k_read_file /sys/class/net/$iface/statistics/tx_bytes; then ip_tx_bytes=$_p9k_ret fi - elif [[ $_p9k_os == (BSD|OSX) && $commands[netstat] == 1 ]]; then + elif [[ $_p9k_os == (BSD|OSX) && $+commands[netstat] == 1 ]]; then local -a lines if lines=(${(f)"$(netstat -inbI $iface)"}); then local header=($=lines[1]) From 75e5712cd036feb13307abdcbca71f634bed1ecd Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 5 Feb 2020 17:26:16 +0100 Subject: [PATCH 72/88] slightly shorter bandwidth display --- internal/p10k.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 7fe3f237..d44417b2 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4597,7 +4597,7 @@ function _p9k_prompt_net_iface_async() { fi if _p9k_prompt_net_iface_match $_POWERLEVEL9K_IP_INTERFACE; then local ip_ip=$ip ip_interface=$iface ip_timestamp=$EPOCHREALTIME - local ip_tx_bytes=0 ip_rx_bytes=0 ip_tx_rate='0 Bps' ip_rx_rate='0 Bps' + local ip_tx_bytes=0 ip_rx_bytes=0 ip_tx_rate='0 B/s' ip_rx_rate='0 B/s' if [[ $_p9k_os == (Linux|Android) ]]; then if [[ -r /sys/class/net/$iface/statistics/rx_bytes ]] && _p9k_read_file /sys/class/net/$iface/statistics/rx_bytes; then @@ -4625,10 +4625,10 @@ function _p9k_prompt_net_iface_async() { ip_tx_rate=$P9K_IP_TX_RATE ip_rx_rate=$P9K_IP_RX_RATE else - _p9k_human_readable_bytes $((8 * (ip_tx_bytes - P9K_IP_TX_BYTES) / t)) - ip_tx_rate="$_p9k_ret[1,-2] $_p9k_ret[-1]bps" - _p9k_human_readable_bytes $((8 * (ip_rx_bytes - P9K_IP_RX_BYTES) / t)) - ip_rx_rate="$_p9k_ret[1,-2] $_p9k_ret[-1]bps" + _p9k_human_readable_bytes $(((ip_tx_bytes - P9K_IP_TX_BYTES) / t)) + [[ $_p9k_ret == *B ]] && ip_tx_rate="$_p9k_ret[1,-2] B/s" || ip_tx_rate="$_p9k_ret[1,-2] $_p9k_ret[-1]iB/s" + _p9k_human_readable_bytes $(((ip_rx_bytes - P9K_IP_RX_BYTES) / t)) + [[ $_p9k_ret == *B ]] && ip_rx_rate="$_p9k_ret[1,-2] B/s" || ip_rx_rate="$_p9k_ret[1,-2] $_p9k_ret[-1]iB/s" fi fi else From 73e24180a037016ffdddcddd154d962ff6bac247 Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 5 Feb 2020 17:26:28 +0100 Subject: [PATCH 73/88] add `ip` to config templates --- config/p10k-classic.zsh | 25 +++++++++++++++++++++++-- config/p10k-lean-8colors.zsh | 25 +++++++++++++++++++++++-- config/p10k-lean.zsh | 25 +++++++++++++++++++++++-- config/p10k-rainbow.zsh | 26 ++++++++++++++++++++++++-- 4 files changed, 93 insertions(+), 8 deletions(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 8801de27..f248d005 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -90,6 +90,7 @@ # time # current time # =========================[ Line #2 ]========================= newline # \n + # ip # ip address and bandwidth usage for a specified network interface # public_ip # public IP address # proxy # system-wide http/https/ftp proxy # battery # internal battery @@ -1085,12 +1086,32 @@ # When on VPN, show just an icon without the IP address. # Tip: To display the private IP address when on VPN, remove the next line. typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= - # Regular expression for the VPN network interface. Run ifconfig while on VPN to see the - # name of the interface. + # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN + # to see the name of the interface. typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(wg|(.*tun))[0-9]*' # Custom icon. # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + ###########[ ip: ip address and bandwidth usage for a specified network interface ]########### + # IP color. + typeset -g POWERLEVEL9K_IP_FOREGROUND=38 + # The following parameters are accessible within the expansion: + # + # Parameter | Meaning + # ----------------------+--------------- + # P9K_IP_IP | IP address + # P9K_IP_INTERFACE | network interface + # P9K_IP_RX_BYTES | total number of bytes received + # P9K_IP_TX_BYTES | total number of bytes sent + # P9K_IP_RX_RATE | receive rate (since last prompt) + # P9K_IP_TX_RATE | send rate (since last prompt) + typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='%70F⇣$P9K_IP_RX_RATE %215F⇡$P9K_IP_TX_RATE %38F$P9K_IP_IP' + # Show information for the first network interface whose name matches this regular expression. + # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. + typeset -g POWERLEVEL9K_IP_INTERFACE='e.*' + # Custom icon. + # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + #########################[ proxy: system-wide http/https/ftp proxy ]########################## # Proxy color. typeset -g POWERLEVEL9K_PROXY_FOREGROUND=68 diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index f34d2680..03051490 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -89,6 +89,7 @@ # time # current time # =========================[ Line #2 ]========================= newline # \n + # ip # ip address and bandwidth usage for a specified network interface # public_ip # public IP address # proxy # system-wide http/https/ftp proxy # battery # internal battery @@ -1064,12 +1065,32 @@ # When on VPN, show just an icon without the IP address. # Tip: To display the private IP address when on VPN, remove the next line. typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= - # Regular expression for the VPN network interface. Run ifconfig while on VPN to see the - # name of the interface. + # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN + # to see the name of the interface. typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(wg|(.*tun))[0-9]*' # Custom icon. # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + ###########[ ip: ip address and bandwidth usage for a specified network interface ]########### + # IP color. + typeset -g POWERLEVEL9K_IP_FOREGROUND=4 + # The following parameters are accessible within the expansion: + # + # Parameter | Meaning + # ----------------------+--------------- + # P9K_IP_IP | IP address + # P9K_IP_INTERFACE | network interface + # P9K_IP_RX_BYTES | total number of bytes received + # P9K_IP_TX_BYTES | total number of bytes sent + # P9K_IP_RX_RATE | receive rate (since last prompt) + # P9K_IP_TX_RATE | send rate (since last prompt) + typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='$P9K_IP_IP %2F⇣$P9K_IP_RX_RATE %3F⇡$P9K_IP_TX_RATE' + # Show information for the first network interface whose name matches this regular expression. + # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. + typeset -g POWERLEVEL9K_IP_INTERFACE='e.*' + # Custom icon. + # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + #########################[ proxy: system-wide http/https/ftp proxy ]########################## # Proxy color. typeset -g POWERLEVEL9K_PROXY_FOREGROUND=2 diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 48bf1e26..81d0d429 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -89,6 +89,7 @@ # time # current time # =========================[ Line #2 ]========================= newline + # ip # ip address and bandwidth usage for a specified network interface # public_ip # public IP address # proxy # system-wide http/https/ftp proxy # battery # internal battery @@ -1064,12 +1065,32 @@ # When on VPN, show just an icon without the IP address. # Tip: To display the private IP address when on VPN, remove the next line. typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= - # Regular expression for the VPN network interface. Run ifconfig while on VPN to see the - # name of the interface. + # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN + # to see the name of the interface. typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(wg|(.*tun))[0-9]*' # Custom icon. # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + ###########[ ip: ip address and bandwidth usage for a specified network interface ]########### + # IP color. + typeset -g POWERLEVEL9K_IP_FOREGROUND=38 + # The following parameters are accessible within the expansion: + # + # Parameter | Meaning + # ----------------------+--------------- + # P9K_IP_IP | IP address + # P9K_IP_INTERFACE | network interface + # P9K_IP_RX_BYTES | total number of bytes received + # P9K_IP_TX_BYTES | total number of bytes sent + # P9K_IP_RX_RATE | receive rate (since last prompt) + # P9K_IP_TX_RATE | send rate (since last prompt) + typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='$P9K_IP_IP %70F⇣$P9K_IP_RX_RATE %215F⇡$P9K_IP_TX_RATE' + # Show information for the first network interface whose name matches this regular expression. + # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. + typeset -g POWERLEVEL9K_IP_INTERFACE='e.*' + # Custom icon. + # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + #########################[ proxy: system-wide http/https/ftp proxy ]########################## # Proxy color. typeset -g POWERLEVEL9K_PROXY_FOREGROUND=68 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 426973ea..006461e9 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -90,6 +90,7 @@ # time # current time # =========================[ Line #2 ]========================= newline + # ip # ip address and bandwidth usage for a specified network interface # public_ip # public IP address # proxy # system-wide http/https/ftp proxy # battery # internal battery @@ -1127,12 +1128,33 @@ # When on VPN, show just an icon without the IP address. # Tip: To display the private IP address when on VPN, remove the next line. typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= - # Regular expression for the VPN network interface. Run ifconfig while on VPN to see the - # name of the interface. + # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN + # to see the name of the interface. typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(wg|(.*tun))[0-9]*' # Custom icon. # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + ###########[ ip: ip address and bandwidth usage for a specified network interface ]########### + # IP color. + typeset -g POWERLEVEL9K_IP_BACKGROUND=4 + typeset -g POWERLEVEL9K_IP_FOREGROUND=0 + # The following parameters are accessible within the expansion: + # + # Parameter | Meaning + # ----------------------+--------------- + # P9K_IP_IP | IP address + # P9K_IP_INTERFACE | network interface + # P9K_IP_RX_BYTES | total number of bytes received + # P9K_IP_TX_BYTES | total number of bytes sent + # P9K_IP_RX_RATE | receive rate (since last prompt) + # P9K_IP_TX_RATE | send rate (since last prompt) + typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='⇣$P9K_IP_RX_RATE ⇡$P9K_IP_TX_RATE $P9K_IP_IP' + # Show information for the first network interface whose name matches this regular expression. + # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. + typeset -g POWERLEVEL9K_IP_INTERFACE='e.*' + # Custom icon. + # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + #########################[ proxy: system-wide http/https/ftp proxy ]########################## # Proxy color. # typeset -g POWERLEVEL9K_PROXY_FOREGROUND=4 From be7e7b3b1583243f2408871c51a3946eafd179bf Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 5 Feb 2020 17:51:08 +0100 Subject: [PATCH 74/88] add `ip` to docs --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7b7c7572..cd04de9d 100644 --- a/README.md +++ b/README.md @@ -298,6 +298,7 @@ enable as many segments as you like. It won't slow down your prompt or Zsh start | `todo` | [todo](https://github.com/todotxt/todo.txt-cli) items | | `timewarrior` | [timewarrior](https://timewarrior.net/) tracking status | | `vpn_ip` | virtual private network indicator | +| `ip` | ip address and bandwidth usage for a specified network interface | | `load` | CPU load | | `disk_usage` | disk usage | | `ram` | free RAM | From a06bbdc1963be2981995ce1feddb1f94800759ae Mon Sep 17 00:00:00 2001 From: David Ward Date: Wed, 5 Feb 2020 15:00:56 -0500 Subject: [PATCH 75/88] respect TIMEWARRIORDB environment variable (#471) Signed-off-by: David Ward --- internal/p10k.zsh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index d44417b2..03558340 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4362,8 +4362,9 @@ function instant_prompt_direnv() { function prompt_timewarrior() { local -a stat + local timewarriordb=${TIMEWARRIORDB:-~/.timewarrior} if [[ -n $_p9k_timewarrior_file_name ]]; then - zstat -A stat +mtime -- ~/.timewarrior/data $_p9k_timewarrior_file_name 2>/dev/null || stat=() + zstat -A stat +mtime -- ${timewarriordb}/data $_p9k_timewarrior_file_name 2>/dev/null || stat=() if [[ $stat[1] == $_p9k_timewarrior_dir_mtime && $stat[2] == $_p9k_timewarrior_file_mtime ]]; then if (( $+_p9k_timewarrior_tags )); then _p9k_prompt_segment $0 grey 255 TIMEWARRIOR_ICON 0 '' "${_p9k_timewarrior_tags//\%/%%}" @@ -4371,7 +4372,7 @@ function prompt_timewarrior() { return fi fi - if [[ ! -d ~/.timewarrior/data ]]; then + if [[ ! -d ${timewarriordb}/data ]]; then _p9k_timewarrior_dir_mtime=0 _p9k_timewarrior_file_mtime=0 _p9k_timewarrior_file_name= @@ -4379,12 +4380,12 @@ function prompt_timewarrior() { return fi if [[ $stat[1] != $_p9k_timewarrior_dir_mtime ]]; then - local -a files=(~/.timewarrior/data/<->-<->.data(.N)) + local -a files=(${timewarriordb}/data/<->-<->.data(.N)) if (( ! $#files )); then - if (( $#stat )) || zstat -A stat +mtime -- ~/.timewarrior/data 2>/dev/null; then + if (( $#stat )) || zstat -A stat +mtime -- ${timewarriordb}/data 2>/dev/null; then _p9k_timewarrior_dir_mtime=$stat[1] _p9k_timewarrior_file_mtime=$stat[1] - _p9k_timewarrior_file_name=~/.timewarrior/data + _p9k_timewarrior_file_name=${timewarriordb}/data else _p9k_timewarrior_dir_mtime=0 _p9k_timewarrior_file_mtime=0 @@ -4395,7 +4396,7 @@ function prompt_timewarrior() { fi _p9k_timewarrior_file_name=${${(AO)files}[1]} fi - if ! zstat -A stat +mtime -- ~/.timewarrior/data $_p9k_timewarrior_file_name 2>/dev/null; then + if ! zstat -A stat +mtime -- ${timewarriordb}/data $_p9k_timewarrior_file_name 2>/dev/null; then _p9k_timewarrior_dir_mtime=0 _p9k_timewarrior_file_mtime=0 _p9k_timewarrior_file_name= From d7168759181d2b80689637b87083bca3e5279935 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 6 Feb 2020 08:44:03 +0100 Subject: [PATCH 76/88] replace terraform icon; several terminals have bugs that prevent them from rendering the current icon correctly --- internal/icons.zsh | 10 +++++----- internal/wizard.zsh | 2 -- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/internal/icons.zsh b/internal/icons.zsh index 9c672b38..f5f4065b 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -115,7 +115,7 @@ function _p9k_init_icons() { RANGER_ICON '\u2B50' # ⭐ MIDNIGHT_COMMANDER_ICON 'mc' VIM_ICON 'vim' - TERRAFORM_ICON '\U1F6E0\u00A0' # 🛠️ + TERRAFORM_ICON 'tf' PROXY_ICON '\u2B82' # ⮂ DOTNET_ICON '.NET' AZURE_ICON '\u2601' # ☁ @@ -228,7 +228,7 @@ function _p9k_init_icons() { RANGER_ICON '\u2B50' # ⭐ MIDNIGHT_COMMANDER_ICON 'mc' VIM_ICON 'vim' - TERRAFORM_ICON '\U1F6E0\u00A0' # 🛠️ + TERRAFORM_ICON 'tf' PROXY_ICON '\u2B82' # ⮂ DOTNET_ICON '.NET' AZURE_ICON '\u2601' # ☁ @@ -345,7 +345,7 @@ function _p9k_init_icons() { RANGER_ICON '\u2B50' # ⭐ MIDNIGHT_COMMANDER_ICON 'mc' VIM_ICON 'vim' - TERRAFORM_ICON '\U1F6E0\u00A0' # 🛠️ + TERRAFORM_ICON 'tf' PROXY_ICON '\u2B82' # ⮂ DOTNET_ICON '.NET' AZURE_ICON '\u2601' # ☁ @@ -459,7 +459,7 @@ function _p9k_init_icons() { RANGER_ICON '\uF00b' #  MIDNIGHT_COMMANDER_ICON 'mc' VIM_ICON '\uE62B' #  - TERRAFORM_ICON '\U1F6E0\u00A0' # 🛠️ + TERRAFORM_ICON '\uF1BB' #  PROXY_ICON '\u2B82' # ⮂ DOTNET_ICON '\uE77F' #  AZURE_ICON '\uFD03' # ﴃ @@ -572,7 +572,7 @@ function _p9k_init_icons() { RANGER_ICON '\u2B50' # ⭐ MIDNIGHT_COMMANDER_ICON 'mc' VIM_ICON 'vim' - TERRAFORM_ICON '\U1F6E0\u00A0' # 🛠️ + TERRAFORM_ICON 'tf' PROXY_ICON '\u2194' # ↔ DOTNET_ICON '.NET' AZURE_ICON '\u2601' # ☁ diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 66150bb0..8162b7c2 100755 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1564,8 +1564,6 @@ function generate_config() { if [[ $POWERLEVEL9K_MODE == (compatible|powerline) ]]; then uncomment 'typeset -g POWERLEVEL9K_DIR_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION' sub DIR_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION "'∅'" - uncomment 'typeset -g POWERLEVEL9K_TERRAFORM_VISUAL_IDENTIFIER_EXPANSION' - sub TERRAFORM_VISUAL_IDENTIFIER_EXPANSION "'tf'" uncomment 'typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION' sub RANGER_VISUAL_IDENTIFIER_EXPANSION "'▲'" uncomment 'typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION' From 17d3dc78feab175fb57d3e2b3b481f7b29d6c89b Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 6 Feb 2020 13:37:22 +0100 Subject: [PATCH 77/88] pick up `ifconfig` and `ip` from PATH Apparently there are systems on which these tools are not in /sbin. Fixes #472. --- internal/p10k.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 03558340..7d690498 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4569,8 +4569,8 @@ function _p9k_prompt_net_iface_compute() { function _p9k_prompt_net_iface_async() { local iface ip line var typeset -a iface2ip - if [[ -x /sbin/ifconfig ]]; then - for line in ${(f)"$(/sbin/ifconfig 2>/dev/null)"}; do + if (( $+commands[ifconfig] )); then + for line in ${(f)"$(command ifconfig 2>/dev/null)"}; do if [[ $line == (#b)([^[:space:]]##):[[:space:]]##flags=(<->)'<'* ]]; then [[ $match[2] == *[13579] ]] && iface=$match[1] || iface= elif [[ -n $iface && $line == (#b)[[:space:]]##inet[[:space:]]##([0-9.]##)* ]]; then @@ -4578,8 +4578,8 @@ function _p9k_prompt_net_iface_async() { iface= fi done - elif [[ -x /sbin/ip ]]; then - for line in ${(f)"$(/sbin/ip -4 a show 2>/dev/null)"}; do + 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 [[ -n $iface && $line == (#b)[[:space:]]##inet[[:space:]]##([0-9.]##)* ]]; then From d17c7278a5ac8f0273ff8ae6ee9d997bff959891 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 6 Feb 2020 15:31:38 +0100 Subject: [PATCH 78/88] spello --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cd04de9d..d32e7123 100644 --- a/README.md +++ b/README.md @@ -1086,7 +1086,7 @@ See [cursor is in the wrong place](#cursor-is-in-the-wrong-place). See [cursor is in the wrong place](#cursor-is-in-the-wrong-place). -### Configuration wizard run automatically every time Zsh is started +### Configuration wizard runs automatically every time Zsh is started When Powerlevel10k starts, it automatically runs `p10k configure` if no `POWERLEVEL9K_*` parameters are defined. Based on your prompt style choices, the configuration wizard creates @@ -1426,7 +1426,7 @@ There are a few mitigation options for this issue. - [Cursor is in the wrong place](#cursor-is-in-the-wrong-place) - [Prompt wrapping around in a weird way](#prompt-wrapping-around-in-a-weird-way) - [Right prompt is in the wrong place](#right-prompt-is-in-the-wrong-place) - - [Configuration wizard run automatically every time Zsh is started](#configuration-wizard-run-automatically-every-time-zsh-is-started) + - [Configuration wizard runs automatically every time Zsh is started](#configuration-wizard-runs-automatically-every-time-zsh-is-started) - [Some prompt styles are missing from the configuration wizard](#some-prompt-styles-are-missing-from-the-configuration-wizard) - [Cannot install the recommended font](#cannot-install-the-recommended-font) - [Extra or missing spaces in prompt compared to Powerlevel9k](#extra-or-missing-spaces-in-prompt-compared-to-powerlevel9k) From 44c479a819e97e72f05284dfe4c7615d2b2f5f46 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 6 Feb 2020 16:10:53 +0100 Subject: [PATCH 79/88] add asdf prompt segment --- internal/p10k.zsh | 202 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 200 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 7fa6ad3f..f39dd904 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -532,7 +532,7 @@ _p9k_get_icon() { if [[ $2 == $'\1'* ]]; then _p9k_ret=${2[2,-1]} else - _p9k_param "$@" ${icons[$2]-$'\1'$3} + _p9k_param "$1" "$2" ${icons[$2]-$'\1'$3} if [[ $_p9k_ret == $'\1'* ]]; then _p9k_ret=${_p9k_ret[2,-1]} else @@ -4520,6 +4520,185 @@ _p9k_prompt_wifi_sync() { fi } +function _p9k_asdf_check_meta() { + [[ -n $_p9k_asdf_meta_sig ]] || return + [[ -z $^_p9k_asdf_meta_non_files(#qN) ]] || return + local -a stat + zstat -A stat +mtime -- $_p9k_asdf_meta_files 2>/dev/null || return + [[ $_p9k_asdf_meta_sig == "$ASDF_CONFIG_FILE:$ASDF_DATA_DIR:${(j.:.)stat}" ]] || return +} + +function _p9k_asdf_init_meta() { + { + local -a files + local -i legacy_enabled + + _p9k_asdf_plugins=() + _p9k_asdf_file_info=() + + local cfg=${ASDF_CONFIG_FILE:-~/.asdfrc} + files+=$cfg + if [[ -f $cfg && -r $cfg ]]; then + # Config parser in adsf is very strange. + # + # This gives "yes": + # + # legacy_version_file = yes = no + # + # This gives "no": + # + # legacy_version_file = yes + # legacy_version_file = yes + # + # We do the same. + local lines=(${(@M)${(f)"$(<$cfg)"}:#[[:space:]]#legacy_version_file[[:space:]]#=*}) + if [[ $#lines == 1 && ${${(s:=:)lines[1]}[2]} == [[:space:]]#yes[[:space:]]# ]]; then + legacy_enabled=1 + fi + fi + + local root=${ASDF_DATA_DIR:-~/.asdf}/plugins + files+=$root + if [[ -d $root ]]; then + local plugin + for plugin in $root/[^[:space:]]##(N); do + _p9k_asdf_plugins+=${plugin:t} + if [[ ! -e $plugin/bin ]]; then + files+=$plugin/bin + else + local list_names=$plugin/bin/list-legacy-filenames + files+=$list_names + if [[ -x $list_names ]]; then + local -i has_parse=0 + if (( legacy_enabled )); then + local parse=$plugin/bin/parse-legacy-file + files+=$parse + [[ -x $parse ]] && has_parse=1 + fi + local name + for name in $($list_names 2>/dev/null); do + _p9k_asdf_file_info[$name]+="${plugin:t} $has_parse " + done + fi + fi + done + fi + + _p9k_asdf_meta_files=($^files(N)) + _p9k_asdf_meta_non_files=(${files:|_p9k_asdf_meta_files}) + + local -a stat + zstat -A stat +mtime -- $_p9k_asdf_meta_files 2>/dev/null || return + _p9k_asdf_meta_sig="$ASDF_CONFIG_FILE:$ASDF_DATA_DIR:${(j.:.)stat}" + } always { + (( $? )) || return + _p9k_asdf_meta_files=() + _p9k_asdf_meta_non_files=() + _p9k_asdf_meta_sig= + _p9k_asdf_plugins=() + _p9k_asdf_file_info=() + _p9k__asdf_dir2files=() + _p9k_asdf_file2versions=() + } +} + +function prompt_asdf() { + _p9k_asdf_check_meta || _p9k_asdf_init_meta || return + + local -A versions + local plugin + for plugin in $_p9k_asdf_plugins; do + local var=ASDF_${(U)plugin}_VERSION + local val="${(P)var}" + [[ -n $val ]] && versions[$plugin]=$val + done + + local -a stat + zstat -A stat +mtime ~ 2>/dev/null || return + local dirs=($_p9k__parent_dirs ~) + local mtimes=($_p9k__parent_mtimes $stat[1]) + + local elem + for elem in ${(@)${:-{1..$#dirs}}/(#m)*/${${:-$MATCH:$_p9k__asdf_dir2files[$dirs[MATCH]]}#$MATCH:$mtimes[MATCH]:}}; do + if [[ $elem == *:* ]]; then + local dir=$dirs[${elem%%:*}] + zstat -A stat +mtime $dir 2>/dev/null || return + local files=($dir/.tool-versions(N) $dir/${(k)^_p9k_asdf_file_info}(N)) + _p9k__asdf_dir2files[$dir]=$stat[1]:${(pj:\0:)files} + else + local files=(${(0)elem}) + fi + local file + for file in $files; do + zstat -A stat +mtime $file 2>/dev/null || return + local cached=$_p9k_asdf_file2versions[$file] + if [[ $cached == $stat[1]:* ]]; then + local file_versions=(${(0)${cached#*:}}) + else + local file_versions=() + if [[ $file == */.tool-versions ]]; then + { local lines=(${(@)${(f)"$(<$file)"}/\#*}) } 2>/dev/null + local line + for line in $lines; do + local words=($=line) + (( $#words > 1 && $_p9k_asdf_plugins[(Ie)$words[1]] )) || continue + file_versions+=($words[1] "${words[2,-1]}") + done + else + local plugin has_parse + for plugin has_parse in $=_p9k_asdf_file_info[$file:t]; do + if (( has_parse )); then + local v=($(${ASDF_DATA_DIR:-~/.asdf}/plugins/$plugin/bin/parse-legacy-file $file 2>/dev/null)) + else + { local v=($(<$file)) } 2>/dev/null + fi + (( $#v )) && file_versions+=($plugin "$v") + done + fi + _p9k_asdf_file2versions[$file]=$stat[1]:${(pj:\0:)file_versions} + fi + local plugin version + for plugin version in $file_versions; do + [[ -z $versions[$plugin] ]] && versions[$plugin]=$version + done + done + done + + if [[ -r $ASDF_DEFAULT_TOOL_VERSIONS_FILENAME ]]; then + local file=$ASDF_DEFAULT_TOOL_VERSIONS_FILENAME + zstat -A stat +mtime $file 2>/dev/null || return + local cached=$_p9k_asdf_file2versions[$file] + if [[ $cached == $stat[1]:* ]]; then + local file_versions=(${(0)${cached#*:}}) + else + local file_versions=() + { local lines=(${(@)${(f)"$(<$file)"}/\#*}) } 2>/dev/null + local line + for line in $lines; do + local words=($=line) + (( $#words > 1 && $_p9k_asdf_plugins[(Ie)$words[1]] )) || continue + file_versions+=($words[1] "${words[2,-1]}") + done + _p9k_asdf_file2versions[$file]=$stat[1]:${(pj:\0:)file_versions} + fi + local plugin version + for plugin version in $file_versions; do + [[ -z $versions[$plugin] ]] && versions[$plugin]=$version + done + fi + + local plugin version + for plugin version in ${(kv)versions}; do + local upper=${(U)plugin} + _p9k_get_icon $0_$upper ${upper}_ICON $plugin + _p9k_prompt_segment $0_$upper green $_p9k_color1 $'\1'$_p9k_ret 0 '' ${version//\%/%%} + done +} + +_p9k_prompt_asdf_init() { + typeset -g "_p9k__segment_cond_${_p9k_prompt_side}[_p9k_segment_index]"='${commands[asdf]:-${${+functions[asdf]}:#0}}' +} + # 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() { @@ -5651,6 +5830,25 @@ typeset -g _p9k__param_pat typeset -g _p9k__param_sig _p9k_init_vars() { + typeset -ga _p9k_asdf_meta_files + typeset -ga _p9k_asdf_meta_non_files + typeset -g _p9k_asdf_meta_sig + + # example: (ruby lua chubaka) + typeset -ga _p9k_asdf_plugins + + # example: (.ruby-version "ruby 1 chubaka 0") + # + # - "1" means parse-legacy-file is present + # - "chubaka" is another plugin that claims to be able to parse .ruby-version + typeset -gA _p9k_asdf_file_info + + # dir => mtime ':' ${(pj:\0:)files} + typeset -gA _p9k__asdf_dir2files + + # file => mtime ':' ${(pj:\0:)versions} + typeset -gA _p9k_asdf_file2versions + # filepath => mtime ':' word typeset -gA _p9k__read_word_cache # filepath:prefix => mtime ':' versions @@ -6670,7 +6868,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v37\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v38\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$DEFAULT_USER\1${ZLE_RPROMPT_INDENT:-1}\1$P9K_SSH\1$__p9k_ksh_arrays' From f788f6b4bddc73b1795a435a977a83dc94d998e9 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 6 Feb 2020 16:31:30 +0100 Subject: [PATCH 80/88] asdf: replace "-" with "_" when converting to upper case --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index f39dd904..f53b0ad3 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4608,7 +4608,7 @@ function prompt_asdf() { local -A versions local plugin for plugin in $_p9k_asdf_plugins; do - local var=ASDF_${(U)plugin}_VERSION + local var=ASDF_${(U)plugin//-/_}_VERSION local val="${(P)var}" [[ -n $val ]] && versions[$plugin]=$val done @@ -4689,7 +4689,7 @@ function prompt_asdf() { local plugin version for plugin version in ${(kv)versions}; do - local upper=${(U)plugin} + local upper=${(U)plugin//-/_} _p9k_get_icon $0_$upper ${upper}_ICON $plugin _p9k_prompt_segment $0_$upper green $_p9k_color1 $'\1'$_p9k_ret 0 '' ${version//\%/%%} done From f509a16bbbd9e53f818b280cedc9b1ca95b0731a Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 6 Feb 2020 16:49:30 +0100 Subject: [PATCH 81/88] add asdf to config templates (enabled by default) --- config/p10k-classic.zsh | 45 +++++++++++++++++++++++++ config/p10k-lean-8colors.zsh | 50 ++++++++++++++++++++++++++++ config/p10k-lean.zsh | 50 ++++++++++++++++++++++++++++ config/p10k-rainbow.zsh | 64 +++++++++++++++++++++++++++++++++++- 4 files changed, 208 insertions(+), 1 deletion(-) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index f248d005..95fc1900 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -48,6 +48,7 @@ command_execution_time # duration of the last command background_jobs # presence of background jobs 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) anaconda # conda environment (https://conda.io/) pyenv # python environment (https://github.com/pyenv/pyenv) @@ -518,6 +519,50 @@ # Custom icon. # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### + # Default asdf color. Only used to display tools for which there is no color override (see below). + typeset -g POWERLEVEL9K_ASDF_FOREGROUND=66 + + # Ruby version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=168 + # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Python version from asdf. + typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=37 + # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Go version from asdf. + typeset -g POWERLEVEL9K_ASDF_GO_FOREGROUND=37 + # typeset -g POWERLEVEL9K_ASDF_GO_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Node.js version from asdf. + typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=70 + # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Rust version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=37 + # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # .NET Core version from asdf. + typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=134 + # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Flutter version from asdf. + typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=38 + # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Lua version from asdf. + typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=32 + # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Java version from asdf. + typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=32 + # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Perl version from asdf. + typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=67 + # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### # NordVPN connection indicator color. typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=39 diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 03051490..b4fdc146 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -48,6 +48,7 @@ command_execution_time # duration of the last command background_jobs # presence of background jobs 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) anaconda # conda environment (https://conda.io/) pyenv # python environment (https://github.com/pyenv/pyenv) @@ -255,7 +256,12 @@ .hg .node-version .python-version + .go-version .ruby-version + .lua-version + .java-version + .perl-version + .tool-version .shorten_folder_marker .svn .terraform @@ -514,6 +520,50 @@ # Custom icon. # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### + # Default asdf color. Only used to display tools for which there is no color override (see below). + typeset -g POWERLEVEL9K_ASDF_FOREGROUND=6 + + # Ruby version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=1 + # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Python version from asdf. + typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=6 + # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Go version from asdf. + typeset -g POWERLEVEL9K_ASDF_GO_FOREGROUND=6 + # typeset -g POWERLEVEL9K_ASDF_GO_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Node.js version from asdf. + typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=2 + # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Rust version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # .NET Core version from asdf. + typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Flutter version from asdf. + typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Lua version from asdf. + typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Java version from asdf. + typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Perl version from asdf. + typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=6 + # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### # NordVPN connection indicator color. typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=6 diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 81d0d429..9470369d 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -48,6 +48,7 @@ command_execution_time # duration of the last command background_jobs # presence of background jobs 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) anaconda # conda environment (https://conda.io/) pyenv # python environment (https://github.com/pyenv/pyenv) @@ -255,7 +256,12 @@ .hg .node-version .python-version + .go-version .ruby-version + .lua-version + .java-version + .perl-version + .tool-version .shorten_folder_marker .svn .terraform @@ -514,6 +520,50 @@ # Custom icon. # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### + # Default asdf color. Only used to display tools for which there is no color override (see below). + typeset -g POWERLEVEL9K_ASDF_FOREGROUND=66 + + # Ruby version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=168 + # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Python version from asdf. + typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=37 + # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Go version from asdf. + typeset -g POWERLEVEL9K_ASDF_GO_FOREGROUND=37 + # typeset -g POWERLEVEL9K_ASDF_GO_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Node.js version from asdf. + typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=70 + # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Rust version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=37 + # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # .NET Core version from asdf. + typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=134 + # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Flutter version from asdf. + typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=38 + # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Lua version from asdf. + typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=32 + # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Java version from asdf. + typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=32 + # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Perl version from asdf. + typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=67 + # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### # NordVPN connection indicator color. typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=39 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 006461e9..a9c1cbcd 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -48,6 +48,7 @@ command_execution_time # duration of the last command background_jobs # presence of background jobs 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) anaconda # conda environment (https://conda.io/) pyenv # python environment (https://github.com/pyenv/pyenv) @@ -259,7 +260,12 @@ .hg .node-version .python-version + .go-version .ruby-version + .lua-version + .java-version + .perl-version + .tool-version .shorten_folder_marker .svn .terraform @@ -515,6 +521,61 @@ # Custom icon. # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### + # Default asdf color. Only used to display tools for which there is no color override (see below). + typeset -g POWERLEVEL9K_ASDF_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_BACKGROUND=7 + + # Ruby version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_RUBY_BACKGROUND=1 + # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Python version from asdf. + typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PYTHON_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Go version from asdf. + typeset -g POWERLEVEL9K_ASDF_GO_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_GO_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_GO_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Node.js version from asdf. + typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_NODEJS_BACKGROUND=2 + # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Rust version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_RUST_BACKGROUND=208 + # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # .NET Core version from asdf. + typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_BACKGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Flutter version from asdf. + typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_FLUTTER_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Lua version from asdf. + typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_LUA_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Java version from asdf. + typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=1 + typeset -g POWERLEVEL9K_ASDF_JAVA_BACKGROUND=7 + # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Perl version from asdf. + typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PERL_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### # NordVPN connection indicator color. # typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=7 @@ -748,7 +809,8 @@ ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### # Nvm color. - # typeset -g POWERLEVEL9K_NVM_FOREGROUND=70 + # typeset -g POWERLEVEL9K_NVM_FOREGROUND=0 + # typeset -g POWERLEVEL9K_NVM_BACKGROUND=5 # Custom icon. # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' From 80139d8949a055af937d07a459a4e755d787cdbc Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 6 Feb 2020 16:52:23 +0100 Subject: [PATCH 82/88] add NODEJS_ICON and DOTNET_CORE_ICON (for asdf) --- internal/icons.zsh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/icons.zsh b/internal/icons.zsh index f5f4065b..fceb74df 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -38,6 +38,7 @@ function _p9k_init_icons() { FAIL_ICON '\u2718' # ✘ SYMFONY_ICON 'SF' NODE_ICON '\u2B22'$s # ⬢ + NODEJS_ICON '\u2B22'$s # ⬢ MULTILINE_FIRST_PROMPT_PREFIX '\u256D\U2500' # ╭─ MULTILINE_NEWLINE_PROMPT_PREFIX '\u251C\U2500' # ├─ MULTILINE_LAST_PROMPT_PREFIX '\u2570\U2500 ' # ╰─ @@ -118,6 +119,7 @@ function _p9k_init_icons() { TERRAFORM_ICON 'tf' PROXY_ICON '\u2B82' # ⮂ DOTNET_ICON '.NET' + DOTNET_CORE_ICON '.NET' AZURE_ICON '\u2601' # ☁ DIRENV_ICON '\u25BC' # ▼ FLUTTER_ICON 'F' @@ -155,6 +157,7 @@ function _p9k_init_icons() { FAIL_ICON '\u2718' # ✘ SYMFONY_ICON 'SF' NODE_ICON '\u2B22' # ⬢ + NODEJS_ICON '\u2B22' # ⬢ MULTILINE_FIRST_PROMPT_PREFIX '\u256D\U2500' # ╭─ MULTILINE_NEWLINE_PROMPT_PREFIX '\u251C\U2500' # ├─ MULTILINE_LAST_PROMPT_PREFIX '\u2570\U2500 ' # ╰─ @@ -231,6 +234,7 @@ function _p9k_init_icons() { TERRAFORM_ICON 'tf' PROXY_ICON '\u2B82' # ⮂ DOTNET_ICON '.NET' + DOTNET_CORE_ICON '.NET' AZURE_ICON '\u2601' # ☁ DIRENV_ICON '\u25BC' # ▼ FLUTTER_ICON 'F' @@ -275,6 +279,7 @@ function _p9k_init_icons() { FAIL_ICON "${CODEPOINT_OF_AWESOME_TIMES:+\\u$CODEPOINT_OF_AWESOME_TIMES}" SYMFONY_ICON 'SF' NODE_ICON '\u2B22' # ⬢ + NODEJS_ICON '\u2B22' # ⬢ MULTILINE_FIRST_PROMPT_PREFIX '\u256D\U2500' # ╭─ MULTILINE_NEWLINE_PROMPT_PREFIX '\u251C\U2500' # ├─ MULTILINE_LAST_PROMPT_PREFIX '\u2570\U2500 ' # ╰─ @@ -348,6 +353,7 @@ function _p9k_init_icons() { TERRAFORM_ICON 'tf' PROXY_ICON '\u2B82' # ⮂ DOTNET_ICON '.NET' + DOTNET_CORE_ICON '.NET' AZURE_ICON '\u2601' # ☁ DIRENV_ICON '\u25BC' # ▼ FLUTTER_ICON 'F' @@ -386,6 +392,7 @@ function _p9k_init_icons() { 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 ' # ╰─ @@ -462,6 +469,7 @@ function _p9k_init_icons() { TERRAFORM_ICON '\uF1BB' #  PROXY_ICON '\u2B82' # ⮂ DOTNET_ICON '\uE77F' #  + DOTNET_CORE_ICON '\uE77F' #  AZURE_ICON '\uFD03' # ﴃ DIRENV_ICON '\u25BC' # ▼ FLUTTER_ICON 'F' @@ -499,6 +507,7 @@ function _p9k_init_icons() { FAIL_ICON '\u2718' # ✘ SYMFONY_ICON 'SF' NODE_ICON 'Node' + NODEJS_ICON 'Node' MULTILINE_FIRST_PROMPT_PREFIX '\u256D\U2500' # ╭─ MULTILINE_NEWLINE_PROMPT_PREFIX '\u251C\U2500' # ├─ MULTILINE_LAST_PROMPT_PREFIX '\u2570\U2500 ' # ╰─ @@ -575,6 +584,7 @@ function _p9k_init_icons() { TERRAFORM_ICON 'tf' PROXY_ICON '\u2194' # ↔ DOTNET_ICON '.NET' + DOTNET_CORE_ICON '.NET' AZURE_ICON '\u2601' # ☁ DIRENV_ICON '\u25BC' # ▼ FLUTTER_ICON 'F' From 71708336a903124f18d8754b07c7e95175f2994b Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 6 Feb 2020 16:54:10 +0100 Subject: [PATCH 83/88] add asdf to docs --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5eb84e97..e5301b33 100644 --- a/README.md +++ b/README.md @@ -265,6 +265,7 @@ enable as many segments as you like. It won't slow down your prompt or Zsh start | `background_jobs` | presence of background jobs | | `time` | current time | | `direnv` | [direnv](https://direnv.net/) status | +| `asdf` | tool versions from [asdf](https://github.com/asdf-vm/asdf) | | `virtualenv` | python environment from [venv](https://docs.python.org/3/library/venv.html) | | `anaconda` | virtual environment from [conda](https://conda.io/) | | `pyenv` | python environment from [pyenv](https://github.com/pyenv/pyenv) | From 50318c02508b3c0b97ce502424b77060da561096 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 6 Feb 2020 17:18:40 +0100 Subject: [PATCH 84/88] add POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER to config templates --- config/p10k-classic.zsh | 5 +++++ config/p10k-lean-8colors.zsh | 5 +++++ config/p10k-lean.zsh | 5 +++++ config/p10k-rainbow.zsh | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 95fc1900..3fb1d35b 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -271,6 +271,11 @@ package.json ) typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" + # If set to true, remove everything before the last (deepest) subdirectory that contains files + # matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is + # /foo/bar/git_repo/baz, prompt will display git_repo/baz. This assumes that /foo/bar/git_repo + # contains a marker (.git) and other directories don't. + typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false # Don't shorten this many last directory segments. They are anchors. typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 # Shorten directory if it's longer than this even if there is space for it. The value can diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index b4fdc146..f0106a36 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -272,6 +272,11 @@ package.json ) typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" + # If set to true, remove everything before the last (deepest) subdirectory that contains files + # matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is + # /foo/bar/git_repo/baz, prompt will display git_repo/baz. This assumes that /foo/bar/git_repo + # contains a marker (.git) and other directories don't. + typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false # Don't shorten this many last directory segments. They are anchors. typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 # Shorten directory if it's longer than this even if there is space for it. The value can diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 9470369d..e18338ec 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -272,6 +272,11 @@ package.json ) typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" + # If set to true, remove everything before the last (deepest) subdirectory that contains files + # matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is + # /foo/bar/git_repo/baz, prompt will display git_repo/baz. This assumes that /foo/bar/git_repo + # contains a marker (.git) and other directories don't. + typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false # Don't shorten this many last directory segments. They are anchors. typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 # Shorten directory if it's longer than this even if there is space for it. The value can diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index a9c1cbcd..c59c1b90 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -276,6 +276,11 @@ package.json ) typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" + # If set to true, remove everything before the last (deepest) subdirectory that contains files + # matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is + # /foo/bar/git_repo/baz, prompt will display git_repo/baz. This assumes that /foo/bar/git_repo + # contains a marker (.git) and other directories don't. + typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false # Don't shorten this many last directory segments. They are anchors. typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 # Shorten directory if it's longer than this even if there is space for it. The value can From f9f3aa594af565a2794126857355d5408c09c44e Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 7 Feb 2020 09:00:03 +0100 Subject: [PATCH 85/88] add spaces after a few icons that tend to be very wide in non-monospace fonts --- internal/icons.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/icons.zsh b/internal/icons.zsh index fceb74df..04a37550 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -463,10 +463,10 @@ function _p9k_init_icons() { TIME_ICON '\uF017 ' #  JAVA_ICON '\uE738' #  LARAVEL_ICON '\ue73f'$q #  - RANGER_ICON '\uF00b' #  + RANGER_ICON '\uF00b ' #  MIDNIGHT_COMMANDER_ICON 'mc' VIM_ICON '\uE62B' #  - TERRAFORM_ICON '\uF1BB' #  + TERRAFORM_ICON '\uF1BB ' #  PROXY_ICON '\u2B82' # ⮂ DOTNET_ICON '\uE77F' #  DOTNET_CORE_ICON '\uE77F' #  @@ -478,8 +478,8 @@ function _p9k_init_icons() { PERL_ICON '\uE769' #  NNN_ICON 'nnn' TIMEWARRIOR_ICON '\uF49B' #  - NIX_SHELL_ICON '\uF313' #  - WIFI_ICON '\uF1EB' #  + NIX_SHELL_ICON '\uF313 ' #  + WIFI_ICON '\uF1EB ' #  ) ;; *) From fd30ed15609b1ccf4cff77ed7c39a15edc04ff01 Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 7 Feb 2020 09:06:32 +0100 Subject: [PATCH 86/88] add icons (for asdf): ERLANG_ICON, ELIXIR_ICON, POSTGRES_ICON --- internal/icons.zsh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/internal/icons.zsh b/internal/icons.zsh index 04a37550..8a30d288 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -130,6 +130,9 @@ function _p9k_init_icons() { TIMEWARRIOR_ICON 'tw' NIX_SHELL_ICON 'nix' WIFI_ICON 'WiFi' + ERLANG_ICON 'erl' + ELIXIR_ICON 'elixir' + POSTGRES_ICON 'postgres' ) ;; 'awesome-fontconfig') @@ -245,6 +248,9 @@ function _p9k_init_icons() { TIMEWARRIOR_ICON 'tw' NIX_SHELL_ICON 'nix' WIFI_ICON 'WiFi' + ERLANG_ICON 'erl' + ELIXIR_ICON 'elixir' + POSTGRES_ICON 'postgres' ) ;; 'awesome-mapped-fontconfig') @@ -364,6 +370,9 @@ function _p9k_init_icons() { TIMEWARRIOR_ICON 'tw' NIX_SHELL_ICON 'nix' WIFI_ICON 'WiFi' + ERLANG_ICON 'erl' + ELIXIR_ICON 'elixir' + POSTGRES_ICON 'postgres' ) ;; 'nerdfont-complete'|'nerdfont-fontconfig') @@ -480,6 +489,9 @@ function _p9k_init_icons() { TIMEWARRIOR_ICON '\uF49B' #  NIX_SHELL_ICON '\uF313 ' #  WIFI_ICON '\uF1EB ' #  + ERLANG_ICON '\uE7B1 ' #  + ELIXIR_ICON '\uE62D' #  + POSTGRES_ICON '\uE76E' #  ) ;; *) @@ -595,6 +607,9 @@ function _p9k_init_icons() { TIMEWARRIOR_ICON 'tw' NIX_SHELL_ICON 'nix' WIFI_ICON 'WiFi' + ERLANG_ICON 'erl' + ELIXIR_ICON 'elixir' + POSTGRES_ICON 'postgres' ) ;; esac From af42857637dc9a6b6122f869d81715d1fdb1f24a Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 7 Feb 2020 09:16:55 +0100 Subject: [PATCH 87/88] add custom colors for several asdf tools: erlang, elixir, postgres --- config/p10k-classic.zsh | 12 ++++++++++++ config/p10k-lean-8colors.zsh | 12 ++++++++++++ config/p10k-lean.zsh | 12 ++++++++++++ config/p10k-rainbow.zsh | 15 +++++++++++++++ 4 files changed, 51 insertions(+) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 3fb1d35b..0627305a 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -568,6 +568,18 @@ typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=67 # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Erlang version from asdf. + typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=125 + # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Elixir version from asdf. + typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=129 + # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Postgres version from asdf. + typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=31 + # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### # NordVPN connection indicator color. typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=39 diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index f0106a36..5c7590d9 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -569,6 +569,18 @@ typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=6 # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Erlang version from asdf. + typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=1 + # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Elixir version from asdf. + typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Postgres version from asdf. + typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=6 + # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### # NordVPN connection indicator color. typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=6 diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index e18338ec..bde8b784 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -569,6 +569,18 @@ typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=67 # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Erlang version from asdf. + typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=125 + # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Elixir version from asdf. + typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=129 + # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Postgres version from asdf. + typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=31 + # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### # NordVPN connection indicator color. typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=39 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index c59c1b90..12fcea6e 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -581,6 +581,21 @@ typeset -g POWERLEVEL9K_ASDF_PERL_BACKGROUND=4 # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Erlang version from asdf. + typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_ERLANG_BACKGROUND=1 + # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Elixir version from asdf. + typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_ELIXIR_BACKGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Postgres version from asdf. + typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_POSTGRES_BACKGROUND=6 + # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### # NordVPN connection indicator color. # typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=7 From abbe7f361c3425433666448f95262499d96b5010 Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 7 Feb 2020 09:44:14 +0100 Subject: [PATCH 88/88] add faq: transient prompt stops working after some time --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index e5301b33..57169382 100644 --- a/README.md +++ b/README.md @@ -1192,6 +1192,11 @@ reliable way to do this is to type `exit` and then start start a new Zsh session `exec zsh`. While not exactly equivalent to complete Zsh restart, this command is much more reliable 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). + ### Cannot make Powerlevel10k work with my plugin manager If the [installation instructions](#installation) didn't work for you, try disabling your current @@ -1435,6 +1440,7 @@ There are a few mitigation options for this issue. - [Extra space without background on the right side of right prompt](#extra-space-without-background-on-the-right-side-of-right-prompt) - [Extra or missing spaces around icons](#extra-or-missing-spaces-around-icons) - [Weird things happen after typing `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc) + - [Transient prompt stops working after some time](#transient-prompt-stops-working-after-some-time) - [Cannot make Powerlevel10k work with my plugin manager](#cannot-make-powerlevel10k-work-with-my-plugin-manager) - [Directory is difficult to see in prompt when using Rainbow style](#directory-is-difficult-to-see-in-prompt-when-using-rainbow-style) - [Horrific mess when resizing terminal window](#horrific-mess-when-resizing-terminal-window)