d*******t 发帖数: 36 | 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 username@hostname: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:
username@shellname_number% or so.
Then how to do it?
Thanks a lot. | m*****e 发帖数: 4193 | 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 username@hostname: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: : username@shellname_number% or so. : Then how to do it?
| W****n 发帖数: 141 | 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 username@hostname: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: : username@shellname_number% or so. : Then how to do it?
|
|