From 7d6d9465cfc5120b9904f3713690e5aebe82b0f6 Mon Sep 17 00:00:00 2001 From: srdusr Date: Thu, 25 May 2023 17:54:13 +0200 Subject: Fixed prompt showing mode in same line by adding preexec() --- .config/zsh/.zshrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index e8b5573..9c1f961 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -135,8 +135,8 @@ function set-prompt() { echo -ne '\e[5 q' VI_MODE=$(insert-mode) fi - PS1="%{┌─[%F{145}%n%f] %F{39}%0~%f%} ${vcs_info_msg_0_} $(jobs_status_indicator) - %{%{$terminfo_down_sc$VI_MODE$terminfo[rc]%}%{└─%{[%{$(tput setaf 226)%}""%{$(tput blink)%}"%{$%}"%{$(tput sgr0)%}]%}%}%}" + PS1="%{┌─[%F{145}%n%f] %F{39}%0~%f%} ${vcs_info_msg_0_} \$(jobs_status_indicator) + %{%{$terminfo_down_sc$VI_MODE$terminfo[rc]%}%{└─%{["%{$(tput setaf 226)%}""%{$(tput blink)%}"%{$%}"%{$(tput sgr0)%}"%{%G]%}%}%}%}" } function update-mode-file() { @@ -170,6 +170,8 @@ function zle-keymap-select() { esac } +preexec () { print -rn -- $terminfo[el]; echo -ne '\e[5 q' ; } + zle -N zle-keymap-select zle -N zle-line-init -- cgit v1.2.3