I'm using Konsole 18.04.3, on Fedora 28, and I have the following set in my .bashrc:

PROMPT_COMMAND='echo -ne "\033]30;$(basename $(pwd))\007"'

I have the following set in my .vimrc:

autocmd BufNewFile,BufRead,BufEnter * let &titlestring = expand("%:t") 
set title

As I understand it, this should cause vim to overwrite the directory name of the window with the name of the file I'm editing. However, that doesn't appear to be the case. When I launch vim, it's as if the set title command has no effect. What am I doing wrong?


I found that using printf instead of echo solved the problem. Instead of

PROMPT_COMMAND='echo -ne "\033]30;$(basename $(pwd))\007"'

I now have

export PROMPT_COMMAND='printf "\033]0;%s\007" "$(basename $(pwd))"'

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.