On looking at this, I realized that I didn't explain what the first and second versions do. I usually try to explain when I post on the newbie list...Miark wrote:
On Fri, 28 Jan 2005 21:25:14 -0500, Miark wrote:
On Fri, 28 Jan 2005 17:17:57 -0600, Mikkel wrote:
Miark wrote: Does Powershell set TERM to any value? If it sets it to a terminal type that isn't defined, there is hope...
If TERM isn't defined, you may be able to add something to .bashrc - something like (untested)
if [ ! $TERM ] ; then export TERM=xterm ; fi
An "echo $TERM" replied "dumb" so I thought it did define one, but I tried your trick in .bashrc and voila! It works!!
Okay, false alarm. During my test, I opened powershell _from_
konsole, so it worked because konsole exported TERM. When I opened powershell from the XFCE launch bar directly, it failed.
So I'm back to square one.
Miark
Well, that is easy to fix. Change it to:
if [ $TERM = "dumb" ] ; then export TERM=xterm ; fi
One thing to keep in mind - if Powerterm is setting TERM to dumb, then it probably does not support some of the terminal functions of xterm. So some programs may not work correctly. There really is a terminal definition called "dumb", with its own description of terminal capabilities.
On the first version, the "[ ! $TERM ]" test checks to see if the variable $TERM has a value. the ! before $TERM basicly inverts the test, so you execute the commands if $TERM in not set. So if $TERM=xterm, $TERM=dumb, , or $TERM is set to anything else, you do not change it.
On the new version, "[ $TERM="dumb" ]" says check if $TERM is set to dumb, and if it is, change it to xterm.
The export TERM=xterm does two things in one command. It sets $TERM to xterm, and exports it so that the value stays set after .bashrc is run. If you do not export the value, then it is lost as soon as the script exits.
One other point - this will only work if you are using bash as your shell. This is the default on MDK, but you can change it. If you do, then .bashrc is no longer run when you open a terminal window...
Mikkel --
Do not meddle in the affairs of dragons, for you are crunchy and taste good with Ketchup!
____________________________________________________ Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com Join the Club : http://www.mandrakeclub.com ____________________________________________________
