1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-22 20:30:07 +00:00

disable icanon on the tty after printing instant prompt; this way keys like Ctrl-R and Ctrl-D will get through to zle

This commit is contained in:
Roman Perepelitsa 2021-10-10 10:34:54 +02:00
parent 5acedce0b0
commit edd98053cc

View file

@ -5933,7 +5933,7 @@ _p9k_set_instant_prompt() {
[[ -n $RPROMPT ]] || unset RPROMPT [[ -n $RPROMPT ]] || unset RPROMPT
} }
typeset -gri __p9k_instant_prompt_version=43 typeset -gri __p9k_instant_prompt_version=44
_p9k_dump_instant_prompt() { _p9k_dump_instant_prompt() {
local user=${(%):-%n} local user=${(%):-%n}
@ -6237,6 +6237,9 @@ _p9k_dump_instant_prompt() {
typeset -g __p9k_instant_prompt_output=${TMPDIR:-/tmp}/p10k-instant-prompt-output-${(%):-%n}-$$ typeset -g __p9k_instant_prompt_output=${TMPDIR:-/tmp}/p10k-instant-prompt-output-${(%):-%n}-$$
{ echo -n > $__p9k_instant_prompt_output } || return { echo -n > $__p9k_instant_prompt_output } || return
print -rn -- "$out" || return print -rn -- "$out" || return
if (( $+commands[stty] )); then
command stty -icanon 2>/dev/null
fi
local fd_null local fd_null
sysopen -ru fd_null /dev/null || return sysopen -ru fd_null /dev/null || return
exec {__p9k_fd_0}<&0 {__p9k_fd_1}>&1 {__p9k_fd_2}>&2 0<&$fd_null 1>$__p9k_instant_prompt_output exec {__p9k_fd_0}<&0 {__p9k_fd_1}>&1 {__p9k_fd_2}>&2 0<&$fd_null 1>$__p9k_instant_prompt_output