summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2023-03-18 16:23:39 -0700
committerTuowen Zhao <ztuowen@gmail.com>2023-03-18 16:23:39 -0700
commit4b0bbc0b263a150eb9a9b59f196914629be06a9b (patch)
tree619723cfa449f93149b766ee397f85ce2acef5f7 /themes
parentdb7efd2336e4dbe6abf321b00dbc11bc5afb1355 (diff)
parent72732a224e886933df6b64a49ec6f5e94c884612 (diff)
downloadzsh-4b0bbc0b263a150eb9a9b59f196914629be06a9b.tar.gz
zsh-4b0bbc0b263a150eb9a9b59f196914629be06a9b.tar.bz2
zsh-4b0bbc0b263a150eb9a9b59f196914629be06a9b.zip
Merge remote-tracking branch 'github/master'
Diffstat (limited to 'themes')
-rw-r--r--themes/af-magic.zsh-theme5
-rw-r--r--themes/amuse.zsh-theme8
-rw-r--r--themes/mlh.zsh-theme10
3 files changed, 19 insertions, 4 deletions
diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme
index 2ef9b02d7..70549d01f 100644
--- a/themes/af-magic.zsh-theme
+++ b/themes/af-magic.zsh-theme
@@ -6,11 +6,12 @@
# dashed separator size
function afmagic_dashes {
# check either virtualenv or condaenv variables
- local python_env="${VIRTUAL_ENV:-$CONDA_DEFAULT_ENV}"
+ local python_env_dir="${VIRTUAL_ENV:-$CONDA_DEFAULT_ENV}"
+ local python_env="${python_env_dir##*/}"
# if there is a python virtual environment and it is displayed in
# the prompt, account for it when returning the number of dashes
- if [[ -n "$python_env" && "$PS1" = \(* ]]; then
+ if [[ -n "$python_env" && "$PS1" = *\(${python_env}\)* ]]; then
echo $(( COLUMNS - ${#python_env} - 3 ))
else
echo $COLUMNS
diff --git a/themes/amuse.zsh-theme b/themes/amuse.zsh-theme
index 3f7ec0bc5..d787fdaa4 100644
--- a/themes/amuse.zsh-theme
+++ b/themes/amuse.zsh-theme
@@ -11,8 +11,14 @@ ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg_bold[red]%}‹"
ZSH_THEME_RUBY_PROMPT_SUFFIX="›%{$reset_color%}"
PROMPT='
-%{$fg_bold[green]%}%~%{$reset_color%}$(git_prompt_info) ⌚ %{$fg_bold[red]%}%*%{$reset_color%}
+%{$fg_bold[green]%}%~%{$reset_color%}$(git_prompt_info)$(virtualenv_prompt_info) ⌚ %{$fg_bold[red]%}%*%{$reset_color%}
$ '
RPROMPT='$(ruby_prompt_info)'
+VIRTUAL_ENV_DISABLE_PROMPT=0
+ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX=" %{$fg[green]%}🐍"
+ZSH_THEME_VIRTUAL_ENV_PROMPT_SUFFIX="%{$reset_color%}"
+ZSH_THEME_VIRTUALENV_PREFIX=$ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX
+ZSH_THEME_VIRTUALENV_SUFFIX=$ZSH_THEME_VIRTUAL_ENV_PROMPT_SUFFIX
+
diff --git a/themes/mlh.zsh-theme b/themes/mlh.zsh-theme
index baff3fb63..c059bf850 100644
--- a/themes/mlh.zsh-theme
+++ b/themes/mlh.zsh-theme
@@ -47,6 +47,10 @@ if [ -z "$MLH_SHELL_SYMBOL" ]; then
MLH_SHELL_SYMBOL="$ "
fi
+if [ -z "$MLH_SHELL_SYMBOL_ROOT" ]; then
+ MLH_SHELL_SYMBOL_ROOT="# "
+fi
+
# colors
USER_COLOR="%F{001}"
DEVICE_COLOR="%F{033}"
@@ -83,7 +87,11 @@ exit_code() {
}
prompt_end() {
- printf "\n$MLH_SHELL_SYMBOL"
+ if [ "$UID" -eq 0 ]; then
+ printf "\n$MLH_SHELL_SYMBOL_ROOT"
+ else
+ printf "\n$MLH_SHELL_SYMBOL"
+ fi
}
# Set git_prompt_info text