Change gnome-terminal title to reflect the current directory?

后端 未结 5 1593
深忆病人
深忆病人 2021-02-01 15:16

I want to change the title of the gnome-terminal window to reflect the current directory. Is there a way to do that? A script may be? The \"change terminal title\" threads did n

5条回答
  •  庸人自扰
    2021-02-01 15:49

    Updated Answer For White Space Problem by 'basename'

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

    Upadate for answered Oct 23 '13 at 1:47 user2909452

提交回复
热议问题