aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-11-04 19:06:42 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-11-04 19:06:42 +0300
commitd4265ab2794145d6550ab6c877f3aef5319bbf58 (patch)
tree68ff82220c5e281f8b3f9c2b16bb0b9ccedcdf34 /internal/p10k.zsh
parent551dd0c27773e6a07f6a0b1ebe1866be4cb50708 (diff)
replace TRAPINT function with trap statement; the former triggers memory corruption bug in zsh
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r--internal/p10k.zsh17
1 files changed, 9 insertions, 8 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index bb4ecfa6..3d990e58 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -4204,6 +4204,14 @@ _p9k_precmd_impl() {
fi
}
+_p9k_trapint() {
+ if (( __p9k_enabled )); then
+ emulate -L zsh
+ setopt no_hist_expand extended_glob no_prompt_bang prompt_{percent,subst}
+ _p9k_zle_line_finish
+ fi
+}
+
_p9k_precmd() {
__p9k_new_status=$?
__p9k_new_pipestatus=($pipestatus)
@@ -4216,14 +4224,7 @@ _p9k_precmd() {
setopt nopromptbang prompt_percent prompt_subst
if (( ! $+functions[TRAPINT] )); then
- function TRAPINT() {
- if (( __p9k_enabled )); then
- emulate -L zsh
- setopt no_hist_expand extended_glob no_prompt_bang prompt_{percent,subst}
- _p9k_zle_line_finish
- fi
- return 130
- }
+ trap '_p9k_trapint; return 130' INT
fi
}