Change gnome-terminal title to reflect the current directory?

后端 未结 5 1590
深忆病人
深忆病人 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 16:01

    since gnome-terminal uses the same control commands as xterm this page might be helpful.

    Xterm Title for bash and other shells

    TL;DR:

    add following to your .bashrc

    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'

提交回复
热议问题