1

I am having the same issues as these guys, but following the recommended advice does not seem to fix my issue. I know I am missing something.

Why does the below cause the first line to loop?

COLOR1="\[\e[38;5;15m\]"
COLOR2="\[\e[48;5;31m\]"
COLOR3="\[\e[48;5;240m\]"
COLOR4="\[\e[38;5;31m\]"
COLOR5="\[\e[48;5;214m\]"
COLOR6="\[\e[38;5;240m\]"
COLOR7="\[\e[38;5;0m\]"
COLOR8="\[\e[0m\]"
COLOR9="\[\e[38;5;214m\]"

function custom_prompt() {
    PS1="${COLOR1}${COLOR2} \u@\h ${COLOR3}${COLOR4}${COLOR1}${COLOR3} \w ${COLOR5}${COLOR6}${COLOR7}${COLOR5} $(__git_ps1 '%s ') \$ ${COLOR8}${COLOR9}${COLOR1}${COLOR8}  "
    VTE_PWD_THING="$(__vte_osc7)"
    PS1="$PS1$VTE_PWD_THING"
}
PROMPT_COMMAND=custom_prompt
  • 2
    You don't need a custom prompt function for that, simply setting a PS1 variable with the terminal control sequence codes is enough. This script doesn't loop. – peterh Apr 22 '17 at 23:04
  • 1
    What do you have in __vte_osc7? Without, this works as one would expect. – resc Apr 23 '17 at 20:52
  • Just the default in F25... I was reading the man pages and the examples had it in there. Guess it is not needed. – AWippler Apr 23 '17 at 20:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.