[OS X TeX] latexit issues
Peter Dyballa
Peter_Dyballa at Web.DE
Sun Jul 20 05:22:07 EDT 2008
Am 20.07.2008 um 04:43 schrieb Owen Densmore:
> Apparently the problem is the billions of odd "export" statements.
Yes. There are shell functions defined that should not be present in
a non-interactive environment or in one in which the environment
variable TERM is either not set or has the value "dumb." The /sw
components in PATH come indeed from LaTeXiT: it takes care that TeX
installations from Fink or MacPorts are found even when the user made
omissions.
I presume the extra BASH stuff is from ~/.bashrc. There you could try
this that I use (although a tcsh user and copied from somewhere, so
that prompt (or window title line) handling in xterm or for root is
not perfect):
case $TERM in
dumb|eterm)
# no color on the dummy terminal
# I should dig up a dummy terminal and test this
;;
"xterm"|"vt100"|"color-xterm"|"xterm-color"|*)
if [ -n "$TERM_PROGRAM" ]; then
# some prompt tweaking
declare prompt_black prompt_red prompt_green
prompt_yellow prompt_blue prompt_magenta prompt_cyan prompt_white
prompt_normal bg_black bg_red bg_green bg_yellow bg_blue bg_magenta
bg_cyan bg_white prompt_foo prompt_bar prompt_char tty_type tty_num
curr_dir username hostname
prompt_black='\[\033[0;30m\]'
prompt_red='\[\033[0;31m\]'
prompt_green='\[\033[0;32m\]'
prompt_yellow='\[\033[0;33m\]'
prompt_blue='\[\033[0;34m\]'
prompt_magenta='\[\033[0;35m\]'
prompt_cyan='\[\033[0;36m\]'
prompt_white='\[\033[0;37m\]'
prompt_normal='\[\033[0m\]'
bg_black='\[\033[0;40m\]'
bg_red='\[\033[0;41m\]'
bg_green='\[\033[0;42m\]'
bg_yellow='\[\033[0;43m\]'
bg_blue='\[\033[0;44m\]'
bg_yellow='\[\033[0;43m\]'
bg_blue='\[\033[0;44m\]'
bg_magenta='\[\033[0;45m\]'
bg_cyan='\[\033[0;46m\]'
bg_white='\[\033[0;47m\]'
tty_type="$( tty | sed -e 's/\/dev\/\([[:alpha:]]*\).*/
\1/' )"
tty_num="$( tty | sed -e 's/[^[:digit:]]*\([[:digit:]]*
\)/\1/' )"
if [ "${UID}" == "0" ]
then
prompt_foo="$prompt_red"
prompt_bar="$prompt_green"
prompt_char='!!'
else
prompt_foo="$prompt_green"
prompt_bar="$prompt_red"
prompt_char='\e[33;46;1m \! /\\'
fi
username="$( whoami )"
hostname="$( /bin/hostname -s )"
curr_dir='${PWD/$HOME//~'${username}'}'
# It's magic time!
export PS1="\e[34;47;1m\j-${prompt_foo}${tty_type}$
{prompt_bar}://${prompt_foo}${username}${prompt_bar}${tty_num:+:$
{tty_num}}${prompt_blue}${curr_dir}${prompt_char} ${prompt_normal}"
unset prompt_black prompt_red prompt_green prompt_yellow
prompt_blue prompt_magenta prompt_cyan prompt_white prompt_normal
bg_black bg_red bg_green bg_yellow bg_blue bg_magenta bg_cyan
bg_white prompt_foo prompt_bar prompt_char tty_type tty_num curr_dir
username hostname
# et voilà! My prompt is an URI.
else
PS1="$TITLEBAR$PSRAW"
export PS1="\[\e]2;\u@\H \w\a\e[32;1m\]>\[\e[0m\] "
fi
;;
esac
Apple's Terminal sets TERM_PROGRAM for which I prepare a lot. The
statement
case $TERM in
is true when TERM is set, i.e., usually in some interactive session.
So the stuff following won't be executed at all in LaTeXiT. Before
the last
;;
statement you could put all those functions and aliases and other
stuff that makes an interactive session – in xterm or in Terminal –
prolific – and useless for non-interactive use as with LaTeXit.
--
Greetings
Pete
The best way to accelerate a PC is 9.8 m/s2
More information about the MacOSX-TeX
mailing list