Set screen-title from shellscript

后端 未结 12 1681
忘掉有多难
忘掉有多难 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:47

    To enable automatic title updating when jumping around with ssh, add this to ~/.bashrc:

    ssh() {
      echo -n -e "\033k$1\033\\"
      /usr/bin/ssh "$@"
      echo -n -e "\033k`hostname -s`\033\\"
    }
    echo -n -e "\033k`hostname -s`\033\\"
    

    See http://linuxepiphany.blogspot.com.ar/2010/05/good-screenrc-config-setup.html

提交回复
热议问题