From 96b358d303ccce35c23edae35f65d60e4b81a3f4 Mon Sep 17 00:00:00 2001 From: "Achim D. Brucker" Date: Thu, 6 Jul 2017 23:07:19 +0100 Subject: [PATCH] Prompt: Isabelle version. --- themes/logicalhacking.zsh-theme | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/themes/logicalhacking.zsh-theme b/themes/logicalhacking.zsh-theme index 76bf0eb..a08b81f 100755 --- a/themes/logicalhacking.zsh-theme +++ b/themes/logicalhacking.zsh-theme @@ -76,8 +76,30 @@ prompt_end() { CURRENT_BG='' } -# LH Logo +# Prompt: LH Logo prompt_logo() { prompt_segment $1 $2 "{*λH*}" } +# Prompt: Isabelle Version +ISAVERSIONCMD="Isabelle version | sed -e 's/:.*//' -e 's/Isabelle//'" +ISAVERSIONDIR="which isabelle | sed -e 's/.*Isabelle//' -e 's/.bin.*//'" +prompt_isabellenv() { + ISADIR=false + if [[ -f ROOT || -f ROOTS ]]; then + ISARDIR=true + else + if (){ setopt localoptions nonomatch nocshnullglob; [ -f *.thy([1]) ] } + then + ISARDIR=true + fi + fi + if [ "ISADIR" = true ]; then + prompt_segment $1 $2 "(Isabelle `$ISAVERSION`)" + fi +} + + +# Default configuration +SEGMENT_SEPARATOR=$PL_BRARROW +ISAVERSION=$ISAVERSIONDIR