Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Look in Darwin' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Look in Darwin
Authored by: sabi on Apr 09, '02 09:29:05AM
There are termcap entries in Darwin, referring to terminals called "Apple_Terminal", "Apple_Terminal+acs", "Apple_Terminal+mac", etc.

Here's what I have in my .zshrc so I can get Terminal to be properly recognized elsewhere (I haven't copied the termcap entries everywhere):

case $TERM_PROGRAM in
Apple_Terminal)
if [[ $TERM == "screen" ]] {
unset TERM_PROGRAM; export TERM_PROGRAM
} else {
if [[ -z $DISPLAY ]] {
export TERM=vt100
}
}
;;
GLterm)
if [[ $TERM == "screen" ]] {
unset TERM_PROGRAM; export TERM_PROGRAM
} else {
if [[ -z $DISPLAY ]] {
export TERM=xterm-color
}
}
esac

if [[ $TERM == "xterm-color" || $TERM_PROGRAM = "Apple_Terminal" ]] {
xterm_prompt=1
prompt="[%U%l:%h%u] %~%#"
}

chpwd() {
[[ -t 1 ]] || return
if [[ -n $xterm_prompt ]] {
print -Pn "e]2;${USER}@${HOST}:%~a"
}
}
etc.

[Editor's note: Edited formatting (only!) of code snippet for cleaner display...]

[ Reply to This | # ]
Look in Darwin
Authored by: krokodil on Jan 18, '03 01:05:34AM
Here is how I've expressed it in CSH:
if ( $TERM_PROGRAM == Apple_Terminal) then
        setenv TERM vt100-color
endif


[ Reply to This | # ]