2021年11月21日星期日

ubuntu自定义终端名称

 vim ~/.bashrc 在最后面加入如下函数代码

function title(){
if [ -z "$ORIG"] ;then
ORIG=$PS1
fi
TITLE="\[\e]2;$*\a\]"
PS1=${ORIG}${TITLE}
}

source ~/.bashrc

title 123 (就可以重命名终端了)

没有评论:

发表评论

login.js