Article:
 |
|
bash on Mac OS X
|
| Subject: |
|
if only ... |
| Date: |
|
2004-02-25 08:54:46 |
| From: |
|
blalor
|
Response to: if only ...
|
But you can!
if [ "${TERM#xterm}" != "${TERM}" ] && [ "${EMACS}" != "t" ]; then
# Set prompt to "[$USER@$HOSTNAME `pwd` ]> "
prompt_command () {
# Display my current machine and directory in the title bar!
title="${LOGNAME}@$(hostname -s):[$(dirs)]"
echo -n "ESC]1;$title^G"
echo -n "ESC]2;$title^G"
}
export PROMPT_COMMAND=prompt_command
else
unset PROMPT_COMMAND
fi
(the ESC and ^G are actually control characters I entered in with Emacs; \033 and \007 would probably work, too.)
That gives you a prompt like [blalor@Animal ~]> and a window title like blalor@Animal:[~]
|
Showing messages 1 through 2 of 2.
-
if only ...
2004-02-28 04:29:31
hysterion
[View]
-
if only ...
2004-02-27 04:04:25
henksmets
[View]
This can be done in tcsh and zsh, but in bash there is simply no way unless you patch it.