mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-12-18 05:40:07 +00:00
Merge pull request #502 from shibumi/detect-virt-debugging
[detect-virt] quickfix for unnecessary information in prompt
This commit is contained in:
commit
954c8697e7
1 changed files with 3 additions and 4 deletions
|
@ -768,20 +768,19 @@ prompt_history() {
|
||||||
|
|
||||||
# Detection for virtualization (systemd based systems only)
|
# Detection for virtualization (systemd based systems only)
|
||||||
prompt_detect_virt() {
|
prompt_detect_virt() {
|
||||||
if ! command -v systemd-detect-virt;then
|
if ! command -v systemd-detect-virt > /dev/null; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
local virt=$(systemd-detect-virt)
|
local virt=$(systemd-detect-virt)
|
||||||
local color="yellow"
|
|
||||||
if [[ "$virt" == "none" ]]; then
|
if [[ "$virt" == "none" ]]; then
|
||||||
if [[ "$(ls -di / | grep -o 2)" != "2" ]]; then
|
if [[ "$(ls -di / | grep -o 2)" != "2" ]]; then
|
||||||
virt="chroot"
|
virt="chroot"
|
||||||
"$1_prompt_segment" "$0" "$2" "$color" "$DEFAULT_COLOR" "$virt"
|
"$1_prompt_segment" "$0" "$2" "yellow" "$DEFAULT_COLOR" "$virt"
|
||||||
else
|
else
|
||||||
;
|
;
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
"$1_prompt_segment" "$0" "$2" "$color" "$DEFAULT_COLOR" "$virt"
|
"$1_prompt_segment" "$0" "$2" "yellow" "$DEFAULT_COLOR" "$virt"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue