From a92744ad4576b2123228c386c8c29263bf4dab7c Mon Sep 17 00:00:00 2001 From: pvincent Date: Wed, 21 Apr 2021 21:47:19 +0400 Subject: [PATCH] tilix awareness2 --- bash.bashrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bash.bashrc b/bash.bashrc index c4ab5ad..7c6216d 100644 --- a/bash.bashrc +++ b/bash.bashrc @@ -145,7 +145,14 @@ __vte_osc7 () { # HINT: special character vte to get TILIX show proper hostname and pwd # Use \[...\] around the parts of PS1 that have length 0. # https://unix.stackexchange.com/questions/28827/why-is-my-bash-prompt-getting-bugged-when-i-browse-the-history#28828 - printf "\[\033]7;file://%s%s\a\]" "${HOSTNAME:-}" "$(__vte_urlencode "${PWD}")" + + VTE_INFO="${HOSTNAME:-}" + if [[ $container == 'lxc' ]];then + VTE_INFO="${container_hostname}.$(hostname)" + fi + printf "\[\033]7;file://%s%s\a\]" "${VTE_INFO}" "$(__vte_urlencode "${PWD}")" + + } __vte_urlencode() (