Browse Source

special characters vte tilix length 0

master 0.11.0
pvincent 4 years ago
parent
commit
7546417c56
  1. 6
      bash.bashrc

6
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() (

Loading…
Cancel
Save