From 1dbbd27532c169f4f5d832c8a22e2743c14dabfa Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Thu, 24 Sep 2020 21:15:22 +0300 Subject: [PATCH 1/6] prompt_pure_system_report: Fallback when $SHELL is not set For instance, in Docker this variable is not always defined. --- pure.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pure.zsh b/pure.zsh index a97d466b..fea53e43 100644 --- a/pure.zsh +++ b/pure.zsh @@ -694,7 +694,11 @@ prompt_pure_state_setup() { prompt_pure_system_report() { setopt localoptions noshwordsplit - print - "- Zsh: $($SHELL --version) ($SHELL)" + local shell=$SHELL + if [[ -z $shell ]]; then + shell=$commands[zsh] + fi + print - "- Zsh: $($shell --version) ($shell)" print -n - "- Operating system: " case "$(uname -s)" in Darwin) print "$(sw_vers -productName) $(sw_vers -productVersion) ($(sw_vers -buildVersion))";; From 228da529322e6341355c710afa49a5a6054ee85e Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Thu, 24 Sep 2020 21:15:47 +0300 Subject: [PATCH 2/6] prompt_pure_system_report: Provide more useful info about Linux systems --- pure.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pure.zsh b/pure.zsh index fea53e43..d785ebcf 100644 --- a/pure.zsh +++ b/pure.zsh @@ -702,7 +702,7 @@ prompt_pure_system_report() { print -n - "- Operating system: " case "$(uname -s)" in Darwin) print "$(sw_vers -productName) $(sw_vers -productVersion) ($(sw_vers -buildVersion))";; - *) print "$(uname -s) ($(uname -v))";; + *) print "$(uname -s) ($(uname -r) $(uname -v) $(uname -m) $(uname -o))";; esac print - "- Terminal program: ${TERM_PROGRAM:-unknown} (${TERM_PROGRAM_VERSION:-unknown})" print -n - "- Tmux: " From 3a83a1fa060158c224d4b6947fa24336711717de Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Thu, 24 Sep 2020 21:15:57 +0300 Subject: [PATCH 3/6] prompt_pure_system_report: Better output for variables The (q-) should provide same visual representation as `typeset -p`. --- pure.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pure.zsh b/pure.zsh index d785ebcf..bd16523b 100644 --- a/pure.zsh +++ b/pure.zsh @@ -714,7 +714,7 @@ prompt_pure_system_report() { print - "- Pure state:" for k v in "${(@kv)prompt_pure_state}"; do - print - " - $k: \`${(q)v}\`" + print - " - $k: \`${(q-)v}\`" done print - "- zsh-async version: ${ASYNC_VERSION}" print - "- PROMPT: \`$(typeset -p PROMPT)\`" From 3683317a0142a324a356e39eb9923c43966565e6 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Thu, 24 Sep 2020 21:16:05 +0300 Subject: [PATCH 4/6] prompt_pure_system_report: Add $TERM Could help debugging encoding issues. --- pure.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/pure.zsh b/pure.zsh index bd16523b..8ddff502 100644 --- a/pure.zsh +++ b/pure.zsh @@ -719,6 +719,7 @@ prompt_pure_system_report() { print - "- zsh-async version: ${ASYNC_VERSION}" print - "- PROMPT: \`$(typeset -p PROMPT)\`" print - "- Colors: \`$(typeset -p prompt_pure_colors)\`" + print - "- TERM: \`$(typeset -p TERM)\`" print - "- Virtualenv: \`$(typeset -p VIRTUAL_ENV_DISABLE_PROMPT)\`" print - "- Conda: \`$(typeset -p CONDA_CHANGEPS1)\`" From 58b194683b2f47ed77322835c91986a6d394e656 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Thu, 24 Sep 2020 21:19:40 +0300 Subject: [PATCH 5/6] prompt_pure_system_report: Wrap async version in code block For consistency. --- pure.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pure.zsh b/pure.zsh index 8ddff502..7a337c80 100644 --- a/pure.zsh +++ b/pure.zsh @@ -716,7 +716,7 @@ prompt_pure_system_report() { for k v in "${(@kv)prompt_pure_state}"; do print - " - $k: \`${(q-)v}\`" done - print - "- zsh-async version: ${ASYNC_VERSION}" + print - "- zsh-async version: `${ASYNC_VERSION}`" print - "- PROMPT: \`$(typeset -p PROMPT)\`" print - "- Colors: \`$(typeset -p prompt_pure_colors)\`" print - "- TERM: \`$(typeset -p TERM)\`" From c5cba75fed235366cc4712c0a6b385b6ec476006 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Thu, 24 Sep 2020 21:21:17 +0300 Subject: [PATCH 6/6] prompt_pure_system_report: Escape backticks --- pure.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pure.zsh b/pure.zsh index 7a337c80..65b1b407 100644 --- a/pure.zsh +++ b/pure.zsh @@ -716,7 +716,7 @@ prompt_pure_system_report() { for k v in "${(@kv)prompt_pure_state}"; do print - " - $k: \`${(q-)v}\`" done - print - "- zsh-async version: `${ASYNC_VERSION}`" + print - "- zsh-async version: \`${ASYNC_VERSION}\`" print - "- PROMPT: \`$(typeset -p PROMPT)\`" print - "- Colors: \`$(typeset -p prompt_pure_colors)\`" print - "- TERM: \`$(typeset -p TERM)\`"