|
|
An simpler alternative for bash
If you're using bash, you can just include the title-changing code in your prompt (I put this line in my .profile):
PS1="\[^[]2;custom-window-title^G\]custom-prompt"
For example, I use the following:
PS1="\[^[]2;\u@\H (\W)^G\]\h (\W)\\$ "
There are a bunch of codes you can use in your prompt (copied from the bash man page):
d the date in "Weekday Month Date" format
h the hostname up to the first `.'
H the hostname
j the number of jobs currently managed by the
shell
l the basename of the shell's terminal device
name
n newline
r carriage return
s the name of the shell, the basename of $0
(the portion following the final slash)
t the current time in 24-hour HH:MM:SS format
T the current time in 12-hour HH:MM:SS format
@ the current time in 12-hour am/pm format
u the username of the current user
v the version of bash (e.g., 2.00)
V the release of bash, version + patchlevel
(e.g., 2.00.0)
w the current working directory
W the basename of the current working direc-
tory
! the history number of this command
# the command number of this command
$ if the effective UID is 0, a #, otherwise a
$
nnn the character corresponding to the octal
number nnn
a backslash
I'm sure there's an analogous way for tcsh.
An simpler alternative for tcsh
In tcsh you do not need to modify the prompt in order to change the window title. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.05 seconds |
|