From e6c37b6bc5ba26928ce75720d7fa1c2addb5ccac Mon Sep 17 00:00:00 2001 From: guixxx Date: Sun, 7 May 2017 10:34:54 -0300 Subject: Icons for Windows/Cygwin + Refixes 32-bit support --- functions/icons.zsh | 4 ++++ functions/utilities.zsh | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'functions') diff --git a/functions/icons.zsh b/functions/icons.zsh index c2cdcba5..7b3bba78 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -42,6 +42,7 @@ case $POWERLEVEL9K_MODE in MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' APPLE_ICON $'\uE26E' # ๎‰ฎ + WINDOWS_ICON $'\uE26F' # ๎‰ฏ FREEBSD_ICON $'\U1F608 ' # ๐Ÿ˜ˆ ANDROID_ICON $'\uE270' # ๎‰ฐ LINUX_ICON $'\uE271' # ๎‰ฑ @@ -112,6 +113,7 @@ case $POWERLEVEL9K_MODE in MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # โ•ญโ”€ MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' # โ•ฐโ”€ APPLE_ICON $'\uF179' # ๏…น + WINDOWS_ICON $'\uF17A' # ๎œ FREEBSD_ICON $'\U1F608 ' # ๐Ÿ˜ˆ ANDROID_ICON $'\uE17B' # ๏…ป LINUX_ICON $'\uF17C' # ๏…ผ @@ -178,6 +180,7 @@ case $POWERLEVEL9K_MODE in MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # โ•ญโ”€ MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' # โ•ฐโ”€ APPLE_ICON $'\uF179' # ๏…น + WINDOWS_ICON $'\uF17A' # ๎œ FREEBSD_ICON $'\UF30E ' # ๏ŒŽ ANDROID_ICON $'\uF17B' # ๏…ป LINUX_ICON $'\uF17C' # ๏…ผ @@ -244,6 +247,7 @@ case $POWERLEVEL9K_MODE in MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\u2500' MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\u2500 ' APPLE_ICON 'OSX' + WINDOWS_ICON 'WIN' FREEBSD_ICON 'BSD' ANDROID_ICON 'And' LINUX_ICON 'Lx' diff --git a/functions/utilities.zsh b/functions/utilities.zsh index 86e5ba0e..9bd82060 100644 --- a/functions/utilities.zsh +++ b/functions/utilities.zsh @@ -85,6 +85,10 @@ case $(uname) in OS='OSX' OS_ICON=$(print_icon 'APPLE_ICON') ;; + CYGWIN_NT-*) + OS='Windows' + OS_ICON=$(print_icon 'WINDOWS_ICON') + ;; FreeBSD) OS='BSD' OS_ICON=$(print_icon 'FREEBSD_ICON') -- cgit v1.2.3 From e9e3e9dc538edc82bf8071919eca2fc9c56292a5 Mon Sep 17 00:00:00 2001 From: Christian Hรถltje Date: Fri, 12 May 2017 21:07:50 -0400 Subject: newline: support PROMPT_ON_NEWLINE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The newline segment will now show โ”œโ”€ when using `POWERLEVEL9K_PROMPT_ON_NEWLINE` Note: This can be overridden via `POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX` --- functions/icons.zsh | 12 ++++++++---- powerlevel9k.zsh-theme | 8 ++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'functions') diff --git a/functions/icons.zsh b/functions/icons.zsh index 7b3bba78..72e0fbe4 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -39,8 +39,9 @@ case $POWERLEVEL9K_MODE in FAIL_ICON $'\u2718' # โœ˜ SYMFONY_ICON 'SF' NODE_ICON $'\u2B22' # โฌข - MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' - MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' + MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # โ•ญโ”€ + MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # โ”œโ”€ + MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' # โ•ฐโ”€ APPLE_ICON $'\uE26E' # ๎‰ฎ WINDOWS_ICON $'\uE26F' # ๎‰ฏ FREEBSD_ICON $'\U1F608 ' # ๐Ÿ˜ˆ @@ -111,6 +112,7 @@ case $POWERLEVEL9K_MODE in SYMFONY_ICON 'SF' NODE_ICON $'\u2B22' # โฌข MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # โ•ญโ”€ + MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # โ”œโ”€ MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' # โ•ฐโ”€ APPLE_ICON $'\uF179' # ๏…น WINDOWS_ICON $'\uF17A' # ๎œ @@ -178,6 +180,7 @@ case $POWERLEVEL9K_MODE in SYMFONY_ICON $'\uE757' # ๎— NODE_ICON $'\uE617 ' # ๎˜— MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # โ•ญโ”€ + MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # โ”œโ”€ MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' # โ•ฐโ”€ APPLE_ICON $'\uF179' # ๏…น WINDOWS_ICON $'\uF17A' # ๎œ @@ -244,8 +247,9 @@ case $POWERLEVEL9K_MODE in FAIL_ICON $'\u2718' # โœ˜ SYMFONY_ICON 'SF' NODE_ICON $'\u2B22' # โฌข - MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\u2500' - MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\u2500 ' + MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # โ•ญโ”€ + MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # โ”œโ”€ + MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' # โ•ฐโ”€ APPLE_ICON 'OSX' WINDOWS_ICON 'WIN' FREEBSD_ICON 'BSD' diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index bcce12f4..cad455e6 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -339,14 +339,18 @@ prompt_background_jobs() { # A newline in your prompt, so you can segments on multiple lines. prompt_newline() { - local lws + local lws newline [[ "$1" == "right" ]] && return + newline=$'\n' lws=$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS + if [[ "$POWERLEVEL9K_PROMPT_ON_NEWLINE" == true ]]; then + newline="${newline}$(print_icon 'MULTILINE_NEWLINE_PROMPT_PREFIX')" + fi POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS= "$1_prompt_segment" \ "$0" \ "$2" \ - "NONE" "NONE" $'\n' + "NONE" "NONE" "${newline}" POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS=$lws } -- cgit v1.2.3 From e844fc4c72e20f84d8022ff9591e75d4a30886cf Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Mon, 22 May 2017 21:12:59 -0400 Subject: Incorporating @dritter's feedback from #524. --- README.md | 7 ++++--- functions/icons.zsh | 8 ++++---- powerlevel9k.zsh-theme | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'functions') diff --git a/README.md b/README.md index a4608c41..1e52bfb4 100644 --- a/README.md +++ b/README.md @@ -445,9 +445,10 @@ segment will not be displayed. ##### newline -Puts a newline in your prompt so you can continue using segments on the next line. - -This allows you to use segments on both lines, unlike `POWERLEVEL9K_PROMPT_ON_NEWLINE`. +Puts a newline in your prompt so you can continue using segments on the next +line. This allows you to use segments on both lines, unlike +`POWERLEVEL9K_PROMPT_ON_NEWLINE`, which simply separates segments from the +prompt itself. This only works on the left side. On the right side it does nothing. diff --git a/functions/icons.zsh b/functions/icons.zsh index 72e0fbe4..238b6b9e 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -41,7 +41,7 @@ case $POWERLEVEL9K_MODE in NODE_ICON $'\u2B22' # โฌข MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # โ•ญโ”€ MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # โ”œโ”€ - MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' # โ•ฐโ”€ + MULTILINE_LAST_PROMPT_PREFIX $'\u2570'$'\U2500 ' # โ•ฐโ”€ APPLE_ICON $'\uE26E' # ๎‰ฎ WINDOWS_ICON $'\uE26F' # ๎‰ฏ FREEBSD_ICON $'\U1F608 ' # ๐Ÿ˜ˆ @@ -113,7 +113,7 @@ case $POWERLEVEL9K_MODE in NODE_ICON $'\u2B22' # โฌข MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # โ•ญโ”€ MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # โ”œโ”€ - MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' # โ•ฐโ”€ + MULTILINE_LAST_PROMPT_PREFIX $'\u2570'$'\U2500 ' # โ•ฐโ”€ APPLE_ICON $'\uF179' # ๏…น WINDOWS_ICON $'\uF17A' # ๎œ FREEBSD_ICON $'\U1F608 ' # ๐Ÿ˜ˆ @@ -181,7 +181,7 @@ case $POWERLEVEL9K_MODE in NODE_ICON $'\uE617 ' # ๎˜— MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # โ•ญโ”€ MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # โ”œโ”€ - MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' # โ•ฐโ”€ + MULTILINE_LAST_PROMPT_PREFIX $'\u2570'$'\U2500 ' # โ•ฐโ”€ APPLE_ICON $'\uF179' # ๏…น WINDOWS_ICON $'\uF17A' # ๎œ FREEBSD_ICON $'\UF30E ' # ๏ŒŽ @@ -249,7 +249,7 @@ case $POWERLEVEL9K_MODE in NODE_ICON $'\u2B22' # โฌข MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # โ•ญโ”€ MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # โ”œโ”€ - MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' # โ•ฐโ”€ + MULTILINE_LAST_PROMPT_PREFIX $'\u2570'$'\U2500 ' # โ•ฐโ”€ APPLE_ICON 'OSX' WINDOWS_ICON 'WIN' FREEBSD_ICON 'BSD' diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index e4629646..ec10be85 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -1352,7 +1352,7 @@ powerlevel9k_prepare_prompts() { if [[ "$POWERLEVEL9K_PROMPT_ON_NEWLINE" == true ]]; then PROMPT='$(print_icon 'MULTILINE_FIRST_PROMPT_PREFIX')%f%b%k$(build_left_prompt) -$(print_icon 'MULTILINE_SECOND_PROMPT_PREFIX')' +$(print_icon 'MULTILINE_LAST_PROMPT_PREFIX')' if [[ "$POWERLEVEL9K_RPROMPT_ON_NEWLINE" != true ]]; then # The right prompt should be on the same line as the first line of the left # prompt. To do so, there is just a quite ugly workaround: Before zsh draws -- cgit v1.2.3 From c11c3a55de2be5a9e11b55426d0afbca43aace4d Mon Sep 17 00:00:00 2001 From: Jason Hutchinson Date: Fri, 26 May 2017 13:27:17 -0500 Subject: use p9k print_icon for kubecontext segment --- functions/icons.zsh | 4 ++++ powerlevel9k.zsh-theme | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'functions') diff --git a/functions/icons.zsh b/functions/icons.zsh index 238b6b9e..e38d66a2 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -84,6 +84,7 @@ case $POWERLEVEL9K_MODE in LOCK_ICON $'\UE138' # ๎„ธ EXECUTION_TIME_ICON $'\UE89C' # ๎ขœ SSH_ICON '(ssh)' + KUBERNETES_ICON $'\U2388' # โŽˆ ) ;; 'awesome-fontconfig') @@ -152,6 +153,7 @@ case $POWERLEVEL9K_MODE in LOCK_ICON $'\UE138' # ๎„ธ EXECUTION_TIME_ICON $'\uF253' SSH_ICON '(ssh)' + KUBERNETES_ICON $'\U2388' # โŽˆ ) ;; 'nerdfont-complete'|'nerdfont-fontconfig') @@ -220,6 +222,7 @@ case $POWERLEVEL9K_MODE in LOCK_ICON $'\UF023' # ๏€ฃ EXECUTION_TIME_ICON $'\uF252' # ๏‰’ SSH_ICON $'\uF489' # ๏’‰ + KUBERNETES_ICON $'\U2388' # โŽˆ ) ;; *) @@ -288,6 +291,7 @@ case $POWERLEVEL9K_MODE in LOCK_ICON $'\UE0A2' EXECUTION_TIME_ICON 'Dur' SSH_ICON '(ssh)' + KUBERNETES_ICON $'\U2388' # โŽˆ ) ;; esac diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index fa2e94ab..0d794a85 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -1362,7 +1362,7 @@ prompt_kubecontext() { local k8s_namespace=$(kubectl config get-contexts --no-headers | grep '*' | awk '{print $5}') # Get the current Kuberenetes context local k8s_context=$(kubectl config current-context) - "$1_prompt_segment" "$0" "$2" "magenta" "white" "$k8s_context/$k8s_namespace \u2388" + "$1_prompt_segment" "$0" "$2" "magenta" "white" "$k8s_context/$k8s_namespace" "KUBERNETES_ICON" fi } -- cgit v1.2.3 From 5eec2e28d0e44b2ac168fc3e08a38d68d4cb4fbe Mon Sep 17 00:00:00 2001 From: David Sabatie Date: Wed, 31 May 2017 17:32:42 +0200 Subject: add vpn ip to prompt --- README.md | 9 +++++++++ functions/icons.zsh | 16 ++++++++++------ powerlevel9k.zsh-theme | 11 +++++++++++ 3 files changed, 30 insertions(+), 6 deletions(-) (limited to 'functions') diff --git a/README.md b/README.md index 890875ad..5b9cb24a 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,7 @@ The segments that are currently available are: * `history` - The command number for the current line. * [`host`](#host) - Your current host name * [`ip`](#ip) - Shows the current IP address. +* [`vpn`](#vpn) - Shows the current VPN IP address. * [`public_ip`](#public_ip) - Shows your public IP address. * `load` - Your machine's load averages. * `os_icon` - Display a nice little icon, depending on your operating system. @@ -444,6 +445,14 @@ specify the correct network interface by setting: |----------|---------------|-------------| |`POWERLEVEL9K_IP_INTERFACE`|None|The NIC for which you wish to display the IP address. Example: `eth0`.| +##### vpn + +This segment tries to extract the VPN related IP addresses from nmcli, based on the NIC type: + +| Variable | Default Value | Description | +|----------|---------------|-------------| +|`POWERLEVEL9K_VPN_IP_INTERFACE`|tun|The VPN NIC type| + ##### public_ip This segment will display your public IP address. There are several methods of obtaining this diff --git a/functions/icons.zsh b/functions/icons.zsh index 238b6b9e..9b5953e3 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -84,6 +84,7 @@ case $POWERLEVEL9K_MODE in LOCK_ICON $'\UE138' # ๎„ธ EXECUTION_TIME_ICON $'\UE89C' # ๎ขœ SSH_ICON '(ssh)' + VPN_ICON '(vpn)' ) ;; 'awesome-fontconfig') @@ -145,13 +146,14 @@ case $POWERLEVEL9K_MODE in VCS_GIT_GITLAB_ICON $'\uF296 ' # ๏Š– VCS_HG_ICON $'\uF0C3 ' # ๏ƒƒ VCS_SVN_ICON '(svn) ' - RUST_ICON $'\uE6A8' # ๎šจ + RUST_ICON $'\uE6A8' # ๎šจ PYTHON_ICON $'\U1F40D' # ๐Ÿ SWIFT_ICON '' PUBLIC_IP_ICON '' LOCK_ICON $'\UE138' # ๎„ธ EXECUTION_TIME_ICON $'\uF253' SSH_ICON '(ssh)' + VPN_ICON $'\uF023' ) ;; 'nerdfont-complete'|'nerdfont-fontconfig') @@ -174,7 +176,7 @@ case $POWERLEVEL9K_MODE in TEST_ICON $'\uF188' # ๏†ˆ TODO_ICON $'\uF133' # ๏„ณ BATTERY_ICON $'\UF240 ' # ๏‰€ - DISK_ICON $'\uF0A0' # ๏‚  + DISK_ICON $'\uF0A0' # ๏‚  OK_ICON $'\uF00C' # ๏€Œ FAIL_ICON $'\uF00D' # ๏€ SYMFONY_ICON $'\uE757' # ๎— @@ -210,16 +212,17 @@ case $POWERLEVEL9K_MODE in VCS_GIT_ICON $'\uF113 ' # ๏„“ VCS_GIT_GITHUB_ICON $'\uE709 ' # ๎œ‰ VCS_GIT_BITBUCKET_ICON $'\uE703 ' # ๎œƒ - VCS_GIT_GITLAB_ICON $'\uF296 ' # ๏Š– + VCS_GIT_GITLAB_ICON $'\uF296 ' # ๏Š– VCS_HG_ICON $'\uF0C3 ' # ๏ƒƒ VCS_SVN_ICON $'\uE72D ' # ๎œญ RUST_ICON $'\uE7A8 ' # ๎žจ PYTHON_ICON $'\UE73C ' # ๎œผ SWIFT_ICON $'\uE755' # ๎• PUBLIC_IP_ICON $'\UF0AC' # ๏‚ฌ - LOCK_ICON $'\UF023' # ๏€ฃ - EXECUTION_TIME_ICON $'\uF252' # ๏‰’ - SSH_ICON $'\uF489' # ๏’‰ + LOCK_ICON $'\UF023' # ๏€ฃ + EXECUTION_TIME_ICON $'\uF252' # ๏‰’ + SSH_ICON $'\uF489' # ๏’‰ + VPN_ICON '(vpn)' ) ;; *) @@ -288,6 +291,7 @@ case $POWERLEVEL9K_MODE in LOCK_ICON $'\UE0A2' EXECUTION_TIME_ICON 'Dur' SSH_ICON '(ssh)' + VPN_ICON '(vpn)' ) ;; esac diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 666ce965..760de5a9 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -914,6 +914,17 @@ prompt_ip() { "$1_prompt_segment" "$0" "$2" "cyan" "$DEFAULT_COLOR" "$ip" 'NETWORK_ICON' } +set_default POWERLEVEL9K_VPN_IP_INTERFACE "tun" +# prompt if vpn active +prompt_vpn_ip() { + for vpn_iface in $(ip tuntap | grep -e ^"$POWERLEVEL9K_VPN_IP_INTERFACE" | cut -d":" -f1) + do + ip=$(ip -4 a show "$vpn_iface" | grep -o "inet\s*[0-9.]*" | grep -o "[0-9.]*") + "$1_prompt_segment" "$0" "$2" "cyan" "$DEFAULT_COLOR" "$ip" 'VPN_ICON' + done +} + + prompt_load() { # The load segment can have three different states local current_state="unknown" -- cgit v1.2.3 From a234636982349a82ab6c7f0674f3ff884acddc94 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Wed, 12 Jul 2017 03:29:31 +0200 Subject: Fix empty delimiter Even if the delimiter is empty, the min length should be 1. This fixes #558 --- functions/utilities.zsh | 2 +- test/segments/dir.spec | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'functions') diff --git a/functions/utilities.zsh b/functions/utilities.zsh index 86e5ba0e..39c5ecae 100644 --- a/functions/utilities.zsh +++ b/functions/utilities.zsh @@ -212,7 +212,7 @@ function segmentShouldBeJoined() { # Given a directory path, truncate it according to the settings for # `truncate_from_right` function truncatePathFromRight() { - local delim_len=${#POWERLEVEL9K_SHORTEN_DELIMITER} + local delim_len=${#POWERLEVEL9K_SHORTEN_DELIMITER:-1} echo $1 | sed $SED_EXTENDED_REGEX_PARAMETER \ "s@(([^/]{$((POWERLEVEL9K_SHORTEN_DIR_LENGTH))})([^/]{$delim_len}))[^/]+/@\2$POWERLEVEL9K_SHORTEN_DELIMITER/@g" } diff --git a/test/segments/dir.spec b/test/segments/dir.spec index b2991175..3a6af649 100755 --- a/test/segments/dir.spec +++ b/test/segments/dir.spec @@ -72,6 +72,26 @@ function testTruncationFromRightWorks() { unset POWERLEVEL9K_SHORTEN_STRATEGY } +function testTruncationFromRightWithEmptyDelimiter() { + POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 + POWERLEVEL9K_SHORTEN_DELIMITER="" + POWERLEVEL9K_SHORTEN_STRATEGY='truncate_from_right' + + FOLDER=/tmp/powerlevel9k-test/1/12/123/1234/12345/123456/1234567/12345678/123456789 + mkdir -p $FOLDER + cd $FOLDER + + assertEquals "%K{blue} %F{black}/tmp/po/1/12/123/12/12/12/12/12/123456789 %k%F{blue}๎‚ฐ%f " "$(build_left_prompt)" + + cd - + rm -fr /tmp/powerlevel9k-test + + unset FOLDER + unset POWERLEVEL9K_SHORTEN_DIR_LENGTH + unset POWERLEVEL9K_SHORTEN_DELIMITER + unset POWERLEVEL9K_SHORTEN_STRATEGY +} + function testTruncateWithFolderMarkerWorks() { POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) POWERLEVEL9K_SHORTEN_STRATEGY="truncate_with_folder_marker" -- cgit v1.2.3 From e3530de3dc2afc56836f3f2113734e3b42b15f1b Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Sat, 22 Jul 2017 12:51:39 -0300 Subject: Fix reference for python icon. While using awesome-terminal-fonts it is recommended to use `\ue63c` to reference python icon instead of `\U1F40D` (that wasn't even working). Ref: https://github.com/gabrielelana/awesome-terminal-fonts/issues/38#issuecomment-302939451 --- functions/icons.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'functions') diff --git a/functions/icons.zsh b/functions/icons.zsh index 5e719be1..272de840 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -76,7 +76,7 @@ case $POWERLEVEL9K_MODE in VCS_HG_ICON $'\uE1C3 ' # ๎‡ƒ VCS_SVN_ICON '(svn) ' RUST_ICON '' - PYTHON_ICON $'\U1F40D' # ๐Ÿ + PYTHON_ICON $'\ue63c' # ๎˜ผ SWIFT_ICON '' GO_ICON '' PUBLIC_IP_ICON '' @@ -143,7 +143,7 @@ case $POWERLEVEL9K_MODE in VCS_HG_ICON $'\uF0C3 ' # ๏ƒƒ VCS_SVN_ICON '(svn) ' RUST_ICON $'\uE6A8' # ๎šจ - PYTHON_ICON $'\U1F40D' # ๐Ÿ + PYTHON_ICON $'\ue63c' # ๎˜ผ SWIFT_ICON '' GO_ICON '' PUBLIC_IP_ICON '' -- cgit v1.2.3 From 1ded7c2c902536eb9582cad08b4b69b15d8761a5 Mon Sep 17 00:00:00 2001 From: Giorgi Gzirishvili Date: Fri, 28 Jul 2017 02:50:31 +0400 Subject: Update OK_ICON weight to march FAIL_ICON Fixes #576. --- functions/icons.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'functions') diff --git a/functions/icons.zsh b/functions/icons.zsh index 272de840..ab4d2bac 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -35,7 +35,7 @@ case $POWERLEVEL9K_MODE in TODO_ICON $'\u2611' # โ˜‘ BATTERY_ICON $'\uE894' # ๎ข” DISK_ICON $'\uE1AE ' # ๎†ฎ - OK_ICON $'\u2713' # โœ“ + OK_ICON $'\u2714' # โœ” FAIL_ICON $'\u2718' # โœ˜ SYMFONY_ICON 'SF' NODE_ICON $'\u2B22' # โฌข @@ -106,7 +106,7 @@ case $POWERLEVEL9K_MODE in TODO_ICON $'\u2611' # โ˜‘ BATTERY_ICON $'\U1F50B' # ๐Ÿ”‹ DISK_ICON $'\uF0A0 ' # ๏‚  - OK_ICON $'\u2713' # โœ“ + OK_ICON $'\u2714' # โœ” FAIL_ICON $'\u2718' # โœ˜ SYMFONY_ICON 'SF' NODE_ICON $'\u2B22' # โฌข @@ -240,7 +240,7 @@ case $POWERLEVEL9K_MODE in TODO_ICON $'\u2611' # โ˜‘ BATTERY_ICON $'\U1F50B' # ๐Ÿ”‹ DISK_ICON $'hdd ' - OK_ICON $'\u2713' # โœ“ + OK_ICON $'\u2714' # โœ” FAIL_ICON $'\u2718' # โœ˜ SYMFONY_ICON 'SF' NODE_ICON $'\u2B22' # โฌข -- cgit v1.2.3 From 36b833aae391000ec752188fae4cc67a314a7756 Mon Sep 17 00:00:00 2001 From: Simon Pettersson Date: Thu, 5 Oct 2017 21:57:08 +0200 Subject: Corrected awesome-fontconfig lock icon --- functions/icons.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'functions') diff --git a/functions/icons.zsh b/functions/icons.zsh index 3a4909f7..89fc0cd5 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -153,7 +153,7 @@ case $POWERLEVEL9K_MODE in SWIFT_ICON '' GO_ICON '' PUBLIC_IP_ICON '' - LOCK_ICON $'\UE138' # ๎„ธ + LOCK_ICON $'\UF023' # ๏€ฃ EXECUTION_TIME_ICON $'\uF253' SSH_ICON '(ssh)' VPN_ICON $'\uF023' -- cgit v1.2.3 From 01b554cda8dab4d8854d93f41420a050917a3753 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Fri, 6 Oct 2017 21:43:25 -0400 Subject: Adding a space after VCS_BRANCH_ICON by default --- functions/icons.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'functions') diff --git a/functions/icons.zsh b/functions/icons.zsh index 89fc0cd5..7124386b 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -69,7 +69,7 @@ case $POWERLEVEL9K_MODE in VCS_TAG_ICON $'\uE817 ' # ๎ — VCS_BOOKMARK_ICON $'\uE87B' # ๎กป VCS_COMMIT_ICON $'\uE821 ' # ๎ ก - VCS_BRANCH_ICON $'\uE220' # ๎ˆ  + VCS_BRANCH_ICON $'\uE220 ' # ๎ˆ  VCS_REMOTE_BRANCH_ICON $'\u2192' # โ†’ VCS_GIT_ICON $'\uE20E ' # ๎ˆŽ VCS_GIT_GITHUB_ICON $'\uE20E ' # @@ -140,7 +140,7 @@ case $POWERLEVEL9K_MODE in VCS_TAG_ICON $'\uF217 ' # ๏ˆ— VCS_BOOKMARK_ICON $'\uF27B' # ๏‰ป VCS_COMMIT_ICON $'\uF221 ' # ๏ˆก - VCS_BRANCH_ICON $'\uF126' # ๏„ฆ + VCS_BRANCH_ICON $'\uF126 ' # ๏„ฆ VCS_REMOTE_BRANCH_ICON $'\u2192' # โ†’ VCS_GIT_ICON $'\uF1D3 ' # ๏‡“ VCS_GIT_GITHUB_ICON $'\uF113 ' # ๏„“ @@ -282,7 +282,7 @@ case $POWERLEVEL9K_MODE in VCS_TAG_ICON '' VCS_BOOKMARK_ICON $'\u263F' # โ˜ฟ VCS_COMMIT_ICON '' - VCS_BRANCH_ICON $'\uE0A0' # ๎‚  + VCS_BRANCH_ICON $'\uE0A0 ' # ๎‚  VCS_REMOTE_BRANCH_ICON $'\u2192' # โ†’ VCS_GIT_ICON '' VCS_GIT_GITHUB_ICON '' -- cgit v1.2.3 From f154e75667aff0801c3d978b44f5e4551d91e240 Mon Sep 17 00:00:00 2001 From: Kentaro Hayashi Date: Mon, 27 Nov 2017 15:15:44 +0900 Subject: Disable alias of grep If user defined alias of grep command with '-r' or '--recursive' option, it causes a slow response of command line. It is not unexpected behavior of vcs info. This commit explicitly disables alias of grep to suppress side effects. --- functions/vcs.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'functions') diff --git a/functions/vcs.zsh b/functions/vcs.zsh index c3e507b9..89f04143 100644 --- a/functions/vcs.zsh +++ b/functions/vcs.zsh @@ -17,7 +17,7 @@ function +vi-git-untracked() { fi if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' && \ - -n $(git status ${FLAGS} | grep -E '^\?\?' 2> /dev/null | tail -n1) ]]; then + -n $(git status ${FLAGS} | \grep -E '^\?\?' 2> /dev/null | tail -n1) ]]; then hook_com[unstaged]+=" $(print_icon 'VCS_UNTRACKED_ICON')" VCS_WORKDIR_HALF_DIRTY=true else @@ -137,15 +137,15 @@ function +vi-vcs-detect-changes() { function +vi-svn-detect-changes() { local svn_status="$(svn status)" - if [[ -n "$(echo "$svn_status" | grep \^\?)" ]]; then + if [[ -n "$(echo "$svn_status" | \grep \^\?)" ]]; then hook_com[unstaged]+=" $(print_icon 'VCS_UNTRACKED_ICON')" VCS_WORKDIR_HALF_DIRTY=true fi - if [[ -n "$(echo "$svn_status" | grep \^\M)" ]]; then + if [[ -n "$(echo "$svn_status" | \grep \^\M)" ]]; then hook_com[unstaged]+=" $(print_icon 'VCS_UNSTAGED_ICON')" VCS_WORKDIR_DIRTY=true fi - if [[ -n "$(echo "$svn_status" | grep \^\A)" ]]; then + if [[ -n "$(echo "$svn_status" | \grep \^\A)" ]]; then hook_com[staged]+=" $(print_icon 'VCS_STAGED_ICON')" VCS_WORKDIR_DIRTY=true fi -- cgit v1.2.3