From 5de7f1fabfaa8040f9d41f60e06c1734e91c626e Mon Sep 17 00:00:00 2001 From: skywind3000 Date: Wed, 21 Nov 2018 16:54:14 +0800 Subject: [PATCH] commit new posix shell compatible --- z.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/z.lua b/z.lua index dcb2e6b..c00fdbe 100644 --- a/z.lua +++ b/z.lua @@ -1201,8 +1201,10 @@ function z_shell_init(opts) print('') print(script_zlua) + local prompt_hook = (os.getenv("_ZL_NO_PROMPT_COMMAND") == nil) + if opts.bash ~= nil then - if os.getenv("_ZL_NO_PROMPT_COMMAND") == nil then + if prompt_hook then if opts.fast == nil then print(script_init_bash) else @@ -1211,12 +1213,14 @@ function z_shell_init(opts) end print(script_complete_bash) elseif opts.zsh ~= nil then - if os.getenv("_ZL_NO_PROMPT_COMMAND") == nil then + if prompt_hook then print(script_init_zsh) end print(script_complete_zsh) else - print(script_init_posix) + if prompt_hook then + print(script_init_posix) + end print('_ZL_NOBUILTIN=1') end end