From eef5286005422528cb2a941876ff35bbfe5c07da Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Wed, 11 Nov 2015 22:00:19 +0100 Subject: [PATCH 1/2] Issue #131: This fixes history-substring-search, home and end keys. --- powerlevel9k.zsh-theme | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index a9ce64b1..0d4b3e7c 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -922,12 +922,26 @@ $(print_icon 'MULTILINE_SECOND_PROMPT_PREFIX')" function zle-line-init { powerlevel9k_prepare_prompts + if (( ${+terminfo[smkx]} )); then + printf '%s' ${terminfo[smkx]} + fi + zle reset-prompt + zle -R +} + +function zle-line-finish { + powerlevel9k_prepare_prompts + if (( ${+terminfo[rmkx]} )); then + printf '%s' ${terminfo[rmkx]} + fi zle reset-prompt + zle -R } function zle-keymap-select { powerlevel9k_prepare_prompts zle reset-prompt + zle -R } powerlevel9k_init() { @@ -954,6 +968,7 @@ powerlevel9k_init() { add-zsh-hook precmd powerlevel9k_prepare_prompts zle -N zle-line-init + zle -N zle-line-finish zle -N zle-keymap-select } From 81a4b3907de32b3dfb54fe6b626c1aa2b5faa13b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20Dupille?= Date: Fri, 13 Nov 2015 12:06:03 +0100 Subject: [PATCH 2/2] Get terminal capabilities using a zsh builtin for portability --- powerlevel9k.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 0d4b3e7c..b039f0d7 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -947,7 +947,7 @@ function zle-keymap-select { powerlevel9k_init() { # Display a warning if the terminal does not support 256 colors local term_colors - term_colors=$(tput colors) + term_colors=$(echotc Co) if (( term_colors < 256 )); then print -P "%F{red}WARNING!%f Your terminal supports less than 256 colors!" print -P "You should put: %F{blue}export TERM=\"xterm-256color\"%f in your \~\/.zshrc"