From bc55253cb7ea8dd51a764ac7a4369e50ca6ee292 Mon Sep 17 00:00:00 2001 From: "pvincent@x260" Date: Sun, 13 Feb 2022 01:27:49 +0400 Subject: [PATCH] container_hostname --- bash.bashrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bash.bashrc b/bash.bashrc index 1b3743a..fd2394a 100644 --- a/bash.bashrc +++ b/bash.bashrc @@ -66,7 +66,7 @@ __prompt_command() { PS1='' - if [[ $container == 'lxc' ]]; then + if [[ -n ${container_hostname:-} ]]; then PS1+="${Gra}[LXC:${R}" local host=$container_hostname case ${host:0:4} in @@ -153,7 +153,7 @@ __vte_osc7() { # https://unix.stackexchange.com/questions/28827/why-is-my-bash-prompt-getting-bugged-when-i-browse-the-history#28828 VTE_INFO="${HOSTNAME:-}" - if [[ $container == 'lxc' ]]; then + if [[ -n ${container_hostname:-} ]]; then VTE_INFO="${container_hostname}" fi printf "\[\033]7;file://%s%s\a\]" "${VTE_INFO}" "$(__vte_urlencode "${PWD}")"