Skip to content

Commit

Permalink
Merge pull request Powerlevel9k#502 from shibumi/detect-virt-debugging
Browse files Browse the repository at this point in the history
[detect-virt] quickfix for unnecessary information in prompt
  • Loading branch information
bhilburn committed Apr 24, 2017
2 parents 95be97e + dc2b5a8 commit 954c869
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions powerlevel9k.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -768,20 +768,19 @@ prompt_history() {

# Detection for virtualization (systemd based systems only)
prompt_detect_virt() {
if ! command -v systemd-detect-virt;then
if ! command -v systemd-detect-virt > /dev/null; then
return
fi
local virt=$(systemd-detect-virt)
local color="yellow"
if [[ "$virt" == "none" ]]; then
if [[ "$(ls -di / | grep -o 2)" != "2" ]]; then
virt="chroot"
"$1_prompt_segment" "$0" "$2" "$color" "$DEFAULT_COLOR" "$virt"
"$1_prompt_segment" "$0" "$2" "yellow" "$DEFAULT_COLOR" "$virt"
else
;
fi
else
"$1_prompt_segment" "$0" "$2" "$color" "$DEFAULT_COLOR" "$virt"
"$1_prompt_segment" "$0" "$2" "yellow" "$DEFAULT_COLOR" "$virt"
fi
}

Expand Down

0 comments on commit 954c869

Please sign in to comment.