From 7546417c569bc4800b621b6479551c883d624037 Mon Sep 17 00:00:00 2001 From: pvincent Date: Wed, 31 Mar 2021 19:31:27 +0400 Subject: [PATCH] special characters vte tilix length 0 --- bash.bashrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bash.bashrc b/bash.bashrc index c677210..c4ab5ad 100644 --- a/bash.bashrc +++ b/bash.bashrc @@ -100,6 +100,7 @@ __prompt_command() { local pwd='~' [ "$PWD" != "$HOME" ] && pwd=${PWD/#$HOME\//\~\/} PS1+=" ${Cya}${pwd}$(__vte_osc7)${R}" + #PS1+=" ${Cya}\w${R}" if hash git 2>&-; then # git command exists @@ -141,7 +142,10 @@ __prompt_command() { __vte_osc7 () { - printf "\033]7;file://%s%s\007" "${HOSTNAME:-}" "$(__vte_urlencode "${PWD}")" + # 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_urlencode() (