Set screen-title from shellscript

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

    To add to Espo's answer, the xterm escape sequences can also be applied to the Bash PS1 variable

    ESC]0;stringBEL -- Set icon name and window title to string
    ESC]1;stringBEL -- Set icon name to string
    ESC]2;stringBEL -- Set window title to string
    

    Example

    PS1='\e]0;string\a'
    

提交回复
热议问题