Set screen-title from shellscript

后端 未结 12 1683
忘掉有多难
忘掉有多难 2020-12-12 16:48

Is it possible to set the Screen Title using a shell script?

I thought about something like sending the key commands ctrl+A shift-

12条回答
  •  忘掉有多难
    2020-12-12 17:44

     # add the following in your ~/.bashrc or ~/.bash_profile
     PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
    

    or even better copy the whole concept for customizing your bash configs between a lot of hosts from here

提交回复
热议问题