From 7de55844b26394688221b1cd12ef4053b3c7f6c7 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Mon, 23 Jan 2023 19:40:42 +0100 Subject: feat(mlh): add separate prompt symbol for root user (#11451) --- themes/mlh.zsh-theme | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'themes') 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 -- cgit v1.2.3-70-g09d2 From 041c35ffc8cd97dd6327f44e35fa777af6f8e845 Mon Sep 17 00:00:00 2001 From: Samyak Sarnayak Date: Thu, 9 Feb 2023 16:57:41 +0530 Subject: feat(amuse): add virtualenv support (#8987) Fixes #7766 Closes #8814 --- themes/amuse.zsh-theme | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'themes') 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 + -- cgit v1.2.3-70-g09d2 From 69b5737daf0448ad7e6686174638be74f86afdec Mon Sep 17 00:00:00 2001 From: shelfofclub Date: Tue, 14 Feb 2023 20:44:23 +0800 Subject: fix(af-magic): fix python venv checking logic (#11495) --- themes/af-magic.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme index 2ef9b02d7..1b629e43a 100644 --- a/themes/af-magic.zsh-theme +++ b/themes/af-magic.zsh-theme @@ -10,7 +10,7 @@ function afmagic_dashes { # 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 -- cgit v1.2.3-70-g09d2 From b54ef89fab89eaa62ece588f96d8cbd7c222d854 Mon Sep 17 00:00:00 2001 From: WaferJay <17383312+WaferJay@users.noreply.github.com> Date: Fri, 24 Feb 2023 05:32:40 +0800 Subject: fix(af-magic): fix logic for separator with virtualenv (#11518) --- themes/af-magic.zsh-theme | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme index 1b629e43a..70549d01f 100644 --- a/themes/af-magic.zsh-theme +++ b/themes/af-magic.zsh-theme @@ -6,7 +6,8 @@ # 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 -- cgit v1.2.3-70-g09d2