From 8bb7ea5b4a46ff5ae1fe31233944ada15bc446d0 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Tue, 3 May 2022 17:54:01 +0300 Subject: [PATCH] Laxed umask indicator --- zsh/.zsh/rc/015prompt.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/zsh/.zsh/rc/015prompt.zsh b/zsh/.zsh/rc/015prompt.zsh index 158ce98..95fcae9 100644 --- a/zsh/.zsh/rc/015prompt.zsh +++ b/zsh/.zsh/rc/015prompt.zsh @@ -1,6 +1,9 @@ setopt PROMPT_SUBST PROMPT="%2~ %B" +# A: autoenv +# V: virtualenv +# M: laxed umask PROMPT+='${(j::)psvar}' PROMPT+="%(1j.%j.)%b" PROMPT+='%U${vcs_info_msg_0_}%u' @@ -18,6 +21,9 @@ function zle-line-init zle-keymap-select { [[ -z "$VIRTUAL_ENV" ]] && psvar=(${psvar#V}) || { [[ -n "${psvar[(r)V]}" ]] || psvar=(V $psvar) } + [[ `umask` == "077" ]] && psvar=(${psvar#M}) || { + [[ -n "${psvar[(r)M]}" ]] || psvar=("M" $psvar) + } zle reset-prompt } -- 2.44.0