Redian新闻
>
How to set the titile of the terminal?
avatar
How to set the titile of the terminal?# Unix - 噫吁兮,危乎高哉
d*t
1
How to set the titile of the terminal. I used Solaris and Linux system. The
dtterm are used.
Normally, the title of the terminal is just a terminal. I would like to set it
title to the form like this:
Terminal [email protected]:path.
I don't want to set this information in the prompt in command line, for it is
too long for a terminal. In the command line, I would like the prompt like
this:
[email protected]_number% or so.
Then how to do it?
Thanks a lot.
avatar
m*e
2
Check the man page of the term emulator you are using.
For xterm it's xterm -title newtitle.

【在 d*******t 的大作中提到】
: How to set the titile of the terminal. I used Solaris and Linux system. The
: dtterm are used.
: Normally, the title of the terminal is just a terminal. I would like to set it
: title to the form like this:
: Terminal [email protected]:path.
: I don't want to set this information in the prompt in command line, for it is
: too long for a terminal. In the command line, I would like the prompt like
: this:
: [email protected]_number% or so.
: Then how to do it?

avatar
W*n
3
#!/bin/sh
if [ $# -eq 0 ]
then
hostname=`/usr/ucb/hostname | cut -d'.' -f1`
username=`/usr/ucb/whoami`
echo "^[]0;$hostname:$username^G\c"
else
echo "^[]0;$1^G\c"
fi
notice: ^ is ctrl key

【在 d*******t 的大作中提到】
: How to set the titile of the terminal. I used Solaris and Linux system. The
: dtterm are used.
: Normally, the title of the terminal is just a terminal. I would like to set it
: title to the form like this:
: Terminal [email protected]:path.
: I don't want to set this information in the prompt in command line, for it is
: too long for a terminal. In the command line, I would like the prompt like
: this:
: [email protected]_number% or so.
: Then how to do it?

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。